GR: draw gridlines below all axes #4945
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
GR currently plots all components of the x-axis first, and then the y-axis (and possibly z). Since horizontal gridlines belong to the y-axis, if there's a tick at the low end of
xrange
, the corresponding gridline will cover the x-axis (see issue #4202).This fixes the issue for GR by splitting
gr_draw_axis
into three stages, so that we first draw all minor gridlines, then all major gridlines, and the rest of the axis on top.With the change, a few image tests would need to be updated, in which the x-axis colour is now no longer affected by the (transparent) overlapping gridline -- as far as I can see, no visible changes. I assume that this is done separately in https://github.com/JuliaPlots/PlotReferenceImages.jl/?
Attribution
Things to consider