Skip to content

Adding markers at constant X-value on skew-T plot #3570

Closed Answered by DanielAdriaansen
DanielAdriaansen asked this question in Q&A
Discussion options

You must be logged in to vote

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 with zorder. But it looks just fine at xval=0.05 or greater.

xval = 0.05
skew1.ax.plot([xval]*len(prs),prs,marker='*',markersize=50,color='orange',transform=skew1.ax.get_yaxis_transform())

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DanielAdriaansen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant