Problem using circles as marker type when linewidth > 0.5 (default)... using Matlab R2018a

I would like to plot a graph showing two different data sets, using circles for one set and squares for the other. However, when I make the linewidth corresponding to the circles larger than the default value of 0.5, these circles are rendered incompletely (see attached .fig file).

6 件のコメント

jonas
jonas 2018 年 9 月 12 日
Uploading a .fig is not ideal, especially when you have a rendering problem. Can you upload a .jpg? I opened the .fig without issue. Here is a printed version:
Peter Stephen
Peter Stephen 2018 年 9 月 13 日
Many thanks for your rapid response. Here is a .jpg to indicate the (circle rendering) problem I am having.
jonas
jonas 2018 年 9 月 13 日
I see the issue now. Did you try OCDER's solution?
Jan
Jan 2018 年 9 月 13 日
@Peter: Did you update the drivers of your graphics card? Try this also:
opengl software
or
opengl hardward
Peter Stephen
Peter Stephen 2018 年 9 月 13 日

Thank you Jonas, Jan and OCDER for your suggestions. Unfortunately, both opengl hardware and set(gcf, 'renderer', 'painters') do nothing to solve the problem; the circles continue being incompletely rendered. On the other hand, opengl software leads to complete circle but of poor resolution. The resolution of the squares is also affected - see attached .jpg

Maybe the only solution for me would be to go back to using an older version of matlab (e.g. 2017a).

Peter Stephen
Peter Stephen 2018 年 9 月 13 日

There is no resolution issue for .svg, .pdf and .emf formats, so it seems opengl software has done the trick! Thanks again.

サインインしてコメントする。

 採用された回答

OCDER
OCDER 2018 年 9 月 12 日
Try this:
set(gcf, 'renderer', 'painters')
If that works, set the default too:
set(0, 'DefaultFigureRenderer', 'painters')

3 件のコメント

Jan
Jan 2018 年 9 月 12 日
I would not modify the default renderer to fix one problem. Maybe sometimes later other problems might be based on a fixed renderer, so hesitate to set the properties globally, but only where it is required.
OCDER
OCDER 2018 年 9 月 13 日

Oh, were you having issues with saving the file, or the figure not showing correctly on screen? How were you saving the images? Using vector graphics like you are doing now (pdf, eps, emf) is probably best, as you don't lose resolution. But if you want the other file types, try this:

    print(gcf, 'test.png', '-dpng', '-r600', '-painters')
  or 
    print(gcf, 'test.png', '-dpng', '-r600', '-opengl')

If you used saveas, then you'll run into resolution issues, especially with jpg formats, due to loss of quality for jpeg formats and also saveas dialog box uses a 150DPI resolution. See the Tips in the way bottom of this page:

https://www.mathworks.com/help/matlab/ref/saveas.html

Tips

  • To control the size or resolution when you save a figure, use the print function instead.
  • The saveas function and the Save As dialog box (accessed from the File menu) do not produce identical results. The Save As dialog box produces images at screen resolution and at screen size. The saveas function uses a resolution of 150 DPI and uses the PaperPosition and PaperPositionMode properties of the figure to determine the size of the image.

You could also try this popular tool for saving images

https://www.mathworks.com/matlabcentral/fileexchange/23629-export_fig

Peter Stephen
Peter Stephen 2018 年 9 月 13 日
OCDER: Thanks a lot for this advice!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Performance についてさらに検索

製品

質問済み:

2018 年 9 月 12 日

コメント済み:

2018 年 9 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by