![OutCorrect.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/238600/image.png)
Why does the resolution become extremely bad when increasing the linewidth when using the the circle as marker.
12 ビュー (過去 30 日間)
古いコメントを表示
As the title is conveying.
% Example
x = -pi:pi/10:pi;
y = tan(sin(x)) - sin(tan(x));
% Plot
sc = scatter(x,y,3*100);
sc.LineWidth = 10;
Why do the circles become like "plus signs" when increasing the line width instead of becoming larger circles?
How can I increas the size and line width of the marker edge in a plot or scatter plot without loosing quality?
0 件のコメント
採用された回答
Pravin Jagtap
2019 年 9 月 17 日
Hello Pontus,
I have tried to reproduce the steps, but it works fine in my case. I am assuming the user is using the older version of MATLAB or using older version of ‘OpenGL’ which does not support OpenGL shaders on your platform whose graphics driver has been flagged as problematic.
One possible workaround could be using the ‘painters’ renderer as shown below:
% Example
f = gcf;
f.Renderer = 'painters';
x = -pi:pi/10:pi;
y = tan(sin(x)) - sin(tan(x));
% Plot
sc = scatter(x,y,300,'o','Linewidth',10);
The above code outputs following image:
![OutCorrect.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/238600/image.png)
There are, however, performance implications as ‘painters’ is typically a little slower than the hardware.
For quality of image you can you appropriate markersize and linewidth and import it as EPS file.
Kind Regards
~Pravin
1 件のコメント
その他の回答 (1 件)
Walter Roberson
2019 年 9 月 17 日
OpenGL has no built-in markers. All that it has are built-in square points. Therefore in order to create the markers, MATLAB has to draw the markers as a series of short lines. When markers are drawn for scatter() plots, then each line segment is a rectangle of given thickness, centered around the line joining two vertices. With each line segment being a rectangle, when the line width is high, those rectangles stick out noticably.
If you use plot(), then plot knows how to join line segments more smoothly. It has a property LineJoin that defaults to 'round', but my investigations suggest that LineJoin is not used for markers. Some other algorithm appears to be used for the round marker for line objects.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!