Skip to content

Question around generating random station plot locations #3216

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

You must be logged in to vote

Hi @stackjohn, so you are looking to plot the value of some random grid point within your domain and overlay that on a color filled contour map?

If so, here is a minimum working example to do a random choice of lat/lon points (with replacement). You should be able to replace the generated arrays with those from a gridded file pretty easily to choose the random points. There will likely be a bit more work to get the values from the array at those points, but not too hard. Hope this helps!

import cartopy.crs as ccrs
from metpy.plots import StationPlot
import numpy as np
import matplotlib.pyplot as plt

# Assuming latitude values between 30 and 60N every 1 degree
lats = np.arange(30, 60, 1)

#…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by stackjohn
Comment options

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