-
-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Fix #1881, Ticks are now visible for filled contours without grid=:none parameter #2809
Conversation
The question is, whether we want to show gridlines on top also or not? |
We don't do it for the other backends, right? |
I think pgfplotsx does so, too. I planned to change that though... however I think it would be nice to be able to enable them, if they are wanted. So basically it would be nice, if we could have different defaults per seriestype. |
So, the defaults should not contain gridlines or the other way around? |
I think for this PR gridlines should either not be displayed or drawn behind the contour. |
I think gridlines should be behind the contour but ticks on top |
Yes, I am working on the required changes. Tweaking |
I tried almost everything, but the latter case doesn't seem to work. The best solution I found till now is this thread from matplotlib forum (which didn't work). Another solution can be showing the ticks on the |
I discussed this issue with the maintainer of Matplotlib and he has suggested solutions in this thread. Kindly look into the discussion and I think then we can decide what will be the best solution 😄 |
I would probably go with disabling the normal ticks and then draw ticks with the secondary axis feature. |
It does increase the complexity, but if we can keep that isolated to the part where axis decorations are built it's worth the flexibility we gain, IMO. |
I think we should not overcomplicate things with secondary axis and stuff make that issue closed due to matplotlib limitations and thats it. If we have secondary axis that might overcomplicate things a lot. Because: 1 Plots calculates the ticks I understand that this issue had turned to be way more complex than it should have been, but I really think that fixing this is not worth our efforts. You have done a great job @LakshyaKhatri I can only say that it is sad that such a thoroughly researched issue happens not to have a simple solution. |
Thanks @isentropic for the appreciation. I'll keep contributing to the Julia community. Feel free to close this PR 😄 |
Hmm... disabling the gridlines is still an option |
Yes, that will be an easy hack. Let me know if you are up to this. I will push the changes. |
Fixes #1881
I discussed this issue with @isentropic and he suggested to add a
zorder
argument in the below call:Plots.jl/src/backends/pyplot.jl
Line 850 in 47590b2
I tried adding
zorder
with a high value in other places too but it didn't work.Turned out the axes were drawn below the countors when
grid
was set to true:Plots.jl/src/backends/pyplot.jl
Lines 1144 to 1151 in 47590b2
and hence the ticks were also hiding:
Removing this line:
Plots.jl/src/backends/pyplot.jl
Line 1151 in 47590b2
or setting
ax."set_axisbelow"(true)
tofalse
is producing the following results:If this is the right solution, I will update the same for other backends too.