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

[python #XYC-538792]: Figure too narrow on the x axis



Greetings!

Apologies for the delayed response.

That's challenging to do and produce a plot that still looks normal, due to the 
way the SkewT plotting works, with the skewed axis.

Your best way to make a plot that expands the horizontal data dimensions, which 
will still keep things looking "normal":

   skew.ax.set_xlim(15, 40)

You can probably also get something with:

   skew.ax.set_aspect(83, adjustable='datalim')

Hope this helps,

Ryan

> Dear MetPy support team,
> 
> I have used MetPy to plot vertical profiles of temperature as well as
> parcel profiles in order to visualize the CAPE.
> 
> The MetPy library is great and easy to use, although I do have a small
> issue in displaying the figure. I have set the plot limits using the
> following:
> 
> fig = plt.figure()
> skew = SkewT(fig, rotation=45)
> [..]
> skew.ax.set_ylim(1000,300)
> skew.ax.set_xlim(20,30)
> 
> The code works, but the figure displayed is very narrow on the x axis, as
> you can see on the attached image. I have tried many different ways to
> stretch out the x axis, including the matplotlib functions such as
> plt.figure(figsize=(x,y)) or plt.figure().set_figwidth(x), but also MetPy
> functions like skew.ax.set_aspect(x) for example, but none seem to work.
> 
> Do you have an idea on how I could stretch out the values on the x axis in
> order to display that figure in a clearer way?
> 
> Thank you in advance for your help.
> 

Ticket Details
===================
Ticket ID: XYC-538792
Department: Support Python
Priority: Low
Status: Closed
===================
NOTE: All email exchanges with NSF 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.