Adding markers at constant X-value on skew-T plot #3570
-
Greetings. I am trying to add markers at a constant x value at each pressure level in a skew-T plot, such that they are vertical and not skewed, colored and symbolized in various ways to signify criteria or conditions at each level in the sounding. I tried using this MetPy Monday example: To try and figure out what flavor of transformation I needed for my x-coordinate to pin the markers on the y-axis. Here is some code that I tried. Only one line produces values, which occur along the skewed Temperature line and not on the y-axis where I'd like them.
Any tips on how to transform my x-coordinate from the skewed to vertical values, or how to reference the underlying axis/axes properly? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I was able to get it to work by changing my x-value to "axes coordinates" (see here: https://matplotlib.org/stable/users/explain/artists/transforms_tutorial.html#axes-coordinates). The selection of the x-value is somewhat arbitrary but is fairly easy to approximate where you'd want it to appear. One problem is if I selected
|
Beta Was this translation helpful? Give feedback.
I was able to get it to work by changing my x-value to "axes coordinates" (see here: https://matplotlib.org/stable/users/explain/artists/transforms_tutorial.html#axes-coordinates).
The selection of the x-value is somewhat arbitrary but is fairly easy to approximate where you'd want it to appear.
One problem is if I selected
xval=0.0
, the marker was hidden behind the y-axis rather than plotted over it, even after tinkering withzorder
. But it looks just fine atxval=0.05
or greater.