[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[python #DUI-816246]: MetPy



Greetings!

Regarding the first question, that's still an open issue:

  https://github.com/Unidata/MetPy/issues/262

This may be more readily achievable now using Matplotlib's "secondary axis" 
functionality:

  
https://matplotlib.org/stable/gallery/subplots_axes_and_figures/secondary_axis.html

I've answered the other questions on your Stack Overflow question:

  
https://stackoverflow.com/questions/67664575/metpy-hodograph-place-point-at-specified-wind-data/67681531#67681531

Hope this helps!

Ryan

> Hi,
> 
> I have two questions related to creating atmospheric soundings in Python.
> 
> At first, is it possible to generate a second y axis at the right side of the 
> plot, showing the corresponding height above ground for the different 
> pressure levels?
> 
> Second, I am trying to include wind data at specific heights above the ground 
> into the hodograph of the atmospheric soundings. More specifically, I would 
> like the winds at the surface, 1 km, 3 km, 6 km and 9 km to be plotted as a 
> dot. So far, I just achieved separating them in boundaries (attachment). I 
> would just like points on the beginning and end of each segment and with a 
> corresponding text specifying the height (sfc, 1 km, 3 km, 6 km, 9 km). How 
> can I do that? By the way, is there also a way to include the labels of the 
> hodograph axis inside circles?
> 
> # Make an array of segment boundaries - don't forget units!
> boundaries_h = [0, 1000, 3000, 6000, 9000] * units.meter
> # Make a list of colors for the segments
> colors_h = ['#66B2FF', '#3333FF', '#7F00FF', '#000000']
> # Create a hodograph
> ax_hod = inset_axes(skew.ax, '37.5%', '40%', loc=1)
> wmax = np.concatenate((u, v))
> wmax = np.max(abs(wmax))
> h = Hodograph(ax_hod, component_range=wmax.magnitude+2)
> if wmax.magnitude < 20:
> h.add_grid(increment=5)
> if wmax.magnitude < 40 and wmax.magnitude > 20:
> h.add_grid(increment=10)
> if wmax.magnitude > 40:
> h.add_grid(increment=20)
> h.plot_colormapped(u, v, z, intervals=boundaries_h, colors=colors_h)


Ticket Details
===================
Ticket ID: DUI-816246
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with Unidata User Support are recorded in the Unidata 
inquiry tracking system and then made publicly available through the web.  If 
you do not want to have your interactions made available in this way, you must 
let us know in each email you send to us.