[Matplotlib-devel] grid line z-order
Eric Firing
efiring at hawaii.edu
Sat Jul 16 18:43:54 EDT 2016
On 2016/07/16 11:58 AM, Benjamin Root wrote:
> Hi all....
>
> Looking over the dev docs, I have come to realize that I am not
> completely sold on the zorder for grid lines. For boxplots, the grid
> lines fall on top of the boxplots. It seems like this was always the
> case, though. I would imagine that the gridlines would fall on top of
> histograms and bar graphs -- which I can convince myself in different
> situations where the gridlines should fall.
>
> Thoughts?
>
> Ben Root
Ben,
I think the problem is that given the basic hierarchy of low-level
objects we work with, there is no ideal solution. Sometimes it will
look better with patches above, other times with patches below. For
something like a boxplot--a complex combination of objects generated by
a single call--the solution should be for the boxplot function to set
the desired zorder for its objects, if the defaults don't give the
desired result. Presumably it should give the patches the same zorder
as the lines, or slightly below, but above the grids. For bar-type
plots it is less clear what the default should be.
Contour plots are a case where the present default works--grids are on
top, as they need to be. One could argue that the default should work
without manipulation for boxplots etc. (i.e., put the default grid
zorder below patches) and contourf should have the responsibility to
reduce the zorder of its patch collections so that they land below the
new grid default. I won't object if you want to make that change. In
setting the present defaults, I was biased by the fact that I have never
used a boxplot, I use histograms but am neutral as to whether the should
land above or below the grid (probably above looks better in many cases,
but is a little less informative), and I use contourf all the time.
Eric
More information about the Matplotlib-devel
mailing list