Basic plotting tools
Append colorbar to axes
Note
This is mostly useful for axes created with curvedEarthAxes().
written by Sebastien, 2013-04
Create curved axes in ground-range and altitude
import numpy as np
from utils import plotUtils
ax, aax = plotUtils.curvedEarthAxes()
th = np.linspace(0, ax.maxground/ax.Re, 50)
r = np.linspace(ax.Re+ax.minalt, ax.Re+ax.maxalt, 20)
Z = exp( -(r - 300 - ax.Re)**2 / 100**2 ) * np.cos(th[:, np.newaxis]/th.max()*4*np.pi)
x, y = np.meshgrid(th, r)
im = aax.pcolormesh(x, y, Z.T)
ax.grid()
written by Sebastien, 2013-04
manually draws a colorbar on a figure. This can be used in lieu of the standard mpl colorbar function if you need the colorbar in a specific location. See pydarn.plotting.rti.plotRti() for an example of its use.
Returns:
cmap,norm,bounds = genCmap('velocity', [-200,200], colors='aj', lowGray=True)
Written by AJ 20120820
Generates a colormap and returns the necessary components to use it
cmap,norm,bounds = genCmap('velocity', [-200,200], colors='aj', lowGray=True)
Written by AJ 20120820
This class wraps arround mpl_toolkits.basemap.Basemap (<http://tinyurl.com/d4rzmfo>)
# Create the map
myMap = utils.mapObj(boundinglat=30, coords='mag')
# Plot the geographic and geomagnetic North Poles
# First convert from lat/lon to map projection coordinates...
x, y = myMap(0., 90., coords='geo')
# ...then plot
myMap.scatter(x, y, zorder=2, color='r')
# Convert to map projection...
x, y = myMap(0., 90., coords='mag')
# ...and plot
myMap.scatter(x, y, zorder=2, color='g')
Note
Once the map is created, all plotting calls will be assumed to already be in the map’s declared coordinate system given by coords.
Plot highlighted annotation (with a white lining)
Belongs to: rbspFp
alias of utils.plotUtils