You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know the window for default style change proposals has long since closed, but as an avid user who is excited to see the new changes I thought I should ask about this (maybe not the best place either).
After seeing the recently built devdocs I've noticed the grid lines are now placed on top of the plot. Was this intentional? If so feel free to close this. If not it would be great to see them placed behind the plotted data by default. The new lines look great, but I think the data should come first as done previously.
I don't think that was intentional, so thanks for pointing it out. I think we would want the grid to be behind lines and markers, but on top of major filled areas like images and filled contours. It's not obvious to me how to handle histograms, bars, and pies, but maybe they should also be on top by default.
This is actually not a new change, they were always drawn on top. One had to use set_axisbelow to get the grid in the background, which annoyinglyalso changed the zorder of the other artists of the axis. The behavior just got more visible due to the new gridlines style.
Hmmm... I've honestly never noticed that until now. Well maybe it's worth looking at if not now then never. Plots like this are super obvious:
@efiring Good point on the different plot types. I guess there might be some subjectivity on whether to put the grid infront or behind certain plot types (and combinations) if a default set of rules were to be established. Maybe looking to other plotting packages could be useful.
On the other hand, incorporating a zorder kwarg in the grid method would probably be do-able and wouldn't have to be part of the default style changes?
Looking at the code, I don't think this is correct. set_axisbelow gives the grid a zorder of 0.5; otherwise it is 2.5. I don't think anything else is changed. It looks to me like a value of 1.5 might actually be a good default. Furthermore, it is a shame to have set_axisbelow as a Boolean when it could offer finer control, such as a range of options. @pbreach the grid method already accepts a zorder kwarg; it accepts the full set of Line2D kwargs, and zorder is inherited from the Artist base class.
On second thought, I'm leaning toward the present 0.5 set_axisbelow value, and the idea that this should be the default now. With the new grid lines, the plotted data look like they are in a federal penitentiary.
@efiring IRC the zorder kwargs get overwritten later, i will check that. (Yep, zorder does nothing)
What i saw in some other PR was the proposal that it should be in front of contour, contourf, pcolormesh and image and below everything else, which is properly a good default for most cases. Also the decoupling of the grid/rest of axis of zordner would be a nice feature.
While testing the 2.0.0b4, I faced the same question regarding bar plot. Grid on top of bars did not feel right to me (personal perception).
I just wanted to raise the question as I did not find any issue talking about that point, but I might be wrong. Feel free to close if already discussed.
It was discussed and is already closed; you have a good point, but the problem is that for some patch-like objects the grid works best on top, and for others below. Rather than putting in a bunch of special-case logic, we ended up deciding on the present default. Maybe we will regret it and have to add the special-case logic later, but for now (v2.0) this was the decision.
Activity
efiring commentedon Feb 9, 2016
I don't think that was intentional, so thanks for pointing it out. I think we would want the grid to be behind lines and markers, but on top of major filled areas like images and filled contours. It's not obvious to me how to handle histograms, bars, and pies, but maybe they should also be on top by default.
Tillsten commentedon Feb 9, 2016
This is actually not a new change, they were always drawn on top. One had to use
set_axisbelowto get the grid in the background, which annoyinglyalso changed the zorder of the other artists of the axis. The behavior just got more visible due to the new gridlines style.pbreach commentedon Feb 9, 2016
Hmmm... I've honestly never noticed that until now. Well maybe it's worth looking at if not now then never. Plots like this are super obvious:
@efiring Good point on the different plot types. I guess there might be some subjectivity on whether to put the grid infront or behind certain plot types (and combinations) if a default set of rules were to be established. Maybe looking to other plotting packages could be useful.
On the other hand, incorporating a
zorderkwarg in the grid method would probably be do-able and wouldn't have to be part of the default style changes?efiring commentedon Feb 9, 2016
Looking at the code, I don't think this is correct.
set_axisbelowgives the grid a zorder of 0.5; otherwise it is 2.5. I don't think anything else is changed. It looks to me like a value of 1.5 might actually be a good default. Furthermore, it is a shame to have set_axisbelow as a Boolean when it could offer finer control, such as a range of options.@pbreach the
gridmethod already accepts a zorder kwarg; it accepts the full set of Line2D kwargs, and zorder is inherited from the Artist base class.efiring commentedon Feb 9, 2016
On second thought, I'm leaning toward the present 0.5
set_axisbelowvalue, and the idea that this should be the default now. With the new grid lines, the plotted data look like they are in a federal penitentiary.Tillsten commentedon Feb 9, 2016
@efiring IRC the zorder kwargs get overwritten later, i will check that. (Yep, zorder does nothing)
What i saw in some other PR was the proposal that it should be in front of contour, contourf, pcolormesh and image and below everything else, which is properly a good default for most cases. Also the decoupling of the grid/rest of axis of zordner would be a nice feature.
u55 commentedon Feb 9, 2016
There is a related issue here: #4243.
efiring commentedon May 2, 2016
closed by #6287
fdeheeger commentedon Sep 24, 2016
While testing the 2.0.0b4, I faced the same question regarding bar plot. Grid on top of bars did not feel right to me (personal perception).
I just wanted to raise the question as I did not find any issue talking about that point, but I might be wrong. Feel free to close if already discussed.
efiring commentedon Sep 24, 2016
It was discussed and is already closed; you have a good point, but the problem is that for some patch-like objects the grid works best on top, and for others below. Rather than putting in a bunch of special-case logic, we ended up deciding on the present default. Maybe we will regret it and have to add the special-case logic later, but for now (v2.0) this was the decision.