You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jd...@us...> - 2008-06-10 15:51:51
|
Revision: 5461
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5461&view=rev
Author: jdh2358
Date: 2008-06-10 08:50:55 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
fixed auto-legend wart for bar and friends
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-10 15:35:13 UTC (rev 5460)
+++ trunk/matplotlib/CHANGELOG 2008-06-10 15:50:55 UTC (rev 5461)
@@ -1,3 +1,7 @@
+2008-06-10 Bar now applies the label only to the frist patch, and
+ sets _nolegend_ for the other patch labels. This let's
+ autolegend work as expected for hist and bar
+
2008-06-10 Fix text baseline alignment bug. [ 1985420 ] Repair of
baseline alignment in Text._get_layout. Thanks Stan West -
MGD
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-06-10 15:35:13 UTC (rev 5460)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-06-10 15:50:55 UTC (rev 5461)
@@ -3530,6 +3530,7 @@
"""
if not self._hold: self.cla()
+ label = kwargs.pop('label', '')
def make_iterable(x):
if not iterable(x):
return [x]
@@ -3667,8 +3668,11 @@
facecolor=c,
edgecolor=e,
linewidth=lw,
+ label=label
)
+ label = '_nolegend_'
r.update(kwargs)
+ #print r.get_label(), label, 'label' in kwargs
self.add_patch(r)
patches.append(r)
@@ -5673,10 +5677,10 @@
is an integer input argument=numbins, numbins+1 bin edges
will be returned, compatabile with the semantics of
np.histogram with the new=True argument.
-
+
range:
The lower and upper range of the bins. Lower and upper outliers
- are ignored. If not provided, range is (x.min(), x.max()).
+ are ignored. If not provided, range is (x.min(), x.max()).
normed:
if True, the first element of the return tuple will
@@ -5925,9 +5929,15 @@
else:
raise ValueError, 'invalid histtype: %s' % histtype
+ label = kwargs.pop('label', '')
+
for patch in patches:
for p in patch:
p.update(kwargs)
+ p.set_label(label)
+ label = '_nolegend'
+
+
if len(n)==1:
return n[0], bins, cbook.silent_list('Patch', patches[0])
else:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-06-10 15:35:18
|
Revision: 5460
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5460&view=rev
Author: mdboom
Date: 2008-06-10 08:35:13 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
[ 1985420 ] Repair of baseline alignment in Text._get_layout
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/text.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-10 14:29:43 UTC (rev 5459)
+++ trunk/matplotlib/CHANGELOG 2008-06-10 15:35:13 UTC (rev 5460)
@@ -1,8 +1,12 @@
+2008-06-10 Fix text baseline alignment bug. [ 1985420 ] Repair of
+ baseline alignment in Text._get_layout. Thanks Stan West -
+ MGD
+
2008-06-09 Committed Gregor's image resample patch to downsampling
images with new rcparam image.resample - JDH
-2008-06-09 Don't install Enthought.Traits along with matplotlib. For
- matplotlib developers convenience, it can still be
+2008-06-09 Don't install Enthought.Traits along with matplotlib. For
+ matplotlib developers convenience, it can still be
installed by setting an option in setup.cfg while we figure
decide if there is a future for the traited config - DSD
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2008-06-10 14:29:43 UTC (rev 5459)
+++ trunk/matplotlib/lib/matplotlib/text.py 2008-06-10 15:35:13 UTC (rev 5460)
@@ -246,7 +246,7 @@
if valign=='center': offsety = (ymin + height/2.0)
elif valign=='top': offsety = (ymin + height)
- elif valign=='baseline': offsety = (ymin + height) + baseline
+ elif valign=='baseline': offsety = (ymin + height) - baseline
else: offsety = ymin
xmin -= offsetx
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-10 14:29:49
|
Revision: 5459
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5459&view=rev
Author: jdh2358
Date: 2008-06-10 07:29:43 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
implemented a warning for the wx sizer func if we cant find a match
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-10 14:25:49 UTC (rev 5458)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-10 14:29:43 UTC (rev 5459)
@@ -94,7 +94,7 @@
cvs_id = '$Id$'
-import sys, os, os.path, math, StringIO, weakref
+import sys, os, os.path, math, StringIO, weakref, warnings
# Debugging settings here...
# Debug level set here. If the debug level is less than 5, information
@@ -1235,7 +1235,9 @@
self.SetStatusBar(statbar)
self.canvas = self.get_canvas(fig)
- def do_nothing(*args, **kwargs): pass
+ def do_nothing(*args, **kwargs):
+ warnings.warn('could not find a SetSizeFunc for backend_wx; please report your wxpython version=%s to the matplotlib developers list'%backend_version)
+ pass
# try to find the set size func across wx versions
self.SetSizeFunc = getattr(self.canvas, 'SetInitialSize',
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-10 14:25:50
|
Revision: 5458
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5458&view=rev
Author: jdh2358
Date: 2008-06-10 07:25:49 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
implemented a cross wx version set size func
Modified Paths:
--------------
trunk/matplotlib/doc/devel/index.rst
trunk/matplotlib/doc/faq/index.rst
trunk/matplotlib/doc/users/artists.rst
trunk/matplotlib/doc/users/index.rst
trunk/matplotlib/doc/users/pyplot_tutorial.rst
trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
Modified: trunk/matplotlib/doc/devel/index.rst
===================================================================
--- trunk/matplotlib/doc/devel/index.rst 2008-06-10 13:57:12 UTC (rev 5457)
+++ trunk/matplotlib/doc/devel/index.rst 2008-06-10 14:25:49 UTC (rev 5458)
@@ -8,6 +8,7 @@
:Date: |today|
.. toctree::
+ :maxdepth: 2
coding_guide.rst
documenting_mpl.rst
Modified: trunk/matplotlib/doc/faq/index.rst
===================================================================
--- trunk/matplotlib/doc/faq/index.rst 2008-06-10 13:57:12 UTC (rev 5457)
+++ trunk/matplotlib/doc/faq/index.rst 2008-06-10 14:25:49 UTC (rev 5458)
@@ -10,6 +10,7 @@
Frequently asked questions about matplotlib
.. toctree::
+ :maxdepth: 2
installing_faq.rst
troubleshooting_faq.rst
Modified: trunk/matplotlib/doc/users/artists.rst
===================================================================
--- trunk/matplotlib/doc/users/artists.rst 2008-06-10 13:57:12 UTC (rev 5457)
+++ trunk/matplotlib/doc/users/artists.rst 2008-06-10 14:25:49 UTC (rev 5458)
@@ -256,7 +256,7 @@
.. _figure-container:
Figure container
-----------------
+================
The top level container ``Artist`` is the
:class:`matplotlib.figure.Figure`, and it contains everything in the
@@ -349,7 +349,7 @@
.. _axes-container:
Axes container
---------------
+==============
The :class:`matplotlib.axes.Axes` is the center of the matplotlib
universe -- it contains the vast majority of all the ``Artists`` used
@@ -527,7 +527,7 @@
.. _axis-container:
Axis containers
----------------
+===============
The :class:`matplotlib.axis.Axis` instances handle the drawing of the
tick lines, the grid lines, the tick labels and the axis label. You
@@ -613,7 +613,7 @@
.. _tick-container:
Tick containers
----------------
+===============
The :class:`matplotlib.axis.Tick` is the final container object in our
descent from the :class:`~matplotlib.figure.Figure` to the
Modified: trunk/matplotlib/doc/users/index.rst
===================================================================
--- trunk/matplotlib/doc/users/index.rst 2008-06-10 13:57:12 UTC (rev 5457)
+++ trunk/matplotlib/doc/users/index.rst 2008-06-10 14:25:49 UTC (rev 5458)
@@ -8,6 +8,7 @@
:Date: |today|
.. toctree::
+ :maxdepth: 2
intro.rst
pyplot_tutorial.rst
Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst
===================================================================
--- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-10 13:57:12 UTC (rev 5457)
+++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-10 14:25:49 UTC (rev 5458)
@@ -197,16 +197,24 @@
import matplotlib.pyplot as plt
plt.figure(1) # the first figure
+ plt.subplot(211) # the first subplot in the first figure
plt.plot([1,2,3])
+ plt.subplot(212) # the second subplot in the first figure
+ plt.plot([4,5,6])
+
plt.figure(2) # a second figure
- plt.plot([4,5,6])
+ plt.plot([4,5,6]) # creates a subplot(111) by default
- plt.figure(1) # figure 1 current
- plt.title('Easy as 1,2,3') # figure 1 title
+ plt.figure(1) # figure 1 current; subplot(212) still current
+ plt.subplot(211) # make subplot(211) in figure1 current
+ plt.title('Easy as 1,2,3') # subplot 211 title
You can clear the current figure with :func:`~matplotlib.pyplot.clf`
-and the current axes with :func:`~matplotlib.pyplot.cla`.
+and the current axes with :func:`~matplotlib.pyplot.cla`. If you find
+this statefulness, annoying, don't despair, this is just a thin
+stateful wrapper around an object oriented API, which you can use
+instead (see :ref:`artist-tutorial`)
.. _working-with-text:
@@ -216,7 +224,8 @@
The :func:`~matplotlib.pyplot.text` command can be used to add text in
an arbitrary location, and the :func:`~matplotlib.pyplot.xlabel`,
:func:`~matplotlib.pyplot.ylabel` and :func:`~matplotlib.pyplot.title`
-are used to add text in the indicated locations.
+are used tox add text in the indicated locations (see :ref:`text-intro`
+for a more detailed example)
.. literalinclude:: figures/pyplot_text.py
@@ -224,11 +233,10 @@
:scale: 50
-All of the text commands The :func:`~matplotlib.pyplot.text` commands
-return an :class:`matplotlib.text.Text` instance. Just as with with
-lines above, you can customize the properties by passing keyword
-arguments into the text functions or using
-:func:`~matplotlib.pyplot.setp`::
+All of the :func:`~matplotlib.pyplot.text` commands return an
+:class:`matplotlib.text.Text` instance. Just as with with lines
+above, you can customize the properties by passing keyword arguments
+into the text functions or using :func:`~matplotlib.pyplot.setp`::
t = plt.xlabel('my data', fontsize=14, color='red')
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-10 13:57:12 UTC (rev 5457)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-06-10 14:25:49 UTC (rev 5458)
@@ -1234,7 +1234,13 @@
statbar = StatusBarWx(self)
self.SetStatusBar(statbar)
self.canvas = self.get_canvas(fig)
- self.canvas.SetInitialSize(wx.Size(fig.bbox.width, fig.bbox.height))
+
+ def do_nothing(*args, **kwargs): pass
+
+ # try to find the set size func across wx versions
+ self.SetSizeFunc = getattr(self.canvas, 'SetInitialSize',
+ getattr(self.canvas, 'SetBestFittingSize', do_nothing))
+ self.SetSizeFunc(wx.Size(fig.bbox.width, fig.bbox.height))
self.sizer =wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.TOP | wx.LEFT | wx.EXPAND)
# By adding toolbar in sizer, we are able to put it at the bottom
@@ -1355,7 +1361,7 @@
def resize(self, width, height):
'Set the canvas size in pixels'
- self.canvas.SetInitialSize(wx.Size(width, height))
+ self.canvas.SetSizeFunc(wx.Size(width, height))
self.window.GetSizer().Fit(self.window)
# Identifiers for toolbar controls - images_wx contains bitmaps for the images
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-10 13:57:13
|
Revision: 5457
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5457&view=rev
Author: jdh2358
Date: 2008-06-10 06:57:12 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
added a text example
Added Paths:
-----------
trunk/matplotlib/doc/users/figures/text_commands.py
Added: trunk/matplotlib/doc/users/figures/text_commands.py
===================================================================
--- trunk/matplotlib/doc/users/figures/text_commands.py (rev 0)
+++ trunk/matplotlib/doc/users/figures/text_commands.py 2008-06-10 13:57:12 UTC (rev 5457)
@@ -0,0 +1,28 @@
+# -*- coding: utf-8 -*-
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+fig.suptitle('bold figure suptitle', fontsize=14, fontweight='bold')
+
+ax = fig.add_subplot(111)
+
+ax.set_title('axes title')
+
+ax.set_xlabel('xlabel')
+ax.set_ylabel('ylabel')
+ax.text(5, 8, 'italics text in data coords', style='italic')
+ax.text(2, 6, r'an equation: $E=mc^2$', fontsize=20)
+
+ax.text(0.95, 0.01, 'text in axes coords',
+ verticalalignment='bottom', horizontalalignment='right',
+ transform=ax.transAxes,
+ color='green', fontsize=20)
+
+
+ax.plot([2], [1], 'o')
+ax.annotate('annotate', xy=(2, 1), xytext=(3, 4),
+ arrowprops=dict(facecolor='black', shrink=0.05))
+
+ax.axis([0, 10, 0, 10])
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-10 13:56:34
|
Revision: 5456
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5456&view=rev
Author: jdh2358
Date: 2008-06-10 06:56:30 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
addressed eric's review comments
Modified Paths:
--------------
trunk/matplotlib/doc/devel/coding_guide.rst
trunk/matplotlib/doc/devel/outline.rst
trunk/matplotlib/doc/users/text_intro.rst
Modified: trunk/matplotlib/doc/devel/coding_guide.rst
===================================================================
--- trunk/matplotlib/doc/devel/coding_guide.rst 2008-06-10 12:27:08 UTC (rev 5455)
+++ trunk/matplotlib/doc/devel/coding_guide.rst 2008-06-10 13:56:30 UTC (rev 5456)
@@ -54,28 +54,31 @@
* install ``svnmerge.py`` in your PATH::
- wget http://svn.collab.net/repos/svn/trunk/contrib/client-side/\
- svnmerge/svnmerge.py
+ > wget http://svn.collab.net/repos/svn/trunk/contrib/client-side/\
+ svnmerge/svnmerge.py
* get a svn copy of the maintenance branch and the trunk (see above)
* Michael advises making the change on the branch and committing
it. Make sure you svn upped on the trunk and have no local
modifications, and then from the svn trunk do::
- > svnmerge.py merge
+ > svnmerge.py merge
If you wish to merge only specific revisions (in an unusual
situation), do::
- > svnmerge.py merge -rNNN1-NNN2
+ > svnmerge.py merge -rNNN1-NNN2
where the ``NNN`` are the revision numbers. Ranges are also
acceptable.
The merge may have found some conflicts (code that must be
manually resolved). Correct those conflicts, build matplotlib and
- test your choices.
+ test your choices. If you have resolved any conflicts, you can
+ let svn clean up the conflict files for you::
+ > svn -R resolved .
+
``svnmerge.py`` automatically creates a file containing the commit
messages, so you are ready to make the commit::
@@ -97,15 +100,8 @@
For masked arrays, use::
- from numpy import ma
+ import numpy.ma as ma
-(The earlier recommendation, :samp:`import matplotlib.numerix.npyma as ma`,
-was needed temporarily during the development of the maskedarray
-implementation as a separate package. As of numpy 1.1, it replaces the
-old implementation. Note: ``from numpy import ma`` works with numpy < 1.1
-*and* with numpy >= 1.1. ``import numpy.ma as ma`` works *only* with
-numpy >= 1.1, so for now we must not use it.)
-
For matplotlib main module, use::
import matplotlib as mpl
@@ -120,9 +116,18 @@
We prefer this over the equivalent ``from matplotlib import cbook``
because the latter is ambiguous whether ``cbook`` is a module or a
-function to the new developer. The former makes it explcit that
-you are importing a module or package.
+function to the new developer. The former makes it explicit that you
+are importing a module or package. There are some modules whose names
+may be ambiguous in the context of local variables, eg
+:mod:`matplotlib.lines` or :mod:`matplotlib.colors`. When you want to
+disambiguate, use the prefix 'm' with the ``import some.thing as
+mthing`` syntax, eg::
+ import matplotlib.lines as mlines
+ import matplotlib.transforms as transforms # OK
+ import matplotlib.transforms as mtransforms # OK, if you want to disambiguate
+ import matplotlib.transforms as mtrans # OK, if you want to abbreviate
+
Naming, spacing, and formatting conventions
-------------------------------------------
@@ -138,16 +143,27 @@
* classes: ``Upper`` or ``MixedCase``
-Personally, I prefer the shortest names that are still readable.
+Prefer the shortest names that are still readable.
Also, use an editor that does not put tabs in files. Four spaces
should be used for indentation everywhere and if there is a file with
-tabs or more or less spaces it is a bug -- please fix it.
+tabs or more or less spaces it is a bug -- please fix it. There are
+some tools to help automate this checking, such as `tabnanny
+<http://effbot.org/librarybook/tabnanny.htm>`_, which is part of the
+standard library::
-Please avoid spurious invisible spaces at the ends of lines.
-(Tell your editor to strip whitespace from line ends when saving
-a file.)
+ In [3]: cd /home/titan/johnh/mpl/lib/matplotlib/
+ /home/titan/johnh/python/svn/matplotlib.trunk/matplotlib/lib/matplotlib
+ In [4]: import tabnanny
+
+ In [5]: tabnanny.check('axis.py')
+
+There is also `reindent.py
+<http://svn.python.org/projects/doctools/trunk/utils/reindent.py>`_
+which can be used to automatically change python files to use 4-space
+indents with no hard tab characters.
+
Keep docstrings uniformly indented as in the example below, with
nothing to the left of the triple quotes. The
:func:`matplotlib.cbook.dedent` function is needed to remove excess
@@ -160,11 +176,11 @@
long line with two shorter and more readable lines.
Please do not commit lines with trailing white space, as it causes
-noise in svn diffs.
+noise in svn diffs. Tell your editor to strip whitespace from line
+ends when saving a file. If you are an emacs user, the following in
+your ``.emacs`` will cause emacs to strip trailing white space upon
+saving for python, C and C++:
-If you are an emacs user, the following in your ``.emacs`` will cause
-emacs to strip trailing white space upon saving for python, C and C++:
-
.. code-block:: cl
; and similarly for c++-mode-hook and c-mode-hook
@@ -172,7 +188,7 @@
(lambda ()
(add-hook 'write-file-functions 'delete-trailing-whitespace)))
-for older versions of emacs (emacs<22) you need to do:
+for older versions of emacs (emacs<22) you need to do:
.. code-block:: cl
@@ -218,17 +234,17 @@
them with the value.
As a general rule, the use of ``**kwargs`` should be reserved for
-pass-through keyword arguments, as in the examaple above. If I intend
-for all the keyword args to be used in some function and not passed
-on, I just use the key/value keyword args in the function definition
-rather than the ``**kwargs`` idiom.
+pass-through keyword arguments, as in the example above. If all the
+keyword args to be used in the function being declared, and not passed
+on, use the key/value keyword args in the function definition rather
+than the ``**kwargs`` idiom.
-In some cases I want to consume some keys and pass through the others,
-in which case I pop the ones I want to use locally and pass on the
-rest, eg., I pop ``scalex`` and ``scaley`` in
-:meth:`~matplotlib.axes.Axes.plot` and assume the rest are
-:meth:`~matplotlib.lines.Line2D` keyword arguments. As an example of
-a pop, passthrough usage, see :meth:`~matplotlib.axes.Axes.plot`::
+In some cases, you may want to consume some keys in the local
+function, and let others pass through. You can ``pop`` the ones to be
+used locally and pass on the rest. For example, in
+:meth:`~matplotlib.axes.Axes.plot`, ``scalex`` and ``scaley`` are
+local arguments and the rest are passed on as
+:meth:`~matplotlib.lines.Line2D` keyword arguments::
# in axes.py
def plot(self, *args, **kwargs):
@@ -240,10 +256,6 @@
self.add_line(line)
lines.append(line)
-The :mod:`matplotlib.cbook` function :func:`~matplotlib.cbook.popd` is rendered
-obsolete by the :func:`~dict.pop` dictionary method introduced in Python 2.3,
-so it should not be used for new code.
-
Note there is a use case when ``kwargs`` are meant to be used locally
in the function (not passed on), but you still need the ``**kwargs``
idiom. That is when you want to use ``*args`` to allow variable
@@ -269,7 +281,7 @@
Documentation and Docstrings
============================
-matplotlib uses artist instrospection of docstrings to support
+matplotlib uses artist introspection of docstrings to support
properties. All properties that you want to support through ``setp``
and ``getp`` should have a ``set_property`` and ``get_property``
method in the :class:`~matplotlib.artist.Artist` class. Yes, this is
@@ -290,8 +302,8 @@
function that creates a line (:func:`~matplotlib.pyplot.plot`,
:func:`~matplotlib.pyplot.semilogx`,
:func:`~matplotlib.pyplot.semilogy`, etc...), it can be difficult for
-the new user to know which ``kwargs`` are supported. I have developed a
-docstring interpolation scheme to support documentation of every
+the new user to know which ``kwargs`` are supported. matplotlib uses
+a docstring interpolation scheme to support documentation of every
function that takes a ``**kwargs``. The requirements are:
1. single point of configuration so changes to the properties don't
@@ -300,12 +312,13 @@
2. as automated as possible so that as properties change the docs
are updated automagically.
-I have added a :attr:`matplotlib.artist.kwdocd` and
-:func:`matplotlib.artist.kwdoc` to faciliate this. They combine
+The functions :attr:`matplotlib.artist.kwdocd` and
+:func:`matplotlib.artist.kwdoc` to facilitate this. They combine
python string interpolation in the docstring with the matplotlib
-artist introspection facility that underlies ``setp`` and ``getp``. The
-``kwdocd`` is a single dictionary that maps class name to a docstring of
-``kwargs``. Here is an example from :mod:`matplotlib.lines`::
+artist introspection facility that underlies ``setp`` and ``getp``.
+The ``kwdocd`` is a single dictionary that maps class name to a
+docstring of ``kwargs``. Here is an example from
+:mod:`matplotlib.lines`::
# in lines.py
artist.kwdocd['Line2D'] = artist.kwdoc(Line2D)
@@ -331,12 +344,12 @@
Note there is a problem for :class:`~matplotlib.artist.Artist`
``__init__`` methods, eg. :meth:`matplotlib.patches.Patch.__init__`,
-which supports ``Patch`` ``kwargs``, since the artist inspector cannot work
-until the class is fully defined and we can't modify the
-``Patch.__init__.__doc__`` docstring outside the class definition. I have
-made some manual hacks in this case which violates the "single entry
-point" requirement above; hopefully we'll find a more elegant solution
-before too long.
+which supports ``Patch`` ``kwargs``, since the artist inspector cannot
+work until the class is fully defined and we can't modify the
+``Patch.__init__.__doc__`` docstring outside the class definition.
+There are some some manual hacks in this case which violates theqq
+"single entry point" requirement above -- see the
+``artist.kwdocd['Patch']`` setting in :mod:`matplotlib.patches`.
.. _licenses:
@@ -345,11 +358,66 @@
========
Matplotlib only uses BSD compatible code. If you bring in code from
-another project make sure it has a PSF, BSD, MIT or compatible
-license. If not, you may consider contacting the author and asking
-them to relicense it. GPL and LGPL code are not acceptible in the
-main code base, though we are considering an alternative way of
+another project make sure it has a PSF, BSD, MIT or compatible license
+(see the Open Source Initiative `licenses page
+<http://www.opensource.org/licenses>`_ for details on individual
+licenses). If it doesn't, you may consider contacting the author and
+asking them to relicense it. GPL and LGPL code are not acceptable in
+the main code base, though we are considering an alternative way of
distributing L/GPL code through an separate channel, possibly a
toolkit. If you include code, make sure you include a copy of that
code's license in the license directory if the code's license requires
-you to distribute the license with it.
+you to distribute the license with it. Non-BSD compatible licenses
+are acceptable in matplotlib toolkits (eg basemap), but make sure you
+clearly state the licenses you are using.
+
+Why BSD compatible?
+-------------------
+
+The two dominant license variants in the wild are GPL-style and
+BSD-style. There are countless other licenses that place specific
+restrictions on code reuse, but there is an important different to be
+considered in the GPL and BSD variants. The best known and perhaps
+most widely used license is the GPL, which in addition to granting you
+full rights to the source code including redistribution, carries with
+it an extra obligation. If you use GPL code in your own code, or link
+with it, your product must be released under a GPL compatible
+license. I.e., you are required to give the source code to other
+people and give them the right to redistribute it as well. Many of the
+most famous and widely used open source projects are released under
+the GPL, including sagemath, linux, gcc and emacs.
+
+The second major class are the BSD-style licenses (which includes MIT
+and the python PSF license). These basically allow you to do whatever
+you want with the code: ignore it, include it in your own open source
+project, include it in your proprietary product, sell it,
+whatever. python itself is released under a BSD compatible license, in
+the sense that, quoting from the PSF license page::
+
+ There is no GPL-like "copyleft" restriction. Distributing
+ binary-only versions of Python, modified or not, is allowed. There
+ is no requirement to release any of your source code. You can also
+ write extension modules for Python and provide them only in binary
+ form.
+
+Famous projects released under a BSD-style license in the permissive
+sense of the last paragraph are the BSD operating system, python and
+TeX.
+
+There are two primary reasons why early matplotlib developers selected
+a BSD compatible license. We wanted to attract as many users and
+developers as possible, and many software companies will not use GPL code
+in software they plan to distribute, even those that are highly
+committed to open source development, such as `enthought
+<http://enthought.com>`_, out of legitimate concern that use of the
+GPL will "infect" their code base by its viral nature. In effect, they
+want to retain the right to release some proprietary code. Companies,
+and institutions in general, who use matplotlib often make significant
+contributions, since they have the resources to get a job done, even a
+boring one, if they need it in their code. Two of the matplotlib
+backends (FLTK and WX) were contributed by private companies.
+
+The other reason is licensing compatibility with the other python
+extensions for scientific computing: ipython, numpy, scipy, the
+enthought tool suite and python itself are all distributed under BSD
+compatible licenses.
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-10 12:27:08 UTC (rev 5455)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-10 13:56:30 UTC (rev 5456)
@@ -62,7 +62,7 @@
the artist John has author ?
transforms Michael submitted John
documenting mpl Darren submitted ?
-coding guide John submitted Eric
+coding guide John in review Eric
and_much_more ? ? ?
=============================== ==================== =========== ===================
@@ -103,11 +103,11 @@
submission, you can put them here. As the author cleans them up or
addresses them, they should be removed.
-mathtext user's guide (reviewd by JDH)
+mathtext user's guide-- reviewd by JDH
--------------------------------------
-This looks good -- there are a few minor things to close the book on
-this chapter.
+This looks good (see :ref:`mathtext-tutorial`) -- there are a few
+minor things to close the book on this chapter.
#. The main thing to wrap this up is getting the mathtext module
ported over to rest and included in the API so the links from the
@@ -123,12 +123,12 @@
coding guide (reviewed by EF)
-----------------------------
-Mostly fine, just a few comments. Also, there are a couple
-of typos, but I would rather just edit those directly in
-another pass (if you don't happen to find them) than include
-them as formal review notes.
+Mostly fine (see :ref:`coding-guide`), just a few comments.
+Also, there are a couple of typos, but I would rather just edit those
+directly in another pass (if you don't happen to find them) than
+include them as formal review notes.
-#. Import recommendation for ma: given that the trunk is
+#. DONE - Import recommendation for ma: given that the trunk is
requiring numpy 1.1, perhaps we should be consistent and
recommend the form::
@@ -152,7 +152,7 @@
rc() function and using that instead of setting the
dictionary entries directly), if necessary.
-#. You give the example::
+#. DONE - You give the example::
import matplotlib.cbook as cbook
@@ -160,18 +160,18 @@
``mtransforms``? (And, again peripherally, I would
shorten that one to ``mtrans``.)
-#. The treatment of whitespace is split into two parts
+#. DONE - The treatment of whitespace is split into two parts
separated by paragraphs on docstrings and line length;
this can be consolidated. It might be worth mentioning
the ``reindent.py`` and ``tabnanny.py`` utilities here.
-#. Minor question of literary style: should use of the first
- person be avoided in most places? It is used, for
- example, in the discussion of the automatic kwarg doc
- generation. I don't mind leaving the first person in,
- with the general understanding that it means you.
+#. DONE - (removed first person usage) - Minor question of literary
+ style: should use of the first person be avoided in most places?
+ It is used, for example, in the discussion of the automatic kwarg
+ doc generation. I don't mind leaving the first person in, with the
+ general understanding that it means you.
-#. Licenses: you might want to add a link to your
+#. DONE - Licenses: you might want to add a link to your
explanation of your BSD choice. Peripheral question: is
there any problem with basemap's inclusion of
sub-packages with the gamut of licenses, GPL to MIT?
Modified: trunk/matplotlib/doc/users/text_intro.rst
===================================================================
--- trunk/matplotlib/doc/users/text_intro.rst 2008-06-10 12:27:08 UTC (rev 5455)
+++ trunk/matplotlib/doc/users/text_intro.rst 2008-06-10 13:56:30 UTC (rev 5456)
@@ -34,7 +34,7 @@
* :func:`~matplotlib.pyplot.xlabel` - add an axis label to the x-axis;
:meth:`matplotlib.axes.Axes.set_xlabel` in the API.
-* :func:`~matplotlib.pyplot.ylabel` - add an axis label to the y-axis;;
+* :func:`~matplotlib.pyplot.ylabel` - add an axis label to the y-axis;
:meth:`matplotlib.axes.Axes.set_ylabel` in the API.
* :func:`~matplotlib.pyplot.title` - add a title to the ``Axes``;
@@ -52,4 +52,11 @@
All of these functions create and return a
:func:`matplotlib.text.Text` instance, which can bew configured with a
-variety of font and other properties.
+variety of font and other properties. The example below shows all of
+these commands in action.
+
+.. literalinclude:: figures/text_commands.py
+
+.. image:: figures/text_commands.png
+ :scale: 50
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-10 12:27:25
|
Revision: 5455
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5455&view=rev
Author: jswhit
Date: 2008-06-10 05:27:08 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
add matplotlib link to intro
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/intro.rst
Modified: trunk/toolkits/basemap/doc/users/intro.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/intro.rst 2008-06-10 12:24:28 UTC (rev 5454)
+++ trunk/toolkits/basemap/doc/users/intro.rst 2008-06-10 12:27:08 UTC (rev 5455)
@@ -12,7 +12,8 @@
are other libraries that provide similar capabilities in Python.
Basemap does not do any plotting on it's own, but provides the facilities to transform coordinates to one of 19 different map projections (using the
-`PROJ.4 <http://trac.osgeo.org/proj/>`_ C library). Matplotlib is then
+`PROJ.4 <http://trac.osgeo.org/proj/>`_ C library). `Matplotlib
+<http://matplotlib.sourceforge.net>`_ is then
used to plot contours, images, vectors, lines or points
in the transformed coordinates.
Shoreline, river and political boundary
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-10 12:24:33
|
Revision: 5454
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5454&view=rev
Author: jswhit
Date: 2008-06-10 05:24:28 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
typo fix
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/intro.rst
Modified: trunk/toolkits/basemap/doc/users/intro.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/intro.rst 2008-06-10 12:21:55 UTC (rev 5453)
+++ trunk/toolkits/basemap/doc/users/intro.rst 2008-06-10 12:24:28 UTC (rev 5454)
@@ -9,7 +9,7 @@
`Generic Mapping Tools <http://gmt.soest.hawaii.edu/>`_.
`PyNGL <http://www.pyngl.ucar.edu/>`_ and
`CDAT <http://www-pcmdi.llnl.gov/software/cdat/support/vcs/vcs.html>`_
-are the only other libraries that provide similar capabilities in Python.
+are other libraries that provide similar capabilities in Python.
Basemap does not do any plotting on it's own, but provides the facilities to transform coordinates to one of 19 different map projections (using the
`PROJ.4 <http://trac.osgeo.org/proj/>`_ C library). Matplotlib is then
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-10 12:22:04
|
Revision: 5453
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5453&view=rev
Author: jswhit
Date: 2008-06-10 05:21:55 -0700 (Tue, 10 Jun 2008)
Log Message:
-----------
added intro to users guide.
Modified Paths:
--------------
trunk/toolkits/basemap/doc/users/index.rst
Added Paths:
-----------
trunk/toolkits/basemap/doc/users/intro.rst
Modified: trunk/toolkits/basemap/doc/users/index.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/index.rst 2008-06-10 02:19:15 UTC (rev 5452)
+++ trunk/toolkits/basemap/doc/users/index.rst 2008-06-10 12:21:55 UTC (rev 5453)
@@ -8,3 +8,5 @@
:Date: |today|
.. toctree::
+
+ intro.rst
Added: trunk/toolkits/basemap/doc/users/intro.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/intro.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/intro.rst 2008-06-10 12:21:55 UTC (rev 5453)
@@ -0,0 +1,38 @@
+Introduction
+============
+
+The matplotlib basemap toolkit is a library for plotting 2D data on maps
+in `Python <http://www.python.org>`_. It is similar in functionality to
+the `matlab mapping toolbox <http://www.mathworks.com/access/helpdesk/help/toolbox/map/map.shtml>`_,
+the `IDL mapping facilities <http://www.msi.umn.edu/software/idl/tutorial/idl-mapping.html>`_,
+`GrADS <http://www.iges.org/grads/downloads.html>`_, or the
+`Generic Mapping Tools <http://gmt.soest.hawaii.edu/>`_.
+`PyNGL <http://www.pyngl.ucar.edu/>`_ and
+`CDAT <http://www-pcmdi.llnl.gov/software/cdat/support/vcs/vcs.html>`_
+are the only other libraries that provide similar capabilities in Python.
+
+Basemap does not do any plotting on it's own, but provides the facilities to transform coordinates to one of 19 different map projections (using the
+`PROJ.4 <http://trac.osgeo.org/proj/>`_ C library). Matplotlib is then
+used to plot contours, images, vectors, lines or points
+in the transformed coordinates.
+Shoreline, river and political boundary
+datasets (from `Generic Mapping Tools <http://gmt.soest.hawaii.edu/>`_)
+are provided, along with methods for plotting them. The `GEOS library
+<http://geos.refractions.net>`_ is used internally to clip the coastline and polticial boundary features to the desired map projection region.
+
+Basemap provides facilities for reading data in `netCDF
+<http://www.unidata.ucar.edu/software/netcdf/>`_ and `Shapefile
+<http://en.wikipedia.org/wiki/Shapefile>`_ formats, as well as
+directly over http using `OPeNDAP <http://en.wikipedia.org/wiki/OPeNDAP>`_.
+This functionality is provided through the `PyDAP <http://pydap.org/>`_
+client, and a python interface to the `Shapefile C library
+<http://shapelib.maptools.org/>`_.
+
+Basemap is geared toward the needs of earth scientists, particular
+oceanographers and meteorologists. I originally wrote Basemap to help in my
+research (climate and weather forecasting), since at the time
+`CDAT <http://www-pcmdi.llnl.gov/software/cdat/support/vcs/vcs.html>`_ was
+the only other tool in python for plotting data on map projections. Over
+the years, the capabilities of Basemap have evolved as scientists in other
+disciplines (such as biology, geology and geophysics) requested and
+contributed new features.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-06-10 02:19:16
|
Revision: 5452
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5452&view=rev
Author: efiring
Date: 2008-06-09 19:19:15 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
Modify comment about mixed case interactive backend list
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/rcsetup.py
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-06-10 01:49:04 UTC (rev 5451)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-06-10 02:19:15 UTC (rev 5452)
@@ -14,8 +14,8 @@
#interactive_bk = ['gtk', 'gtkagg', 'gtkcairo', 'fltkagg', 'qtagg', 'qt4agg',
# 'tkagg', 'wx', 'wxagg', 'cocoaagg']
-# The capitalized forms seem to be needed for ipython at present;
-# this is mysterious to me (EF).
+# The capitalized forms are needed for ipython at present; this may
+# change for later versions.
interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg',
'TkAgg', 'WX', 'WXAgg', 'CocoaAgg']
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-10 01:49:07
|
Revision: 5451
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5451&view=rev
Author: jswhit
Date: 2008-06-09 18:49:04 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/toolkits/basemap/doc/README.txt
Modified: trunk/toolkits/basemap/doc/README.txt
===================================================================
--- trunk/toolkits/basemap/doc/README.txt 2008-06-09 21:58:30 UTC (rev 5450)
+++ trunk/toolkits/basemap/doc/README.txt 2008-06-10 01:49:04 UTC (rev 5451)
@@ -1,5 +1,9 @@
To build docs ....
* install sphinx from svn.
* make _static and sphinxext symlinks here that point to the corresponding
- directories in the matplotlib doc tree.
+ directories in the matplotlib doc tree, e.g.
+
+ ln -s ../../../matplotlib/doc/_static _static
+ ln -s ../../../matplotlib/doc/sphinxext sphinxext
+
* run make.py. Entry point is build/html/index.html.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-06-09 21:58:33
|
Revision: 5450
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5450&view=rev
Author: efiring
Date: 2008-06-09 14:58:30 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
Added review comments on coding_guide.rst to outline.rst
Modified Paths:
--------------
trunk/matplotlib/doc/devel/outline.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-09 21:51:10 UTC (rev 5449)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-09 21:58:30 UTC (rev 5450)
@@ -120,3 +120,61 @@
#. There is still a TODO in the file to include a complete list of symbols
+coding guide (reviewed by EF)
+-----------------------------
+
+Mostly fine, just a few comments. Also, there are a couple
+of typos, but I would rather just edit those directly in
+another pass (if you don't happen to find them) than include
+them as formal review notes.
+
+#. Import recommendation for ma: given that the trunk is
+ requiring numpy 1.1, perhaps we should be consistent and
+ recommend the form::
+
+ import numpy.ma as ma
+
+ for use in the trunk.
+ A note about the difference between the two forms and the
+ history can stay in place, and the alternative form would
+ still be required for the maintenance branch, I presume.
+
+#. This is peripheral, but regarding the example::
+
+ mpl.rcParams['xtick.major.pad'] = 6
+
+ At least at the application level, I think we should move
+ towards using validation routinely when setting rcParams,
+ to reduce a source of hard-to-find bugs. I don't know to
+ what extent Darren's traits-based system takes care of
+ this, but if it does, that is a big point in its favor.
+ There are alternatives (e.g. building validation into the
+ rc() function and using that instead of setting the
+ dictionary entries directly), if necessary.
+
+#. You give the example::
+
+ import matplotlib.cbook as cbook
+
+ Should there also be a list of the standard variants like
+ ``mtransforms``? (And, again peripherally, I would
+ shorten that one to ``mtrans``.)
+
+#. The treatment of whitespace is split into two parts
+ separated by paragraphs on docstrings and line length;
+ this can be consolidated. It might be worth mentioning
+ the ``reindent.py`` and ``tabnanny.py`` utilities here.
+
+#. Minor question of literary style: should use of the first
+ person be avoided in most places? It is used, for
+ example, in the discussion of the automatic kwarg doc
+ generation. I don't mind leaving the first person in,
+ with the general understanding that it means you.
+
+#. Licenses: you might want to add a link to your
+ explanation of your BSD choice. Peripheral question: is
+ there any problem with basemap's inclusion of
+ sub-packages with the gamut of licenses, GPL to MIT?
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-09 21:51:12
|
Revision: 5449
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5449&view=rev
Author: jdh2358
Date: 2008-06-09 14:51:10 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
added text intro
Modified Paths:
--------------
trunk/matplotlib/doc/users/index_text.rst
Added Paths:
-----------
trunk/matplotlib/doc/users/text_intro.rst
Modified: trunk/matplotlib/doc/users/index_text.rst
===================================================================
--- trunk/matplotlib/doc/users/index_text.rst 2008-06-09 21:47:38 UTC (rev 5448)
+++ trunk/matplotlib/doc/users/index_text.rst 2008-06-09 21:51:10 UTC (rev 5449)
@@ -5,59 +5,10 @@
.. toctree::
+ text_intro.rst
text_props.rst
mathtext.rst
usetex.rst
annotations.rst
-matplotlib has excellent text support, including mathematical
-expressions, truetype support for raster and vector outputs, newline
-separated text with arbitrary rotations, and unicode support. Because
-we embed the fonts directly in the output documents, eg for postscript
-or PDF, what you see on the screen is what you get in the hardcopy.
-`freetype2 <http://freetype.sourceforge.net/index2.html>`_ support
-produces very nice, antialiased fonts, that look good even at small
-raster sizes. matplotlib includes its own
-:mod:`matplotlib.font_manager`, thanks to Paul Barrett, which
-implements a cross platform, W3C compliant font finding algorithm.
-
-You have total control over every text property (font size, font
-weight, text location and color, etc) with sensible defaults set in
-the rc file. And significantly for those interested in mathematical
-or scientific figures, matplotlib implements a large number of TeX
-math symbols and commands, to support mathematical expressions
-anywhere in your figure.
-
-
-Basic text commands
-===================
-
-The following commands are used to create text in the pyplot
-interface
-
-* :func:`~matplotlib.pyplot.text` - add text at an arbitrary location to the ``Axes``;
- :meth:`matplotlib.axes.Axes.text` in the API.
-
-* :func:`~matplotlib.pyplot.xlabel` - add an axis label to the x-axis;
- :meth:`matplotlib.axes.Axes.set_xlabel` in the API.
-
-* :func:`~matplotlib.pyplot.ylabel` - add an axis label to the y-axis;;
- :meth:`matplotlib.axes.Axes.set_ylabel` in the API.
-
-* :func:`~matplotlib.pyplot.title` - add a title to the ``Axes``;
- :meth:`matplotlib.axes.Axes.set_title` in the API.
-
-* :func:`~matplotlib.pyplot.figtext` - add text at an arbitrary location to the ``Figure``;
- :meth:`matplotlib.figure.Figure.text` in the API.
-
-* :func:`~matplotlib.pyplot.suptitle` - add a title to the ``Figure``;
- :meth:`matplotlib.figure.Figure.suptitle` in the API.
-
-* :func:`~matplotlib.pyplot.annotate` - add an annotation, with
- optional arrow, to the ``Axes`` ; :meth:`matplotlib.axes.Axes.annotate`
- in the API.
-
-All of these functions create and return a
-:func:`matplotlib.text.Text` instance, which can bew configured with a
-variety of font and other properties.
Added: trunk/matplotlib/doc/users/text_intro.rst
===================================================================
--- trunk/matplotlib/doc/users/text_intro.rst (rev 0)
+++ trunk/matplotlib/doc/users/text_intro.rst 2008-06-09 21:51:10 UTC (rev 5449)
@@ -0,0 +1,55 @@
+.. _text-intro:
+
+Text introduction
+=================
+
+matplotlib has excellent text support, including mathematical
+expressions, truetype support for raster and vector outputs, newline
+separated text with arbitrary rotations, and unicode support. Because
+we embed the fonts directly in the output documents, eg for postscript
+or PDF, what you see on the screen is what you get in the hardcopy.
+`freetype2 <http://freetype.sourceforge.net/index2.html>`_ support
+produces very nice, antialiased fonts, that look good even at small
+raster sizes. matplotlib includes its own
+:mod:`matplotlib.font_manager`, thanks to Paul Barrett, which
+implements a cross platform, W3C compliant font finding algorithm.
+
+You have total control over every text property (font size, font
+weight, text location and color, etc) with sensible defaults set in
+the rc file. And significantly for those interested in mathematical
+or scientific figures, matplotlib implements a large number of TeX
+math symbols and commands, to support mathematical expressions
+anywhere in your figure.
+
+
+Basic text commands
+===================
+
+The following commands are used to create text in the pyplot
+interface
+
+* :func:`~matplotlib.pyplot.text` - add text at an arbitrary location to the ``Axes``;
+ :meth:`matplotlib.axes.Axes.text` in the API.
+
+* :func:`~matplotlib.pyplot.xlabel` - add an axis label to the x-axis;
+ :meth:`matplotlib.axes.Axes.set_xlabel` in the API.
+
+* :func:`~matplotlib.pyplot.ylabel` - add an axis label to the y-axis;;
+ :meth:`matplotlib.axes.Axes.set_ylabel` in the API.
+
+* :func:`~matplotlib.pyplot.title` - add a title to the ``Axes``;
+ :meth:`matplotlib.axes.Axes.set_title` in the API.
+
+* :func:`~matplotlib.pyplot.figtext` - add text at an arbitrary location to the ``Figure``;
+ :meth:`matplotlib.figure.Figure.text` in the API.
+
+* :func:`~matplotlib.pyplot.suptitle` - add a title to the ``Figure``;
+ :meth:`matplotlib.figure.Figure.suptitle` in the API.
+
+* :func:`~matplotlib.pyplot.annotate` - add an annotation, with
+ optional arrow, to the ``Axes`` ; :meth:`matplotlib.axes.Axes.annotate`
+ in the API.
+
+All of these functions create and return a
+:func:`matplotlib.text.Text` instance, which can bew configured with a
+variety of font and other properties.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-09 21:47:41
|
Revision: 5448
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5448&view=rev
Author: jdh2358
Date: 2008-06-09 14:47:38 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
added text intro
Added Paths:
-----------
trunk/matplotlib/doc/users/index_text.rst
Added: trunk/matplotlib/doc/users/index_text.rst
===================================================================
--- trunk/matplotlib/doc/users/index_text.rst (rev 0)
+++ trunk/matplotlib/doc/users/index_text.rst 2008-06-09 21:47:38 UTC (rev 5448)
@@ -0,0 +1,63 @@
+.. _text-guide:
+
+Working with text
+#################
+
+.. toctree::
+
+ text_props.rst
+ mathtext.rst
+ usetex.rst
+ annotations.rst
+
+
+matplotlib has excellent text support, including mathematical
+expressions, truetype support for raster and vector outputs, newline
+separated text with arbitrary rotations, and unicode support. Because
+we embed the fonts directly in the output documents, eg for postscript
+or PDF, what you see on the screen is what you get in the hardcopy.
+`freetype2 <http://freetype.sourceforge.net/index2.html>`_ support
+produces very nice, antialiased fonts, that look good even at small
+raster sizes. matplotlib includes its own
+:mod:`matplotlib.font_manager`, thanks to Paul Barrett, which
+implements a cross platform, W3C compliant font finding algorithm.
+
+You have total control over every text property (font size, font
+weight, text location and color, etc) with sensible defaults set in
+the rc file. And significantly for those interested in mathematical
+or scientific figures, matplotlib implements a large number of TeX
+math symbols and commands, to support mathematical expressions
+anywhere in your figure.
+
+
+Basic text commands
+===================
+
+The following commands are used to create text in the pyplot
+interface
+
+* :func:`~matplotlib.pyplot.text` - add text at an arbitrary location to the ``Axes``;
+ :meth:`matplotlib.axes.Axes.text` in the API.
+
+* :func:`~matplotlib.pyplot.xlabel` - add an axis label to the x-axis;
+ :meth:`matplotlib.axes.Axes.set_xlabel` in the API.
+
+* :func:`~matplotlib.pyplot.ylabel` - add an axis label to the y-axis;;
+ :meth:`matplotlib.axes.Axes.set_ylabel` in the API.
+
+* :func:`~matplotlib.pyplot.title` - add a title to the ``Axes``;
+ :meth:`matplotlib.axes.Axes.set_title` in the API.
+
+* :func:`~matplotlib.pyplot.figtext` - add text at an arbitrary location to the ``Figure``;
+ :meth:`matplotlib.figure.Figure.text` in the API.
+
+* :func:`~matplotlib.pyplot.suptitle` - add a title to the ``Figure``;
+ :meth:`matplotlib.figure.Figure.suptitle` in the API.
+
+* :func:`~matplotlib.pyplot.annotate` - add an annotation, with
+ optional arrow, to the ``Axes`` ; :meth:`matplotlib.axes.Axes.annotate`
+ in the API.
+
+All of these functions create and return a
+:func:`matplotlib.text.Text` instance, which can bew configured with a
+variety of font and other properties.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-09 21:41:59
|
Revision: 5447
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5447&view=rev
Author: dsdale
Date: 2008-06-09 14:41:56 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
added to customization guide
Modified Paths:
--------------
trunk/matplotlib/doc/users/customizing.rst
Modified: trunk/matplotlib/doc/users/customizing.rst
===================================================================
--- trunk/matplotlib/doc/users/customizing.rst 2008-06-09 21:31:46 UTC (rev 5446)
+++ trunk/matplotlib/doc/users/customizing.rst 2008-06-09 21:41:56 UTC (rev 5447)
@@ -1,27 +1,58 @@
.. _customizing-matplotlib:
+**********************
Customizing matplotlib
-======================
+**********************
-matplotlib uses an configuration file ``matplotlibrc`` which is
-located in ``matplotlib/mpl-data/matplotlibrc``. Every time you
-install matplotlib, this file will be overwritten, so if you want your
-customizations to be saved, please move this file to your ``HOME/.matplotlib``
-directory.
+The matplotlibrc File
+=====================
-You can control the defaults of almost every property in matplotlib:
-figure size and dpi, line width, color and style, axes, axis and grid
-properties, text and font properties and so on.
+matplotlib uses :file:`matplotlibrc` configuration files to customize all kinds
+of properties, which we call `rc settings` or `rc parameters`. You can control
+the defaults of almost every property in matplotlib: figure size and dpi, line
+width, color and style, axes, axis and grid properties, text and font
+properties and so on. matplotlib looks for :file:`matplotlibrc` in three
+locations, in the following order:
-You can also dynamically change the defaults in a python script or
-interactively from the python shell using the :func:`matplotlib.rc`
-command. For example to change the default line properties, you could
-do::
+1. :file:`matplotlibrc` in the current working directory, usually used for
+ specific customizations that you do not want to apply elsewhere.
+2. :file:`{HOME}/.matplotlib/matplotlibrc`, for the user's default
+ customizations
+3. :file:`{INSTALL}/matplotlib/mpl-data/matplotlibrc`, where :file:`{INSTALL}`
+ is something like :file:`/usr/lib/python2.5/site-packages` on Linux, and
+ maybe :file:`C:\Python25\Lib\site-packages` on Windows. Every time you
+ install matplotlib, this file will be overwritten, so if you want your
+ customizations to be saved, please move this file to
+ :file:`{HOME}/.matplotlib/matplotlibrc`.
- import matplotlib
- matplotlib.rc('lines', linewidth=2, color='r')
+See below for a sample :ref:`matplotlibrc file<matplotlibrc-sample>`.
+Dynamic rc Settings
+===================
+You can also dynamically change the default rc settings in a python script or
+interactively from the python shell. All of the rc settings are stored in a
+dictionary-like variable called :data:`matplotlib.rcParams`, which is global to
+the matplotlib package. rcParams can be modified directly, for example::
+
+ import matplotlib as mpl
+ mpl.rcParams['lines.linewidth'] = 2
+ mpl.rcParams['lines.color'] = 'r'
+
+Matplotlib also provides a couple of convenience functions for modifying rc
+settings. The :func:`matplotlib.rc` command can be used to modify multiple
+settings in a single group at once, using keyword arguments::
+
+ import matplotlib as mpl
+ mpl.rc('lines', linewidth=2, color='r')
+
+There :func:`matplotlib.rcdefaults` command will restore the standard
+matplotlib default settings.
+
+There is some degree of validation when setting the values of rcParams, see
+:mod:`matplotlib.rcsetup` for details.
+
+
.. _matplotlibrc-sample:
A sample matplotlibrc file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-09 21:31:49
|
Revision: 5446
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5446&view=rev
Author: jdh2358
Date: 2008-06-09 14:31:46 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
added text properties to users guide
Modified Paths:
--------------
trunk/matplotlib/doc/users/figures/pyplot_text.py
trunk/matplotlib/doc/users/pyplot_tutorial.rst
Added Paths:
-----------
trunk/matplotlib/doc/users/figures/text_layout.py
trunk/matplotlib/doc/users/text_props.rst
Modified: trunk/matplotlib/doc/users/figures/pyplot_text.py
===================================================================
--- trunk/matplotlib/doc/users/figures/pyplot_text.py 2008-06-09 21:01:33 UTC (rev 5445)
+++ trunk/matplotlib/doc/users/figures/pyplot_text.py 2008-06-09 21:31:46 UTC (rev 5446)
@@ -11,7 +11,7 @@
plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title('Histogram of IQ')
-plt.text(85, .025, r'$\mu=100,\ \sigma=15$')
+plt.text(60, .025, r'$\mu=100,\ \sigma=15$')
plt.axis([40, 160, 0, 0.03])
plt.grid(True)
Added: trunk/matplotlib/doc/users/figures/text_layout.py
===================================================================
--- trunk/matplotlib/doc/users/figures/text_layout.py (rev 0)
+++ trunk/matplotlib/doc/users/figures/text_layout.py 2008-06-09 21:31:46 UTC (rev 5446)
@@ -0,0 +1,77 @@
+import matplotlib.pyplot as plt
+import matplotlib.patches as patches
+
+# build a rectangle in axes coords
+left, width = .25, .5
+bottom, height = .25, .5
+right = left + width
+top = bottom + height
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+# axes coordinates are 0,0 is bottom left and 1,1 is upper right
+p = patches.Rectangle(
+ (left, bottom), width, height,
+ fill=False, transform=ax.transAxes, clip_on=False
+ )
+
+ax.add_patch(p)
+
+ax.text(left, bottom, 'left top',
+ horizontalalignment='left',
+ verticalalignment='top',
+ transform=ax.transAxes)
+
+ax.text(left, bottom, 'left bottom',
+ horizontalalignment='left',
+ verticalalignment='bottom',
+ transform=ax.transAxes)
+
+ax.text(right, top, 'right bottom',
+ horizontalalignment='right',
+ verticalalignment='bottom',
+ transform=ax.transAxes)
+
+ax.text(right, top, 'right top',
+ horizontalalignment='right',
+ verticalalignment='top',
+ transform=ax.transAxes)
+
+ax.text(right, bottom, 'center top',
+ horizontalalignment='center',
+ verticalalignment='top',
+ transform=ax.transAxes)
+
+ax.text(left, 0.5*(bottom+top), 'right center',
+ horizontalalignment='right',
+ verticalalignment='center',
+ rotation='vertical',
+ transform=ax.transAxes)
+
+ax.text(left, 0.5*(bottom+top), 'left center',
+ horizontalalignment='left',
+ verticalalignment='center',
+ rotation='vertical',
+ transform=ax.transAxes)
+
+ax.text(0.5*(left+right), 0.5*(bottom+top), 'middle',
+ horizontalalignment='center',
+ verticalalignment='center',
+ fontsize=20, color='red',
+ transform=ax.transAxes)
+
+ax.text(right, 0.5*(bottom+top), 'centered',
+ horizontalalignment='center',
+ verticalalignment='center',
+ rotation='vertical',
+ transform=ax.transAxes)
+
+ax.text(left, top, 'rotated\nwith newlines',
+ horizontalalignment='center',
+ verticalalignment='center',
+ rotation=45,
+ transform=ax.transAxes)
+
+ax.set_axis_off()
+plt.show()
Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst
===================================================================
--- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-09 21:01:33 UTC (rev 5445)
+++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-09 21:31:46 UTC (rev 5446)
@@ -153,8 +153,8 @@
.. _multiple-figs-axes:
-Working with multiple figure and axes
-=====================================
+Working with multiple figures and axes
+======================================
Matlab, and :mod:`~matplotlib.pyplot`, have the concept of the current
@@ -232,47 +232,9 @@
t = plt.xlabel('my data', fontsize=14, color='red')
-The following font properties can be set
+These properties are covered in more detail in :ref:`text-properties`.
-========================== ==============================================================================
-Property Value Type
-========================== ==============================================================================
-alpha float
-backgroundcolor any matplotlib color
-bbox rectangle prop dict plus key 'pad' which is a pad in points
-clip_box a matplotlib.transform.Bbox instance
-clip_on [True | False]
-clip_path a Path instance and a Transform instance, a Patch
-color any matplotlib color
-family [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
-fontproperties a matplotlib.font_manager.FontProperties instance
-horizontalalignment or ha [ 'center' | 'right' | 'left' ]
-label any string
-linespacing float
-multialignment ['left' | 'right' | 'center' ]
-name or fontname string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
-picker [None|float|boolean|callable]
-position (x,y)
-rotation [ angle in degrees 'vertical' | 'horizontal'
-size or fontsize [ size in points | relative size eg 'smaller', 'x-large' ]
-style or fontstyle [ 'normal' | 'italic' | 'oblique']
-text string or anything printable with '%s' conversion
-transform a matplotlib.transform transformation instance
-variant [ 'normal' | 'small-caps' ]
-verticalalignment or va [ 'center' | 'top' | 'bottom' | 'baseline' ]
-visible [True | False]
-weight or fontweight [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
-x float
-y float
-zorder any number
-========================== ==============================================================================
-
-See `align_text <http://matplotlib.sf.net/screenshots.html#align_text>`_ for
-examples of how to control the alignment and orientation of text.
-
-
-
Using mathematical expressions in text
--------------------------------------
Added: trunk/matplotlib/doc/users/text_props.rst
===================================================================
--- trunk/matplotlib/doc/users/text_props.rst (rev 0)
+++ trunk/matplotlib/doc/users/text_props.rst 2008-06-09 21:31:46 UTC (rev 5446)
@@ -0,0 +1,63 @@
+.. _text-properties:
+
+Text properties and layout
+==========================
+
+The :class:`matplotlib.text.Text` instances have a variety of
+properties which can be configured via keyword arguments to the text
+commands (eg :func:`~matplotlib.pyplot.title`,
+:func:`~matplotlib.pyplot.xlabel` and :func:`~matplotlib.pyplot.text`).
+
+========================== ==============================================================================
+Property Value Type
+========================== ==============================================================================
+alpha float
+backgroundcolor any matplotlib color
+bbox rectangle prop dict plus key 'pad' which is a pad in points
+clip_box a matplotlib.transform.Bbox instance
+clip_on [True | False]
+clip_path a Path instance and a Transform instance, a Patch
+color any matplotlib color
+family [ 'serif' | 'sans-serif' | 'cursive' | 'fantasy' | 'monospace' ]
+fontproperties a matplotlib.font_manager.FontProperties instance
+horizontalalignment or ha [ 'center' | 'right' | 'left' ]
+label any string
+linespacing float
+multialignment ['left' | 'right' | 'center' ]
+name or fontname string eg, ['Sans' | 'Courier' | 'Helvetica' ...]
+picker [None|float|boolean|callable]
+position (x,y)
+rotation [ angle in degrees 'vertical' | 'horizontal'
+size or fontsize [ size in points | relative size eg 'smaller', 'x-large' ]
+style or fontstyle [ 'normal' | 'italic' | 'oblique']
+text string or anything printable with '%s' conversion
+transform a matplotlib.transform transformation instance
+variant [ 'normal' | 'small-caps' ]
+verticalalignment or va [ 'center' | 'top' | 'bottom' | 'baseline' ]
+visible [True | False]
+weight or fontweight [ 'normal' | 'bold' | 'heavy' | 'light' | 'ultrabold' | 'ultralight']
+x float
+y float
+zorder any number
+========================== ==============================================================================
+
+
+You can layout text with the alignment arguments
+``horizontalalignment``, ``verticalalignment``, and
+``multialignment``. ``horizontalalignment`` controls whether the x
+positional argument for the text indicates the left, center or right
+side of the text bounding box. ``verticalalignment`` controls whether
+the y positional argument for the text indicates the bottom, center or
+top side of the text bounding box. ``multialignment``, for newline
+separated strings only, controls whether the different lines are left,
+center or right justified. Here is an example which uses the
+:func:`~matplotlib.pyplot.text` command to show the various alignment
+possibilities. The use of ``transform=ax.transAxes`` throughout the
+code indicates that the coordinates are given relative to the axes
+bounding box, with 0,0 being the lower left of the axes and 1,1 the
+upper right.
+
+.. literalinclude:: figures/text_layout.py
+
+.. image:: figures/text_layout.png
+ :scale: 50
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-09 21:01:35
|
Revision: 5445
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5445&view=rev
Author: jdh2358
Date: 2008-06-09 14:01:33 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
reorg text users guide, added annotations unit
Modified Paths:
--------------
trunk/matplotlib/doc/devel/outline.rst
trunk/matplotlib/doc/faq/howto_faq.rst
trunk/matplotlib/doc/users/event_handling.rst
trunk/matplotlib/doc/users/index.rst
trunk/matplotlib/doc/users/pyplot_tutorial.rst
trunk/matplotlib/doc/users/usetex.rst
Added Paths:
-----------
trunk/matplotlib/doc/users/annotations.rst
trunk/matplotlib/doc/users/figures/annotation_basic.py
trunk/matplotlib/doc/users/figures/annotation_polar.py
trunk/matplotlib/doc/users/figures/pyplot_annotate.py
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst 2008-06-09 20:13:23 UTC (rev 5444)
+++ trunk/matplotlib/doc/devel/outline.rst 2008-06-09 21:01:33 UTC (rev 5445)
@@ -23,15 +23,15 @@
working with data John has author Darren
custom ticking ? no author ?
masked data Eric has author ?
-text ? no author ?
patches ? no author ?
legends ? no author ?
animation John has author ?
collections ? no author ?
-mathtext Michael in review John
+text - mathtext Michael in review John
+text - usetex Darren submitted ?
+text - annotations John submitted ?
fonts et al Michael ? no author Darren
pyplot tut John submitted Eric
-usetex Darren submitted ?
configuration Darren preliminary ?
win32 install Charlie ? no author Darren
os x install Charlie ? no author ?
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-09 20:13:23 UTC (rev 5444)
+++ trunk/matplotlib/doc/faq/howto_faq.rst 2008-06-09 21:01:33 UTC (rev 5445)
@@ -104,28 +104,28 @@
there is not data. The solution is to pass in some proxy x-data, eg
evenly sampled indicies, and then use a custom formatter to format
these as dates. The example below shows how to use an 'index formatter'
-to achieve the desired plot
+to achieve the desired plot::
- import numpy as np
- import matplotlib.pyplot as plt
- import matplotlib.mlab as mlab
- import matplotlib.ticker as ticker
+ import numpy as np
+ import matplotlib.pyplot as plt
+ import matplotlib.mlab as mlab
+ import matplotlib.ticker as ticker
- r = mlab.csv2rec('../data/aapl.csv')
- r.sort()
- r = r[-30:] # get the last 30 days
+ r = mlab.csv2rec('../data/aapl.csv')
+ r.sort()
+ r = r[-30:] # get the last 30 days
- N = len(r)
- ind = np.arange(N) # the evenly spaced plot indices
+ N = len(r)
+ ind = np.arange(N) # the evenly spaced plot indices
- def format_date(x, pos=None):
- thisind = np.clip(int(x+0.5), 0, N-1)
- return r.date[thisind].strftime('%Y-%m-%d')
+ def format_date(x, pos=None):
+ thisind = np.clip(int(x+0.5), 0, N-1)
+ return r.date[thisind].strftime('%Y-%m-%d')
- fig = plt.figure()
- ax = fig.add_subplot(111)
- ax.plot(ind, r.adj_close, 'o-')
- ax.xaxis.set_major_formatter(ticker.FuncFormatter(format_date))
- fig.autofmt_xdate()
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.plot(ind, r.adj_close, 'o-')
+ ax.xaxis.set_major_formatter(ticker.FuncFormatter(format_date))
+ fig.autofmt_xdate()
- plt.show()
+ plt.show()
Added: trunk/matplotlib/doc/users/annotations.rst
===================================================================
--- trunk/matplotlib/doc/users/annotations.rst (rev 0)
+++ trunk/matplotlib/doc/users/annotations.rst 2008-06-09 21:01:33 UTC (rev 5445)
@@ -0,0 +1,83 @@
+.. _annotations-tutorial:
+
+Annotating text
+===============
+
+The uses of the basic :func:`~matplotlib.pyplot.text` command above
+place text at an arbitrary position on the Axes. A common use case of
+text is to annotate some feature of the plot, and the
+:func:`~matplotlib.Axes.annotate` method provides helper functionality
+to make annotations easy. In an annotation, there are two points to
+consider: the location being annotated represented by the argument
+``xy`` and the location of the text ``xytext``. Both of these
+arguments are ``(x,y)`` tuples.
+
+.. literalinclude:: figures/annotation_basic.py
+
+.. image:: figures/annotation_basic.png
+ :scale: 50
+
+In this example, both the ``xy`` (arrow tip) and ``xytext`` locations
+(text location) are in data coordinates. There are a variety of other
+coordinate systems one can choose -- you can specify the coordinate
+system of ``xy`` and ``xytext`` with one of the following strings for
+``xycoords`` and ``textcoords`` (default is 'data')
+
+==================== ====================================================
+argument coordinate system
+==================== ====================================================
+ 'figure points' points from the lower left corner of the figure
+ 'figure pixels' pixels from the lower left corner of the figure
+ 'figure fraction' 0,0 is lower left of figure and 1,1 is upper, right
+ 'axes points' points from lower left corner of axes
+ 'axes pixels' pixels from lower left corner of axes
+ 'axes fraction' 0,1 is lower left of axes and 1,1 is upper right
+ 'data' use the axes data coordinate system
+==================== ====================================================
+
+For example to place the text coordinates in fractional axes
+coordinates, one could do::
+
+ ax.annotate('local max', xy=(3, 1), xycoords='data',
+ xytext=(0.8, 0.95), textcoords='axes fraction',
+ arrowprops=dict(facecolor='black', shrink=0.05),
+ horizontalalignment='right', verticalalignment='top',
+ )
+
+For physical coordinate systems (points or pixels) the origin is the
+(bottom, left) of the figure or axes. If the value is negative,
+however, the origin is from the (right, top) of the figure or axes,
+analogous to negative indexing of sequences.
+
+Optionally, you can specify arrow properties which draws an arrow
+from the text to the annotated point by giving a dictionary of arrow
+properties in the optional keyword argument ``arrowprops``.
+
+
+==================== ===========================================================================
+``arrowprops`` key description
+==================== ===========================================================================
+width the width of the arrow in points
+frac the fraction of the arrow length occupied by the head
+headwidth the width of the base of the arrow head in points
+shrink move the tip and base some percent away from the annotated point and text
+\*\*kwargs any key for :class:`matplotlib.patches.Polygon`, eg ``facecolor``
+==================== ===========================================================================
+
+
+In the example below, the ``xy`` point is in native coordinates
+(``xycoords`` defaults to 'data'). For a polar axes, this is in
+(theta, radius) space. The text in this example is placed in the
+fractional figure coordinate system. :class:`matplotlib.text.Text`
+keyword args like ``horizontalalignment``, ``verticalalignment`` and
+``fontsize are passed from the `~matplotlib.Axes.annotate` to the
+``Text`` instance
+
+.. literalinclude:: figures/annotation_polar.py
+
+.. image:: figures/annotation_polar.png
+ :scale: 50
+
+See the `annotations demo
+<http://matplotlib.sf.net/examples/pylab_examples/annotation_demo.py>`_ for more
+examples.
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst 2008-06-09 20:13:23 UTC (rev 5444)
+++ trunk/matplotlib/doc/users/event_handling.rst 2008-06-09 21:01:33 UTC (rev 5445)
@@ -1,8 +1,8 @@
.. _event-handling-tutorial:
-***********************************
-Event Handling and Picking Tutorial
-***********************************
+**************************
+Event handling and picking
+**************************
matplotlib works with 5 user interface toolkits (wxpython, tkinter,
qt, gtk and fltk) and in order to support features like interactive
Added: trunk/matplotlib/doc/users/figures/annotation_basic.py
===================================================================
--- trunk/matplotlib/doc/users/figures/annotation_basic.py (rev 0)
+++ trunk/matplotlib/doc/users/figures/annotation_basic.py 2008-06-09 21:01:33 UTC (rev 5445)
@@ -0,0 +1,16 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+
+t = np.arange(0.0, 5.0, 0.01)
+s = np.cos(2*np.pi*t)
+line, = ax.plot(t, s, lw=2)
+
+ax.annotate('local max', xy=(2, 1), xytext=(3, 1.5),
+ arrowprops=dict(facecolor='black', shrink=0.05),
+ )
+
+ax.set_ylim(-2,2)
+plt.show()
Added: trunk/matplotlib/doc/users/figures/annotation_polar.py
===================================================================
--- trunk/matplotlib/doc/users/figures/annotation_polar.py (rev 0)
+++ trunk/matplotlib/doc/users/figures/annotation_polar.py 2008-06-09 21:01:33 UTC (rev 5445)
@@ -0,0 +1,21 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+ax = fig.add_subplot(111, polar=True)
+r = np.arange(0,1,0.001)
+theta = 2*2*np.pi*r
+line, = ax.plot(theta, r, color='#ee8d18', lw=3)
+
+ind = 800
+thisr, thistheta = r[ind], theta[ind]
+ax.plot([thistheta], [thisr], 'o')
+ax.annotate('a polar annotation',
+ xy=(thistheta, thisr), # theta, radius
+ xytext=(0.05, 0.05), # fraction, fraction
+ textcoords='figure fraction',
+ arrowprops=dict(facecolor='black', shrink=0.05),
+ horizontalalignment='left',
+ verticalalignment='bottom',
+ )
+plt.show()
Added: trunk/matplotlib/doc/users/figures/pyplot_annotate.py
===================================================================
--- trunk/matplotlib/doc/users/figures/pyplot_annotate.py (rev 0)
+++ trunk/matplotlib/doc/users/figures/pyplot_annotate.py 2008-06-09 21:01:33 UTC (rev 5445)
@@ -0,0 +1,15 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+ax = plt.subplot(111)
+
+t = np.arange(0.0, 5.0, 0.01)
+s = np.cos(2*np.pi*t)
+line, = plt.plot(t, s, lw=2)
+
+plt.annotate('local max', xy=(2, 1), xytext=(3, 1.5),
+ arrowprops=dict(facecolor='black', shrink=0.05),
+ )
+
+plt.ylim(-2,2)
+plt.show()
Modified: trunk/matplotlib/doc/users/index.rst
===================================================================
--- trunk/matplotlib/doc/users/index.rst 2008-06-09 20:13:23 UTC (rev 5444)
+++ trunk/matplotlib/doc/users/index.rst 2008-06-09 21:01:33 UTC (rev 5445)
@@ -11,11 +11,12 @@
intro.rst
pyplot_tutorial.rst
- mathtext.rst
navigation_toolbar.rst
customizing.rst
+ index_text.rst
artists.rst
event_handling.rst
- usetex.rst
+
+
Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst
===================================================================
--- trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-09 20:13:23 UTC (rev 5444)
+++ trunk/matplotlib/doc/users/pyplot_tutorial.rst 2008-06-09 21:01:33 UTC (rev 5445)
@@ -273,4 +273,46 @@
+Using mathematical expressions in text
+--------------------------------------
+matplotlib accepts TeX equation expressions in any text expression.
+For example to write the expression :math:`\sigma_i=15` in the title,
+you can write a TeX expression surrounded by dollar signs::
+
+ plt.title(r'$\sigma_i=15$')
+
+The ``r`` preceeding the title string is important -- it signifies
+that the string is a *raw* string and not to treate backslashes and
+python escapes. matplotlib has a built-in TeX expression parser and
+layout engine, and ships its own math fonts -- for details see
+:ref:`mathtext-tutorial`. Thus you can use mathematical text across platforms
+without requiring a TeX installation. For those who have LaTeX and
+dvipng installed, you can also use LaTeX to format your text and
+incorporate the output directly into your display figures or saved
+postscript -- see :ref:`usetex-tutorial`.
+
+
+Annotating text
+---------------
+
+The uses of the basic :func:`~matplotlib.pyplot.text` command above
+place text at an arbitrary position on the Axes. A common use case of
+text is to annotate some feature of the plot, and the
+:func:`~matplotlib.pyplot.annotate` method provides helper
+functionality to make annotations easy. In an annotation, there are
+two points to consider: the location being annotated represented by
+the argument ``xy`` and the location of the text ``xytext``. Both of
+these arguments are ``(x,y)`` tuples.
+
+.. literalinclude:: figures/pyplot_annotate.py
+
+.. image:: figures/pyplot_annotate.png
+ :scale: 50
+
+In this basic example, both the ``xy`` (arrow tip) and ``xytext``
+locations (text location) are in data coordinates. There are a
+variety of other coordinate systems one can choose -- see
+:ref:`annotations-tutorial` for details. More examples can be found
+in the `annotations demo
+<http://matplotlib.sf.net/examples/pylab_examples/annotation_demo.py>`_
Modified: trunk/matplotlib/doc/users/usetex.rst
===================================================================
--- trunk/matplotlib/doc/users/usetex.rst 2008-06-09 20:13:23 UTC (rev 5444)
+++ trunk/matplotlib/doc/users/usetex.rst 2008-06-09 21:01:33 UTC (rev 5445)
@@ -1,7 +1,7 @@
.. _usetex-tutorial:
*************************
-Text Rendering With LaTeX
+Text rendering With LaTeX
*************************
Matplotlib has the option to use LaTeX to manage all text layout. This
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-09 20:13:24
|
Revision: 5444
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5444&view=rev
Author: dsdale
Date: 2008-06-09 13:13:23 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
merged traits fix on branch and trunk
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Name: svnmerge-integrated
- /branches/v0_91_maint:1-5396
+ /branches/v0_91_maint:1-5443
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-06-09 20:08:23 UTC (rev 5443)
+++ trunk/matplotlib/CHANGELOG 2008-06-09 20:13:23 UTC (rev 5444)
@@ -1,13 +1,11 @@
2008-06-09 Committed Gregor's image resample patch to downsampling
images with new rcparam image.resample - JDH
-
2008-06-09 Don't install Enthought.Traits along with matplotlib. For
matplotlib developers convenience, it can still be
installed by setting an option in setup.cfg while we figure
decide if there is a future for the traited config - DSD
-
2008-06-09 Added range keyword arg to hist() - MM
2008-06-07 Moved list of backends to rcsetup.py; made use of lower
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-09 20:08:26
|
Revision: 5443
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5443&view=rev
Author: dsdale
Date: 2008-06-09 13:08:23 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
forgot CHANGELOG message
Modified Paths:
--------------
branches/v0_91_maint/CHANGELOG
Modified: branches/v0_91_maint/CHANGELOG
===================================================================
--- branches/v0_91_maint/CHANGELOG 2008-06-09 20:07:15 UTC (rev 5442)
+++ branches/v0_91_maint/CHANGELOG 2008-06-09 20:08:23 UTC (rev 5443)
@@ -1,3 +1,8 @@
+2008-06-09 Don't install Enthought.Traits along with matplotlib. For
+ matplotlib developers convenience, it can still be
+ installed by setting an option in setup.cfg while we figure
+ decide if there is a future for the traited config - DSD
+
2008-06-02 Fix crash in Agg when drawing collections with no fill and/or
edge color - MGD
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-09 20:07:22
|
Revision: 5442
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5442&view=rev
Author: dsdale
Date: 2008-06-09 13:07:15 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
don't install traits
Modified Paths:
--------------
branches/v0_91_maint/setup.cfg.template
branches/v0_91_maint/setupext.py
Modified: branches/v0_91_maint/setup.cfg.template
===================================================================
--- branches/v0_91_maint/setup.cfg.template 2008-06-09 19:58:46 UTC (rev 5441)
+++ branches/v0_91_maint/setup.cfg.template 2008-06-09 20:07:15 UTC (rev 5442)
@@ -25,7 +25,8 @@
#pytz = False
#dateutil = False
#
-## Experimental config package support:
+## Experimental config package support, this should only be enabled by
+## matplotlib developers, for matplotlib development
#enthought.traits = False
#configobj = False
Modified: branches/v0_91_maint/setupext.py
===================================================================
--- branches/v0_91_maint/setupext.py 2008-06-09 19:58:46 UTC (rev 5441)
+++ branches/v0_91_maint/setupext.py 2008-06-09 20:07:15 UTC (rev 5442)
@@ -105,7 +105,7 @@
'provide_pytz': 'auto',
'provide_dateutil': 'auto',
'provide_configobj': 'auto',
- 'provide_traits': 'auto',
+ 'provide_traits': False,
'build_agg': True,
'build_gtk': 'auto',
'build_gtkagg': 'auto',
@@ -140,7 +140,7 @@
try: options['provide_traits'] = config.getboolean("provide_packages",
"enthought.traits")
- except: options['provide_traits'] = 'auto'
+ except: options['provide_traits'] = False
try: options['build_gtk'] = config.getboolean("gui_support", "gtk")
except: options['build_gtk'] = 'auto'
@@ -461,9 +461,11 @@
return False
def check_provide_traits():
- if options['provide_traits'] is True:
- print_status("enthought.traits", "matplotlib will provide")
- return True
+ # Let's not install traits by default for now, unless it is specifically
+ # asked for in setup.cfg AND it is not already installed
+# if options['provide_traits'] is True:
+# print_status("enthought.traits", "matplotlib will provide")
+# return True
try:
from enthought import traits
try:
@@ -477,12 +479,16 @@
version = version.version
except AttributeError:
version = version.__version__
- if version.endswith('mpl'):
- print_status("enthought.traits", "matplotlib will provide")
- return True
- else:
- print_status("enthought.traits", version)
- return False
+ # next 2 lines added temporarily while we figure out what to do
+ # with traits:
+ print_status("enthought.traits", version)
+ return False
+# if version.endswith('mpl'):
+# print_status("enthought.traits", "matplotlib will provide")
+# return True
+# else:
+# print_status("enthought.traits", version)
+# return False
except ImportError:
if options['provide_traits']:
print_status("enthought.traits", "matplotlib will provide")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2008-06-09 19:58:51
|
Revision: 5441
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5441&view=rev
Author: efiring
Date: 2008-06-09 12:58:46 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
Start of arraydata doc
Added Paths:
-----------
trunk/matplotlib/doc/users/arraydata.rst
Added: trunk/matplotlib/doc/users/arraydata.rst
===================================================================
--- trunk/matplotlib/doc/users/arraydata.rst (rev 0)
+++ trunk/matplotlib/doc/users/arraydata.rst 2008-06-09 19:58:46 UTC (rev 5441)
@@ -0,0 +1,72 @@
+.. _arraydata:
+
+***********************************************
+Plotting 2-D arrays or functions of 2 variables
+***********************************************
+
+In this chapter we will address methods for plotting a
+scalar function of two variables. Here are some examples:
+
+* A photographic image, represented as a 2-D array of
+ colors; the grid is regular, with each element of the
+ array corresponding to a square pixel.
+
+* Earth surface elevation and ocean bottom topography,
+ represented as a 2-D array of heights; the grid is
+ rectangular in latitude and longitude, but the latitude
+ increment may not be uniform--often it will decrease
+ toward the poles.
+
+* A mathematical function of two variables, such as a
+ bivariate Gaussian probability density.
+
+Note: in this chapter we will assume the data to be plotted
+are on a grid. If you have scalar data of two
+variables, but the data are not on a grid - for
+example, sea level at island stations - then you will need
+to use an interpolation or other gridding routine
+before you can use any of the
+plotting methods we will discuss here.
+
+As a 2-D plotting library, matplotlib offers two basic
+styles of plot for scalar functions of two variables: an
+image style and a contour style. The image style renders
+the data as either a continuously-varying field of color or
+a set of contiguous colored quadrilaterals. Hence, the
+image style is a direct representation of the data array.
+The contour style is less direct; isolines of the data are
+calculated and then either plotted as lines or used to delimit
+colored regions.
+
+.. _image_styles:
+
+Image (or pcolor) styles
+========================
+
+some text
+
+.. _image:
+
+image
+-----
+
+image text and example
+
+.. _pcolor:
+
+pcolor
+------
+
+pcolor and pcolorfast, including quadmesh variant
+
+.. _contour:
+
+Contouring
+==========
+
+contour and contourf
+
+
+
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ds...@us...> - 2008-06-09 19:52:15
|
Revision: 5440
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5440&view=rev
Author: dsdale
Date: 2008-06-09 12:52:11 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
updated the environment variables FAQ
Modified Paths:
--------------
trunk/matplotlib/doc/faq/environment_variables_faq.rst
Modified: trunk/matplotlib/doc/faq/environment_variables_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/environment_variables_faq.rst 2008-06-09 18:15:08 UTC (rev 5439)
+++ trunk/matplotlib/doc/faq/environment_variables_faq.rst 2008-06-09 19:52:11 UTC (rev 5440)
@@ -4,22 +4,77 @@
Environment Variables
*********************
+.. envvar:: HOME
+
+ The user's home directory. On linux, :envvar:`~ <HOME>` is shorthand for :envvar:`HOME`.
+
.. envvar:: PATH
The list of directories searched to find executable programs
.. envvar:: PYTHONPATH
- The list of directories that is searched to find Python packages and modules
+ The list of directories that is added to Python's standard search list when
+ importing packages and modules
-Setting Environment Variables
-=============================
+Setting Environment Variables in Linux
+======================================
-Linux/OS-X
-----------
+To list the current value of :envvar:`PYTHONPATH`, which may be empty, try::
+ echo $PYTHONPATH
+The procedure for setting environment variables in depends on what your default
+shell is. BASH seems to be the most common, but CSH is also common. You
+should be able to determine which by running at the command prompt::
-Windows
--------
+ echo $SHELL
+
+
+BASH/KSH
+--------
+
+To create a new environment variable::
+
+ export PYTHONPATH=~/Python
+
+To prepend to an existing environment variable::
+
+ export PATH=~/bin:${PATH}
+
+The search order may be important to you, do you want `~/bin` to be searched
+first or last? To append to an existing environment variable::
+
+ export PATH=${PATH}:~/bin
+
+To make your changes available in the future, add the commands to your
+`~/.bashrc` file.
+
+
+CSH/TCSH
+--------
+
+To create a new environment variable::
+
+ setenv PYTHONPATH ~/Python
+
+To prepend to an existing environment variable::
+
+ setenv PATH ~/bin:${PATH}
+
+The search order may be important to you, do you want `~/bin` to be searched
+first or last? To append to an existing environment variable::
+
+ setenv PATH ${PATH}:~/bin
+
+To make your changes available in the future, add the commands to your
+`~/.cshrc` file.
+
+
+Setting Environment Variables in Windows
+========================================
+
+Go to the Windows start menu, select `Control Panel`, then select the `System`
+icon, click the `Advanced` tab, and select the `Environment Variables`
+button. You can edit or add to the `user variables`.
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-09 18:15:17
|
Revision: 5439
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5439&view=rev
Author: jswhit
Date: 2008-06-09 11:15:08 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/toolkits/basemap/doc/README.txt
Modified: trunk/toolkits/basemap/doc/README.txt
===================================================================
--- trunk/toolkits/basemap/doc/README.txt 2008-06-09 18:10:36 UTC (rev 5438)
+++ trunk/toolkits/basemap/doc/README.txt 2008-06-09 18:15:08 UTC (rev 5439)
@@ -1,2 +1,5 @@
+To build docs ....
+* install sphinx from svn.
* make _static and sphinxext symlinks here that point to the corresponding
directories in the matplotlib doc tree.
+* run make.py. Entry point is build/html/index.html.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-06-09 18:10:42
|
Revision: 5438
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5438&view=rev
Author: jswhit
Date: 2008-06-09 11:10:36 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
add stub files for future sphinx docs.
Added Paths:
-----------
trunk/toolkits/basemap/doc/
trunk/toolkits/basemap/doc/README.txt
trunk/toolkits/basemap/doc/api/
trunk/toolkits/basemap/doc/api/index.rst
trunk/toolkits/basemap/doc/conf.py
trunk/toolkits/basemap/doc/index.rst
trunk/toolkits/basemap/doc/make.py
trunk/toolkits/basemap/doc/users/
trunk/toolkits/basemap/doc/users/figures/
trunk/toolkits/basemap/doc/users/index.rst
Added: trunk/toolkits/basemap/doc/README.txt
===================================================================
--- trunk/toolkits/basemap/doc/README.txt (rev 0)
+++ trunk/toolkits/basemap/doc/README.txt 2008-06-09 18:10:36 UTC (rev 5438)
@@ -0,0 +1,2 @@
+* make _static and sphinxext symlinks here that point to the corresponding
+ directories in the matplotlib doc tree.
Added: trunk/toolkits/basemap/doc/api/index.rst
===================================================================
--- trunk/toolkits/basemap/doc/api/index.rst (rev 0)
+++ trunk/toolkits/basemap/doc/api/index.rst 2008-06-09 18:10:36 UTC (rev 5438)
@@ -0,0 +1,10 @@
+.. _api-index:
+
+####################################
+ The Matplotlib Basemap Toolkit API
+####################################
+
+:Release: |version|
+:Date: |today|
+
+.. toctree::
Added: trunk/toolkits/basemap/doc/conf.py
===================================================================
--- trunk/toolkits/basemap/doc/conf.py (rev 0)
+++ trunk/toolkits/basemap/doc/conf.py 2008-06-09 18:10:36 UTC (rev 5438)
@@ -0,0 +1,165 @@
+# -*- coding: utf-8 -*-
+#
+# Basemap documentation build configuration file, created by
+# sphinx-quickstart on Fri May 2 12:33:25 2008.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# The contents of this file are pickled, so don't put values in the namespace
+# that aren't pickleable (module imports are okay, they're removed automatically).
+#
+# All configuration values have a default value; values that are commented out
+# serve to show the default value.
+
+import sys, os
+
+# If your extensions are in another directory, add it here. If the directory
+# is relative to the documentation root, use os.path.abspath to make it
+# absolute, like shown here.
+sys.path.append(os.path.abspath('sphinxext'))
+
+# Import support for ipython console session syntax highlighting (lives
+# in the sphinxext directory defined above)
+import ipython_console_highlighting
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['mathpng', 'sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General substitutions.
+project = 'Basemap Basemap Toolkit'
+copyright = '2008, Jeffrey Whitaker'
+
+# The default replacements for |version| and |release|, also used in various
+# other places throughout the built documents.
+#
+# The short X.Y version.
+version = '0.99'
+# The full version, including alpha/beta/rc tags.
+release = '0.99'
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+unused_docs = []
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'matplotlib.css'
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# The name of an image file (within the static path) to place at the top of
+# the sidebar.
+#html_logo = 'logo.png'
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# If nonempty, this is the file name suffix for generated HTML files. The
+# default is ``".html"``.
+#html_file_suffix = '.xhtml'
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If true, the reST sources are included in the HTML build as _sources/<name>.
+#html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.
+html_use_opensearch = 'False'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'Basemapdoc'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+latex_font_size = '11pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, document class [howto/manual]).
+
+latex_documents = [
+ ('index', 'Basemap.tex', 'Basemap', 'Jeffrey Whitaker', 'manual'),
+]
+
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+latex_logo = None
+
+# Additional stuff for the LaTeX preamble.
+latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+latex_appendices = []
+
+# If false, no module index is generated.
+latex_use_modindex = True
+
+latex_use_parts = True
+
+# Show both class-level docstring and __init__ docstring in class
+# documentation
+autoclass_content = 'both'
Added: trunk/toolkits/basemap/doc/index.rst
===================================================================
--- trunk/toolkits/basemap/doc/index.rst (rev 0)
+++ trunk/toolkits/basemap/doc/index.rst 2008-06-09 18:10:36 UTC (rev 5438)
@@ -0,0 +1,19 @@
+.. basemap documentation master file
+
+Welcome to the Matplotlib Basemap Toolkit documentation!
+========================================================
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ users/index.rst
+ api/index.rst
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
Added: trunk/toolkits/basemap/doc/make.py
===================================================================
--- trunk/toolkits/basemap/doc/make.py (rev 0)
+++ trunk/toolkits/basemap/doc/make.py 2008-06-09 18:10:36 UTC (rev 5438)
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+import fileinput
+import glob
+import os
+import shutil
+import sys
+
+def check_build():
+ build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex',
+ '_static', '_templates']
+ for d in build_dirs:
+ try:
+ os.mkdir(d)
+ except OSError:
+ pass
+
+def figs():
+ #os.system('cd users/figures/ && python make.py')
+ os.system('cd users/figures')
+
+def html():
+ check_build()
+ figs()
+ os.system('sphinx-build -b html -d build/doctrees . build/html')
+
+def latex():
+ check_build()
+ figs()
+ if sys.platform != 'win32':
+ # LaTeX format.
+ os.system('sphinx-build -b latex -d build/doctrees . build/latex')
+
+ # Produce pdf.
+ os.chdir('build/latex')
+
+ # Copying the makefile produced by sphinx...
+ os.system('pdflatex Basemap.tex')
+ os.system('pdflatex Basemap.tex')
+ os.system('makeindex -s python.ist Basemap.idx')
+ os.system('makeindex -s python.ist modBasemap.idx')
+ os.system('pdflatex Basemap.tex')
+
+ os.chdir('../..')
+ else:
+ print 'latex build has not been tested on windows'
+
+def clean():
+ shutil.rmtree('build')
+
+def all():
+ figs()
+ html()
+ latex()
+
+
+funcd = {'figs':figs,
+ 'html':html,
+ 'latex':latex,
+ 'clean':clean,
+ 'all':all,
+ }
+
+
+if len(sys.argv)>1:
+ for arg in sys.argv[1:]:
+ func = funcd.get(arg)
+ if func is None:
+ raise SystemExit('Do not know how to handle %s; valid args are'%(
+ arg, funcd.keys()))
+ func()
+else:
+ all()
Property changes on: trunk/toolkits/basemap/doc/make.py
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/toolkits/basemap/doc/users/index.rst
===================================================================
--- trunk/toolkits/basemap/doc/users/index.rst (rev 0)
+++ trunk/toolkits/basemap/doc/users/index.rst 2008-06-09 18:10:36 UTC (rev 5438)
@@ -0,0 +1,10 @@
+.. _users-guide-index:
+
+#############################################
+ The Matplotlib Basemap Toolkit User's Guide
+#############################################
+
+:Release: |version|
+:Date: |today|
+
+.. toctree::
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-06-09 17:49:16
|
Revision: 5436
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5436&view=rev
Author: jdh2358
Date: 2008-06-09 10:47:32 -0700 (Mon, 09 Jun 2008)
Log Message:
-----------
added date index formatter example
Added Paths:
-----------
trunk/matplotlib/examples/api/date_index_formatter.py
Added: trunk/matplotlib/examples/api/date_index_formatter.py
===================================================================
--- trunk/matplotlib/examples/api/date_index_formatter.py (rev 0)
+++ trunk/matplotlib/examples/api/date_index_formatter.py 2008-06-09 17:47:32 UTC (rev 5436)
@@ -0,0 +1,36 @@
+"""
+When plotting time series, eg financial time series, one often wants
+to leave out days on which there is no data, eh weekends. The example
+below shows how to use an 'index formatter' to achieve the desired plot
+"""
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.mlab as mlab
+import matplotlib.ticker as ticker
+
+r = mlab.csv2rec('../data/aapl.csv')
+r.sort()
+r = r[-30:] # get the last 30 days
+
+
+# first we'll do it the default way, with gaps on weekends
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot(r.date, r.adj_close, 'o-')
+fig.autofmt_xdate()
+
+# next we'll write a custom formatter
+N = len(r)
+ind = np.arange(N) # the evenly spaced plot indices
+
+def format_date(x, pos=None):
+ thisind = np.clip(int(x+0.5), 0, N-1)
+ return r.date[thisind].strftime('%Y-%m-%d')
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot(ind, r.adj_close, 'o-')
+ax.xaxis.set_major_formatter(ticker.FuncFormatter(format_date))
+fig.autofmt_xdate()
+
+plt.show()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|