I have to translate an image plotting script from matlab to matplotlib/pylab, and I'm trying to achieve the same effect as the matlab image below:
As you can see, the z order of the plots seem to be higher than the z order of the grid, so the markers are not hidden by the axes. However, I can't figure out a way to do the same with my matplotlib image:
I'm wondering if it is possible to get the same display without having to increase the limits of the y axis.
If you're plotting the lines one after the other, just change the order of the plotting calls and that would fix the z order.
To get the marker to show beyond the axes you can turn the clipping off. This can be done using the keyword argument in the
plot
commandclip_on=False
.For example:
This is a complete example of how to use the
zorder
kwarg: http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.htmlNote that a higher z-order equates to a graph-element being more in the foreground.
For your second question, have a look at the
figsize
kwarg to instances of theFigure
class: http://matplotlib.sourceforge.net/api/figure_api.html?highlight=figsize#matplotlib.figure.FigureIf you run into issues, please post some of your code and we'll be able to give more-detailed recommendations. Best of luck.