Strange print function behavior related to output resolution and zoom level using filled patch objects
Hello all,
I've prepared some figures which display a bunch of information in a local coordinate system. When plotting this figure to a png file using print:
print(gcf,'-dpng','-r400','file.png');
The results look like:
So cutting off a part of my patch object, though when I'm exporting my figure to pdf using
print(gcf,'-dpdf','-r400','file.pdf');
OR to png using:
print(gcf,'-dpdf','-r0','file.png'); saveas(gcf,'file.png','png');
I get the following results (which are correct):
So it appears that a higher png resolution results in my green patch object being cut off.
Strikingly, when plotting the identical figure, though zooming out for a bit, but again using png and the higher resolution ('-r400'), so using the above code which created the initial problems again:
print(gcf,'-dpng','-r400','file.png');
The result is a follows:
Which is just fine, as I've zoomed out the figure. Quite strange indeed!
So it appears that the cuts in my patch objects are not only related to the output resolution, but also patch connection points being outside of my current plot (XLim and YLim). Is there anyone who can clarify anything about this to me, as I cannot come up with a good reason, let alone, a solution..
Kind regards,
Freek
2 Comments
Answers (0)
See Also
Categories
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!