save a plot without gridlines

5 views (last 30 days)
jelle
jelle on 8 Nov 2012
I use the plt function found here on the file exchange http://www.mathworks.nl/matlabcentral/fileexchange/4936-plt to make a plot and set the color of the gridlines to white (same as background), set the 'gridlinestyle' to 'none' and used the 'grid off' command. a bit much, I know, but I keep having the same problem. the resulting plot has no gridlines, but when I use either 'saveas' or 'print' to save the figure the gridlines reappear. I saved to both .png and .jpeg, but that made no difference. less important, but also strange is that the figure is rotated 90º couterclockwise. none of these problems occur when I manually save a figure using the drop down menu.
any ideas as to why this happens and how to solve it?
thanks
jelle

Accepted Answer

Matt Fig
Matt Fig on 8 Nov 2012
No idea why this happens, but I recommend you use this to export your figure no matter how you made it

More Answers (1)

Richard Quist
Richard Quist on 9 Nov 2012
Edited: Richard Quist on 9 Nov 2012
You might contact the author of the File Exchange submission you're using to see if they can provide assistance. I'd guess that the "grid" you see on those plots aren't the normal MATLAB axes grid, but are really just lines drawn to form a grid. If that's true, the commands you've used to adjust the grid properties are probably not having the effect you desire.
I suggest that you check the values of the figure's *InvertHardcopy * and *PaperOrientation * properties.
* Setting InvertHardcopy to 'off' will probably resolve the re-appearing gridlines issue.
* I'm guessing that the PaperOrientation is something other than 'Portrait'. If that's the case, setting it to 'Portrait' should fix the rotation you're seeing in the generated output
Hope that helps.

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!