Unidata / MetPy

MetPy is a collection of tools in Python for reading, visualizing and performing calculations with weather data.
https://unidata.github.io/MetPy/
BSD 3-Clause "New" or "Revised" License
1.24k stars 413 forks source link

Add/modify Hodograph plot_colormapped examples #752

Open dopplershift opened 6 years ago

dopplershift commented 6 years ago

We don't currently demonstrate how to:

michiboo commented 5 years ago

Hi! Can I try this issues?

jrleeman commented 5 years ago

You bet!

jrleeman commented 5 years ago

Let us know if you get stuck and need a hand!

igorol commented 5 years ago

Hi, guys. Got here searching for a 'good first issue' tag

I modified the Hodograph_Inset.py example like this:

# Create a hodograph
ax_hod = inset_axes(skew.ax, "40%", "40%", loc=1)
h = Hodograph(ax_hod, component_range=80.0)
h.add_grid(increment=20)
c = np.hypot(u, v)
colors = ["red", "green", "darkblue"]
h.plot_colormapped(u, v, c, bounds=c[:-1], colors=colors)
# Show the plot
plt.show()

And this is the plot created: hodo

Is this solution good enough or would you like to explore more the colors and bounds. Maybe adding a colormap?

igorol commented 5 years ago

Actually I just read the original post mentioning colormaps, will work on that

zbruick commented 5 years ago

Hi @igorol! Thanks for looking to contribute to MetPy. Let us know if you have any questions along the way - we're happy to have any and all contributions! Yeah expanding the current Hodograph Inset example looks like a great way to go - feel free to open a PR when you're ready for us to take a look at it!