Markers have white boxes over them when printed to png file

1 回表示 (過去 30 日間)
Catherine
Catherine 2017 年 5 月 4 日
コメント済み: Catherine 2017 年 5 月 5 日
Here is my problem reduced down to 2 lines:
scatter(170.8*ones(1,8),[1:8],[100 200 300 400 500 600 700 800],[0 0 0; 1 0 0; 0 0 1; 1 0 1; 1 1 0; 0 1 1; .8 .8 .8; 0 0 0 ],'filled')
set(gca,'xlim',[0 250],'ylim', [0 8])
print('-dpng', '-r300', 'test')
Gives me markers that look like the attached file.
It does the same thing if I loop using plot. It works just fine if I plot all the symbols at once - but then I cannot alter the size/color accordingly. I am using 2014b, I have to because I need to use the char(9651) symbol in the text function.
opengl info gives me true for software and I've set the renderer to opengl.
  7 件のコメント
Santhana Raj
Santhana Raj 2017 年 5 月 5 日
I am using 2017a, and your code plots perfectly for me. I think the bug was fixed in newer versions. Can you upgrade your Matlab??
KSSV
KSSV 2017 年 5 月 5 日
I tried with plot.....it shows still the same problem...

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

採用された回答

Catherine
Catherine 2017 年 5 月 5 日
Thanks to all of you for your input. Santhana is correct - there does not seem to be an issue with 2017a. The code worked just fine. Thanks!
  1 件のコメント
Catherine
Catherine 2017 年 5 月 5 日
Also - ImageAnalyst did not find this error with 2016b.

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

その他の回答 (1 件)

Jan
Jan 2017 年 5 月 5 日
What happens, if you limit the axes limits at first?
AxesH = axes('xlim',[0 250],'ylim', [0 8], 'NextPlot', 'add');
drawnow;
scatter(170.8*ones(1,8), 1:8, [100 200 300 400 500 600 700 800], ...
[0 0 0; 1 0 0; 0 0 1; 1 0 1; 1 1 0; 0 1 1; .8 .8 .8; 0 0 0 ], 'filled')
?
  3 件のコメント
Image Analyst
Image Analyst 2017 年 5 月 5 日
Looks fine to me in R2016b:
but then so does Catherine's original code. I suspect she had later code that did something to put up a white box, like a patch(), fill(), area(), or text() command. The cyan spot having a corner in it is a big tip off.
Catherine
Catherine 2017 年 5 月 5 日
Jan - I had the same result as KSSV, setting the axes limits first did not fix the problem. It really does appear to be a bug that was present during 2014b, but was fixed at a later time (from ImageAnalyst's comment - it was fixed at least by the 2016b release).
ImageAnalyst - the error was produced with code that had just those 2 lines, there was nothing else.
I've been swamped for time to convert all my old code up to 2017 changes, but it looks like I need to make that a priority.
Thanks all!

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

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by