SF.net SVN: matplotlib: [4542] trunk/py4science/workbook/fig
Revision: 4542 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4542&view=rev Author: jswhit Date: 2007-12-02 05:22:48 -0800 (Sun, 02 Dec 2007) Log Message: --- remove pdf files Removed Paths: - trunk/py4science/workbook/fig/basemap1.pdf trunk/py4science/workbook/fig/basemap3.pdf trunk/py4science/workbook/fig/basemap4.pdf Deleted: trunk/py4science/workbook/fig/basemap1.pdf === (Binary files differ) Deleted: trunk/py4science/workbook/fig/basemap3.pdf === (Binary files differ) Deleted: trunk/py4science/workbook/fig/basemap4.pdf === (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4543] trunk/py4science/examples
Revision: 4543
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4543&view=rev
Author: jswhit
Date: 2007-12-02 05:23:22 -0800 (Sun, 02 Dec 2007)
Log Message:
---
save png output at 600 dpi (instead of eps/pdf)
Modified Paths:
--
trunk/py4science/examples/basemap1.py
trunk/py4science/examples/basemap2.py
trunk/py4science/examples/basemap3.py
trunk/py4science/examples/basemap4.py
trunk/py4science/examples/basemap5.py
Modified: trunk/py4science/examples/basemap1.py
===
--- trunk/py4science/examples/basemap1.py 2007-12-02 13:22:48 UTC (rev
4542)
+++ trunk/py4science/examples/basemap1.py 2007-12-02 13:23:22 UTC (rev
4543)
@@ -24,5 +24,4 @@
m.drawcountries()
m.drawstates()
pylab.title('map region specified using corner lat/lon values')
-pylab.savefig('basemap1.eps')
-pylab.savefig('basemap1.png')
+pylab.savefig('basemap1.png',dpi=600)
Modified: trunk/py4science/examples/basemap2.py
===
--- trunk/py4science/examples/basemap2.py 2007-12-02 13:22:48 UTC (rev
4542)
+++ trunk/py4science/examples/basemap2.py 2007-12-02 13:23:22 UTC (rev
4543)
@@ -19,5 +19,4 @@
m.drawcountries()
m.drawstates()
pylab.title('map region specified using width and height')
-pylab.savefig('basemap2.eps')
-pylab.savefig('basemap2.png')
+pylab.savefig('basemap2.png',dpi=600)
Modified: trunk/py4science/examples/basemap3.py
===
--- trunk/py4science/examples/basemap3.py 2007-12-02 13:22:48 UTC (rev
4542)
+++ trunk/py4science/examples/basemap3.py 2007-12-02 13:23:22 UTC (rev
4543)
@@ -40,5 +40,4 @@
m.drawcountries()
m.drawstates()
pylab.title('NY to London Great Circle')
-pylab.savefig('basemap3.eps')
-pylab.savefig('basemap3.png')
+pylab.savefig('basemap3.png',dpi=600)
Modified: trunk/py4science/examples/basemap4.py
===
--- trunk/py4science/examples/basemap4.py 2007-12-02 13:22:48 UTC (rev
4542)
+++ trunk/py4science/examples/basemap4.py 2007-12-02 13:23:22 UTC (rev
4543)
@@ -24,5 +24,4 @@
# of the plot frame.
m.drawparallels(numpy.arange(-80,81,20),labels=[1,1,1,0])
pylab.title('labelled meridians and parallels',y=1.075)
-pylab.savefig('basemap4.eps')
-pylab.savefig('basemap4.png')
+pylab.savefig('basemap4.png',dpi=600)
Modified: trunk/py4science/examples/basemap5.py
===
--- trunk/py4science/examples/basemap5.py 2007-12-02 13:22:48 UTC (rev
4542)
+++ trunk/py4science/examples/basemap5.py 2007-12-02 13:23:22 UTC (rev
4543)
@@ -29,5 +29,4 @@
m.drawmapboundary(fill_color='k')
# draw horizontal colorbar.
pylab.colorbar(orientation='horizontal')
-pylab.savefig('basemap5.pdf')
-pylab.savefig('basemap5.png')
+pylab.savefig('basemap5.png',dpi=600)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4544] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/basemap.py
Revision: 4544 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4544&view=rev Author: jswhit Date: 2007-12-02 05:57:34 -0800 (Sun, 02 Dec 2007) Log Message: --- make sure there are no empty coastline segments. Modified Paths: -- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py === --- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py 2007-12-02 13:23:22 UTC (rev 4543) +++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py 2007-12-02 13:57:34 UTC (rev 4544) @@ -658,7 +658,9 @@ iprev = 0 ind.append(len(xd)) for i in ind: -coastsegs.append(zip(x[iprev:i],y[iprev:i])) +# don't add empty lists. +if len(range(iprev,i)): +coastsegs.append(zip(x[iprev:i],y[iprev:i])) iprev = i else: coastsegs.append(seg) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4545] trunk/toolkits/basemap/examples
Revision: 4545 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4545&view=rev Author: jswhit Date: 2007-12-02 06:24:29 -0800 (Sun, 02 Dec 2007) Log Message: --- wrap ax.get_position in a try/except so examples will work with transforms branch. Modified Paths: -- trunk/toolkits/basemap/examples/contour_demo.py trunk/toolkits/basemap/examples/panelplot.py trunk/toolkits/basemap/examples/plotmap.py trunk/toolkits/basemap/examples/plotmap_masked.py trunk/toolkits/basemap/examples/plotmap_oo.py trunk/toolkits/basemap/examples/plotprecip.py trunk/toolkits/basemap/examples/pnganim.py trunk/toolkits/basemap/examples/simpletest_oo.py trunk/toolkits/basemap/examples/test.py Modified: trunk/toolkits/basemap/examples/contour_demo.py === --- trunk/toolkits/basemap/examples/contour_demo.py 2007-12-02 13:57:34 UTC (rev 4544) +++ trunk/toolkits/basemap/examples/contour_demo.py 2007-12-02 14:24:29 UTC (rev 4545) @@ -21,7 +21,10 @@ x, y = m(lons, lats) CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) -l,b,w,h=ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -46,7 +49,10 @@ x, y = m(lons, lats) CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) -l,b,w,h=ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -71,7 +77,10 @@ x, y = m(lons, lats) CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) -l,b,w,h=ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -96,7 +105,10 @@ x, y = m(lons, lats) CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) -l,b,w,h=ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again @@ -122,7 +134,10 @@ x, y = m(lons, lats) CS = m.contour(x,y,hgt,15,linewidths=0.5,colors='k') CS = m.contourf(x,y,hgt,15,cmap=cm.jet) -l,b,w,h=ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = axes([l+w+0.075, b, 0.05, h]) # setup colorbar axes colorbar(drawedges=True, cax=cax) # draw colorbar axes(ax) # make the original axes current again Modified: trunk/toolkits/basemap/examples/panelplot.py === --- trunk/toolkits/basemap/examples/panelplot.py2007-12-02 13:57:34 UTC (rev 4544) +++ trunk/toolkits/basemap/examples/panelplot.py2007-12-02 14:24:29 UTC (rev 4545) @@ -27,7 +27,10 @@ CS = mnh.contour(xnh,ynh,hgt,15,linewidths=0.5,colors='k') CS = mnh.contourf(xnh,ynh,hgt,15,cmap=P.cm.Spectral) # colorbar on bottom. -l,b,w,h = ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = P.axes([l, b-0.05, w, 0.025]) # setup colorbar axes P.colorbar(cax=cax, orientation='horizontal',ticks=CS.levels[0::4]) # draw colorbar P.axes(ax) # make the original axes current again @@ -50,7 +53,10 @@ CS = msh.contourf(xsh,ysh,hgt,15,cmap=P.cm.Spectral) # colorbar on bottom. ax.apply_aspect() -l,b,w,h = ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = P.axes([l, b-0.05, w, 0.025]) # setup colorbar axes P.colorbar(cax=cax,orientation='horizontal',ticks=MultipleLocator(320)) # draw colorbar P.axes(ax) # make the original axes current again @@ -72,7 +78,10 @@ CS = mnh.contour(xnh,ynh,hgt,15,linewidths=0.5,colors='k') CS = mnh.contourf(xnh,ynh,hgt,15,cmap=P.cm.RdBu) # colorbar on right -l,b,w,h = ax.get_position() +try: +l,b,w,h = ax.get_position() +except: +l,b,w,h = (ax.get_position()).bounds cax = P.axes([l+w+0.025, b, 0.025, h]) # setup colorbar axes P.colorbar(cax=cax, ticks=MultipleLocator(160), format='%4i') # draw colorbar P.axes(ax) # make the original axes current again @@ -86,7 +95,10 @@ CS = msh.contour(xsh,ysh,hgt,15,linewidths=0.5,colors='k') CS = msh.contourf(xsh,ysh,hgt,15,cmap=P.cm.RdBu) # colorbar on right. -l,b,w,h = ax.get_position() +tr
SF.net SVN: matplotlib: [4546] trunk/py4science/doc/rest_basics.txt
Revision: 4546 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4546&view=rev Author: jdh2358 Date: 2007-12-02 09:27:27 -0800 (Sun, 02 Dec 2007) Log Message: --- added requirements and rest doc Added Paths: --- trunk/py4science/doc/rest_basics.txt Added: trunk/py4science/doc/rest_basics.txt === --- trunk/py4science/doc/rest_basics.txt(rev 0) +++ trunk/py4science/doc/rest_basics.txt2007-12-02 17:27:27 UTC (rev 4546) @@ -0,0 +1,172 @@ += + reST (reSTructured Text) basics +=k +.. Author: Fernando Perez +.. Contact: [EMAIL PROTECTED] +.. Time-stamp: "2007-08-29 15:50:06 fperez" + +.. contents:: +.. +1 What is reST? +2 Markup summary +3 Emacs cheat sheet +4 Tests +5 Things I don't like + + +What is reST? += + +It's a simple text markup format which can be converted easily into other +formats (html, latex, pdf) while being easily readable in its plaintext +version. This document is a little example of reST basics for my own +reference. + +As shown above, it's good practice to start any reST document with a title and +simple metadata. The two leading dots indicate a comment or special markup +directive in reST. The time stamp can be updated with the emacs command +``time-stamp`` (these two back-quotes mean 'inline literal', which is normally +rendered as monospace font). + +The metadata above was enclosed inside comment fields, so it won't be visible +in the generated document. You can instead use reST fields if you want these +values to be automatically formatted in produced documents: + +:Author: Fernando Perez +:Contact: [EMAIL PROTECTED] +:Date: January 4, 2007 + +The table of contents is auto-updated by Emacs with 'C-c p u', and it is also +rendered in HTML by the rst2html compiler. This can be invoked from Emacs via +the ``rst-compile`` command. Additionally, Emacs makes each entry in the TOC +an internal clickable link, which is great for navigation. + +This_ link is a quick reference to the reST markup (links are made by an +underscore at the end of the word, and the same word following shortly with the +underscore preceding it instead, and its target indicated after a colon). + +.. _This: http://docutils.sourceforge.net/docs/user/rst/quickref.html + +Making websites: look at http://www.voidspace.org.uk/python/rest2web + + +Markup summary +== + +These are taken from the quickref mentioned above, and are just a small subset +of the more common markup options. See that document for more details. + +- *emphasis*: Normally rendered as italics. + +- **strong emphasis**: Normally rendered as boldface. + +- ``inline literal``: Normally rendered as monospaced text. Spaces should be + preserved, but line breaks will not be. For multiline literal blocks, use + ``::`` preceding the literal block (if it's at the end of a sentence, it gets + converted into a single ':'). + +- reference_: A simple, one-word hyperlink reference. + +- `phrase reference`_: A reference with spaces or punctuation. + +- footnote reference [1]_: See quickref for details. + +- citation reference [CIT2002]_: See quickref for details. + +Note: the above are listed using bullet list markup. reST also has markup for +enumerated, options, definitions and fields lists. + + +Emacs cheat sheet += + +These are a few useful Emacs bindings, copied from the help and support source +code. C-= is by far the most common and useful one:: + +C-c p a (also C-=): rst-adjust + + Updates or rotates the section title around point or promotes/demotes + the decorations within the region (see full details below). + + Note that C-= is a good binding, since it allows you to specify a + negative arg easily with C-- C-= (easy to type), as well as ordinary + prefix arg with C-u C-=. + +C-c p h: rst-display-decorations-hierarchy + + Displays the level decorations that are available in the file. + +C-c p t: rst-toc + + Displays the hierarchical table-of-contents of the document and allows + you to jump to any section from it. + +C-c p i: rst-toc-insert + + Inserts a table-of-contents in the document at the column where the + cursor is. + +C-c p u: rst-toc-insert-update + + Finds an existing inserted table-of-contents in the document an + updates it. + +C-c p p, C-c p n (C-c C-p, C-c C-n): rst-backward-section, +rst-forward-section + + Navigate between section titles. + +C-c p l, C-c p r (C-c C-l, C-c C-r): rst-shift-region-left, +rst-shift-region-right + + Shift the region left or right by two-char increments, which is perfect + for bulleted lists. + +M-Scenter-paragraph + +M-scenter-line + + +Tests += + +some text + +-
SF.net SVN: matplotlib: [4547] trunk/py4science/doc/requirements.txt
Revision: 4547 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4547&view=rev Author: jdh2358 Date: 2007-12-02 09:27:41 -0800 (Sun, 02 Dec 2007) Log Message: --- added requirements and rest doc Added Paths: --- trunk/py4science/doc/requirements.txt Added: trunk/py4science/doc/requirements.txt === --- trunk/py4science/doc/requirements.txt (rev 0) +++ trunk/py4science/doc/requirements.txt 2007-12-02 17:27:41 UTC (rev 4547) @@ -0,0 +1,160 @@ +Core requirements += + +The four python packages you will need for this course are + +- ipython: an interactive python shell http://ipython.scipy.org + +- numpy: high performance numerical arrays http://numpy.scipy.org + +- scipy: algorithms and numerics http://scipy.org + +- matplotlib: plotting http://matplotlib.sf.net + +With these four packages, you will be able to do about 90% of the +exercises in the course. In addition, to generate plot windows, +matplotlib requires a user interface toolkit, for example Tk, GTK, +wxPython or Qt. Tk comes with python, so that should work out of the +box, but some of the other code we will be demoing work best with +wxPython, so we also recommend you install wxPython +(http://www.wxpython.org/) + +We will detail the optional packages that will be used in the workshop +below. It will be great if you can get all the optional packages as +well, but since most of the workshop depends on these four +requirements, make sure you have these four installed, configured and +tested before turning to the optional packages. + +For those of you who do not succeed in getting a machine properly +configured with the packages above, we will be providing an X11 server +that you can log into to work on the exercises remotely. If your +machine supports ssh with X11 forwarding, you will be in good shape. +If not, we will provide ubuntu boot CDs so you can reboot into linux +and then ssh into the x11 server to run the exercises. + + +Basic configuration +=== + +You need to configure matplotlib to work with the user interface you +have selected. The configuration file is called matplotlibrc and it +is installed in site-packages/matplotlib/mpl-data/matplotlibrc along +with the rest of your matplotlib install. Create a directory in your +home directory called .matplotlib and copy this file into it (or +simply edit in place in mpl-data) and change the line that starts with +'backend' to + + backend : WXAgg + +for use with wxpython. + +Testing +=== + +If you can execute the following commands w/o error, and have a plot +window pop up, you have an installation that will work for 90% of the +exercises in the workshop + +> ipython -pylab +Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) +Type "copyright", "credits" or "license" for more information. + +IPython 0.8.3.svn.r2876 -- An enhanced Interactive Python. + +In [1]: import numpy + +In [2]: import scipy + +In [3]: plot([1,2,3]) +Out[3]: [] + +Checking your versions +== + +It helps to have the most recent packages for the workshop. We are +recommending at least the following + + - ipython >= 0.7.0 + + - numpy >= 1.01 + + - matplotlib >= 0.90.0 + + - scipy >= 0.5.2 + +The example code below shows you how to check your versions: + +In [4]: import numpy + +In [5]: numpy.__version__ +Out[5]: '1.0.4.dev4380' + +In [6]: import scipy + +In [7]: scipy.__version__ +Out[7]: '0.7.0.dev3494' + +In [8]: import IPython + +In [9]: IPython.__version__ +Out[9]: '0.8.3.svn.r2876' + +In [10]: import matplotlib + +In [11]: matplotlib.__version__ +Out[11]: '0.91.1' + +Platform specific instructions +== + +linux + +os x + +win32 + +Optional packages += + +We will be doing demos and exercises with a nmber of additional +packages, which we will describe briefly below. Because there are so +many variations in operating systems and platforms, we will not +attempt to provide details so consult the web sites and other +resources if there is a package you are particularly interested in and +want to make sure you are configured properly to do an exercise on +your own machine. We will be providing a properly configured server, +so even if you do not have each of these packages installed, as long +as your machine supports remote login with X11 forwarding to our +server, you can long in to do the exercises if you are missing a +package on your local machine. + + +- pytables : a package for managing large datasets efficiently + http://www.pytables.org/moin (also requires hdf5) + +- pydap : a python implementation of the Data Access Protocol + (DAP). http://pydap.org. + +- enthought tool suite (ETS) : provides traits, a package for strong + typing in python that also facilitates automatic use
SF.net SVN: matplotlib: [4549] trunk/py4science/examples/basemap5.py
Revision: 4549 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4549&view=rev Author: jswhit Date: 2007-12-02 17:33:24 -0800 (Sun, 02 Dec 2007) Log Message: --- remove blank lines Modified Paths: -- trunk/py4science/examples/basemap5.py Modified: trunk/py4science/examples/basemap5.py === --- trunk/py4science/examples/basemap5.py 2007-12-03 00:12:18 UTC (rev 4548) +++ trunk/py4science/examples/basemap5.py 2007-12-03 01:33:24 UTC (rev 4549) @@ -1,6 +1,5 @@ from matplotlib.toolkits.basemap import Basemap, NetCDFFile import pylab, numpy - # read in netCDF sea-surface temperature data # can be a local file, a URL for a remote opendap dataset, # or (if PyNIO is installed) a GRIB or HDF file. @@ -8,9 +7,6 @@ sst = ncfile.variables['analysed_sst'][:] lats = ncfile.variables['lat'][:] lons = ncfile.variables['lon'][:] - -print sst.shape, sst.min(), sst.max() - # set colormap cmap = pylab.cm.gist_ncar # create Basemap instance for mollweide projection. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4550] trunk/py4science/examples
Revision: 4550
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4550&view=rev
Author: jswhit
Date: 2007-12-02 17:39:21 -0800 (Sun, 02 Dec 2007)
Log Message:
---
remove blank lines
Modified Paths:
--
trunk/py4science/examples/basemap1.py
trunk/py4science/examples/basemap2.py
trunk/py4science/examples/basemap3.py
trunk/py4science/examples/basemap4.py
trunk/py4science/examples/basemap5.py
Modified: trunk/py4science/examples/basemap1.py
===
--- trunk/py4science/examples/basemap1.py 2007-12-03 01:33:24 UTC (rev
4549)
+++ trunk/py4science/examples/basemap1.py 2007-12-03 01:39:21 UTC (rev
4550)
@@ -1,6 +1,5 @@
import pylab, numpy
from matplotlib.toolkits.basemap import Basemap
-
# create figure.
fig = pylab.figure()
# create map by specifying lat/lon values at corners.
@@ -24,4 +23,4 @@
m.drawcountries()
m.drawstates()
pylab.title('map region specified using corner lat/lon values')
-pylab.savefig('basemap1.png',dpi=600)
+pylab.show()
Modified: trunk/py4science/examples/basemap2.py
===
--- trunk/py4science/examples/basemap2.py 2007-12-03 01:33:24 UTC (rev
4549)
+++ trunk/py4science/examples/basemap2.py 2007-12-03 01:39:21 UTC (rev
4550)
@@ -1,6 +1,5 @@
import pylab, numpy
from matplotlib.toolkits.basemap import Basemap
-
# create figure.
fig = pylab.figure()
# create map by specifying width and height in km.
@@ -19,4 +18,4 @@
m.drawcountries()
m.drawstates()
pylab.title('map region specified using width and height')
-pylab.savefig('basemap2.png',dpi=600)
+pylab.show()
Modified: trunk/py4science/examples/basemap3.py
===
--- trunk/py4science/examples/basemap3.py 2007-12-03 01:33:24 UTC (rev
4549)
+++ trunk/py4science/examples/basemap3.py 2007-12-03 01:39:21 UTC (rev
4550)
@@ -1,6 +1,5 @@
import pylab, numpy
from matplotlib.toolkits.basemap import Basemap
-
# create figure.
fig = pylab.figure()
# create map by specifying width and height in km.
@@ -40,4 +39,4 @@
m.drawcountries()
m.drawstates()
pylab.title('NY to London Great Circle')
-pylab.savefig('basemap3.png',dpi=600)
+pylab.show()
Modified: trunk/py4science/examples/basemap4.py
===
--- trunk/py4science/examples/basemap4.py 2007-12-03 01:33:24 UTC (rev
4549)
+++ trunk/py4science/examples/basemap4.py 2007-12-03 01:39:21 UTC (rev
4550)
@@ -24,4 +24,4 @@
# of the plot frame.
m.drawparallels(numpy.arange(-80,81,20),labels=[1,1,1,0])
pylab.title('labelled meridians and parallels',y=1.075)
-pylab.savefig('basemap4.png',dpi=600)
+pylab.show()
Modified: trunk/py4science/examples/basemap5.py
===
--- trunk/py4science/examples/basemap5.py 2007-12-03 01:33:24 UTC (rev
4549)
+++ trunk/py4science/examples/basemap5.py 2007-12-03 01:39:21 UTC (rev
4550)
@@ -25,4 +25,4 @@
m.drawmapboundary(fill_color='k')
# draw horizontal colorbar.
pylab.colorbar(orientation='horizontal')
-pylab.savefig('basemap5.png',dpi=600)
+pylab.show()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4551] trunk/py4science
Revision: 4551 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4551&view=rev Author: fer_perez Date: 2007-12-02 17:50:55 -0800 (Sun, 02 Dec 2007) Log Message: --- Update reST in requirements doc Modified Paths: -- trunk/py4science/classes/0712_ncar_agenda.txt trunk/py4science/doc/requirements.txt trunk/py4science/workbook/main.tex Modified: trunk/py4science/classes/0712_ncar_agenda.txt === --- trunk/py4science/classes/0712_ncar_agenda.txt 2007-12-03 01:39:21 UTC (rev 4550) +++ trunk/py4science/classes/0712_ncar_agenda.txt 2007-12-03 01:50:55 UTC (rev 4551) @@ -4,161 +4,149 @@ Initials indicate who presents what: -JDH - John D. Hunter -FP - Fernando Perez -JW - Jeff Whitaker + * JDH: John D. Hunter + * FP: Fernando Perez + * JW: Jeff Whitaker Day 1 (Friday December 7) = -830-900 Installation and configuration (optional) -This half hour will be spent helping with installation issues, before the -real workshop begins. If you've already set things up on your system -(meaning you have ipython, numpy, matplotlib and scipy installed and -running), feel free to skip this. +830-900: Installation and configuration (optional) + This half hour will be spent helping with installation issues, before the + real workshop begins. If you've already set things up on your system + (meaning you have ipython, numpy, matplotlib and scipy installed and + running), feel free to skip this. -900-905 Introduction -Official start of the workshop, introduce instructors. +900-905: Introduction + Official start of the workshop, introduce instructors. -905-945 JDH: Python for scientific computing -A high-level overview of the topic of Python in a scientific context. +905-945 (JDH): Python for scientific computing + A high-level overview of the topic of Python in a scientific context. -950-1045 FP: Workflow, guided by a simple example: trapezoid integration. +950-1045 (FP): Workflow, guided by a simple examples. + This section will be used to illustrate basic workflow for students, by + having them 'type along' a very simple exercise, trapezoid rule integration. + We'll discuss the basics of numpy arrays and will solve the trapezoid + integration exercise together. -This section will be used to illustrate basic workflow for students, by having -them 'type along' a very simple exercise, trapezoid rule integration. We'll -discuss the basics of numpy arrays and will solve the trapezoid integration -exercise together. + -Editor: (X)Emacs, Vi(m), etc. +1045-1100: Coffee break -ipython. Saving and reloading files, interactive use of variables, %run, -%debug, %xmode verbose. + -Getting help: - - pydoc (-g, -p) +1100-1145 (FP): Introductory examples. + We'll have two exercises, so students who finish the first one early don't + get bored and can do a second one: - - The standard docs (bookmark them) + * FFTs: 2-d image denoising via FFT. + * Numerical integration and root finding. - - ipython ?/??, help(), the tab key. numpy.*cos*? search. + - - The open source process: mailing lists, wikis, svn. Python - cookbook. Participate! +1145-1230: Lunch Break -Basic setup: - - ipython - - matplotlib (latex, etc). - - Modules: import/reload, PYTHONPATH. + -- Urllib Yahoo finance demo. - -ToDo: Add numerical error measure of trapezoid rule. +1300-1400 (JDH): Basic numpy/pylab usage. + A linear algebra/2d data visualization demo using numpy and matplotlib will + then be extended as an exercise by the students. If time allows, an ODE + example will be presented: -ToDo Add in workflow comparison with scipy's integration. compare timing and -eror. + * Glass2 demo: linear algebra, event handling in interactive plots. + * Glass1 exercise: simplified version of the above as an exercise. + * ODEs - Lotka Volterra equations. -ToDo: write cheat-sheet. +1400-1500 (JW): Basemap: geographical datasets. + Basemap_ is a matplotlib toolkit that plots data on map projections (with + continental and political boundaries). -1045:1100 --- Coffee break --- +.. _Basemap: http://matplotlib.sourceforge.net/matplotlib.toolkits.basemap.basemap.html + -1100:1145 FP: Introductory examples. +1500 End of main work for Friday -We'll have two exercises, so students who finish the first one early don't get -bored and can do a second one. + -FFTs: 2-d image denoising via FFT. +1500-1700: Open data access standards and protocols (optional material) + We realize there's a Christmas party, so we'll keep this part optional, feel + free to skip out as the needs for wine and cheese dictate. We'll look at the + Python implementation of the OpenDAP protocol and a package for easy + construction and manipulation of HDF5 datsets: -Numerical integration and root finding: Find t such that + * (FP) - OpenDAP_ via the
SF.net SVN: matplotlib: [4552] trunk/py4science/doc
Revision: 4552 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4552&view=rev Author: jdh2358 Date: 2007-12-02 19:24:57 -0800 (Sun, 02 Dec 2007) Log Message: --- updated requirements links Modified Paths: -- trunk/py4science/doc/requirements.txt trunk/py4science/doc/rest_basics.txt Modified: trunk/py4science/doc/requirements.txt === --- trunk/py4science/doc/requirements.txt 2007-12-03 01:50:55 UTC (rev 4551) +++ trunk/py4science/doc/requirements.txt 2007-12-03 03:24:57 UTC (rev 4552) @@ -17,14 +17,22 @@ The four python packages you will need for this course are -- ipython: an interactive python shell http://ipython.scipy.org +- ipython_: an interactive python shell -- numpy: high performance numerical arrays http://numpy.scipy.org +- numpy_: high performance numerical arrays -- scipy: algorithms and numerics http://scipy.org +- scipy_: algorithms and numerics -- matplotlib: plotting http://matplotlib.sf.net +- matplotlib_: plotting +.. _ipython: http://ipython.scipy.org + +.. _numpy: http://numpy.scipy.org + +.. _scipy: http://scipy.org + +.. _matplotlib: http://matplotlib.sf.net + With these four packages, you will be able to do about 90% of the exercises in the course. In addition, to generate plot windows, matplotlib requires a user interface toolkit, for example Tk, GTK, Modified: trunk/py4science/doc/rest_basics.txt === --- trunk/py4science/doc/rest_basics.txt2007-12-03 01:50:55 UTC (rev 4551) +++ trunk/py4science/doc/rest_basics.txt2007-12-03 03:24:57 UTC (rev 4552) @@ -1,4 +1,4 @@ -= +_= reST (reSTructured Text) basics =k .. Author: Fernando Perez This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4553] trunk/py4science/doc/requirements.txt
Revision: 4553 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4553&view=rev Author: jdh2358 Date: 2007-12-02 19:27:09 -0800 (Sun, 02 Dec 2007) Log Message: --- updated requirements links Modified Paths: -- trunk/py4science/doc/requirements.txt Modified: trunk/py4science/doc/requirements.txt === --- trunk/py4science/doc/requirements.txt 2007-12-03 03:24:57 UTC (rev 4552) +++ trunk/py4science/doc/requirements.txt 2007-12-03 03:27:09 UTC (rev 4553) @@ -17,13 +17,13 @@ The four python packages you will need for this course are -- ipython_: an interactive python shell +- ipython_: an interactive python shell - numpy_: high performance numerical arrays - scipy_: algorithms and numerics -- matplotlib_: plotting +- matplotlib_: plotting .. _ipython: http://ipython.scipy.org @@ -31,7 +31,7 @@ .. _scipy: http://scipy.org -.. _matplotlib: http://matplotlib.sf.net +.. _matplotlib:http://matplotlib.sf.net With these four packages, you will be able to do about 90% of the exercises in the course. In addition, to generate plot windows, @@ -151,32 +151,39 @@ server, you can long in to do the exercises if you are missing a package on your local machine. +- pytables_ : a package for managing large datasets efficiently + (also requires hdf5) -- pytables : a package for managing large datasets efficiently - http://www.pytables.org/moin (also requires hdf5) +- pydap_ : a python implementation of the Data Access Protocol + (DAP). -- pydap : a python implementation of the Data Access Protocol - (DAP). http://pydap.org. - -- enthought tool suite (ETS) : provides traits, a package for strong +- `enthought tool suite`_ (ETS) : provides traits, a package for strong typing in python that also facilitates automatic user interface generation and more. Also provides tvtk and mayavi2 for 3D - visualization. http://code.enthought.com/ets/ + visualization. - weave : a package for inlining C and C++ in your python code. Comes - with scipy but requires a working compiler suite (eg gcc and g++) + with scipy but requires a working compiler suite (eg, gcc and g++) - f2py : comes with scipy but requires a working fortran compiler. See http://scipy.org/Installing_SciPy for platform specific instructions -- pyrex : lets you mix c and python for writing high performance +- pyrex_ : lets you mix c and python for writing high performance python extensions - http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ + -- basemap : a matplotlib toolkit for workin with geographic data and - map projections. Available for download at the matplotlib downloa +- basemap_ : a matplotlib toolkit for workin with geographic data and + map projections. Available for download at the matplotlib download page http://sourceforge.net/project/platformdownload.php?group_id=80706 - with documentation at - http://matplotlib.sourceforge.net/matplotlib.toolkits.basemap.basemap.html + +.. _pytables: http://www.pytables.org/moin + +.. _basemap: http://matplotlib.sourceforge.net/matplotlib.toolkits.basemap.basemap.html + +.. _pyrex: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/ + +.. _`enthought tool suite`: http://code.enthought.com/ets/ + +.. _pydap: http://pydap.org. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4554] trunk/py4science/workbook/README
Revision: 4554 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4554&view=rev Author: jdh2358 Date: 2007-12-02 20:56:40 -0800 (Sun, 02 Dec 2007) Log Message: --- updated win32 requirements doc Modified Paths: -- trunk/py4science/workbook/README Modified: trunk/py4science/workbook/README === --- trunk/py4science/workbook/README2007-12-03 03:27:09 UTC (rev 4553) +++ trunk/py4science/workbook/README2007-12-03 04:56:40 UTC (rev 4554) @@ -4,14 +4,12 @@ it in. We use the latex listing package for including python source code. -For every unit, create an example in ../examples/your_example.py, a -skeleton in ../examples/your_example_skel.py, and a symlink from -../examples/your_example_skel.py -> examples_skel/your_example.py -(../examples is in the top level of the py4science repository). If -there are any figures, you should create a PNG and EPS version of each -and add them to the fig subdirectory of the workbook directory. You -will need to svn add your tex file, example, skeleton, skeleton -symlink, and figures. +For every unit, create an example in +../problems_solved/your_problem.py, and a skeleton in +../problems_skel/your_problem_skel.py. If there are any figures, you +should create a PNG and EPS version of each and add them to the fig +subdirectory of the workbook directory. You will need to svn add your +tex file, problem, skeleton, skeleton symlink, and figures. You can build the workbook in skeleton form with This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4555] trunk/py4science/doc/requirements.txt
Revision: 4555 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4555&view=rev Author: jdh2358 Date: 2007-12-02 20:56:57 -0800 (Sun, 02 Dec 2007) Log Message: --- updated win32 requirements doc Modified Paths: -- trunk/py4science/doc/requirements.txt Modified: trunk/py4science/doc/requirements.txt === --- trunk/py4science/doc/requirements.txt 2007-12-03 04:56:40 UTC (rev 4554) +++ trunk/py4science/doc/requirements.txt 2007-12-03 04:56:57 UTC (rev 4555) @@ -38,9 +38,10 @@ matplotlib requires a user interface toolkit, for example Tk, GTK, wxPython or Qt. Tk comes with python, so that should work out of the box, but some of the other code we will be demoing work best with -wxPython, so we also recommend you install wxPython -(http://www.wxpython.org/) +wxPython, so we also recommend you install wxPython_ +.. _wxPython: http://www.wxpython.org + We will detail the optional packages that will be used in the workshop below. It will be great if you can get all the optional packages as well, but since most of the workshop depends on these four @@ -126,16 +127,48 @@ In [11]: matplotlib.__version__ Out[11]: '0.91.1' + + Platform specific instructions == -linux +Linux += -os x +TODO -win32 +OS X + +TODO +Microsoft Windows += + +- Install the latest windows `python MSI installer`_ from + +- install the win32com_ extensions. IPython needs these to set up the start menu properly and they have lots of useful goodies for windows users anyhow, like the abiliy to read and write MS Office documents via the COM API. + +- ipython: grab the latest win32 exe installer from the `ipython distributions`_ page + +- numpy: grab the latest exe or msi installer for your version of python at `numpy download`_ + +- scipy: grab the latest exe or msi installer from the "Binary installation for Windows" distribution from the `scipy download`_ page. + +- matplotlib: grab the latest exe from the `matplotlib download`_ page + +.. _`python MSI installer`: http://www.python.org/download/releases/2.5.1/ + +.. _win32com: http://sourceforge.net/project/showfiles.php?group_id=78018&package_id=79063&release_id=449591 + +.. _`ipython distributions`: http://ipython.scipy.org/dist/ + +.. _`numpy download`: http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103 + +.. _`scipy download`: http://www.scipy.org/Download + +.. _`matplotlib download`: http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474&release_id=558083 + Optional packages = @@ -171,13 +204,15 @@ - pyrex_ : lets you mix c and python for writing high performance python extensions - - basemap_ : a matplotlib toolkit for workin with geographic data and map projections. Available for download at the matplotlib download page http://sourceforge.net/project/platformdownload.php?group_id=80706 - +- svn_ : we wil be teaching open source software development + processes, which require svn. Windows users should consider + `tortise svn`_ + .. _pytables: http://www.pytables.org/moin .. _basemap: http://matplotlib.sourceforge.net/matplotlib.toolkits.basemap.basemap.html @@ -187,3 +222,8 @@ .. _`enthought tool suite`: http://code.enthought.com/ets/ .. _pydap: http://pydap.org. + +.. _svn: http://subversion.tigris.org/ + +.. `tortise svn`_: http://tortoisesvn.tigris.org/ + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
