Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc',
#extensions = ['matplotlib.sphinxext.mathmpl',
# 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives',
# 'matplotlib.sphinxext.plot_directive',
'matplotlib.sphinxext.plot_directive',
# 'sphinx.ext.inheritance_diagram',
# 'matplotlib.sphinxext.ipython_console_highlighting']
# 'matplotlib.sphinxext.ipython_console_highlighting',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand Down Expand Up @@ -164,3 +165,14 @@
# Show both class-level docstring and __init__ docstring in class
# documentation
autoclass_content = 'both'




################ plot directive configurations #####################
plot_html_show_formats = False
plot_include_source = True
plot_rcparams = {'figure.figsize':[8, 6]}
plot_formats = [('png', 100), # pngs for html building
('pdf', 72), # pdfs for latex building
]
19 changes: 1 addition & 18 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,10 @@
import shutil
import sys

def check_build():
build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex',
'_static', '_templates']
for d in build_dirs:
try:
os.mkdir(d)
except OSError:
pass

def figs():
os.system('cd users/figures/ && python make.py')

def html():
check_build()
figs()
os.system('sphinx-build -b html -d build/doctrees . build/html')

def latex():
check_build()
figs()
if sys.platform != 'win32':
# LaTeX format.
os.system('sphinx-build -b latex -d build/doctrees . build/latex')
Expand All @@ -47,12 +31,11 @@ def clean():
shutil.rmtree('build')

def all():
figs()
html()
latex()


funcd = {'figs':figs,
funcd = {
'html':html,
'latex':latex,
'clean':clean,
Expand Down
3 changes: 1 addition & 2 deletions doc/users/aea.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ shape is not.

Distortion is very large near the poles in this projection.

.. literalinclude:: figures/aea.py

.. image:: figures/aea.png
.. plot:: users/figures/aea.py
8 changes: 2 additions & 6 deletions doc/users/aeqd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@ The specified point ``lon_0, lat_0`` shows up as a black dot in the center of th

Here's an example using the width and height keywords to specify the map region.

.. literalinclude:: figures/aeqd.py

.. image:: figures/aeqd.png
.. plot:: users/figures/aeqd.py

If both the width/height and corner lat/lon keywords are omitted, the whole world is
plotted in a circle.

.. literalinclude:: figures/aeqd_fulldisk.py

.. image:: figures/aeqd_fulldisk.png
.. plot:: users/figures/aeqd_fulldisk.py
4 changes: 1 addition & 3 deletions doc/users/cass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ The transverse aspect of the equidistant cassindrical projection.
The globe is first rotated so the central meridian becomes the "equator",
and then the normal equidistant cylindrical projection is applied.

.. literalinclude:: figures/cass.py

.. image:: figures/cass.png
.. plot:: users/figures/cass.py
4 changes: 1 addition & 3 deletions doc/users/cyl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ Equidistant Cylindrical Projection

The simplest projection, just displays the world in latitude/longitude coordinates.

.. literalinclude:: figures/cyl.py

.. image:: figures/cyl.png
.. plot:: users/figures/cyl.py
4 changes: 1 addition & 3 deletions doc/users/eck4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ Eckert IV Projection

A global equal-area projection.

.. literalinclude:: figures/eck4.py

.. image:: figures/eck4.png
.. plot:: users/figures/eck4.py
4 changes: 1 addition & 3 deletions doc/users/eqdc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ On a conformal projection, the shape of the circles is preserved, but the
area is not. On a equal-area projection, the area is preserved but the
shape is not.

.. literalinclude:: figures/eqdc.py

.. image:: figures/eqdc.png
.. plot:: users/figures/eqdc.py
44 changes: 10 additions & 34 deletions doc/users/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,65 +37,41 @@ to retrieve datasets over http):

* Plot contour lines on a basemap

.. literalinclude:: figures/contour1.py

.. image:: figures/contour1.png
.. plot:: users/figures/contour1.py

* Plot precip with filled contours

.. literalinclude:: figures/plotprecip.py

.. image:: figures/plotprecip.png
.. plot:: users/figures/plotprecip.py

* Plot sea-level pressure weather map with labelled highs and lows

.. literalinclude:: figures/plothighsandlows.py
.. plot:: users/figures/plothighsandlows.py

.. image:: figures/plothighsandlows.png

* Plot hurricane tracks from a shapefile

.. literalinclude:: figures/hurrtracks.py
.. plot:: users/figures/hurrtracks.py

.. image:: figures/hurrtracks.png

* Plot etopo5 topography/bathymetry data as an image (with
and without shading from a specified light source).

.. literalinclude:: figures/plotetopo5.py
.. plot:: users/figures/plotetopo5.py

.. image:: figures/etopo5.png

.. image:: figures/etopo5_shaded.png

* Plot markers at locations of `ARGO <http://www.argo.ucsd.edu/>`__ floats.

.. literalinclude:: figures/plotargo.py
.. plot:: users/figures/plotargo.py

.. image:: figures/plotargo.png

* Pseudo-color plot of SST and sea ice analysis.

.. literalinclude:: figures/plotsst.py
.. plot:: users/figures/plotsst.py

.. image:: figures/plotsst.png

* Plotting wind vectors and wind barbs.

.. literalinclude:: figures/plotwindvec.py
.. plot:: users/figures/plotwindvec.py

.. image:: figures/plotwindvec1.png

.. image:: figures/plotwindvec2.png

* Draw great circle between NY and London.

.. literalinclude:: figures/plotgreatcircle.py
.. plot:: users/figures/plotgreatcircle.py

.. image:: figures/plotgreatcircle.png

* Draw day-night terminator on a map.

.. literalinclude:: figures/plotdaynight.py

.. image:: figures/plotdaynight.png
.. plot:: users/figures/plotdaynight.py
2 changes: 1 addition & 1 deletion doc/users/figures/aea.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
poly = m.tissot(lon,lat,1.25,100,\
facecolor='green',zorder=10,alpha=0.5)
plt.title("Albers Equal Area Projection")
plt.savefig('aea.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/aeqd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
m.plot([xpt],[ypt],'ko')
# draw the title.
plt.title('Azimuthal Equidistant Projection')
plt.savefig('aeqd.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/aeqd_fulldisk.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
m.plot([xpt],[ypt],'ko')
# draw the title.
plt.title('Whole World Azimuthal Equidistant Projection')
plt.savefig('aeqd_fulldisk.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/azeqd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
m.plot([xpt],[ypt],'ko')
# draw the title.
plt.title('Azimuthal Equidistant Projection')
plt.savefig('azeqd.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/background1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
m.drawmapboundary(fill_color='aqua')
# fill continents, set lake color same as ocean color.
m.fillcontinents(color='coral',lake_color='aqua')
plt.savefig('background1.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/background2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# lakes=True means plot inland lakes with ocean color.
m.drawlsmask(land_color='coral',ocean_color='aqua',lakes=True)
plt.show()
plt.savefig('background2.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/background3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
m.bluemarble()
plt.savefig('background3.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/background4.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
m.shadedrelief()
plt.savefig('background4.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/background5.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
m = Basemap(width=12000000,height=9000000,projection='lcc',
resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
m.etopo()
plt.savefig('background5.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/cass.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
m.drawmeridians(np.arange(-20.,21.,2.))
m.drawmapboundary(fill_color='aqua')
plt.title("Cassini Projection")
plt.savefig('cass.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/contour1.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
# contour data over the map.
cs = map.contour(x,y,wave+mean,15,linewidths=1.5)
plt.title('contour lines over filled continent background')
plt.savefig('contour1.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/cyl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
m.drawmeridians(np.arange(-180.,181.,60.))
m.drawmapboundary(fill_color='aqua')
plt.title("Equidistant Cylindrical Projection")
plt.savefig('cyl.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/eck4.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
m.drawmeridians(np.arange(0.,360.,60.))
m.drawmapboundary(fill_color='aqua')
plt.title("Eckert IV Projection")
plt.savefig('eck4.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/eqdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
poly = m.tissot(lon,lat,1.5,100,\
facecolor='green',zorder=10,alpha=0.5)
plt.title("Equidistant Conic Projection")
plt.savefig('eqdc.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/gall.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
m.drawmeridians(np.arange(-180.,181.,60.))
m.drawmapboundary(fill_color='aqua')
plt.title("Gall Stereographic Projection")
plt.savefig('gall.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/geos_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
m.drawmeridians(np.arange(0.,420.,60.))
m.drawmapboundary(fill_color='aqua')
plt.title("Full Disk Geostationary Projection")
plt.savefig('geos_full.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/geos_partial.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
m.drawmeridians(np.arange(0.,360.,60.))
m.drawmapboundary()
plt.title('Geostationary Map Showing A Quadrant of the Globe')
plt.savefig('geos_partial.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/gnomon.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
m.drawparallels(np.arange(10,90,20))
m.drawmeridians(np.arange(-180,180,30))
plt.title('Gnomonic Projection')
plt.savefig('gnomon.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/graticule.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
m.drawparallels(parallels,labels=[False,True,True,False])
meridians = np.arange(10.,351.,20.)
m.drawmeridians(meridians,labels=[True,False,False,True])
plt.savefig('graticule.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/hammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
m.drawmeridians(np.arange(0.,420.,60.))
m.drawmapboundary(fill_color='aqua')
plt.title("Hammer Projection")
plt.savefig('hammer.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/hurrtracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
m.drawparallels(np.arange(10,70,20),labels=[1,1,0,0])
m.drawmeridians(np.arange(-100,0,20),labels=[0,0,0,1])
plt.title('Atlantic Hurricane Tracks (Storms Reaching Category 4, 1851-2004)')
plt.savefig('hurrtracks.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/kav7.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
m.drawmeridians(np.arange(0.,360.,60.))
m.drawmapboundary(fill_color='aqua')
plt.title("Kavrayskiy VII Projection")
plt.savefig('kav7.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/laea.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
poly = m.tissot(lon,lat,1.5,100,\
facecolor='green',zorder=10,alpha=0.5)
plt.title("Lambert Azimuthal Equal Area Projection")
plt.savefig('laea.png')
plt.show()
2 changes: 1 addition & 1 deletion doc/users/figures/lcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
poly = m.tissot(lon,lat,1.5,100,\
facecolor='green',zorder=10,alpha=0.5)
plt.title("Lambert Conformal Projection")
plt.savefig('lcc.png')
plt.show()
Loading