-
Notifications
You must be signed in to change notification settings - Fork 133
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
Positioning wind roses onto an existing x-y axis #188
Comments
What happens if you pass the projection in your subplot?
|
Yep, that fixes the issue. However now I have two different wind roses appearing... Any idea what's going on? For now I'm just plotting a single time step ax_winds = plt.subplot(gs[2], projection="windrose")
wspd = wind_speed(dset_city['u10'], dset_city['v10']).metpy.dequantify()
wdir = wind_direction(dset_city['u10'], dset_city['v10']).metpy.dequantify()
wrax_cham = inset_axes(ax_winds,
width=0.8, # size in inches
height=0.8, # size in inches
loc='center', # center bbox at given position
bbox_to_anchor=(dset_city['valid_time'][5], 0.3), # position of the axe
bbox_transform=ax_winds.transData, # use data coordinate (not axe coordinate)
axes_class=WindroseAxes, # specify the class of the axe
)
wrax_cham.contourf(wdir[:,30], wspd[:,30])
wrax_cham.tick_params(labelleft=False, labelbottom=False)
ax_winds.xaxis.set_major_locator(locator)
ax_winds.xaxis.set_major_formatter(formatter)
ax_winds.tick_params(axis='y', which='major', labelleft=False)
ax_winds.tick_params(axis='x', which='both', labelbottom=False) |
Not sure. If you can make a self-contained example that one can easily run without external data I can try to debug. My guess is that mpl is drawing the polar axis too and not only just the windrose. |
I noticed that if I reduce the size of the axis then it seems to fill the background circle. https://drive.google.com/file/d/1SZo0rzTIO6nSDkHVywXg_NeZEX7ptg5L/view?usp=sharing I'm trying to reproduce something similar to this of Course, it doesn't have to be exactly the same. |
I have a meteogram with many variables and I would like to add a "strip" with wind roses like this
I'm using gridspec and already made space for an axis (
ax_winds
). Following the example on the documentation I'm trying to create an inset ax based on this axis and just tried to plot a single wind rose at a certain point in time.But I'm getting some errors
which are probably related to how I'm passing the parent axis to
inset_axes
.Does anyone have an example of positioning multiple wind roses over a define time axis?
Full code is here if someone is interested https://github.com/guidocioni/icon_d2_eps/blob/master/plotting/plot_meteogram.py
The text was updated successfully, but these errors were encountered: