Markers have white boxes over them when printed to png file
이전 댓글 표시
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
KSSV
2017년 5월 5일
When you don't limit the axis it is printing properly.
Walter Roberson
2017년 5월 5일
As an experiment try using scatter3() instead of scatter(), and use a z value that is slightly greater than 0, to put the dots "above" the axis.
Catherine
2017년 5월 5일
Catherine
2017년 5월 5일
KSSV
2017년 5월 5일
YOu can use plot instead of scatter and see....
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
2017년 5월 5일
I tried with plot.....it shows still the same problem...
채택된 답변
추가 답변 (1개)
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
KSSV
2017년 5월 5일
Markers are not as expected.....
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
2017년 5월 5일
카테고리
도움말 센터 및 File Exchange에서 Graphics Performance에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!