How to increase smoothness of a patch edgeline?

4 Ansichten (letzte 30 Tage)
Wassili Dimitriew
Wassili Dimitriew am 23 Mai 2023
Dear community,
I want to publish the following plot I counstructed using the patch function:
However, I am not happy about the edge lines' quality, I want them to be smoother. How can I achieve that?
Thank you in advance.

Antworten (1)

Venkat Siddarth
Venkat Siddarth am 2 Jun. 2023
I understand that you are looking for a high quality image of the above plot, which can be achieved as follows:
To generate a high quality image,you can set higher value for resolution parameter of print function and generate the image
Here is an example
%Example Patch Code
% Define the vertices of a cube
v = [-1 -1 -1; 1 -1 -1; 1 1 -1; -1 1 -1; -1 -1 1; 1 -1 1; 1 1 1; -1 1 1];
% Define the faces of the cube by indexing into the list of vertices
f = [1 2 3 4; 2 6 7 3; 4 3 7 8; 8 7 6 5; 5 6 2 1; 5 1 4 8];
% Create a figure and axes for the 3D plot
figure;
axes('DataAspectRatio',[1 1 1],'Xlim',[-2 2],'Ylim',[-2 2],'Zlim',[-2 2]);
% Set the view angle and lighting of the plot
view(3);
light('Position',[0 0 1],'Style','infinite');
% Draw the edges of the cube using the patch function with no face color
patch('Faces',f,'Vertices',v,'FaceColor','none','EdgeColor','k');
%High Resolution file
print("-dpng",'-r600','cube1.png')
To know more about this function check out the following documentation
I hope this resolves the query
Regards,
Venkat Siddarth V
  1 Kommentar
Wassili Dimitriew
Wassili Dimitriew am 5 Jun. 2023
Thank you for the answer; unfortunately, it did not help. I tried to save it in .png (see attached) as well as .svg (unfortunately, cannot attach this) format, the steep lines are still quite pixelized. Do you have any idea what can possibly cause it? I already checked and updated my video card drivers.
Best,
Wassili

Melden Sie sich an, um zu kommentieren.

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by