MATLAB Answers

Saveas or print: figure not appearing as desired (scatter points are half points, black lines appearing in a red region)

2 views (last 30 days)
CT
CT on 25 Oct 2019
Commented: darova on 26 Oct 2019
Consider the following figure in Matlab
load matrices
%Rb, vertices_deg, vertices_comp
close all
patch([0 0 1],[0 1 0],[1 0 0],[0.8 0.8 0.8]);
axis equal
axis([0 1 0 1 0 1])
view(120,30)
hold on
T = delaunayTriangulation(Rb.');
K = convexHull(T);
patch('Faces',K,'Vertices',T.Points,'FaceColor','k','edgecolor','k');
hold on
scatter3(vertices_deg(:,1), vertices_deg(:,2) , vertices_deg(:,3),100,'o','filled','b')
hold on
patch(vertices_comp(:,1), vertices_comp(:,2) , vertices_comp(:,3),'red')
hold off
xlim([0 1])
ylim([0 1])
zlim([0,1])
box on
set(gca, 'ytick',0:0.2:1,'xtick',0:0.2:1,'ztick',0:0.2:1,'FontSize',13)
I would like to save this figure in a way such that:
  • within the red region, I do not get the black lines that I can see in the Matlab output
  • the blu scatter point is a full circle (and not half circle, as it appears in the Matlab output)
I tried two ways of saving the figure
saveas(gcf,'3.jpg')
print(gcf, '3.jpg', '-dpng', '-r300', '-painters')
None of these two gives me what I want. Could you help?
This is what I get with print and with saves
3SAVEAS.jpg
3PRINT.jpg
  1 Comment
darova
darova on 26 Oct 2019
Can't replace it a bit?
T.Points = T.Points + 0.01;
vertices_deg = vertices_deg + 0.02;
vertices_comp = vertices_comp + 0.02;

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!