-
Notifications
You must be signed in to change notification settings - Fork 96
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
x axis labeling disappears when using twinx() #127
Comments
You can actually see this in the RC settings demo on the docs on the right subplot. https://proplot.readthedocs.io/en/latest/basics.html#Changing-rc-settings |
Thanks for the report -- which version are you using? Is this the "dev" release? |
I'm using the 0.0.5 that's on pip now. |
Actually this is intended behavior. My guess is you have confused Since this naming is really confusing for users, proplot introduces the more intutively-named Anyway maybe you already knew all this; since the whole purpose of "twin" axes is that their properties should be identical, I thought it made sense to forbid specially modifying the properties of the "twin". I'm open to arguments against this though. |
@lukelbd I met the same problem today. If I use the same example as @bradyrx showed above without twin, the xaxis tick labels are correct: But, if I add the the twinx(), the tick labels disappeared: This is the actual case I met: I want to plot two kinds of profiles with pressure, but I couldn't let the pressure ticks labels show up ... |
Yes I understand this and agree with you that the naming is bad. I also agree that you shouldn't be able to modify the dual axis so you don't get out-of-phase ticks, clutter, etc. The issue, as @zxdawn also mentioned, is that the original axis completely disappears. And in my example, you see that modifying the original axis does nothing to fix this (below with import proplot as plot
import numpy as np
import xarray as xr
times = np.arange(1990, 2000)
data = xr.DataArray(np.random.rand(len(times)), dims=['time'], coords=[times])
f, ax = plot.subplots(aspect=2)
ax.plot(data.time, data)
twinax = ax.alty()
# twinax.format(xlocator=1)
ax.format(xticks=np.arange(1990, 2000, 2)) I agree you shouldn't be able to modify the twin axis, but it shouldn't render the original axis unreadable. It's still important to see the ticks, time series labeling, etc. |
My bad! I see now, this definitely is a major problem. I will address this before the end of the weekend. Thanks for the additional examples. |
Sorry for the wait guys; I had to step back from proplot for a while and knew this one would be tricky to fix. But it's finally done. |
@lukelbd Thanks for the fix! Will test it for the O3 and Qv profile tomorrow. |
This is great, thanks Luke! |
Code sample, a copy-pastable example if possible
A "Minimal, Complete and Verifiable Example" will make it much easier for maintainers to help you.
Actual result vs. expected result
Using
twinx()
, the tick labeling disappears on the twin axis. This happens for datetime and normal numbers. Usingxticks
/xlocator
on the main axis ortwinax
instance changes the ticks but does not produce labels.The text was updated successfully, but these errors were encountered: