SF.net SVN: matplotlib: [4639] trunk/py4science
Revision: 4639
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4639&view=rev
Author: fer_perez
Date: 2007-12-06 00:44:18 -0800 (Thu, 06 Dec 2007)
Log Message:
---
Talk about pydap
Added Paths:
---
trunk/py4science/slides/
trunk/py4science/slides/pydap/
trunk/py4science/slides/pydap/pydap.lyx
trunk/py4science/slides/pydap/pydap.pdf
trunk/py4science/slides/pydap/pydap_arch.png
Added: trunk/py4science/slides/pydap/pydap.lyx
===
--- trunk/py4science/slides/pydap/pydap.lyx (rev 0)
+++ trunk/py4science/slides/pydap/pydap.lyx 2007-12-06 08:44:18 UTC (rev
4639)
@@ -0,0 +1,827 @@
+#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
+\textclass beamer
+\begin_preamble
+% Include only certain frames - this speeds up compilation
+% The frames to be included need to be labeled, by using ERT
+% as [label=LABELNAME] (no backslashes or {})
+%\includeonlyframes{currentt}
+
+% To make a printable handout (one page per frame), pass
+% the handout option to the doc class (Layout menu)
+
+% For good fonts in PDFs, use pslatex fonts (Layout menu)
+
+% Colors and symbols
+\usepackage{latexsym}
+\usepackage{color}
+
+% Display covered items in transparent form (as opposed
+% to not showing them at all)
+\newcommand{\coveredinvisible}{
+\setbeamercovered{invisible}
+}
+\newcommand{\coveredvisible}{
+\setbeamercovered{highly dynamic}
+}
+
+% Choose default setting here:
+\coveredvisible
+
+\newcommand{\ps}{\vspace{-4mm} }
+
+% Theme configuration. I've basically built a custom theme out of
+% Warsaw, adding infoline and changing the nav. symbol bar
+
+% Warning: the commands below are order-sensitive!
+
+% load the infolines theme, b/c I want the headline Warsaw
+% uses (split), but the footline from infolines.
+% In the document body, these will be deactivated for the title and
+% turned on later
+\useoutertheme{infolines}
+% Main theme
+\usetheme{Warsaw}
+% Adjust the color for the center (title) box to be that of
+% infolines, which Warsaw changes
+\setbeamercolor*{title in head/foot}{parent=palette secondary}
+
+% Define a minimal set of navigation symbols
+\defbeamertemplate*{navigation symbols}{minmal}
+{%
+ \hbox{%
+\hbox{\insertframenavigationsymbol}
+\hbox{\insertdocnavigationsymbol}
+\hbox{\insertbackfindforwardnavigationsymbol}%
+ }%
+}
+% activate the minimal navbar
+\setbeamertemplate{navigation symbols}[minimal]
+
+% HACK %
+% I started getting errors because LyX is emmitting a color 'none'
+% call, which confuses xcolor. I'm defining 'none' to be black here.
+\definecolor{none}{cmyk}{0,0,0,1}
+% /HACK %
+\end_preamble
+\options compress
+\language english
+\inputencoding auto
+\font_roman times
+\font_sans helvet
+\font_typewriter courier
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
+\graphics default
+\paperfontsize default
+\spacing single
+\papersize default
+\use_geometry false
+\use_amsmath 2
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
+\paperorientation landscape
+\secnumdepth 2
+\tocdepth 2
+\paragraph_separation indent
+\defskip medskip
+\quotes_language english
+\papercolumns 1
+\papersides 1
+\paperpagestyle default
+\tracking_changes false
+\output_changes false
+\author ""
+\author ""
+\end_header
+
+\begin_body
+
+\begin_layout Standard
+\begin_inset Note Note
+status open
+
+\begin_layout Standard
+Some things to fix in a future version:
+\end_layout
+
+\begin_layout Standard
+- trim a bit of time
+\end_layout
+
+\begin_layout Standard
+- add more about ipython and my own python work, reduce that of others
+\end_layout
+
+\begin_layout Standard
+- add a final python pros/cons, esp.
+ the cons part.
+ It will make things more balanced.
+\end_layout
+
+\begin_layout Standard
+- the PDE part repeats a bit the 'python benefits' which were already pounded
+ on.
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+% disable the bottom bar for the title and outline pages
+\end_layout
+
+\begin_layout Standard
+
+\end_layout
+
+\begin_layout Standard
+
+
+\backslash
+setbeamertemplate{footline}{}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+vspace*{-5mm}
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Title
+PyDAP
+\begin_inset OptArg
+status open
+
+\begin_layout Standard
+PyDAP
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subtitle
+OpenDAP client and server in Python
+\end_layout
+
+\begin_layout Author
+Thanks and Credits:
+\newline
+Rob de Almeida
+\newline
+
+\family typewriter
+\size scriptsize
+<[EMAIL PROTECTED]>
+\family default
+\size default
+
+\newline
+
+\begin_inset O
SF.net SVN: matplotlib: [4640] trunk/matplotlib/lib/matplotlib/cm.py
Revision: 4640 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4640&view=rev Author: mdboom Date: 2007-12-06 04:48:16 -0800 (Thu, 06 Dec 2007) Log Message: --- Import numpy. Modified Paths: -- trunk/matplotlib/lib/matplotlib/cm.py Modified: trunk/matplotlib/lib/matplotlib/cm.py === --- trunk/matplotlib/lib/matplotlib/cm.py 2007-12-06 08:44:18 UTC (rev 4639) +++ trunk/matplotlib/lib/matplotlib/cm.py 2007-12-06 12:48:16 UTC (rev 4640) @@ -2,6 +2,7 @@ This module contains the instantiations of color mapping classes """ +import numpy as npy import matplotlib as mpl import matplotlib.colors as colors import matplotlib.numerix.npyma as ma 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: [4641] branches/transforms/lib/matplotlib/axes.py
Revision: 4641 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4641&view=rev Author: mdboom Date: 2007-12-06 05:37:29 -0800 (Thu, 06 Dec 2007) Log Message: --- Fix backward-compatibility breakage of apply_aspect. Modified Paths: -- branches/transforms/lib/matplotlib/axes.py Modified: branches/transforms/lib/matplotlib/axes.py === --- branches/transforms/lib/matplotlib/axes.py 2007-12-06 12:48:16 UTC (rev 4640) +++ branches/transforms/lib/matplotlib/axes.py 2007-12-06 13:37:29 UTC (rev 4641) @@ -909,11 +909,14 @@ ysize = max(math.fabs(ymax-ymin), 1e-30) return ysize/xsize -def apply_aspect(self, position): +def apply_aspect(self, position=None): ''' Use self._aspect and self._adjustable to modify the axes box or the view limits. ''' +if position is None: +position = self.get_position(True) + aspect = self.get_aspect() if aspect == 'auto': self.set_position( position , 'active') 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: [4642] branches/transforms/examples
Revision: 4642 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4642&view=rev Author: mdboom Date: 2007-12-06 06:55:01 -0800 (Thu, 06 Dec 2007) Log Message: --- Revert examples to work best without auto-layout. Modified Paths: -- branches/transforms/examples/colorbar_only.py branches/transforms/examples/figlegend_demo.py branches/transforms/examples/finance_demo.py branches/transforms/examples/mathtext_demo.py Modified: branches/transforms/examples/colorbar_only.py === --- branches/transforms/examples/colorbar_only.py 2007-12-06 13:37:29 UTC (rev 4641) +++ branches/transforms/examples/colorbar_only.py 2007-12-06 14:55:01 UTC (rev 4642) @@ -7,7 +7,7 @@ # Make a figure and axes with dimensions as desired. fig = pylab.figure(figsize=(8,1.5)) -ax = fig.add_axes([0.05, 0.05, 0.9, 0.9]) +ax = fig.add_axes([0.05, 0.4, 0.9, 0.5]) # Set the colormap and norm to correspond to the data for which # the colorbar will be used. Modified: branches/transforms/examples/figlegend_demo.py === --- branches/transforms/examples/figlegend_demo.py 2007-12-06 13:37:29 UTC (rev 4641) +++ branches/transforms/examples/figlegend_demo.py 2007-12-06 14:55:01 UTC (rev 4642) @@ -1,7 +1,7 @@ #!/usr/bin/env python from pylab import * -ax1 = axes([0.05, 0.1, 0.4, 0.7]) +ax1 = axes([0.1, 0.1, 0.4, 0.7]) ax2 = axes([0.55, 0.1, 0.4, 0.7]) x = arange(0.0, 2.0, 0.02) Modified: branches/transforms/examples/finance_demo.py === --- branches/transforms/examples/finance_demo.py2007-12-06 13:37:29 UTC (rev 4641) +++ branches/transforms/examples/finance_demo.py2007-12-06 14:55:01 UTC (rev 4642) @@ -22,7 +22,7 @@ raise SystemExit fig = figure() -# fig.subplots_adjust(bottom=0.2) +fig.subplots_adjust(bottom=0.2) ax = fig.add_subplot(111) ax.xaxis.set_major_locator(mondays) ax.xaxis.set_minor_locator(alldays) Modified: branches/transforms/examples/mathtext_demo.py === --- branches/transforms/examples/mathtext_demo.py 2007-12-06 13:37:29 UTC (rev 4641) +++ branches/transforms/examples/mathtext_demo.py 2007-12-06 14:55:01 UTC (rev 4642) @@ -7,7 +7,7 @@ from matplotlib.pyplot import figure, show fig = figure() -# fig.subplots_adjust(bottom=0.2) +fig.subplots_adjust(bottom=0.2) ax = fig.add_subplot(111, axisbg='y') ax.plot([1,2,3], 'r') 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: [4643] trunk/matplotlib/lib/matplotlib/cm.py
Revision: 4643 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4643&view=rev Author: mdboom Date: 2007-12-06 07:10:15 -0800 (Thu, 06 Dec 2007) Log Message: --- Fixing display of float images. Modified Paths: -- trunk/matplotlib/lib/matplotlib/cm.py Modified: trunk/matplotlib/lib/matplotlib/cm.py === --- trunk/matplotlib/lib/matplotlib/cm.py 2007-12-06 14:55:01 UTC (rev 4642) +++ trunk/matplotlib/lib/matplotlib/cm.py 2007-12-06 15:10:15 UTC (rev 4643) @@ -58,7 +58,7 @@ if x.shape[2] == 3: if x.dtype == npy.uint8: alpha = npy.array(alpha*255, npy.uint8) -m, n = npy.shape[:2] +m, n = x.shape[:2] xx = npy.empty(shape=(m,n,4), dtype = x.dtype) xx[:,:,:3] = x xx[:,:,3] = alpha 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: [4644] trunk/matplotlib/examples/annotation_demo.py
Revision: 4644
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4644&view=rev
Author: jrevans
Date: 2007-12-06 08:11:17 -0800 (Thu, 06 Dec 2007)
Log Message:
---
Updated to demonstrate 'offset points'
Modified Paths:
--
trunk/matplotlib/examples/annotation_demo.py
Modified: trunk/matplotlib/examples/annotation_demo.py
===
--- trunk/matplotlib/examples/annotation_demo.py2007-12-06 15:10:15 UTC
(rev 4643)
+++ trunk/matplotlib/examples/annotation_demo.py2007-12-06 16:11:17 UTC
(rev 4644)
@@ -55,6 +55,12 @@
ax.annotate('points', xy=(100, 300), xycoords='figure points')
+ax.annotate('offset', xy=(1, 1), xycoords='data',
+xytext=(-15, 10), textcoords='offset points',
+arrowprops=dict(facecolor='black', shrink=0.05),
+horizontalalignment='right', verticalalignment='bottom',
+)
+
ax.annotate('local max', xy=(3, 1), xycoords='data',
xytext=(0.8, 0.95), textcoords='axes fraction',
arrowprops=dict(facecolor='black', shrink=0.05),
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: [4645] trunk/matplotlib
Revision: 4645 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4645&view=rev Author: dsdale Date: 2007-12-06 08:23:58 -0800 (Thu, 06 Dec 2007) Log Message: --- modified svn:ignore properties to ignore generated files not under revision control Property Changed: trunk/matplotlib/ trunk/matplotlib/examples/ trunk/matplotlib/lib/ trunk/matplotlib/lib/matplotlib/mpl-data/ trunk/matplotlib/unit/ Property changes on: trunk/matplotlib ___ Name: svn:ignore - build dist docs *.pyc .project matplotlibrc win32_static + build dist docs *.pyc .project matplotlibrc win32_static setup.cfg Property changes on: trunk/matplotlib/examples ___ Name: svn:ignore - *.eps *.jpeg *.jpg *.pdf *.png *.ps *.pyc *.svg + matplotlibrc matplotlib.conf *.eps *.jpeg *.jpg *.pdf *.png *.ps *.pyc *.svg Property changes on: trunk/matplotlib/lib ___ Name: svn:ignore + matplotlib.egg-info Property changes on: trunk/matplotlib/lib/matplotlib/mpl-data ___ Name: svn:ignore + matplotlibrc matplotlib.conf Property changes on: trunk/matplotlib/unit ___ Name: svn:ignore + *.png 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: [4646] branches/transforms/lib/matplotlib/backends/ backend_agg.py
Revision: 4646 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4646&view=rev Author: mdboom Date: 2007-12-06 09:09:53 -0800 (Thu, 06 Dec 2007) Log Message: --- Fix an incorrect merge from trunk. Modified Paths: -- branches/transforms/lib/matplotlib/backends/backend_agg.py Modified: branches/transforms/lib/matplotlib/backends/backend_agg.py === --- branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-12-06 16:23:58 UTC (rev 4645) +++ branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-12-06 17:09:53 UTC (rev 4646) @@ -152,7 +152,7 @@ key = s, size, self.dpi, angle, texmanager.get_font_config() im = self.texd.get(key) if im is None: -Z = texmanager.get_grey(s, size, dpi) +Z = texmanager.get_grey(s, size, self.dpi) Z = npy.array(Z * 255.0, npy.uint8) self._renderer.draw_text_image(Z, x, y, angle, gc) 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: [4647] trunk/matplotlib
Revision: 4647
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4647&view=rev
Author: dsdale
Date: 2007-12-06 09:47:46 -0800 (Thu, 06 Dec 2007)
Log Message:
---
fixed a bug in rcsetup, see bug 1845057
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/rcsetup.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2007-12-06 17:09:53 UTC (rev 4646)
+++ trunk/matplotlib/CHANGELOG 2007-12-06 17:47:46 UTC (rev 4647)
@@ -1,3 +1,5 @@
+2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD
+
===
2007-11-27 Released 0.91.1 at revision 4517
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===
--- trunk/matplotlib/lib/matplotlib/__init__.py 2007-12-06 17:09:53 UTC (rev
4646)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2007-12-06 17:47:46 UTC (rev
4647)
@@ -615,6 +615,15 @@
if ret['datapath'] is None:
ret['datapath'] = get_data_path()
+if not ret['text.latex.preamble'] == ['']:
+verbose.report("""
+*
+You have the following UNSUPPORTED LaTeX preamble customizations:
+%s
+Please do not ask for support with these customizations active.
+*
+"""% '\n'.join(ret['text.latex.preamble']), 'helpful')
+
verbose.report('loaded rc file %s'%fname)
return ret
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2007-12-06 17:09:53 UTC (rev
4646)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2007-12-06 17:47:46 UTC (rev
4647)
@@ -143,7 +143,7 @@
if len(s)==6 and s.isalnum(): # looks like hex
return '#' + s
-
+
if len(s)==7 and s.startswith('#') and s[1:].isalnum():
return s
@@ -165,21 +165,6 @@
'landscape', 'portrait',
])
-def validate_latex_preamble(s):
-'return a list'
-preamble_list = validate_stringlist(s)
-if not preamble_list == ['']:
-verbose.report("""
-*
-You have the following UNSUPPORTED LaTeX preamble customizations:
-%s
-Please do not ask for support with these customizations active.
-*
-"""% '\n'.join(preamble_list), 'helpful')
-return preamble_list
-
-
-
def validate_aspect(s):
if s in ('auto', 'equal'):
return s
@@ -198,7 +183,7 @@
return float(s)
except ValueError:
raise ValueError('not a valid font size')
-
+
def validate_font_properties(s):
parse_fontconfig_pattern(s)
return s
@@ -353,7 +338,7 @@
'text.color' : ['k', validate_color], # black
'text.usetex' : [False, validate_bool],
'text.latex.unicode' : [False, validate_bool],
-'text.latex.preamble' : [[''], validate_latex_preamble],
+'text.latex.preamble' : [[''], validate_stringlist],
'text.dvipnghack' : [False, validate_bool],
'text.fontstyle' : ['normal', str],
'text.fontangle' : ['normal', str],
@@ -369,7 +354,7 @@
'mathtext.sf' : ['sans\-serif', validate_font_properties],
'mathtext.fontset': ['cm', validate_fontset],
'mathtext.fallback_to_cm' : [True, validate_bool],
-
+
'image.aspect': ['equal', validate_aspect], # equal, auto, a
number
'image.interpolation' : ['bilinear', str],
'image.cmap' : ['jet', str],# one of gray, jet, etc
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: [4649] trunk/matplotlib
Revision: 4649
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4649&view=rev
Author: dsdale
Date: 2007-12-06 10:32:44 -0800 (Thu, 06 Dec 2007)
Log Message:
---
fixed a bug in savefig, saving to a nonexistent directory
would result in a crash in some circumstances. Closes bug
1699614
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2007-12-06 18:08:21 UTC (rev 4648)
+++ trunk/matplotlib/CHANGELOG 2007-12-06 18:32:44 UTC (rev 4649)
@@ -1,3 +1,7 @@
+2007-12-06 fixed a bug in savefig, saving to a nonexistent directory
+ would result in a crash in some circumstances. Closes bug
+ 1699614 - DSD
+
2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD
===
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===
--- trunk/matplotlib/lib/matplotlib/figure.py 2007-12-06 18:08:21 UTC (rev
4648)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2007-12-06 18:32:44 UTC (rev
4649)
@@ -1,6 +1,7 @@
"""
Figure class -- add docstring here!
"""
+import os
import sys
import numpy as npy
@@ -772,6 +773,9 @@
format - one of the file extensions supported by the active backend.
"""
+path = os.path.abspath(os.path.split(args[0])[0])
+if not os.access(path, os.W_OK):
+raise IOError('%s is not a writeable directory'%path)
for key in ('dpi', 'facecolor', 'edgecolor'):
if not kwargs.has_key(key):
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: [4650] trunk/matplotlib
Revision: 4650
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4650&view=rev
Author: dsdale
Date: 2007-12-06 10:38:55 -0800 (Thu, 06 Dec 2007)
Log Message:
---
undo that last change, mdboom had a different solution that I overlooked
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/figure.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2007-12-06 18:32:44 UTC (rev 4649)
+++ trunk/matplotlib/CHANGELOG 2007-12-06 18:38:55 UTC (rev 4650)
@@ -1,7 +1,3 @@
-2007-12-06 fixed a bug in savefig, saving to a nonexistent directory
- would result in a crash in some circumstances. Closes bug
- 1699614 - DSD
-
2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD
===
Modified: trunk/matplotlib/lib/matplotlib/figure.py
===
--- trunk/matplotlib/lib/matplotlib/figure.py 2007-12-06 18:32:44 UTC (rev
4649)
+++ trunk/matplotlib/lib/matplotlib/figure.py 2007-12-06 18:38:55 UTC (rev
4650)
@@ -773,9 +773,6 @@
format - one of the file extensions supported by the active backend.
"""
-path = os.path.abspath(os.path.split(args[0])[0])
-if not os.access(path, os.W_OK):
-raise IOError('%s is not a writeable directory'%path)
for key in ('dpi', 'facecolor', 'edgecolor'):
if not kwargs.has_key(key):
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: [4651] trunk/matplotlib
Revision: 4651
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4651&view=rev
Author: mdboom
Date: 2007-12-06 10:47:50 -0800 (Thu, 06 Dec 2007)
Log Message:
---
Fix saving to a file-like object.
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/cbook.py
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===
--- trunk/matplotlib/lib/matplotlib/cbook.py2007-12-06 18:38:55 UTC (rev
4650)
+++ trunk/matplotlib/lib/matplotlib/cbook.py2007-12-06 18:47:50 UTC (rev
4651)
@@ -214,7 +214,7 @@
return 1
def is_writable_file_like(obj):
-return hasattr(filename, 'write') and callable(filename.write)
+return hasattr(obj, 'write') and callable(obj.write)
def is_scalar(obj):
return is_string_like(obj) or not iterable(obj)
@@ -891,7 +891,7 @@
return x, self._mem[i0:self._n:isub]
def plot(self, i0=0, isub=1, fig=None):
-if fig is None:
+if fig is None:
from pylab import figure, show
fig = figure()
Modified: trunk/matplotlib/src/_backend_agg.cpp
===
--- trunk/matplotlib/src/_backend_agg.cpp 2007-12-06 18:38:55 UTC (rev
4650)
+++ trunk/matplotlib/src/_backend_agg.cpp 2007-12-06 18:47:50 UTC (rev
4651)
@@ -2293,11 +2293,9 @@
throw Py::RuntimeError( Printf("Could not open file %s",
file_name).str() );
}
else {
-if ((fp = PyFile_AsFile(py_fileobj.ptr())) == NULL) {
- PyObject* write_method = PyObject_GetAttrString(py_fileobj.ptr(),
"write");
- if (!(write_method && PyCallable_Check(write_method)))
- throw Py::TypeError("Object does not appear to be a path or a Python
file-like object");
-}
+PyObject* write_method = PyObject_GetAttrString(py_fileobj.ptr(), "write");
+if (!(write_method && PyCallable_Check(write_method)))
+ throw Py::TypeError("Object does not appear to be a path or a Python
file-like object");
}
png_bytep *row_pointers = NULL;
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: [4652] branches/transforms/lib/matplotlib/dates.py
Revision: 4652 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4652&view=rev Author: mdboom Date: 2007-12-06 10:49:35 -0800 (Thu, 06 Dec 2007) Log Message: --- Making note about broken unit test. Modified Paths: -- branches/transforms/lib/matplotlib/dates.py Modified: branches/transforms/lib/matplotlib/dates.py === --- branches/transforms/lib/matplotlib/dates.py 2007-12-06 18:47:50 UTC (rev 4651) +++ branches/transforms/lib/matplotlib/dates.py 2007-12-06 18:49:35 UTC (rev 4652) @@ -534,7 +534,7 @@ def set_axis(self, axis): DateLocator.set_axis(self, axis) self._locator.set_axis(axis) - + def refresh(self): 'refresh internal information based on current lim' dmin, dmax = self.viewlim_to_dt() @@ -664,7 +664,7 @@ locator = RRuleLocator(rrule, self.tz) locator.set_axis(self.axis) - + locator.set_view_interval(*self.axis.get_view_interval()) locator.set_data_interval(*self.axis.get_data_interval()) return locator @@ -1039,6 +1039,7 @@ delta = datetime.timedelta(hours=6) dates = drange(d1, d2, delta) +# MGDTODO: Broken on transforms branch #print 'orig', d1 #print 'd2n and back', num2date(date2num(d1), tz) from _transforms import Value, Interval 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: [4653] trunk/matplotlib/lib/matplotlib/font_manager .py
Revision: 4653 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4653&view=rev Author: mdboom Date: 2007-12-06 11:10:12 -0800 (Thu, 06 Dec 2007) Log Message: --- [ 1841933 ] font_manager.win32FontDirectory() fails as Vista service Modified Paths: -- trunk/matplotlib/lib/matplotlib/font_manager.py Modified: trunk/matplotlib/lib/matplotlib/font_manager.py === --- trunk/matplotlib/lib/matplotlib/font_manager.py 2007-12-06 18:49:35 UTC (rev 4652) +++ trunk/matplotlib/lib/matplotlib/font_manager.py 2007-12-06 19:10:12 UTC (rev 4653) @@ -105,14 +105,16 @@ try: import _winreg except ImportError: -return os.path.join(os.environ['WINDIR'], 'Fonts') +pass # Fall through to default else: user = _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, MSFolders) try: return _winreg.QueryValueEx(user, 'Fonts')[0] +except OSError: +pass # Fall through to default finally: _winreg.CloseKey(user) -return None +return os.path.join(os.environ['WINDIR'], 'Fonts') def win32InstalledFonts(directory=None, fontext='ttf'): """ 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: [4648] trunk/matplotlib/lib/matplotlib/rcsetup.py
Revision: 4648
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4648&view=rev
Author: dsdale
Date: 2007-12-06 10:08:21 -0800 (Thu, 06 Dec 2007)
Log Message:
---
changed the default backend in rcsetup from WXAgg, which
is not certain to be present, to Agg.
Modified Paths:
--
trunk/matplotlib/lib/matplotlib/rcsetup.py
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2007-12-06 17:47:46 UTC (rev
4647)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2007-12-06 18:08:21 UTC (rev
4648)
@@ -275,7 +275,7 @@
# a map from key -> value, converter
defaultParams = {
-'backend' : ['WXAgg', validate_backend],
+'backend' : ['Agg', validate_backend], # agg is certainly present
'numerix' : ['numpy', validate_numerix],
'maskedarray' : [False, validate_bool],
'toolbar' : ['toolbar2', validate_toolbar],
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: [4654] trunk/matplotlib
Revision: 4654
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4654&view=rev
Author: dsdale
Date: 2007-12-06 11:18:49 -0800 (Thu, 06 Dec 2007)
Log Message:
---
updated references to mpl data directories for py2exe
Modified Paths:
--
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/__init__.py
trunk/matplotlib/lib/matplotlib/config/cutils.py
Modified: trunk/matplotlib/CHANGELOG
===
--- trunk/matplotlib/CHANGELOG 2007-12-06 19:10:12 UTC (rev 4653)
+++ trunk/matplotlib/CHANGELOG 2007-12-06 19:18:49 UTC (rev 4654)
@@ -1,3 +1,5 @@
+2007-12-06 updated references to mpl data directories for py2exe - DSD
+
2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD
===
Modified: trunk/matplotlib/lib/matplotlib/__init__.py
===
--- trunk/matplotlib/lib/matplotlib/__init__.py 2007-12-06 19:10:12 UTC (rev
4653)
+++ trunk/matplotlib/lib/matplotlib/__init__.py 2007-12-06 19:18:49 UTC (rev
4654)
@@ -428,11 +428,16 @@
# py2exe zips pure python, so still need special check
if getattr(sys,'frozen',None):
-path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata')
+path = os.path.join(os.path.split(sys.path[0])[0], 'mpl-data')
if os.path.isdir(path): return path
else:
+# Try again assuming we need to step up one more directory
+path =
os.path.join(os.path.split(os.path.split(sys.path[0])[0])[0],
+'mpl-data')
+if os.path.isdir(path): return path
+else:
# Try again assuming sys.path[0] is a dir not a exe
-path = os.path.join(sys.path[0], 'matplotlibdata')
+path = os.path.join(sys.path[0], 'mpl-data')
if os.path.isdir(path): return path
raise RuntimeError('Could not find the matplotlib data files')
@@ -442,7 +447,8 @@
defaultParams['datapath'][0] = _get_data_path()
return defaultParams['datapath'][0]
-get_data_path = verbose.wrap('matplotlib data path %s', _get_data_path_cached,
always=False)
+get_data_path = verbose.wrap('matplotlib data path %s', _get_data_path_cached,
+ always=False)
def get_py2exe_datafiles():
datapath = get_data_path()
@@ -454,8 +460,8 @@
if 'Matplotlib.nib' in files:
files.remove('Matplotlib.nib')
files = [os.path.join(root, filename) for filename in files]
-root = root.replace(tail, 'matplotlibdata')
-root = root[root.index('matplotlibdata'):]
+root = root.replace(tail, 'mpl-data')
+root = root[root.index('mpl-data'):]
d[root] = files
return d.items()
Modified: trunk/matplotlib/lib/matplotlib/config/cutils.py
===
--- trunk/matplotlib/lib/matplotlib/config/cutils.py2007-12-06 19:10:12 UTC
(rev 4653)
+++ trunk/matplotlib/lib/matplotlib/config/cutils.py2007-12-06 19:18:49 UTC
(rev 4654)
@@ -77,7 +77,7 @@
if os.path.exists(p):
if not is_writable_dir(p):
raise RuntimeError("""\
-'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir.
+'%s' is not a writable dir; you must set %s/.matplotlib to be a writable dir.
You can also set environment variable MPLCONFIGDIR to any writable directory
where you want matplotlib data stored """%h)
else:
@@ -110,11 +110,16 @@
# py2exe zips pure python, so still need special check
if getattr(sys,'frozen',None):
-path = os.path.join(os.path.split(sys.path[0])[0], 'matplotlibdata')
+path = os.path.join(os.path.split(sys.path[0])[0], 'mpl-data')
if os.path.isdir(path): return path
else:
+# Try again assuming we need to step up one more directory
+path =
os.path.join(os.path.split(os.path.split(sys.path[0])[0])[0],
+'mpl-data')
+if os.path.isdir(path): return path
+else:
# Try again assuming sys.path[0] is a dir not a exe
-path = os.path.join(sys.path[0], 'matplotlibdata')
+path = os.path.join(sys.path[0], 'mpl-data')
if os.path.isdir(path): return path
raise RuntimeError('Could not find the matplotlib data files')
@@ -136,8 +141,8 @@
if 'Matplotlib.nib' in files:
files.remove('Matplotlib.nib')
files = [os.path.join(root, filename) for filename in files]
-root = root.replace(tail, 'matplotlibdata')
-root = root[root.index('matplotlibdata'):]
+root = root.replace(tail, 'mpl-data')
+root = root[root.index('mpl-data'):]
d[root] = files
return d.items()
This was sent by the SourceForge.net collaborative development platform, the
world'
SF.net SVN: matplotlib: [4655] trunk/py4science/examples
Revision: 4655
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4655&view=rev
Author: jdh2358
Date: 2007-12-06 12:01:48 -0800 (Thu, 06 Dec 2007)
Log Message:
---
added pyrex simple sum demo
Modified Paths:
--
trunk/py4science/examples/lotka_volterra.py
Added Paths:
---
trunk/py4science/examples/pyrex/
trunk/py4science/examples/pyrex/Makefile
trunk/py4science/examples/pyrex/c_numpy.pxd
trunk/py4science/examples/pyrex/c_python.pxd
trunk/py4science/examples/pyrex/numpyx.pyx
trunk/py4science/examples/pyrex/run_test.py
trunk/py4science/examples/pyrex/setup.py
trunk/py4science/examples/pyrex/sums.pyx
trunk/py4science/examples/pyrex/sums_test.py
Modified: trunk/py4science/examples/lotka_volterra.py
===
--- trunk/py4science/examples/lotka_volterra.py 2007-12-06 19:18:49 UTC (rev
4654)
+++ trunk/py4science/examples/lotka_volterra.py 2007-12-06 20:01:48 UTC (rev
4655)
@@ -34,24 +34,22 @@
f = y[:,1] # extract the foxes vector
p.figure()
-p.plot(t, r, label='rabbits')
-p.plot(t, f, label='foxes')
+p.subplots_adjust(hspace=0.3)
+p.subplot(211)
+p.plot(t, r, color='blue', label='rabbits', lw=2)
+p.plot(t, f, color='green', label='foxes', lw=2)
p.xlabel('time (years)')
p.ylabel('population')
-p.title('population trajectories')
+p.title('population trajectories and phase plane')
p.grid()
p.legend()
-p.savefig('lotka_volterra.png', dpi=150)
-p.savefig('lotka_volterra.eps')
-p.figure()
-p.plot(r, f)
+p.subplot(212, aspect='equal')
+p.plot(r, f, 'k', lw=2)
p.xlabel('rabbits')
p.ylabel('foxes')
-p.title('phase plane')
-
# make a direction field plot with quiver
rmax = 1.1 * r.max()
fmax = 1.1 * f.max()
@@ -65,13 +63,13 @@
dR = dr(R, F)
dF = df(R, F)
-p.contour(R, F, dR, levels=[0], linewidths=3, colors='black')
-p.contour(R, F, dF, levels=[0], linewidths=3, colors='black')
+CSR = p.contour(R, F, dR, levels=[0], linewidths=3, colors='blue')
+CSF = p.contour(R, F, dF, levels=[0], linewidths=3, colors='green')
+
p.ylabel('foxes')
-p.title('trajectory, direction field and null clines')
-p.savefig('lotka_volterra_pplane.png', dpi=150)
-p.savefig('lotka_volterra_pplane.eps')
+p.savefig('lotka_volterra.png', dpi=150)
+p.savefig('lotka_volterra.eps')
p.show()
Added: trunk/py4science/examples/pyrex/Makefile
===
--- trunk/py4science/examples/pyrex/Makefile(rev 0)
+++ trunk/py4science/examples/pyrex/Makefile2007-12-06 20:01:48 UTC (rev
4655)
@@ -0,0 +1,9 @@
+all:
+ python setup.py build_ext --inplace
+
+test: all
+ python sums_test.py
+
+.PHONY: clean
+clean:
+ rm -rf *~ *.so *.c *.o build
Added: trunk/py4science/examples/pyrex/c_numpy.pxd
===
--- trunk/py4science/examples/pyrex/c_numpy.pxd (rev 0)
+++ trunk/py4science/examples/pyrex/c_numpy.pxd 2007-12-06 20:01:48 UTC (rev
4655)
@@ -0,0 +1,125 @@
+# :Author:Travis Oliphant
+
+cdef extern from "numpy/arrayobject.h":
+
+cdef enum NPY_TYPES:
+NPY_BOOL
+NPY_BYTE
+NPY_UBYTE
+NPY_SHORT
+NPY_USHORT
+NPY_INT
+NPY_UINT
+NPY_LONG
+NPY_ULONG
+NPY_LONGLONG
+NPY_ULONGLONG
+NPY_FLOAT
+NPY_DOUBLE
+NPY_LONGDOUBLE
+NPY_CFLOAT
+NPY_CDOUBLE
+NPY_CLONGDOUBLE
+NPY_OBJECT
+NPY_STRING
+NPY_UNICODE
+NPY_VOID
+NPY_NTYPES
+NPY_NOTYPE
+
+cdef enum requirements:
+NPY_CONTIGUOUS
+NPY_FORTRAN
+NPY_OWNDATA
+NPY_FORCECAST
+NPY_ENSURECOPY
+NPY_ENSUREARRAY
+NPY_ELEMENTSTRIDES
+NPY_ALIGNED
+NPY_NOTSWAPPED
+NPY_WRITEABLE
+NPY_UPDATEIFCOPY
+NPY_ARR_HAS_DESCR
+
+NPY_BEHAVED
+NPY_BEHAVED_NS
+NPY_CARRAY
+NPY_CARRAY_RO
+NPY_FARRAY
+NPY_FARRAY_RO
+NPY_DEFAULT
+
+NPY_IN_ARRAY
+NPY_OUT_ARRAY
+NPY_INOUT_ARRAY
+NPY_IN_FARRAY
+NPY_OUT_FARRAY
+NPY_INOUT_FARRAY
+
+NPY_UPDATE_ALL
+
+cdef enum defines:
+# Note: as of Pyrex 0.9.5, enums are type-checked more strictly, so
this
+# can't be used as an integer.
+NPY_MAXDIMS
+
+ctypedef struct npy_cdouble:
+double real
+double imag
+
+ctypedef struct npy_cfloat:
+double real
+double imag
+
+ctypedef int npy_intp
+
+ctypedef extern class numpy.dtype [object PyArray_Descr]:
+cdef int type_num, elsize, alignment
+cdef char type, kind, byteorder, hasobject
+cdef object fields, typeobj
+
+ctypedef extern class numpy.ndarray [object PyArrayObject]:
+cdef char *data
+cdef int nd
+
SF.net SVN: matplotlib: [4656] trunk/py4science
Revision: 4656 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4656&view=rev Author: jdh2358 Date: 2007-12-06 13:31:53 -0800 (Thu, 06 Dec 2007) Log Message: --- reorg pyrex dir Added Paths: --- trunk/py4science/examples/ Removed Paths: - trunk/py4science/examples/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4658] trunk/matplotlib
Revision: 4658 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4658&view=rev Author: dsdale Date: 2007-12-06 14:28:27 -0800 (Thu, 06 Dec 2007) Log Message: --- let widgets.Cursor initialize to the lower x and y bounds rather than 0,0, which can cause havoc for dates and other transforms Modified Paths: -- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/widgets.py Modified: trunk/matplotlib/CHANGELOG === --- trunk/matplotlib/CHANGELOG 2007-12-06 21:51:12 UTC (rev 4657) +++ trunk/matplotlib/CHANGELOG 2007-12-06 22:28:27 UTC (rev 4658) @@ -1,3 +1,7 @@ +2007-12-06 let widgets.Cursor initialize to the lower x and y bounds + rather than 0,0, which can cause havoc for dates and other + transforms - DSD + 2007-12-06 updated references to mpl data directories for py2exe - DSD 2007-12-06 fixed a bug in rcsetup, see bug 1845057 - DSD Modified: trunk/matplotlib/lib/matplotlib/widgets.py === --- trunk/matplotlib/lib/matplotlib/widgets.py 2007-12-06 21:51:12 UTC (rev 4657) +++ trunk/matplotlib/lib/matplotlib/widgets.py 2007-12-06 22:28:27 UTC (rev 4658) @@ -662,8 +662,8 @@ self.vertOn = True self.useblit = useblit -self.lineh = ax.axhline(0, visible=False, **lineprops) -self.linev = ax.axvline(0, visible=False, **lineprops) +self.lineh = ax.axhline(ax.get_ybound()[0], visible=False, **lineprops) +self.linev = ax.axvline(ax.get_xbound()[0], visible=False, **lineprops) self.background = None self.needclear = False @@ -1070,11 +1070,11 @@ # If RectangleSelector is not active : if not self.active: return True - + # If canvas was locked if not self.canvas.widgetlock.available(self): return True - + # If no button was pressed yet ignore the event if it was out # of the axes if self.eventpress == None: @@ -1174,7 +1174,7 @@ def get_active(self): """ to get status of active mode (boolean variable)""" -return self.active +return self.active class Lasso(Widget): def __init__(self, ax, xy, callback=None, useblit=True): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4659] trunk/toolkits/basemap
Revision: 4659
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4659&view=rev
Author: jswhit
Date: 2007-12-06 15:30:17 -0800 (Thu, 06 Dec 2007)
Log Message:
---
add initial support for reading shapefiles with Point shapes.
(from patch by Erik Andersen on the patch tracker)
Modified Paths:
--
trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
Added Paths:
---
trunk/toolkits/basemap/examples/cities.dbf
trunk/toolkits/basemap/examples/cities.shp
trunk/toolkits/basemap/examples/cities.shx
trunk/toolkits/basemap/examples/plotcities.py
Added: trunk/toolkits/basemap/examples/cities.dbf
===
(Binary files differ)
Property changes on: trunk/toolkits/basemap/examples/cities.dbf
___
Name: svn:mime-type
+ application/octet-stream
Added: trunk/toolkits/basemap/examples/cities.shp
===
(Binary files differ)
Property changes on: trunk/toolkits/basemap/examples/cities.shp
___
Name: svn:mime-type
+ application/octet-stream
Added: trunk/toolkits/basemap/examples/cities.shx
===
(Binary files differ)
Property changes on: trunk/toolkits/basemap/examples/cities.shx
___
Name: svn:mime-type
+ application/octet-stream
Added: trunk/toolkits/basemap/examples/plotcities.py
===
--- trunk/toolkits/basemap/examples/plotcities.py
(rev 0)
+++ trunk/toolkits/basemap/examples/plotcities.py 2007-12-06 23:30:17 UTC
(rev 4659)
@@ -0,0 +1,18 @@
+import pylab as p
+import numpy
+from matplotlib.toolkits.basemap import Basemap as Basemap
+
+# cities colored by population rank.
+m = Basemap()
+shp_info = m.readshapefile('cities','cities')
+x, y = zip(*m.cities)
+pop = []
+for item in m.cities_info:
+pop.append(int(item['POPULATION']))
+pop = numpy.array(pop)
+poprank = numpy.argsort(pop)
+m.drawcoastlines()
+m.fillcontinents()
+m.scatter(x,y,25,poprank,cmap=p.cm.jet_r,marker='o',faceted=False,zorder=10)
+p.title('City Locations colored by Population Rank')
+p.show()
Modified: trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
===
--- trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
2007-12-06 22:28:27 UTC (rev 4658)
+++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py
2007-12-06 23:30:17 UTC (rev 4659)
@@ -1317,29 +1317,39 @@
def readshapefile(self,shapefile,name,drawbounds=True,zorder=None,
linewidth=0.5,color='k',antialiased=1,ax=None):
"""
-read in shape file, draw boundaries on map.
+read in shape file, optionally draw boundaries on map.
Restrictions:
- Assumes shapes are 2D
- - vertices must be in geographic (lat/lon) coordinates.
+ - works for Point, MultiPoint, Polyline and Polygon shapes.
+ - vertices/points must be in geographic (lat/lon) coordinates.
+Mandatory Arguments:
+
shapefile - path to shapefile components. Example:
shapefile='/home/jeff/esri/world_borders' assumes that
world_borders.shp, world_borders.shx and world_borders.dbf
live in /home/jeff/esri.
name - name for Basemap attribute to hold the shapefile
- vertices in native map projection coordinates.
+ vertices or points in native map projection coordinates.
Class attribute name+'_info' is a list of dictionaries, one
for each shape, containing attributes of each shape from dbf file.
- For example, if name='counties', self.counties
- will be a list of vertices for each shape in map projection
+ For example, if name='counties', self.counties will be
+ a list of x,y vertices for each shape in map projection
coordinates and self.counties_info will be a list of dictionaries
- with shape attributes. Rings in individual shapes are split out
- into separate polygons. Additional keys
+ with shape attributes. Rings in individual Polygon shapes are split
+ out into separate polygons, and. additional keys
'RINGNUM' and 'SHAPENUM' are added to shape attribute dictionary.
-drawbounds - draw boundaries of shapes (default True)
-zorder = shape boundary zorder (if not specified, default for
LineCollection
-is used).
+
+Optional Keyword Arguments (only relevant for Polyline
+ and Polygon shape types, for Point and MultiPoint shapes they
+ are ignored):
+
+drawbou
SF.net SVN: matplotlib: [4660] trunk/toolkits/basemap/Changelog
Revision: 4660 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4660&view=rev Author: jswhit Date: 2007-12-06 15:32:15 -0800 (Thu, 06 Dec 2007) Log Message: --- added support for Point and MultiPoint shapes in shapefiles (from Erik Andersen's patch tracker submission). Modified Paths: -- trunk/toolkits/basemap/Changelog Modified: trunk/toolkits/basemap/Changelog === --- trunk/toolkits/basemap/Changelog2007-12-06 23:30:17 UTC (rev 4659) +++ trunk/toolkits/basemap/Changelog2007-12-06 23:32:15 UTC (rev 4660) @@ -1,4 +1,6 @@ version 0.9.9 (not yet released) + * added support for reading Point and MultiPoint shapes + from ESRI shapefiles. * now automatically draws figure if running in interactive mode (so draw() does not need to be called explicitly in ipython). This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4661] trunk/toolkits/basemap/lib/matplotlib/ toolkits/basemap/basemap.py
Revision: 4661 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4661&view=rev Author: jswhit Date: 2007-12-06 16:01:46 -0800 (Thu, 06 Dec 2007) Log Message: --- fixed so it really should work now with MultiPoint shape files (although I haven't found one to test with). 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-06 23:32:15 UTC (rev 4660) +++ trunk/toolkits/basemap/lib/matplotlib/toolkits/basemap/basemap.py 2007-12-07 00:01:46 UTC (rev 4661) @@ -1380,16 +1380,23 @@ in map projection coordinates. You can convert the shapefile to geographic coordinates using the shpproj utility from the shapelib tools (http://shapelib.maptools.org/shapelib-tools.html)""") -if info[1] in [1,8]: # a Point or Multi-Point file. -coords = [shp.read_object(i).vertices()[0] - for i in range(shp.info()[0])] -attributes = [dbf.read_record(i) - for i in range(shp.info()[0])] -lons, lats = zip(*coords) -if max(lons) > 721. or min(lons) < -721. or max(lats) > 91. or min(lats) < -91: -raise ValueError,msg -x,y = self(lons, lats) -self.__dict__[name]=zip(x,y) +if info[1] in [1,8]: # a Point or MultiPoint file. +coords = [] +nelements = shp.info()[0] +for nelement in range(nelements): +shp_object = shp.read_object(nelement) +verts = shp_object.vertices() +lons, lats = zip(*verts) +if max(lons) > 721. or min(lons) < -721. or max(lats) > 91. or min(lats) < -91: +raise ValueError,msg +if len(verts) > 1: # MultiPoint +x,y = self(lons, lats) +coords.append(zip(x,y)) +else: # single Point +x,y = self(lons[0], lats[0]) +coords.append((x,y)) +attributes = [dbf.read_record(i) for i in range(nelements)] +self.__dict__[name]=coords self.__dict__[name+'_info']=attributes else: # a Polyline or Polygon file. shpsegs = [] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4662] trunk/py4science/examples/pyrex/movavg
Revision: 4662 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4662&view=rev Author: jdh2358 Date: 2007-12-06 20:43:36 -0800 (Thu, 06 Dec 2007) Log Message: --- updates to the pyrex examples Modified Paths: -- trunk/py4science/examples/pyrex/movavg/Makefile trunk/py4science/examples/pyrex/movavg/movavg.pyx trunk/py4science/examples/pyrex/movavg/ringbuf.pyx trunk/py4science/examples/pyrex/movavg/ringbuf_demo.py trunk/py4science/examples/pyrex/movavg/setup.py Added Paths: --- trunk/py4science/examples/pyrex/movavg/README trunk/py4science/examples/pyrex/movavg/movavg_bruteforce.py trunk/py4science/examples/pyrex/movavg/movavg_fast.py trunk/py4science/examples/pyrex/movavg/movavg_ringbuf.py trunk/py4science/examples/pyrex/movavg/ringbufnan.c Removed Paths: - trunk/py4science/examples/pyrex/movavg/circbuffer.py trunk/py4science/examples/pyrex/movavg/movavg_test.py trunk/py4science/examples/pyrex/movavg/numpyx.pyx trunk/py4science/examples/pyrex/movavg/run_test.py Modified: trunk/py4science/examples/pyrex/movavg/Makefile === --- trunk/py4science/examples/pyrex/movavg/Makefile 2007-12-07 00:01:46 UTC (rev 4661) +++ trunk/py4science/examples/pyrex/movavg/Makefile 2007-12-07 04:43:36 UTC (rev 4662) @@ -6,4 +6,4 @@ .PHONY: clean clean: - rm -rf *~ *.so *.c *.o build + rm -rf *~ *.so *.o build ringbuf.c Added: trunk/py4science/examples/pyrex/movavg/README === --- trunk/py4science/examples/pyrex/movavg/README (rev 0) +++ trunk/py4science/examples/pyrex/movavg/README 2007-12-07 04:43:36 UTC (rev 4662) @@ -0,0 +1,82 @@ +Introduction + + +This exercise introduces pyrex to wrap a C library for trailing +statistics. + +Computation of trailing windowed statistics is common in many +quantitative data driven disciplines, particularly where there is +noisy data. Common uses of windowed statistics are the trailing +moving average, standard deviation, minumum and maximum. Two common +use cases which pose computational challenges for python: real time +updating of trailing statistics as live data comes in, and posthoc +computation of trailing statistics over a large data array. In the +second case, for some statistics we can use convolution and related +techniques for efficient computation, eg of the trailing 30 sample +average + +numpy.convolve(x, numpy.ones(30), mode=valid')[:len(x)] + +but for other statistics like the trailing 30 day maximum at each +point, efficient routines like convolution are of no help. + +This exercise introduces pyrex to efficiently solve the problem of +trailing statistics over arrays as well as for a live, incoming data +stream. A pure C library, ringbuf, defines a circular C buffer and +attached methods for efficiently computing trailing averages, and +pyrex is used to provide a pythonic API on top of this extension code. +The rigid segregation between the C library and the python wrappers +insures that the C code can be used in other projects, be it a matlab +(TM) extension or some other C library. The goal of the exericse is +to compute the trailing statistics mean, median, stddev, min and max +using three approaches: + + - with brute force using numpy arrays, slices and methods +(movavg_bruteforce.py) + + - with python bindings to the ringbuf code ringbuf.Rinbuf +(movavg_ringbuf.py). See ringbuf_demo.py for an example of how to +use the ringbuf module + + - using a pyrex extension to the ringbuf runstats code +(movavg_fast.py) + +pyrex module support + + + - Makefile : simple interface to setup.py so you can just 'make' + + - setup.py : configure and build the python modules + + - c_numpy.pxd : the numpy C API for pyrex + + - c_python.pxd : the python C API for pyrex + + - c_ringbuf.pxi : the ringbuf C API for pyrex + + - ringbuf.pyx : python interface to the ringbuf C API + +examples + + + - ringbuf_demo.py : basic demo of the python bindings to basic +Ringbuf class + + - movavg_bruteforce.py : do the trailing stats with brute force +numpy slices and methods + + - movavg_ringbuf.py : do the trailing stats with the Ringbuf code + + - movavg_fast.py : do the trailing stats with the ringbuf runstats wrapper + +ringbuf C code +== + + - ringbuf.h : pure C ringbuf API headers + + - ringbufnan.c : pure C ringbuf library + +Acknowledgements + + +Thanks to Eric Firing for the ringbuf and runstats code! Deleted: trunk/py4science/examples/pyrex/movavg/circbuffer.py === --- trunk/py4science/examples/pyrex/movavg/circbuffer.py2007-12-07 00:01:46 UTC (rev 4661) +++ trunk/py4science/examples/pyrex/movavg/circbuffe
SF.net SVN: matplotlib: [4663] trunk/py4science/workbook
Revision: 4663
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4663&view=rev
Author: jdh2358
Date: 2007-12-06 20:48:30 -0800 (Thu, 06 Dec 2007)
Log Message:
---
updated pyrex workbook
Modified Paths:
--
trunk/py4science/workbook/main.tex
Added Paths:
---
trunk/py4science/workbook/intro_pyrex.tex
trunk/py4science/workbook/pyrex_ringbuf.tex
Added: trunk/py4science/workbook/intro_pyrex.tex
===
--- trunk/py4science/workbook/intro_pyrex.tex (rev 0)
+++ trunk/py4science/workbook/intro_pyrex.tex 2007-12-07 04:48:30 UTC (rev
4663)
@@ -0,0 +1,167 @@
+\texttt{pyrex} is a pure python packages that utilizes a custom
+language which is a hybid of C and python to write code that looks
+like python, but is converted by \texttt{pyrex} into python C
+extension code. It can be used to write custom C extension modules in
+a python like module to remove performance bottlenecks in code, as
+well as to wrap and existing C API with a python binding. \textt{pyrex}
+generates C code, so you can use it to automatically generate C
+extensions that you can ship with your code and users can build your
+code without \texttt{pyrex} installed.
+
+\section{Writing C extensions \texttt{pyrex}}
+
+The canonical \texttt{pyrex} example generates a list of \texttt{N}
+prime numbers, and illustrates the hybrid nature of \texttt{pyrex}
+syntax
+
+\begin{lstlisting}
+
+# name this file with the pyx extension for pyrex, rather than the py
+# extension for python, eg primes.pyx
+def primes(int kmax):
+# pyrex uses cdef to declare a c type
+cdef int n, k, i
+cdef int p[1000]
+
+# you can use normal python too, eg a python list
+result = []
+if kmax > 1000:
+kmax = 1000
+k = 0
+n = 2
+while k < kmax:
+i = 0
+while i < k and n % p[i] <> 0:
+i = i + 1
+if i == k:
+p[k] = n
+k = k + 1
+result.append(n)
+n = n + 1
+return result
+
+\end{lstlisting}
+
+To build our python extension, we will use the \texttt{pyrex.distutils}
+extensions. Here is a typical setup.py
+
+\begin{lstlisting}
+from distutils.core import setup
+
+# we use the Pyrex distutils Extension class rather than the standard
+# python one
+#from distutils.extension import Extension
+
+from Pyrex.Distutils.extension import Extension
+from Pyrex.Distutils import build_ext
+
+setup(
+ name = 'Demos',
+ ext_modules=[
+Extension("primes", ["primes.pyx"]),
+],
+ cmdclass = {'build_ext': build_ext}
+)
+
+\end{lstlisting}
+
+and we can build it in place using
+
+\begin{lstlisting}
+python setup.py build_ext --inplace
+\end{lstlisting}
+
+This creates a primes.c module which is the generated C code that we
+can ship with our python code to users who may not have \texttt{pyrex}
+installed, and a primes.so file which is the python shared library
+extension. We can now fire up ipython, import primes, and call our
+function with C performance. Here is an example shell session in
+which we build and test our new extension code
+
+\begin{lstlisting}
+# our single pyx file from above
+pyrex_demos> ls primes*
+primes.pyx
+
+# build the module in place
+pyrex_demos> python setup.py build_ext --inplace
+running build_ext
+pyrexc primes.pyx --> primes.c
+building 'primes' extension
+creating build
+creating build/temp.macosx-10.3-fat-2.5
+gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd
-fno-common -dynamic -DNDEBUG -g -O3
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c
primes.c -o build/temp.macosx-10.3-fat-2.5/primes.o
+gcc -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle
-undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/primes.o -o primes.so
+
+# now we have the original pyx and also the autogenerated C file and
+# the extension module
+pyrex_demos> ls primes*
+primes.cprimes.pyxprimes.so
+
+# let's test drive this in ipython
+pyrex_demos> ipython
+IPython 0.8.3.svn.r2876 -- An enhanced Interactive Python.
+
+In [1]: import primes
+
+In [2]: dir(primes)
+Out[2]: ['__builtins__', '__doc__', '__file__', '__name__', 'primes']
+
+In [3]: print primes.primes(20)
+[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]
+
+
+\end{lstlisting}
+
+
+\section{Working with \texttt{numpy} arrays}
+
+\textt{numpy} arrays are the core of high performance computing in
+python, and on of the most common data formats for passing large data
+sets around between pyhton code and other wrappers. There are many
+things that arrays do very well and are practically as fast as a
+native C or Fortran implementations, eg convolutions and FFTs. But
+there are somethings that can be painfully slow in python when working
+with arrays, for example iterative algorithm
SF.net SVN: matplotlib: [4664] trunk/py4science
Revision: 4664
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4664&view=rev
Author: jdh2358
Date: 2007-12-06 22:29:31 -0800 (Thu, 06 Dec 2007)
Log Message:
---
minor tweaks to pyrex
Modified Paths:
--
trunk/py4science/doc/requirements.txt
trunk/py4science/workbook/intro_pyrex.tex
trunk/py4science/workbook/main.tex
Modified: trunk/py4science/doc/requirements.txt
===
--- trunk/py4science/doc/requirements.txt 2007-12-07 04:48:30 UTC (rev
4663)
+++ trunk/py4science/doc/requirements.txt 2007-12-07 06:29:31 UTC (rev
4664)
@@ -153,9 +153,10 @@
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
+- install pyreadline_: ipython needs this for tab completion and other handy
features
+- 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`_
@@ -174,6 +175,8 @@
.. _win32com:
http://sourceforge.net/project/showfiles.php?group_id=78018&package_id=79063&release_id=449591
+.. _pyreadline: http://ipython.scipy.org/moin/PyReadline/Intro
+
.. _`ipython distributions`: http://ipython.scipy.org/dist/
.. _`numpy download`:
http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
Modified: trunk/py4science/workbook/intro_pyrex.tex
===
--- trunk/py4science/workbook/intro_pyrex.tex 2007-12-07 04:48:30 UTC (rev
4663)
+++ trunk/py4science/workbook/intro_pyrex.tex 2007-12-07 06:29:31 UTC (rev
4664)
@@ -3,7 +3,7 @@
like python, but is converted by \texttt{pyrex} into python C
extension code. It can be used to write custom C extension modules in
a python like module to remove performance bottlenecks in code, as
-well as to wrap and existing C API with a python binding. \textt{pyrex}
+well as to wrap and existing C API with a python binding. \texttt{pyrex}
generates C code, so you can use it to automatically generate C
extensions that you can ship with your code and users can build your
code without \texttt{pyrex} installed.
@@ -116,11 +116,11 @@
\section{Working with \texttt{numpy} arrays}
-\textt{numpy} arrays are the core of high performance computing in
-python, and on of the most common data formats for passing large data
+\texttt{numpy} arrays are the core of high performance computing in
+python, and one of the most common data formats for passing large data
sets around between pyhton code and other wrappers. There are many
things that arrays do very well and are practically as fast as a
-native C or Fortran implementations, eg convolutions and FFTs. But
+native C or FORTRAN implementations, eg convolutions and FFTs. But
there are somethings that can be painfully slow in python when working
with arrays, for example iterative algorithms over an array of values.
For these cases, it is nice to be able to quickly generate some python
@@ -130,8 +130,8 @@
\texttt{pyrex} extension code, you can find it, and another file which
\texttt{numpy} uses to expose the requisite bits of the Python C API
which it needs, in the \texttt{numpy} source code directory
-\texttt{numpy/doc/pyrex}. These files are \texttt{c_numpy.pxd} and
-\texttt{c_python.pxd}. In addition, \texttt{numpy} provides and
+\texttt{numpy/doc/pyrex}. These files are \texttt{c\_numpy.pxd} and
+\texttt{c\_python.pxd}. In addition, \texttt{numpy} provides and
example file \texttt{numpyx.pyx}that shows you how to build a pyx
extension file for multi-dimensional array sof different data types
(eg int, float, python object). Here we will be a little less
Modified: trunk/py4science/workbook/main.tex
===
--- trunk/py4science/workbook/main.tex 2007-12-07 04:48:30 UTC (rev 4663)
+++ trunk/py4science/workbook/main.tex 2007-12-07 06:29:31 UTC (rev 4664)
@@ -1,5 +1,3 @@
-%% LyX 1.4.3 created this file. For more info, see http://www.lyx.org/.
-%% Do not edit unless you really know what you are doing.
\documentclass[english]{amsbook}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4665] trunk/matplotlib/lib/matplotlib
Revision: 4665 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4665&view=rev Author: efiring Date: 2007-12-06 23:12:33 -0800 (Thu, 06 Dec 2007) Log Message: --- Clarify docstrings on Subplot classes; closes 1659419 Modified Paths: -- trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/figure.py Modified: trunk/matplotlib/lib/matplotlib/axes.py === --- trunk/matplotlib/lib/matplotlib/axes.py 2007-12-07 06:29:31 UTC (rev 4664) +++ trunk/matplotlib/lib/matplotlib/axes.py 2007-12-07 07:12:33 UTC (rev 4665) @@ -5403,25 +5403,23 @@ class SubplotBase: """ -Emulate matlab's(TM) subplot command, creating axes with - - Subplot(numRows, numCols, plotNum) - -where plotNum=1 is the first plot number and increasing plotNums -fill rows first. max(plotNum)==numRows*numCols - -You can leave out the commas if numRows<=numCols<=plotNum<10, as -in - - Subplot(211)# 2 rows, 1 column, first (upper) plot +Base class for subplots, which are Axes instances with additional +methods to facilitate generating and manipulating a set of Axes +within a figure. """ def __init__(self, fig, *args): """ fig is a figure instance -args is a varargs to specify the subplot +args is numRows, numCols, plotNum +where the array of subplots in the figure has dimensions +numRows, numCols, and where plotNum is the number of the +subplot being created. plotNum starts at 1 in the upper +right corner and increases to the right. +If numRows<=numCols<=plotNum<10, args can be the decimal +integer numRows*100 + numCols*10 + plotNum. """ self.figure = fig @@ -5538,24 +5536,17 @@ class Subplot(SubplotBase, Axes): """ -Emulate matlab's(TM) subplot command, creating axes with +subplot class for Cartesian Axes - Subplot(numRows, numCols, plotNum) - -where plotNum=1 is the first plot number and increasing plotNums -fill rows first. max(plotNum)==numRows*numCols - -You can leave out the commas if numRows<=numCols<=plotNum<10, as -in - - Subplot(211)# 2 rows, 1 column, first (upper) plot +This is not normally instantiated by the user; instead, +use the Figure.add_subplot method. """ def __str__(self): return "Subplot(%g,%g)"%(self.bottom.get(),self.left.get()) def __init__(self, fig, *args, **kwargs): """ -See Axes base class documentation for args and kwargs +See SubplotBase and Axes base class documentation for args and kwargs """ SubplotBase.__init__(self, fig, *args) Axes.__init__(self, fig, [self.figLeft, self.figBottom, @@ -5565,7 +5556,6 @@ class PolarAxes(Axes): """ - Make a PolarAxes. The rectangular bounding box of the axes is given by @@ -6018,17 +6008,10 @@ class PolarSubplot(SubplotBase, PolarAxes): """ -Create a polar subplot with +subplot class for Polar Axes - PolarSubplot(numRows, numCols, plotNum) - -where plotNum=1 is the first plot number and increasing plotNums -fill rows first. max(plotNum)==numRows*numCols - -You can leave out the commas if numRows<=numCols<=plotNum<10, as -in - - Subplot(211)# 2 rows, 1 column, first (upper) plot +This is not normally instantiated by the user; instead, +use the Figure.add_subplot(..., polar=True) method. """ def __str__(self): return "PolarSubplot(%gx%g)"%(self.figW,self.figH) Modified: trunk/matplotlib/lib/matplotlib/figure.py === --- trunk/matplotlib/lib/matplotlib/figure.py 2007-12-07 06:29:31 UTC (rev 4664) +++ trunk/matplotlib/lib/matplotlib/figure.py 2007-12-07 07:12:33 UTC (rev 4665) @@ -519,6 +519,7 @@ Add a subplot. Examples add_subplot(111) +add_subplot(1,1,1)# equivalent but more general add_subplot(212, axisbg='r') # add subplot with red background add_subplot(111, polar=True) # add a polar subplot add_subplot(sub) # add Subplot instance sub This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
