I want to export a figure to a .png and I want my linetypes and gridlines to be scaled correctly, so I've got to use the 'painters' renderer. The axis border ('box') is exported under the plot which means it gets covered by the plotted points. This does not happen with the default renderer.
If I change the axes layer to 'top' then the border comes to the top but so do the gridlines. Is there a way of having only the axes border at the top but not the gridlines?
Thanks for the script Oliver... been using it for a long time now and it fills a big gap in MATLAB.