SourceForge logo
SourceForge logo
Menu

matplotlib-checkins

From: <jd...@us...> - 2008年03月21日 17:51:13
Revision: 5014
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5014&view=rev
Author: jdh2358
Date: 2008年03月21日 10:51:06 -0700 (2008年3月21日)
Log Message:
-----------
added api and event tutorials
Added Paths:
-----------
 trunk/matplotlib/doc/artist_api_tut.txt
 trunk/matplotlib/doc/event_handling_tut.txt
 trunk/matplotlib/doc/figures/
 trunk/matplotlib/doc/figures/dollar_ticks.py
 trunk/matplotlib/doc/figures/fig_axes_customize_simple.py
 trunk/matplotlib/doc/figures/fig_axes_labels_simple.py
 trunk/matplotlib/doc/figures/make.py
 trunk/matplotlib/doc/make.py
Added: trunk/matplotlib/doc/artist_api_tut.txt
===================================================================
--- trunk/matplotlib/doc/artist_api_tut.txt	 (rev 0)
+++ trunk/matplotlib/doc/artist_api_tut.txt	2008年03月21日 17:51:06 UTC (rev 5014)
@@ -0,0 +1,597 @@
+The matplotlib Artist API tutorial
+==================================
+
+There are three layers to the matplotlib API. The FigureCanvas is the
+area onto which the figure is drawn, the Renderer is the object which
+knows how to draw on the FigureCanvas, and the Artist is the object
+that knows how to use a renderer to paint onto the canvas. The
+FigureCanvas and Renderer handle all the details of talking to user
+interface toolkits like wxpython or drawing languages like postscript,
+and the Artist handles all the high level constructs like
+representing and laying out the figure, text, and lines. The typical
+user will spend 95% of his time working with the Artists.
+
+There are two types Artists: primitives and containers. The
+primitives represent the standard graphical objects we want to paint
+onto our canvas: Line2D, Rectangle, Text, AxesImage, etc, and the
+containers are places to put them (Axis, Axes and Figure). The
+standard use is to create a Figure instance, use the Figure to create
+one or more Axes or Subplot instances, and use the Axes instance
+helper methods to create the primitives. In the example below, we
+create a Figure instance using pyplot.figure, which is a convenience
+method for instantiating Figure instances and connecting them with
+your user interface or drawing toolkit FigureCanvas. As we will
+discuss below, this is not necessary, and you can work directly with
+postscript, pdf gtk, or wxpython FigureCanvas es, instantiate your
+Figures directly and connect them yourselves, but since we are
+focusing here on the Artist API we'll let pyplot handle some of those
+details for us::
+
+ import matplotlib.pyplot as plt
+ fig = plt.figure()
+ ax = fig.add_subplot(2,1,1) # two rows, one column, first plot
+
+The Axes is probably the most important class in the matplotlib API,
+and the one you will be working with most of the time. This is
+because the Axes is the plotting area into which most of the objects
+go, and the Axes has many special helper methods (ax.plot, ax.text,
+ax.hist, ax.imshow) to create the most common graphics primitives
+(Line2D, Text, Rectangle, Image, respectively). These helper methods
+will take your data (eg numpy arrays and strings) create primitive
+Artist instances as needed (eg Line2D), add them to the relevant
+containers, and draw them when requested. Most of you are probably
+familiar with the Subplot, which is just a special case of an Axes
+that lives on a regular rows by columns grid of Subplot instances. If
+you want to create an Axes at an arbitrary location, simply use the
+add_axes method which takes a list of [left, bottom, width, height]
+values in 0-1 relative figure coordinates::
+
+ ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3])
+
+Continuing with our example::
+
+ import numpy as np
+ t = np.arange(0.0, 1.0, 0.01)
+ s = np.sin(2*np.pi*t)
+ line, = ax1.plot(t, s, color='blue', lw=2)
+
+In this example, ax is the Axes instance created by the
+fig.add_subplot call above (remember Subplot is just a subclass of
+Axes) and when you call ax.plot, it creates a Line2D instance and adds
+it the the Axes.lines list. In the interactive ipython session below,
+you can see that Axes.lines list is length one and contains the same
+line that was returned by the "line, ax.plot(x, y, 'o')" call::
+
+ In [101]: ax.lines[0]
+ Out[101]: <matplotlib.lines.Line2D instance at 0x19a95710>
+
+ In [102]: line
+ Out[102]: <matplotlib.lines.Line2D instance at 0x19a95710>
+
+If you make subsequent calls to ax.plot (and the hold state is "on"
+which is the default) then additional lines will be added to the list.
+You can remove lines later simply by calling the list methods; either
+of these will work::
+
+ del ax.lines[0]
+ ax.lines.remove(line) # one or the other, not both!
+
+The Axes also has helper methods to configure and decorate the xaxis
+and yaxis tick, ticklabels and axis labels::
+
+ xtext = ax.set_xlabel('my xdata') # returns a Text instance
+ ytext = ax.set_ylabel('my xdata')
+
+When you call ax.set_xlabel, it passes the information on the Text
+instance of the XAxis. Each Axes instance contains an xaxis and a
+yaxis instance, which handle the layout and drawing of the ticks, tick
+labels and axis labels.
+
+Here are the most important matplotlib modules that contain the
+classes referenced above
+
+=============== ==================
+Artist Module
+=============== ==================
+Artist matplotlib.artist
+Rectangle matplotlib.patches
+Line2D matplotlib.lines
+Axes matplotlib.axes
+XAxis and YAxis matplotlib.axis
+Figure matplotlib.figure
+Text	 matplotlib.text
+=============== ==================
+
+Try creating the figure below
+
+.. image:: figures/fig_axes_labels_simple.png
+ :scale: 75
+
+Customizing your objects
+========================
+
+Every element in the figure is represented by a matplotlib Artist, and
+each has an extensive list of properties to configure its appearance.
+The figure itself contains a Rectangle exactly the size of the figure,
+which you can use to set the background color and transparency of the
+figures. Likewise, each Axes bounding box (the standard white box
+with black edges in the typical matplotlib plot, has a Rectangle
+instance that determines the color, transparency, and other properties
+of the Axes. These instances are stored as member variables
+Figure.figurePatch and Axes.axesPatch ("Patch" is a name inherited
+from Matlab, and is a 2D "patch" of color on the figure, eg
+rectangles, circles and polygons). Every matplotlib Artist has the
+following properties
+
+========== ======================================================================
+Property Description
+========== ======================================================================
+alpha 	 The transparency - a scalar from 0-1
+animated A boolean that is used to facilitate animated drawing
+axes The axes that the Artist lives in, possibly None
+clip_box The bounding box that clips the Artist
+clip_on Whether clipping is enabled
+clip_path The path the artist is clipped to
+contains A picking function to test whether the artist contains the pick point
+figure The figure instance the aritst lives in, possibly None
+label A text label (eg for auto-labeling)
+picker A python object that controls object picking
+transform The transformation
+visible A boolean whether the artist should be drawn
+zorder A number which determines the drawing order
+========== ======================================================================
+
+Each of the properties is accessed with an old-fashioned setter or
+getter (yes we know this irritates pythonistas and we plan to support
+direct access via properties or traits but it hasn't been done yet).
+For example, to multiply the current alpha by a half::
+
+ a = o.get_alpha()
+ o.set_alpha(0.5*a)
+
+If you want to set a number of properties at once, you can also use
+the "set" method with keyword arguments. For example::
+
+ o.set(alpha=0.5, zorder=2)
+
+If you are working interactively at the python shell, a handy way to
+inspect the artist properties is to use the matplotlib.artist.getp
+method, which lists the properties and their values (simply "getp") in
+pylab. This works for classes derived from Artist as well, eg Figure
+and Rectangle. Here are the Figure rectangle properties mentioned above::
+
+
+ In [149]: matplotlib.artist.getp(fig.figurePatch)
+	alpha = 1.0
+	animated = False
+	antialiased or aa = True
+	axes = None
+	clip_box = None
+	clip_on = False
+	clip_path = None
+	contains = None
+	edgecolor or ec = w
+	facecolor or fc = 0.75
+	figure = Figure(8.125x6.125)
+	fill = 1
+	hatch = None
+	height = 1
+	label =
+	linewidth or lw = 1.0
+	picker = None
+	transform = <Affine object at 0x134cca84>
+	verts = ((0, 0), (0, 1), (1, 1), (1, 0))
+	visible = True
+	width = 1
+	window_extent = <Bbox object at 0x134acbcc>
+	x = 0
+	y = 0
+	zorder = 1
+
+The docstrings for all of the classes also contain the artist
+properties, so you can consult the interactive "help", the online html
+docs at http://matplotlib.sourceforge.net/classdocs.html or PDF documentation
+at http://matplotlib.sourceforge.net/api.pdf for a listing of
+properties for a give object.
+
+Getting at the objects to customize them
+========================================
+
+Now that we know how to inspect set the properties of a given
+object we want to configure, we need to now how to get at that
+object. As mentioned in the introduction, there are two kinds of
+objects: primitives and containers. The primitives are usually the
+things you want to configure (the font of a Text instance, the width
+of a Line2D) although the containers also have some properties as
+well -- for example the Axes Artist is a container that contains many
+of the primitives in your plot, but it also has properties like the
+xscale to control whether the xaxis is 'linear' or 'log'. In this
+section we'll review where the various container objects store the
+Artists that you want to get at.
+
+The Figure container
+--------------------
+
+The top level container Artist is the matplotlib.figure.Figure, and it
+contains everything in the figure. The background of the figure is a
+Rectangle which is stored in fig.figurePatch (where fig is your Figure
+instance). As you add subplots (fig.add_subplot) and axes
+(ax.add_axes)to the figure these will be appended to the fig.axes
+list. These are also returned by the methods that create them::
+
+ In [156]: fig = plt.figure()
+
+ In [157]: ax1 = fig.add_subplot(211)
+
+ In [158]: ax2 = fig.add_axes([0.1, 0.1, 0.7, 0.3])
+
+ In [159]: ax1
+ Out[159]: <matplotlib.axes.Subplot instance at 0xd54b26c>
+
+ In [160]: print fig.axes
+ [<matplotlib.axes.Subplot instance at 0xd54b26c>, <matplotlib.axes.Axes instance at 0xd3f0b2c>]
+
+
+Because the figure maintains the concept of the "current axes" (see
+Figure.gca and Figure.sca) to support the pylab/pyplot state machine,
+you should not insert or remove axes directly from the axes list, but
+rather use the Figure.add_axes and Figure.add_subplot method to
+insert, and the Figure.delaxes methods to delete. You are free
+however, to iterate over the list of axes or index into it to get
+access to Axes instances you want to customize. Here is an example
+which turns all the axes grids on::
+
+ for ax in fig.axes:
+ ax.grid(True)
+
+
+The figure also has its own text, lines, patches and images, which you
+can use to add primitives directly. The default coordinate system for
+the Figure will simply be in pixels (which is not usually what you
+want) but you can control this by setting the transform property of
+the Artist you are adding to the figure. More useful is "figure
+coordinates" where 0,0 is the bottom, left of the figure and 1,1 is
+the top, right of the figure which you can obtain by setting the
+Artist transform to fig.transFigure::
+
+ In [191]: fig = plt.figure()
+
+ In [192]: l1 = matplotlib.lines.Line2D([0, 1], [0, 1], transform=fig.transFigure, figure=fig)
+
+ In [193]: l2 = matplotlib.lines.Line2D([0, 1], [1, 0], transform=fig.transFigure, figure=fig)
+
+ In [194]: fig.lines.extend([l1, l2])
+
+ In [195]: fig.canvas.draw()
+
+.. image:: figures/fig_x.png
+ :scale: 75
+
+
+Here is a summary of the Artists the figure contains
+
+================ ===============================================================
+Figure attribute Description
+================ ===============================================================
+axes A list of Axes instances (includes Subplot)
+figurePatch The Rectangle background
+images A list of FigureImages patches - useful for raw pixel display
+legends A list of Figure Legend instances (different from Axes.legends)
+lines A list of Figure Line2D instances (rarely used, see Axes.lines)
+patches A list of Figure patches (rarely used, see Axes.patches)
+texts A list Figure Text instances
+================ ===============================================================
+
+
+The Axes container
+------------------
+
+The matplotlib.axes.Axes is the center of the matplotlib universe --
+it contains the vast majority of all the Artists used in a figure with
+many helper methods to create and these Artists to itself, as well as
+helper methods to access and customize the Artists it contains. Like
+the Figure, it contains a Patch ax.axesPatch which is Rectangle for
+Cartesian coordinates and a Circle for polar coordinates; this patch
+determines the shape, background and border of the plotting region::
+
+ ax = fig.add_subplot(111)
+ rect = ax.axesPatch # a Rectangle instance
+ rect.set_facecolor('green')
+
+When you call a plotting method, eg the canonical "ax.plot" and pass
+in arrays or list of values, the method will a matplotlib.lines.Line2D
+instance, update the line with all the Line2D properties passed as
+keyword arguments, add the line to the Axes.lines container, and
+returns it to you::
+
+ In [213]: x, y = np.random.rand(2, 100)
+
+ In [214]: line, = ax.plot(x, y, '-', color='blue', linewidth=2)
+
+ax.plot returns a list of lines because you can pass in multiple x, y
+pairs to plot, and we are unpacking the first element of the length
+one list into the line variable. The line has been added to the
+ax.lines list::
+
+
+ In [229]: print ax.lines
+ [<matplotlib.lines.Line2D instance at 0xd378b0c>]
+
+Similarly, methods that create patches, like ax.bar creates a list of
+rectangles, will add the patches to the ax.patches list::
+
+ In [233]: n, bins, rectangles = ax.hist(np.random.randn(1000), 50, facecolor='yellow')
+
+ In [234]: rectangles
+ Out[234]: <a list of 50 Patch objects>
+
+ In [235]: print len(ax.patches)
+
+You should not add objects directly to the ax.lines or ax.patches
+unless you know exactly what you are doing, because the Axes needs to
+do a few things when it creates and adds an object. It sets the figure
+and axes property of the Artist, as well as the default Axes
+transformation (unless a transformation is set). It also inspects the
+data contained in the Artist to update the data structures controlling
+auto-scaling, so that the view limits can be adjusted to contain the
+plotted data. You can, nonetheless, create objects yourself and add
+them directly to the Axes using helper methods like ax.add_line and
+ax.add_patch. Here is an annotated interactive session illustrating
+what is going on::
+
+ In [261]: fig = plt.figure()
+
+ In [262]: ax = fig.add_subplot(111)
+
+ # create a rectangle instance
+ In [263]: rect = matplotlib.patches.Rectangle( (1,1), width=5, height=12)
+
+ # by default the axes instance is None
+ In [264]: print rect.get_axes()
+ None
+
+ # and the transformation instance is set to the "identity transform"
+ In [265]: print rect.get_transform()
+ <Affine object at 0x13695544>
+
+ # now we add the Rectangle to the Axes
+ In [266]: ax.add_patch(rect)
+
+ # and notice that the ax.add_patch method has set the axes
+ # instance
+ In [267]: print rect.get_axes()
+ Subplot(49,81.25)
+
+ # and the transformation has been set too
+ In [268]: print rect.get_transform()
+ <Affine object at 0x15009ca4>
+
+ # the default axes transformation is ax.transData
+ In [269]: print ax.transData
+ <Affine object at 0x15009ca4>
+
+ # notice that the xlimits of the Axes have not been changed
+ In [270]: print ax.get_xlim()
+ (0.0, 1.0)
+
+ # but the data limits have been updated to encompass the rectangle
+ In [271]: print ax.dataLim.get_bounds()
+ (1.0, 1.0, 5.0, 12.0)
+
+ # we can manually invoke the auto-scaling machinery
+ In [272]: ax.autoscale_view()
+
+ # and now the xlim are updated to encompass the rectangle
+ In [273]: print ax.get_xlim()
+ (1.0, 6.0)
+
+ # we have to manually force a figure draw
+ In [274]: ax.figure.canvas.draw()
+
+
+There are many, many Axes helper methods for creating primitive
+Artists and adding them to their respective containers. The table
+below summarizes a small sampling of them, the kinds of Artist they
+create, and where they store them
+
+============================== ==================== =======================
+Helper method Artist Container
+============================== ==================== =======================
+ax.annotate - text annotations Annotate ax.texts
+ax.bar - bar charts Rectangle ax.patches
+ax.errorbar - error bar plots Line2D and Rectangle ax.lines and ax.patches
+ax.fill - shared area Polygon ax.patches
+ax.hist - histograms Rectangle ax.patches
+ax.imshow - image data AxesImage ax.images
+ax.legend - axes legends Legend ax.legends
+ax.plot - xy plots Line2D ax.lines
+ax.scatter - scatter charts PolygonCollection ax.collections
+ax.text - text Text ax.texts
+============================== ==================== =======================
+
+
+In addition to all of these Artists, the Axes contains two important
+Artist containers: the XAxis and YAxis, which handle the drawing of
+the ticks and labels. These are stored as instance variables xaxis
+and yaxis. The XAxis and YAxis containers will be detailed below, but
+note that the Axes contains many helper methods which forward calls on
+to the Axis instances so you often do not need to work with them
+directly unless you want to. For example, you can set the fontsize of
+the XAxis ticklabels using the Axes helper method::
+
+ for label in ax.get_xticklabels():
+ label.set_color('orange')
+
+Below is a summary of the Artists that the Axes contains
+
+============== ======================================
+Axes attribute Description
+============== ======================================
+artists A list of Artist instances
+axesPatch Rectangle instance for Axes background
+collections A list of Collection instances
+images A list of AxesImage
+legends A list of Legend instances
+lines A list of Line2D instances
+patches A list of Patch instances
+texts A list of Text instances
+xaxis matplotlib.axis.XAxis instance
+yaxis matplotlib.axis.YAxis instance
+============== ======================================
+
+The Axis containers
+-------------------
+
+The matplotlib.axis.Axis instances handle the drawing of the tick lines, the grid
+lines, the tick labels and the axis label. You can configure the left
+and right ticks separately for the y axis, and the upper and lower
+ticks separately for the x axis. The axis also stores the data and view
+intervals used in auto-scaling, panning and zooming, as well as the
+locator and formatter instances which control where the ticks are
+placed and how they are represented as strings.
+
+Each axis object contains a label attribute (this is what the pylab
+calls to xlabel and ylabel set) as well as a list of major and minor
+ticks. The ticks are XTick and YTick instances, which contain the
+actual line and text primitives that render the ticks and ticklabels.
+Because the ticks are dynamically created as needed (eg when panning
+and zooming), you should access the lists of major and minor ticks
+through their accessor methods axis.get_major_ticks() and
+axis.get_minor_ticks(). Although the ticks contain all the primitives
+and will be covered below, the Axis methods contain accessor methods
+to return the tick lines, tick labels, tick locations etc....::
+
+ In [285]: axis = ax.xaxis
+
+ In [286]: axis.get_ticklocs()
+ Out[286]: array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
+
+ In [287]: axis.get_ticklabels()
+ Out[287]: <a list of 10 Text major ticklabel objects>
+
+ # note there are twice as many ticklines as labels because by
+ # default there are tick lines at the top and bottom but only tick
+ # labels below the xaxis; this can be customized
+ In [288]: axis.get_ticklines()
+ Out[288]: <a list of 20 Line2D ticklines objects>
+
+ # by default you get the major ticks back
+ In [291]: axis.get_ticklines()
+ Out[291]: <a list of 20 Line2D ticklines objects>
+
+ # but you can also ask for the minor ticks
+ In [292]: axis.get_ticklines(minor=True)
+ Out[292]: <a list of 0 Line2D ticklines objects>
+
+Here is a summary of some of the useful accessor methods of the Axis
+(these have corresponding setters where useful, such as
+set_major_formatter)
+
+====================== =========================================================
+Accessor method Description
+====================== =========================================================
+get_scale The scale of the axis, eg 'log' or 'linear'
+get_view_interval The interval instance of the axis view limits
+get_data_interval The interval instance of the axis data limits
+get_gridlines A list of grid lines for the Axis
+get_label The axis label - a Text instance
+get_ticklabels A list of Text instances - keyword minor=True|False
+get_ticklines A list of Line2D instances - keyword minor=True|False
+get_ticklocs A list of Tick locations - keyword minor=True|False
+get_major_locator The matplotlib.ticker.Locator instance for major ticks
+get_major_formatter The matplotlib.ticker.Formatter instance for major ticks
+get_minor_locator The matplotlib.ticker.Locator instance for minor ticks
+get_minor_formatter The matplotlib.ticker.Formatter instance for minor ticks
+get_major_ticks A list of Tick instances for major ticks
+get_minor_ticks A list of Tick instances for minor ticks
+grid Turn the grid on or off for the major or minor ticks
+====================== =========================================================
+
+Try creating the figure below
+
+.. image:: figures/fig_axes_customize_simple.png
+ :scale: 75
+
+Exercise solution::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ # plt.figure creates a matplotlib.figure.Figure instance
+ fig = plt.figure()
+ rect = fig.figurePatch # a rectangle instance
+ rect.set_facecolor('lightgoldenrodyellow')
+
+ ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4])
+ rect = ax1.axesPatch
+ rect.set_facecolor('lightslategray')
+
+
+ for label in ax1.xaxis.get_ticklabels():
+ # label is a Text instance
+ label.set_color('red')
+ label.set_rotation(45)
+ label.set_fontsize(16)
+
+ for line in ax1.yaxis.get_ticklines():
+ # line is a Line2D instance
+ line.set_color('green')
+ line.set_markersize(25)
+ line.set_markeredgewidth(3)
+
+ fig.savefig('figures/fig_axes_customize_simple.png', dpi=150)
+ fig.savefig('figures/fig_axes_customize_simple.eps')
+ plt.show()
+
+
+
+The Tick containers
+-------------------
+
+The matplotlib.axis.Tick is the final container object in our descent
+from the Figure to the Axes to the Axis to the Tick. The Tick
+contains the tick and grid line instances, as well as the label
+instances for the upper and lower ticks. Each of these is accessible
+directly as an attribute of the Tick. In addition, there are boolean
+variables that determine whether the upper labels and ticks are on for
+the xaxis and whether the right labels and ticks are on for the yaxis.
+
+============== ==========================================================
+Tick attribute Description
+============== ==========================================================
+tick1line Line2D instance
+tick2line Line2D instance
+gridline Line2D instance
+label1 Text instance
+label2 Text instance
+gridOn boolean which determines whether to draw the tickline
+tick1On boolean which determines whether to draw the 1st tickline
+tick2On boolean which determines whether to draw the 2nd tickline
+label1On boolean which determines whether to draw tick label
+label2On boolean which determines whether to draw tick label
+============== ==========================================================
+
+Here is an example which sets the formatter for the upper ticks with
+dollar signs and colors them green on the right side of the yaxis::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+ import matplotlib.ticker as ticker
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.plot(100*np.random.rand(20))
+
+ formatter = ticker.FormatStrFormatter('$%1.2f')
+ ax.yaxis.set_major_formatter(formatter)
+
+ for tick in ax.yaxis.get_major_ticks():
+ tick.label1On = False
+ tick.label2On = True
+ tick.label2.set_color('green')
+
+ plt.show()
+
+
+.. image:: figures/dollar_ticks.png
+ :scale: 75
Added: trunk/matplotlib/doc/event_handling_tut.txt
===================================================================
--- trunk/matplotlib/doc/event_handling_tut.txt	 (rev 0)
+++ trunk/matplotlib/doc/event_handling_tut.txt	2008年03月21日 17:51:06 UTC (rev 5014)
@@ -0,0 +1,470 @@
+Event Handling and Picking Tutorial
+===================================
+
+matplotlib works with 5 user interface toolkits (wxpython, tkinter,
+qt, gtk and fltk) and in order to support features like interactive
+panning and zooming of figures, it is helpful to the developers to
+have an API for interacting with the figure via key presses and mouse
+movements that is "GUI neutral" so we don't have to repeat a lot of
+code across the different user interfaces. Although the event
+handling API is GUI neutral, it is based on the GTK model, which was
+the first user interface matplotlib supported. The events that are
+triggered are also a bit richer vis-a-vis matplotlib than standard GUI
+events, including information like which Axes the event occurred in.
+The events also understand the matplotlib coordinate system, and
+report event locations in both pixel and data coordinates.
+
+
+Event connections
+=================
+
+To receive events, you need to write a callback function and then
+connect your function to the event manager, which is part of the
+FigureCanvas. Here is a simple example that prints the location of
+the mouse click and which button was pressed::
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.plot(np.random.rand(10))
+
+ def onclick(event):
+ print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f'%(
+ event.button, event.x, event.y, event.xdata, event.ydata)
+
+ cid = fig.canvas.mpl_connect('button_press_event', onclick)
+
+The FigureCanvas method mpl_connect returns a connection id which is
+simply an integer. When you want to disconnect the callback, just
+call::
+
+ fig.canvas.mpl_disconnect(cid)
+
+Here are the events that you can connect to, the class instances that
+are sent back to you when the event occurs, and the event descriptions
+
+
+===================== =========== ===================================
+Event name Class Description
+===================== =========== ===================================
+button_press_event MouseEvent mouse button is pressed
+button_release_event MouseEvent mouse button is released
+draw_event DrawEvent canvas draw
+key_press_event KeyEvent key is pressed
+key_release_event KeyEvent key is released
+motion_notify_event MouseEvent mouse motion
+pick_event PickEvent an object in the canvas is selected
+resize_event ResizeEvent figure canvas is resized
+scroll_event MouseEvent mouse scroll wheel is rolled
+===================== =========== ===================================
+
+
+Event attributes
+================
+
+All matplotlib events inherit from the base class
+matplotlib.backend_bases.Event, which store the attributes
+
+=============== =================================================
+Event attribute Description
+=============== =================================================
+name the event name
+canvas the FigureCanvas instance generating the event
+guiEvent the GUI event that triggered the matplotlib event
+=============== =================================================
+
+The most common events that are the bread and butter of event handling
+are key press/release events and mouse press/release and movement
+events. The KeyEvent and MouseEvent classes that handle these events
+are both derived from the LocationEvent, which has the following
+attributes
+
+======================= ========================================
+LocationEvent attribute Description
+======================= ========================================
+x x position - pixels from left of canvas
+y y position - pixels from right of canvas
+button button pressed None, 1, 2, 3
+inaxes the Axes instance if mouse us over axes
+xdata x coord of mouse in data coords
+ydata y coord of mouse in data coords
+======================= ========================================
+
+Let's look a simple example of a canvas, where a simple line segment
+is created every time a mouse is pressed::
+
+ class LineBuilder:
+ def __init__(self, line):
+ self.line = line
+ self.xs = list(line.get_xdata())
+ self.ys = list(line.get_ydata())
+ self.cid = line.figure.canvas.mpl_connect('button_press_event', self)
+
+ def __call__(self, event):
+ print 'click', event
+ if event.inaxes!=self.line.axes: return
+ self.xs.append(event.xdata)
+ self.ys.append(event.ydata)
+ self.line.set_data(self.xs, self.ys)
+ self.line.figure.canvas.draw()
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.set_title('click to build line segments')
+ line, = ax.plot([0], [0]) # empty line
+ linebuilder = LineBuilder(line)
+
+
+
+The MouseEvent that we just used is a LocationEvent, so we have access
+to the data and pixel coordinates in event.x and event.xdata. In
+addition to the LocationEvent attributes, it has
+
+==================== ==============================================================
+MouseEvent attribute Description
+==================== ==============================================================
+button button pressed None, 1, 2, 3
+key the key pressed: None, chr(range(255)), shift, win, or control
+==================== ==============================================================
+
+Draggable Rectangle Exercise
+----------------------------
+
+Write draggable rectangle class that is initialized with a Rectangle
+instance but will move its x,y location when dragged. Hint: you will
+need to store the orginal xy location of the rectangle which is stored
+as rect.xy and connect to the press, motion and release mouse events.
+When the mouse is pressed, check to see if the click occurs over your
+rectangle (see rect.contains) and if it does, store the rectangle xy
+and the location of the mouse click in data coords. In the motion
+event callback, compute the deltax and deltay of the mouse movement,
+and add those deltas to the origin of the rectangle you stored. The
+redraw the figure. On the button release event, just reset all the
+button press data you stored as None.
+
+Here is the solution::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ class DraggableRectangle:
+ def __init__(self, rect):
+ self.rect = rect
+ self.press = None
+
+ def connect(self):
+ 'connect to all the events we need'
+ self.cidpress = self.rect.figure.canvas.mpl_connect(
+ 'button_press_event', self.on_press)
+ self.cidrelease = self.rect.figure.canvas.mpl_connect(
+ 'button_release_event', self.on_release)
+ self.cidmotion = self.rect.figure.canvas.mpl_connect(
+ 'motion_notify_event', self.on_motion)
+
+ def on_press(self, event):
+ 'on button press we will see if the mouse is over us and store some data'
+ if event.inaxes != self.rect.axes: return
+
+ contains, attrd = self.rect.contains(event)
+ if not contains: return
+ print 'event contains', self.rect.xy
+ x0, y0 = self.rect.xy
+ self.press = x0, y0, event.xdata, event.ydata
+
+ def on_motion(self, event):
+ 'on motion we will move the rect if the mouse is over us'
+ if self.press is None: return
+ if event.inaxes != self.rect.axes: return
+ x0, y0, xpress, ypress = self.press
+ dx = event.xdata - xpress
+ dy = event.ydata - ypress
+ #print 'x0=%f, xpress=%f, event.xdata=%f, dx=%f, x0+dx=%f'%(x0, xpress, event.xdata, dx, x0+dx)
+ self.rect.set_x(x0+dx)
+ self.rect.set_y(y0+dy)
+
+ self.rect.figure.canvas.draw()
+
+
+ def on_release(self, event):
+ 'on release we reset the press data'
+ self.press = None
+ self.rect.figure.canvas.draw()
+
+ def disconnect(self):
+ 'disconnect all the stored connection ids'
+ self.rect.figure.canvas.mpl_disconnect(self.cidpress)
+ self.rect.figure.canvas.mpl_disconnect(self.cidrelease)
+ self.rect.figure.canvas.mpl_disconnect(self.cidmotion)
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ rects = ax.bar(range(10), 20*np.random.rand(10))
+ drs = []
+ for rect in rects:
+ dr = DraggableRectangle(rect)
+ dr.connect()
+ drs.append(dr)
+
+ plt.show()
+
+
+**Extra credit**: use the animation blit techniques discussed at
+http://www.scipy.org/Cookbook/Matplotlib/Animations to make the
+animated drawing faster and smoother.
+
+Extra credit solution::
+
+ # draggable rectangle with the animation blit techniques; see
+ # http://www.scipy.org/Cookbook/Matplotlib/Animations
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ class DraggableRectangle:
+ lock = None # only one can be animated at a time
+ def __init__(self, rect):
+ self.rect = rect
+ self.press = None
+ self.background = None
+
+ def connect(self):
+ 'connect to all the events we need'
+ self.cidpress = self.rect.figure.canvas.mpl_connect(
+ 'button_press_event', self.on_press)
+ self.cidrelease = self.rect.figure.canvas.mpl_connect(
+ 'button_release_event', self.on_release)
+ self.cidmotion = self.rect.figure.canvas.mpl_connect(
+ 'motion_notify_event', self.on_motion)
+
+ def on_press(self, event):
+ 'on button press we will see if the mouse is over us and store some data'
+ if event.inaxes != self.rect.axes: return
+ if DraggableRectangle.lock is not None: return
+ contains, attrd = self.rect.contains(event)
+ if not contains: return
+ print 'event contains', self.rect.xy
+ x0, y0 = self.rect.xy
+ self.press = x0, y0, event.xdata, event.ydata
+ DraggableRectangle.lock = self
+
+ # draw everything but the selected rectangle and store the pixel buffer
+ canvas = self.rect.figure.canvas
+ axes = self.rect.axes
+ self.rect.set_animated(True)
+ canvas.draw()
+ self.background = canvas.copy_from_bbox(self.rect.axes.bbox)
+
+ # now redraw just the rectangle
+ axes.draw_artist(self.rect)
+
+ # and blit just the redrawn area
+ canvas.blit(axes.bbox)
+
+ def on_motion(self, event):
+ 'on motion we will move the rect if the mouse is over us'
+ if DraggableRectangle.lock is not self:
+ return
+ if event.inaxes != self.rect.axes: return
+ x0, y0, xpress, ypress = self.press
+ dx = event.xdata - xpress
+ dy = event.ydata - ypress
+ self.rect.set_x(x0+dx)
+ self.rect.set_y(y0+dy)
+
+
+ canvas = self.rect.figure.canvas
+ axes = self.rect.axes
+ # restore the background region
+ canvas.restore_region(self.background)
+
+ # redraw just the current rectangle
+ axes.draw_artist(self.rect)
+
+ # blit just the redrawn area
+ canvas.blit(axes.bbox)
+
+
+
+ def on_release(self, event):
+ 'on release we reset the press data'
+ if DraggableRectangle.lock is not self:
+ return
+
+ self.press = None
+ DraggableRectangle.lock = None
+
+ # turn off the rect animation property and reset the background
+ self.rect.set_animated(False)
+ self.background = None
+
+ # redraw the full figure
+ self.rect.figure.canvas.draw()
+ def disconnect(self):
+ 'disconnect all the stored connection ids'
+ self.rect.figure.canvas.mpl_disconnect(self.cidpress)
+ self.rect.figure.canvas.mpl_disconnect(self.cidrelease)
+ self.rect.figure.canvas.mpl_disconnect(self.cidmotion)
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ rects = ax.bar(range(10), 20*np.random.rand(10))
+ drs = []
+ for rect in rects:
+ dr = DraggableRectangle(rect)
+ dr.connect()
+ drs.append(dr)
+
+ plt.show()
+
+
+Object Picking
+==============
+
+You can enable picking by setting the ``picker`` property of an Artist
+(eg a matplotlib Line2D, Text, Patch, Polygon, AxesImage,
+etc...)
+
+There are a variety of meanings of the picker property:
+
+- None : picking is disabled for this artist (default)
+
+- boolean : if True then picking will be enabled and the artist will
+ fire a pick event if the mouse event is over the artist
+
+- float : if picker is a number it is interpreted as an epsilon
+ tolerance in points and the the artist will fire off an event if its
+ data is within epsilon of the mouse event. For some artists like
+ lines and patch collections, the artist may provide additional data
+ to the pick event that is generated, eg the indices of the data
+ within epsilon of the pick event.
+
+- function : if picker is callable, it is a user supplied function
+ which determines whether the artist is hit by the mouse event. The
+ signature is ``hit, props = picker(artist, mouseevent)`` to
+ determine the hit test. If the mouse event is over the artist,
+ return hit=True and props is a dictionary of properties you want
+ added to the PickEvent attributes
+
+
+After you have enabled an artist for picking by setting the ``picker``
+property, you need to connect to the figure canvas pick_event to get
+pick callbacks on mouse press events. Eg::
+
+ def pick_handler(event):
+ mouseevent = event.mouseevent
+ artist = event.artist
+ # now do something with this...
+
+
+The pick event (matplotlib.backend_bases.PickEvent) which is passed to
+your callback is always fired with two attributes:
+
+- mouseevent : the mouse event that generate the pick event. The
+ mouse event in turn has attributes like x and y (the coords in
+ display space, eg pixels from left, bottom) and xdata, ydata (the
+ coords in data space). Additionally, you can get information about
+ which buttons were pressed, which keys were pressed, which Axes the
+ mouse is over, etc. See matplotlib.backend_bases.MouseEvent for
+ details.
+
+- artist : the matplotlib.artist that generated the pick event.
+
+Additionally, certain artists like Line2D and PatchCollection may
+attach additional meta data like the indices into the data that meet
+the picker criteria (eg all the points in the line that are within the
+specified epsilon tolerance)
+
+Simple picking example
+----------------------
+
+In the example below, we set the line picker property to a scalar, so
+it represents a tolerance in points (72 points per inch). The onpick
+callback function will be called when the pick event it within the
+tolerance distance from the line, and has the indices of the data
+vertices that are within the pick distance tolerance. Our onpick
+callback function simply prints the data that are under the pick
+location. Different matplotlib Artists can attach different data to
+the PickEvent. For example, Line2D attaches the ind property, which
+are the indices into the line data under the pick point. See
+Line2D.pick for details on the PickEvent properties of the line. Here
+is the code::
+
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.set_title('click on points')
+
+ line, = ax.plot(np.random.rand(100), 'o', picker=5) # 5 points tolerance
+
+ def onpick(event):
+ thisline = event.artist
+ xdata = thisline.get_xdata()
+ ydata = thisline.get_ydata()
+ ind = event.ind
+ print 'onpick points:', zip(xdata[ind], ydata[ind])
+
+ fig.canvas.mpl_connect('pick_event', onpick)
+
+ plt.show()
+
+
+Picking Exercise
+----------------
+
+Create a data set of 100 arrays of 1000 Gaussian random numbers and
+compute the sample mean and standard deviation of each of them (hint:
+numpy arrays have a mean and std method) and make a xy marker plot of
+the 100 means vs the 100 standard deviations. Connect the line
+created by the plot command to the pick event, and plot the original
+time series of the data that generated the clicked on points. If more
+than one point is within the tolerance of the clicked on point, you
+can use multiple subplots to plot the multiple time series.
+
+Exercise solution::
+
+ """
+ compute the mean and stddev of 100 data sets and plot mean vs stddev.
+ When you click on one of the mu, sigma points, plot the raw data from
+ the dataset that generated the mean and stddev
+ """
+ import numpy as np
+ import matplotlib.pyplot as plt
+
+ X = np.random.rand(100, 1000)
+ xs = np.mean(X, axis=1)
+ ys = np.std(X, axis=1)
+
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.set_title('click on point to plot time series')
+ line, = ax.plot(xs, ys, 'o', picker=5) # 5 points tolerance
+
+
+ def onpick(event):
+
+ if event.artist!=line: return True
+
+ N = len(event.ind)
+ if not N: return True
+
+
+ figi = plt.figure()
+ for subplotnum, dataind in enumerate(event.ind):
+ ax = figi.add_subplot(N,1,subplotnum+1)
+ ax.plot(X[dataind])
+ ax.text(0.05, 0.9, 'mu=%1.3f\nsigma=%1.3f'%(xs[dataind], ys[dataind]),
+ transform=ax.transAxes, va='top')
+ ax.set_ylim(-0.5, 1.5)
+ figi.show()
+ return True
+
+ fig.canvas.mpl_connect('pick_event', onpick)
+
+ plt.show()
+
+
+
+
+
+
+
Added: trunk/matplotlib/doc/figures/dollar_ticks.py
===================================================================
--- trunk/matplotlib/doc/figures/dollar_ticks.py	 (rev 0)
+++ trunk/matplotlib/doc/figures/dollar_ticks.py	2008年03月21日 17:51:06 UTC (rev 5014)
@@ -0,0 +1,20 @@
+import numpy as np
+import matplotlib.pyplot as plt
+import matplotlib.ticker as ticker
+
+fig = plt.figure()
+ax = fig.add_subplot(111)
+ax.plot(100*np.random.rand(20))
+
+formatter = ticker.FormatStrFormatter('$%1.2f')
+ax.yaxis.set_major_formatter(formatter)
+
+for tick in ax.yaxis.get_major_ticks():
+ tick.label1On = False
+ tick.label2On = True
+ tick.label2.set_color('green')
+
+fig.savefig('dollar_ticks')
+plt.show()
+
+
Added: trunk/matplotlib/doc/figures/fig_axes_customize_simple.py
===================================================================
--- trunk/matplotlib/doc/figures/fig_axes_customize_simple.py	 (rev 0)
+++ trunk/matplotlib/doc/figures/fig_axes_customize_simple.py	2008年03月21日 17:51:06 UTC (rev 5014)
@@ -0,0 +1,29 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+# plt.figure creates a matplotlib.figure.Figure instance
+fig = plt.figure()
+rect = fig.figurePatch # a rectangle instance
+rect.set_facecolor('lightgoldenrodyellow')
+
+ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4])
+rect = ax1.axesPatch
+rect.set_facecolor('lightslategray')
+
+
+for label in ax1.xaxis.get_ticklabels():
+ # label is a Text instance
+ label.set_color('red')
+ label.set_rotation(45)
+ label.set_fontsize(16)
+
+for line in ax1.yaxis.get_ticklines():
+ # line is a Line2D instance
+ line.set_color('green')
+ line.set_markersize(25)
+ line.set_markeredgewidth(3)
+
+
+fig.savefig('fig_axes_customize_simple')
+
+plt.show()
Added: trunk/matplotlib/doc/figures/fig_axes_labels_simple.py
===================================================================
--- trunk/matplotlib/doc/figures/fig_axes_labels_simple.py	 (rev 0)
+++ trunk/matplotlib/doc/figures/fig_axes_labels_simple.py	2008年03月21日 17:51:06 UTC (rev 5014)
@@ -0,0 +1,21 @@
+import numpy as np
+import matplotlib.pyplot as plt
+
+fig = plt.figure()
+fig.subplots_adjust(top=0.8)
+ax1 = fig.add_subplot(211)
+ax1.set_ylabel('volts')
+ax1.set_title('a sine wave')
+
+t = np.arange(0.0, 1.0, 0.01)
+s = np.sin(2*np.pi*t)
+line, = ax1.plot(t, s, color='blue', lw=2)
+
+ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3])
+n, bins, patches = ax2.hist(np.random.randn(1000), 50,
+ facecolor='yellow', edgecolor='yellow')
+ax2.set_xlabel('time (s)')
+
+fig.savefig('fig_axes_labels_simple')
+
+plt.show()
Added: trunk/matplotlib/doc/figures/make.py
===================================================================
--- trunk/matplotlib/doc/figures/make.py	 (rev 0)
+++ trunk/matplotlib/doc/figures/make.py	2008年03月21日 17:51:06 UTC (rev 5014)
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+import sys, os, glob
+import matplotlib
+matplotlib.use('Agg')
+
+def figs():
+ # each one of these will make a figure when imported
+ import dollar_ticks
+ import fig_axes_customize_simple
+ import fig_axes_labels_simple
+
+ print 'all figures made'
+ for fname in glob.glob('*.pyc'):
+ os.remove(fname)
+
+def clean():
+ patterns = ['#*', '*~', '*.png']
+ for pattern in patterns:
+ for fname in glob.glob(pattern):
+ os.remove(fname)
+ print 'all clean'
+
+
+
+def all():
+ figs()
+
+funcd = {'figs':figs,
+ '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/matplotlib/doc/figures/make.py
___________________________________________________________________
Name: svn:executable
 + *
Added: trunk/matplotlib/doc/make.py
===================================================================
--- trunk/matplotlib/doc/make.py	 (rev 0)
+++ trunk/matplotlib/doc/make.py	2008年03月21日 17:51:06 UTC (rev 5014)
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+import os, sys, glob
+
+def check_png():
+ if not len(glob.glob('figures/*.png')):
+ raise SystemExit('No PNG files in figures dir; please run make.py in the figures directory first')
+
+def check_rst2latex():
+ sin, sout = os.popen2('which rst2latex')
+ if not sout.read():
+ raise SystemExit('Build requires rst2latex')
+
+def check_pdflatex():
+ sin, sout = os.popen2('which pdflatex')
+ if not sout.read():
+ raise SystemExit('Build requires pdflatex')
+
+
+
+
+def artist_tut():
+ check_png()
+ check_rst2latex()
+ check_pdflatex()
+ os.system('rst2latex artist_api_tut.txt > artist_api_tut.tex')
+ os.system('pdflatex artist_api_tut.tex')
+
+
+def event_tut():
+ check_png()
+ check_rst2latex()
+ check_pdflatex()
+ os.system('rst2latex event_handling_tut.txt > event_handling_tut.tex')
+ os.system('pdflatex event_handling_tut.tex')
+
+def clean():
+ patterns = ['#*', '*~', '*.tex', '*.log', '*.out', '*.aux']
+ for pattern in patterns:
+ for fname in glob.glob(pattern):
+ os.remove(fname)
+ print 'all clean'
+
+def all():
+ artist_tut()
+ event_tut()
+
+funcd = {'artist_tut': artist_tut,
+ 'event_tut': event_tut,
+ '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/matplotlib/doc/make.py
___________________________________________________________________
Name: svn:executable
 + *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ds...@us...> - 2008年05月22日 19:58:44
Revision: 5217
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5217&view=rev
Author: dsdale
Date: 2008年05月22日 12:58:22 -0700 (2008年5月22日)
Log Message:
-----------
added support for ReST-based documentation using Sphinx
Added Paths:
-----------
 trunk/matplotlib/doc/CODING_GUIDE
 trunk/matplotlib/doc/api_reference/
 trunk/matplotlib/doc/api_reference/make.py
 trunk/matplotlib/doc/api_reference/source/
 trunk/matplotlib/doc/api_reference/source/_static/
 trunk/matplotlib/doc/api_reference/source/_templates/
 trunk/matplotlib/doc/api_reference/source/conf.py
 trunk/matplotlib/doc/api_reference/source/figures/
 trunk/matplotlib/doc/api_reference/source/figures/make.py
 trunk/matplotlib/doc/api_reference/source/figures/matplotlibrc
 trunk/matplotlib/doc/api_reference/source/index.txt
 trunk/matplotlib/doc/api_reference/source/introduction.txt
 trunk/matplotlib/doc/api_reference/source/latex.txt
 trunk/matplotlib/doc/sphinxext/
 trunk/matplotlib/doc/sphinxext/mathml.py
 trunk/matplotlib/doc/users_guide/
 trunk/matplotlib/doc/users_guide/make.py
 trunk/matplotlib/doc/users_guide/source/
 trunk/matplotlib/doc/users_guide/source/_static/
 trunk/matplotlib/doc/users_guide/source/_templates/
 trunk/matplotlib/doc/users_guide/source/add_new_projection.txt
 trunk/matplotlib/doc/users_guide/source/artist_api_tut.txt
 trunk/matplotlib/doc/users_guide/source/coding_guide.txt
 trunk/matplotlib/doc/users_guide/source/conf.py
 trunk/matplotlib/doc/users_guide/source/developerguide.txt
 trunk/matplotlib/doc/users_guide/source/event_handling_tut.txt
 trunk/matplotlib/doc/users_guide/source/figures/
 trunk/matplotlib/doc/users_guide/source/figures/dollar_ticks.py
 trunk/matplotlib/doc/users_guide/source/figures/fig_axes_customize_simple.py
 trunk/matplotlib/doc/users_guide/source/figures/fig_axes_labels_simple.py
 trunk/matplotlib/doc/users_guide/source/figures/fig_x.py
 trunk/matplotlib/doc/users_guide/source/figures/make.py
 trunk/matplotlib/doc/users_guide/source/figures/matplotlibrc
 trunk/matplotlib/doc/users_guide/source/index.txt
 trunk/matplotlib/doc/users_guide/source/introduction.txt
 trunk/matplotlib/doc/users_guide/source/userguide.txt
Removed Paths:
-------------
 trunk/matplotlib/doc/artist_api_tut.txt
 trunk/matplotlib/doc/devel/
 trunk/matplotlib/doc/event_handling_tut.txt
 trunk/matplotlib/doc/figures/
Added: trunk/matplotlib/doc/CODING_GUIDE
===================================================================
--- trunk/matplotlib/doc/CODING_GUIDE	 (rev 0)
+++ trunk/matplotlib/doc/CODING_GUIDE	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -0,0 +1,317 @@
+***************
+Version Control
+***************
+
+svn checkouts
+=============
+
+Checking out everything in the trunk (matplotlib and toolkits)::
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk \
+ matplotlib --username=youruser --password=yourpass
+
+Checking out the main source::
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/\
+ matplotlib matplotlib --username=youruser --password=yourpass
+
+Branch checkouts, eg the maintenance branch::
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\
+ v0_91_maint mplv0_91_maint
+
+Committing changes
+==================
+
+When committing changes to matplotlib, there are a few things to bear
+in mind.
+
+* if your changes are non-trivial, please make an entry in the
+ CHANGELOG
+* if you change the API, please document it in API_CHANGES, and
+ consider posting to mpl-devel
+* Are your changes python2.3 compatible? We are still trying to
+ support 2.3, so avoid 2.4 only features like decorators until we
+ remove 2.3 support
+* Can you pass examples/backend_driver.py? This is our poor man's
+ unit test.
+* If you have altered extension code, do you pass
+ unit/memleak_hawaii.py?
+* if you have added new files or directories, or reorganized
+ existing ones, are the new files included in the match patterns in
+ MANIFEST.in. This file determines what goes into the src
+ distribution of the mpl build.
+* Keep the maintenance branch and trunk in sync where it makes sense.
+ If there is a bug on both that needs fixing, use svnmerge.py to
+ keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
+ basic procedure is:
+
+ * install svnmerge.py in your PATH::
+
+ 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 -rNNN1,NNN2
+
+ where the NNN* are the revision numbers. Ranges arealso acceptable. 
+ svnmergy.py automatically creates a file containing the commit messages, 
+ so you are ready to make the commit::
+
+ > svn commit -F svnmerge-commit-message.txt
+
+***********
+Style Guide
+***********
+
+Importing and name spaces
+=========================
+
+For numpy, use::
+
+ import numpy as np
+ a = np.array([1,2,3])
+
+For masked arrays, use::
+
+ from numpy import ma
+
+(The earlier recommendation, '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
+ mpl.rcParams['xtick.major.pad'] = 6
+
+For matplotlib modules (or any other modules), use::
+
+ import matplotlib.cbook as cbook
+
+ if cbook.iterable(z):
+ pass
+
+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.
+
+Naming, spacing, and formatting conventions
+===========================================
+
+In general, we want to hew as closely as possible to the standard
+coding guidelines for python written by Guido in
+http://www.python.org/dev/peps/pep-0008, though we do not do this
+throughout.
+
+* functions and class methods: lower or lower_underscore_separated
+
+* attributes and variables: lower or lowerUpper
+
+* classes: Upper or MixedCase
+
+Personally, I 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.
+
+Please avoid spurious invisible spaces at the ends of lines.
+(Tell your editor to strip whitespace from line ends when saving
+a file.)
+
+Keep docstrings uniformly indented as in the example below, with
+nothing to the left of the triple quotes. The dedent() function
+is needed to remove excess indentation only if something will be
+interpolated into the docstring, again as in the example above.
+
+Limit line length to 80 characters. If a logical line needs to be
+longer, use parentheses to break it; do not use an escaped
+newline. It may be preferable to use a temporary variable
+to replace a single 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. If you are an emacs user, the following in your
+.emacs will cause emacs to strip trailing white space on save for
+python, C and C++::
+
+ ; and similarly for c++-mode-hook and c-mode-hook
+ (add-hook 'python-mode-hook
+ (lambda ()
+	 (add-hook 'write-file-functions 'delete-trailing-whitespace)))
+
+for older versions of emacs (emacs<22) you need to do::
+
+ (add-hook 'python-mode-hook
+ (lambda ()
+ (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
+
+Keyword argument processing
+===========================
+
+Matplotlib makes extensive use of ``**kwargs`` for pass through
+customizations from one function to another. A typical example is in
+pylab.text, The definition of the pylab text function is a simple
+pass-through to axes.Axes.text::
+
+ # in pylab.py
+ def text(*args, **kwargs):
+ ret = gca().text(*args, **kwargs)
+ draw_if_interactive()
+ return ret
+
+axes.Axes.text in simplified form looks like this, ie it just passes
+them on to text.Text.__init__::
+
+ # in axes.py
+ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
+ t = Text(x=x, y=y, text=s, **kwargs)
+
+and Text.__init__ (again with liberties for illustration) just passes
+them on to the artist.Artist.update method::
+
+ # in text.py
+ def __init__(self, x=0, y=0, text='', **kwargs):
+ Artist.__init__(self)
+ self.update(kwargs)
+
+'update' does the work looking for methods named like 'set_property'
+if 'property' is a keyword argument. Ie, noone looks at the keywords,
+they just get passed through the API to the artist constructor which
+looks for suitably named methods and calls 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.
+
+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 Axes.plot and assume the rest are
+Line2D keyword arguments. As an example of a pop, passthrough
+usage, see Axes.plot::
+
+ # in axes.py
+ def plot(self, *args, **kwargs):
+ scalex = kwargs.pop('scalex', True)
+ scaley = kwargs.pop('scaley', True)
+ if not self._hold: self.cla()
+ lines = []
+ for line in self._get_lines(*args, **kwargs):
+ self.add_line(line)
+ lines.append(line)
+
+The matplotlib.cbook function popd() is rendered
+obsolete by the 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 numbers of
+non-keyword args. In this case, python will not allow you to use
+named keyword args after the ``*args`` usage, so you will be forced to use
+``**kwargs``. An example is matplotlib.contour.ContourLabeler.clabel::
+
+ # in contour.py
+ def clabel(self, *args, **kwargs):
+ fontsize = kwargs.get('fontsize', None)
+ inline = kwargs.get('inline', 1)
+ self.fmt = kwargs.get('fmt', '%1.3f')
+ colors = kwargs.get('colors', None)
+ if len(args) == 0:
+ levels = self.levels
+ indices = range(len(self.levels))
+ elif len(args) == 1:
+ ...etc...
+
+Documentation and Docstrings
+============================
+
+matplotlib uses artist instrospection 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 Artist
+class. Yes, this is not ideal given python properties or enthought
+traits, but it is a historical legacy for now. The setter methods use
+the docstring with the ACCEPTS token to indicate the type of argument
+the method accepts. Eg in matplotlib.lines.Line2D::
+
+ # in lines.py
+ def set_linestyle(self, linestyle):
+ """
+ Set the linestyle of the line
+ 
+ ACCEPTS: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' | ' ' | '' ]
+ """
+
+Since matplotlib uses a lot of pass through kwargs, eg in every
+function that creates a line (plot, semilogx, 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 function that takes a ``**kwargs``. The
+requirements are:
+
+1. single point of configuration so changes to the properties don't
+ require multiple docstring edits
+
+2. as automated as possible so that as properties change the docs
+ are updated automagically.
+
+I have added a matplotlib.artist.kwdocd and kwdoc() to faciliate this.
+They combines 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 matplotlib.lines::
+
+ # in lines.py
+ artist.kwdocd['Line2D'] = artist.kwdoc(Line2D)
+
+Then in any function accepting Line2D passthrough kwargs, eg
+matplotlib.axes.Axes.plot::
+
+ # in axes.py
+ def plot(self, *args, **kwargs):
+ """
+ Some stuff omitted
+ 
+ The kwargs are Line2D properties:
+ %(Line2D)s
+
+ kwargs scalex and scaley, if defined, are passed on
+ to autoscale_view to determine whether the x and y axes are
+ autoscaled; default True. See Axes.autoscale_view for more
+ information
+ """
+ pass
+ plot.__doc__ = cbook.dedent(plot.__doc__) % artist.kwdocd
+
+Note there is a problem for Artist __init__ methods, eg 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
+
+********
+Licenses
+********
+
+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
+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.
\ No newline at end of file
Added: trunk/matplotlib/doc/api_reference/make.py
===================================================================
--- trunk/matplotlib/doc/api_reference/make.py	 (rev 0)
+++ trunk/matplotlib/doc/api_reference/make.py	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -0,0 +1,68 @@
+#!/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', 
+ 'source/_static', 'source/_templates']
+ for d in build_dirs:
+ try:
+ os.mkdir(d)
+ except OSError:
+ pass
+
+def figs():
+ os.system('cd source/figures/ && python make.py')
+
+def html():
+ check_build()
+ os.system('sphinx-build -b html -d build/doctrees source build/html')
+
+def latex():
+ if sys.platform != 'win32':
+ # LaTeX format.
+ os.system('sphinx-build -b latex -d build/doctrees source build/latex')
+ 
+ # Produce pdf.
+ os.chdir('build/latex')
+ 
+ # Copying the makefile produced by sphinx...
+ os.system('pdflatex Matplotlib_API_Reference.tex')
+ os.system('pdflatex Matplotlib_API_Reference.tex')
+ os.system('makeindex -s python.ist Matplotlib_API_Reference.idx')
+ os.system('makeindex -s python.ist modMatplotlib_API_Reference.idx')
+ os.system('pdflatex Matplotlib_API_Reference.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()
\ No newline at end of file
Property changes on: trunk/matplotlib/doc/api_reference/make.py
___________________________________________________________________
Name: svn:executable
 + *
Name: svn:eol-style
 + native
Added: trunk/matplotlib/doc/api_reference/source/conf.py
===================================================================
--- trunk/matplotlib/doc/api_reference/source/conf.py	 (rev 0)
+++ trunk/matplotlib/doc/api_reference/source/conf.py	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -0,0 +1,155 @@
+# -*- coding: utf-8 -*-
+#
+# Matplotlib 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'))
+
+# 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 = ['mathml', 'sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.txt'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General substitutions.
+project = 'Matplotlib'
+copyright = '2008, John Hunter, Darren Dale'
+
+# The default replacements for |version| and |release|, also used in various
+# other places throughout the built documents.
+#
+# The short X.Y version.
+version = '0.98'
+# The full version, including alpha/beta/rc tags.
+release = '0.98pre'
+
+# 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 = 'default.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 = None
+
+# 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 = '.xml'
+
+# 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 = 'Matplotlib_API_doc'
+
+
+# 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', 'Matplotlib_API_Reference.tex', 'Matplotlib API Reference', 'John Hunter, Darren Dale', '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
Property changes on: trunk/matplotlib/doc/api_reference/source/conf.py
___________________________________________________________________
Name: svn:eol-style
 + native
Added: trunk/matplotlib/doc/api_reference/source/figures/make.py
===================================================================
--- trunk/matplotlib/doc/api_reference/source/figures/make.py	 (rev 0)
+++ trunk/matplotlib/doc/api_reference/source/figures/make.py	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -0,0 +1,44 @@
+#!/usr/bin/env python
+import sys, os, glob
+import matplotlib
+matplotlib.rcdefaults()
+matplotlib.use('Agg')
+
+def figs():
+ # each one of these will make a figure when imported
+ # ...
+
+ print 'all figures made'
+ for fname in glob.glob('*.pyc'):
+ os.remove(fname)
+
+def clean():
+ patterns = ['#*', '*~', '*.png']
+ for pattern in patterns:
+ for fname in glob.glob(pattern):
+ os.remove(fname)
+ print 'all clean'
+
+
+
+def all():
+ figs()
+
+funcd = {'figs':figs,
+ '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/matplotlib/doc/api_reference/source/figures/make.py
___________________________________________________________________
Name: svn:executable
 + *
Name: svn:eol-style
 + native
Added: trunk/matplotlib/doc/api_reference/source/figures/matplotlibrc
===================================================================
Added: trunk/matplotlib/doc/api_reference/source/index.txt
===================================================================
--- trunk/matplotlib/doc/api_reference/source/index.txt	 (rev 0)
+++ trunk/matplotlib/doc/api_reference/source/index.txt	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -0,0 +1,14 @@
+.. Matplotlib documentation master file.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+.. _contents:
+
+Matplotlib API Reference
+========================
+
+.. toctree::
+ :maxdepth: 4
+
+ introduction
+ latex
Property changes on: trunk/matplotlib/doc/api_reference/source/index.txt
___________________________________________________________________
Name: svn:eol-style
 + CRLF
Added: trunk/matplotlib/doc/api_reference/source/introduction.txt
===================================================================
--- trunk/matplotlib/doc/api_reference/source/introduction.txt	 (rev 0)
+++ trunk/matplotlib/doc/api_reference/source/introduction.txt	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -0,0 +1,4 @@
+************
+Introduction
+************
+
Property changes on: trunk/matplotlib/doc/api_reference/source/introduction.txt
___________________________________________________________________
Name: svn:eol-style
 + CRLF
Added: trunk/matplotlib/doc/api_reference/source/latex.txt
===================================================================
--- trunk/matplotlib/doc/api_reference/source/latex.txt	 (rev 0)
+++ trunk/matplotlib/doc/api_reference/source/latex.txt	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -0,0 +1,25 @@
+############################################
+Matplotlib Application Programming Interface
+############################################
+
+*************
+LaTeX Support
+*************
+
+:mod:`matplotlib.texmanager`
+=============================
+
+.. automodule:: matplotlib.texmanager
+ :members:
+
+:mod:`matplotlib.dviread`
+=============================
+
+.. automodule:: matplotlib.dviread
+ :members:
+
+:mod:`matplotlib.axes`
+=============================
+
+.. autoclass:: matplotlib.axes.Axes
+ :members: plot
\ No newline at end of file
Property changes on: trunk/matplotlib/doc/api_reference/source/latex.txt
___________________________________________________________________
Name: svn:eol-style
 + CRLF
Deleted: trunk/matplotlib/doc/artist_api_tut.txt
===================================================================
--- trunk/matplotlib/doc/artist_api_tut.txt	2008年05月22日 18:16:43 UTC (rev 5216)
+++ trunk/matplotlib/doc/artist_api_tut.txt	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -1,597 +0,0 @@
-The matplotlib Artist API tutorial
-==================================
-
-There are three layers to the matplotlib API. The FigureCanvas is the
-area onto which the figure is drawn, the Renderer is the object which
-knows how to draw on the FigureCanvas, and the Artist is the object
-that knows how to use a renderer to paint onto the canvas. The
-FigureCanvas and Renderer handle all the details of talking to user
-interface toolkits like wxpython or drawing languages like postscript,
-and the Artist handles all the high level constructs like
-representing and laying out the figure, text, and lines. The typical
-user will spend 95% of his time working with the Artists.
-
-There are two types Artists: primitives and containers. The
-primitives represent the standard graphical objects we want to paint
-onto our canvas: Line2D, Rectangle, Text, AxesImage, etc, and the
-containers are places to put them (Axis, Axes and Figure). The
-standard use is to create a Figure instance, use the Figure to create
-one or more Axes or Subplot instances, and use the Axes instance
-helper methods to create the primitives. In the example below, we
-create a Figure instance using pyplot.figure, which is a convenience
-method for instantiating Figure instances and connecting them with
-your user interface or drawing toolkit FigureCanvas. As we will
-discuss below, this is not necessary, and you can work directly with
-postscript, pdf gtk, or wxpython FigureCanvas es, instantiate your
-Figures directly and connect them yourselves, but since we are
-focusing here on the Artist API we'll let pyplot handle some of those
-details for us::
-
- import matplotlib.pyplot as plt
- fig = plt.figure()
- ax = fig.add_subplot(2,1,1) # two rows, one column, first plot
-
-The Axes is probably the most important class in the matplotlib API,
-and the one you will be working with most of the time. This is
-because the Axes is the plotting area into which most of the objects
-go, and the Axes has many special helper methods (ax.plot, ax.text,
-ax.hist, ax.imshow) to create the most common graphics primitives
-(Line2D, Text, Rectangle, Image, respectively). These helper methods
-will take your data (eg numpy arrays and strings) create primitive
-Artist instances as needed (eg Line2D), add them to the relevant
-containers, and draw them when requested. Most of you are probably
-familiar with the Subplot, which is just a special case of an Axes
-that lives on a regular rows by columns grid of Subplot instances. If
-you want to create an Axes at an arbitrary location, simply use the
-add_axes method which takes a list of [left, bottom, width, height]
-values in 0-1 relative figure coordinates::
-
- ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3])
-
-Continuing with our example::
-
- import numpy as np
- t = np.arange(0.0, 1.0, 0.01)
- s = np.sin(2*np.pi*t)
- line, = ax1.plot(t, s, color='blue', lw=2)
-
-In this example, ax is the Axes instance created by the
-fig.add_subplot call above (remember Subplot is just a subclass of
-Axes) and when you call ax.plot, it creates a Line2D instance and adds
-it the the Axes.lines list. In the interactive ipython session below,
-you can see that Axes.lines list is length one and contains the same
-line that was returned by the "line, ax.plot(x, y, 'o')" call::
-
- In [101]: ax.lines[0]
- Out[101]: <matplotlib.lines.Line2D instance at 0x19a95710>
-
- In [102]: line
- Out[102]: <matplotlib.lines.Line2D instance at 0x19a95710>
-
-If you make subsequent calls to ax.plot (and the hold state is "on"
-which is the default) then additional lines will be added to the list.
-You can remove lines later simply by calling the list methods; either
-of these will work::
-
- del ax.lines[0]
- ax.lines.remove(line) # one or the other, not both!
-
-The Axes also has helper methods to configure and decorate the xaxis
-and yaxis tick, ticklabels and axis labels::
-
- xtext = ax.set_xlabel('my xdata') # returns a Text instance
- ytext = ax.set_ylabel('my xdata')
-
-When you call ax.set_xlabel, it passes the information on the Text
-instance of the XAxis. Each Axes instance contains an xaxis and a
-yaxis instance, which handle the layout and drawing of the ticks, tick
-labels and axis labels.
-
-Here are the most important matplotlib modules that contain the
-classes referenced above
-
-=============== ==================
-Artist Module
-=============== ==================
-Artist matplotlib.artist
-Rectangle matplotlib.patches
-Line2D matplotlib.lines
-Axes matplotlib.axes
-XAxis and YAxis matplotlib.axis
-Figure matplotlib.figure
-Text	 matplotlib.text
-=============== ==================
-
-Try creating the figure below
-
-.. image:: figures/fig_axes_labels_simple.png
- :scale: 75
-
-Customizing your objects
-========================
-
-Every element in the figure is represented by a matplotlib Artist, and
-each has an extensive list of properties to configure its appearance.
-The figure itself contains a Rectangle exactly the size of the figure,
-which you can use to set the background color and transparency of the
-figures. Likewise, each Axes bounding box (the standard white box
-with black edges in the typical matplotlib plot, has a Rectangle
-instance that determines the color, transparency, and other properties
-of the Axes. These instances are stored as member variables
-Figure.figurePatch and Axes.axesPatch ("Patch" is a name inherited
-from Matlab, and is a 2D "patch" of color on the figure, eg
-rectangles, circles and polygons). Every matplotlib Artist has the
-following properties
-
-========== ======================================================================
-Property Description
-========== ======================================================================
-alpha 	 The transparency - a scalar from 0-1
-animated A boolean that is used to facilitate animated drawing
-axes The axes that the Artist lives in, possibly None
-clip_box The bounding box that clips the Artist
-clip_on Whether clipping is enabled
-clip_path The path the artist is clipped to
-contains A picking function to test whether the artist contains the pick point
-figure The figure instance the aritst lives in, possibly None
-label A text label (eg for auto-labeling)
-picker A python object that controls object picking
-transform The transformation
-visible A boolean whether the artist should be drawn
-zorder A number which determines the drawing order
-========== ======================================================================
-
-Each of the properties is accessed with an old-fashioned setter or
-getter (yes we know this irritates pythonistas and we plan to support
-direct access via properties or traits but it hasn't been done yet).
-For example, to multiply the current alpha by a half::
-
- a = o.get_alpha()
- o.set_alpha(0.5*a)
-
-If you want to set a number of properties at once, you can also use
-the "set" method with keyword arguments. For example::
-
- o.set(alpha=0.5, zorder=2)
-
-If you are working interactively at the python shell, a handy way to
-inspect the artist properties is to use the matplotlib.artist.getp
-method, which lists the properties and their values (simply "getp") in
-pylab. This works for classes derived from Artist as well, eg Figure
-and Rectangle. Here are the Figure rectangle properties mentioned above::
-
-
- In [149]: matplotlib.artist.getp(fig.figurePatch)
-	alpha = 1.0
-	animated = False
-	antialiased or aa = True
-	axes = None
-	clip_box = None
-	clip_on = False
-	clip_path = None
-	contains = None
-	edgecolor or ec = w
-	facecolor or fc = 0.75
-	figure = Figure(8.125x6.125)
-	fill = 1
-	hatch = None
-	height = 1
-	label =
-	linewidth or lw = 1.0
-	picker = None
-	transform = <Affine object at 0x134cca84>
-	verts = ((0, 0), (0, 1), (1, 1), (1, 0))
-	visible = True
-	width = 1
-	window_extent = <Bbox object at 0x134acbcc>
-	x = 0
-	y = 0
-	zorder = 1
-
-The docstrings for all of the classes also contain the artist
-properties, so you can consult the interactive "help", the online html
-docs at http://matplotlib.sourceforge.net/classdocs.html or PDF documentation
-at http://matplotlib.sourceforge.net/api.pdf for a listing of
-properties for a give object.
-
-Getting at the objects to customize them
-========================================
-
-Now that we know how to inspect set the properties of a given
-object we want to configure, we need to now how to get at that
-object. As mentioned in the introduction, there are two kinds of
-objects: primitives and containers. The primitives are usually the
-things you want to configure (the font of a Text instance, the width
-of a Line2D) although the containers also have some properties as
-well -- for example the Axes Artist is a container that contains many
-of the primitives in your plot, but it also has properties like the
-xscale to control whether the xaxis is 'linear' or 'log'. In this
-section we'll review where the various container objects store the
-Artists that you want to get at.
-
-The Figure container
---------------------
-
-The top level container Artist is the matplotlib.figure.Figure, and it
-contains everything in the figure. The background of the figure is a
-Rectangle which is stored in fig.figurePatch (where fig is your Figure
-instance). As you add subplots (fig.add_subplot) and axes
-(ax.add_axes)to the figure these will be appended to the fig.axes
-list. These are also returned by the methods that create them::
-
- In [156]: fig = plt.figure()
-
- In [157]: ax1 = fig.add_subplot(211)
-
- In [158]: ax2 = fig.add_axes([0.1, 0.1, 0.7, 0.3])
-
- In [159]: ax1
- Out[159]: <matplotlib.axes.Subplot instance at 0xd54b26c>
-
- In [160]: print fig.axes
- [<matplotlib.axes.Subplot instance at 0xd54b26c>, <matplotlib.axes.Axes instance at 0xd3f0b2c>]
-
-
-Because the figure maintains the concept of the "current axes" (see
-Figure.gca and Figure.sca) to support the pylab/pyplot state machine,
-you should not insert or remove axes directly from the axes list, but
-rather use the Figure.add_axes and Figure.add_subplot method to
-insert, and the Figure.delaxes methods to delete. You are free
-however, to iterate over the list of axes or index into it to get
-access to Axes instances you want to customize. Here is an example
-which turns all the axes grids on::
-
- for ax in fig.axes:
- ax.grid(True)
-
-
-The figure also has its own text, lines, patches and images, which you
-can use to add primitives directly. The default coordinate system for
-the Figure will simply be in pixels (which is not usually what you
-want) but you can control this by setting the transform property of
-the Artist you are adding to the figure. More useful is "figure
-coordinates" where 0,0 is the bottom, left of the figure and 1,1 is
-the top, right of the figure which you can obtain by setting the
-Artist transform to fig.transFigure::
-
- In [191]: fig = plt.figure()
-
- In [192]: l1 = matplotlib.lines.Line2D([0, 1], [0, 1], transform=fig.transFigure, figure=fig)
-
- In [193]: l2 = matplotlib.lines.Line2D([0, 1], [1, 0], transform=fig.transFigure, figure=fig)
-
- In [194]: fig.lines.extend([l1, l2])
-
- In [195]: fig.canvas.draw()
-
-.. image:: figures/fig_x.png
- :scale: 75
-
-
-Here is a summary of the Artists the figure contains
-
-================ ===============================================================
-Figure attribute Description
-================ ===============================================================
-axes A list of Axes instances (includes Subplot)
-figurePatch The Rectangle background
-images A list of FigureImages patches - useful for raw pixel display
-legends A list of Figure Legend instances (different from Axes.legends)
-lines A list of Figure Line2D instances (rarely used, see Axes.lines)
-patches A list of Figure patches (rarely used, see Axes.patches)
-texts A list Figure Text instances
-================ ===============================================================
-
-
-The Axes container
-------------------
-
-The matplotlib.axes.Axes is the center of the matplotlib universe --
-it contains the vast majority of all the Artists used in a figure with
-many helper methods to create and these Artists to itself, as well as
-helper methods to access and customize the Artists it contains. Like
-the Figure, it contains a Patch ax.axesPatch which is Rectangle for
-Cartesian coordinates and a Circle for polar coordinates; this patch
-determines the shape, background and border of the plotting region::
-
- ax = fig.add_subplot(111)
- rect = ax.axesPatch # a Rectangle instance
- rect.set_facecolor('green')
-
-When you call a plotting method, eg the canonical "ax.plot" and pass
-in arrays or list of values, the method will a matplotlib.lines.Line2D
-instance, update the line with all the Line2D properties passed as
-keyword arguments, add the line to the Axes.lines container, and
-returns it to you::
-
- In [213]: x, y = np.random.rand(2, 100)
-
- In [214]: line, = ax.plot(x, y, '-', color='blue', linewidth=2)
-
-ax.plot returns a list of lines because you can pass in multiple x, y
-pairs to plot, and we are unpacking the first element of the length
-one list into the line variable. The line has been added to the
-ax.lines list::
-
-
- In [229]: print ax.lines
- [<matplotlib.lines.Line2D instance at 0xd378b0c>]
-
-Similarly, methods that create patches, like ax.bar creates a list of
-rectangles, will add the patches to the ax.patches list::
-
- In [233]: n, bins, rectangles = ax.hist(np.random.randn(1000), 50, facecolor='yellow')
-
- In [234]: rectangles
- Out[234]: <a list of 50 Patch objects>
-
- In [235]: print len(ax.patches)
-
-You should not add objects directly to the ax.lines or ax.patches
-unless you know exactly what you are doing, because the Axes needs to
-do a few things when it creates and adds an object. It sets the figure
-and axes property of the Artist, as well as the default Axes
-transformation (unless a transformation is set). It also inspects the
-data contained in the Artist to update the data structures controlling
-auto-scaling, so that the view limits can be adjusted to contain the
-plotted data. You can, nonetheless, create objects yourself and add
-them directly to the Axes using helper methods like ax.add_line and
-ax.add_patch. Here is an annotated interactive session illustrating
-what is going on::
-
- In [261]: fig = plt.figure()
-
- In [262]: ax = fig.add_subplot(111)
-
- # create a rectangle instance
- In [263]: rect = matplotlib.patches.Rectangle( (1,1), width=5, height=12)
-
- # by default the axes instance is None
- In [264]: print rect.get_axes()
- None
-
- # and the transformation instance is set to the "identity transform"
- In [265]: print rect.get_transform()
- <Affine object at 0x13695544>
-
- # now we add the Rectangle to the Axes
- In [266]: ax.add_patch(rect)
-
- # and notice that the ax.add_patch method has set the axes
- # instance
- In [267]: print rect.get_axes()
- Subplot(49,81.25)
-
- # and the transformation has been set too
- In [268]: print rect.get_transform()
- <Affine object at 0x15009ca4>
-
- # the default axes transformation is ax.transData
- In [269]: print ax.transData
- <Affine object at 0x15009ca4>
-
- # notice that the xlimits of the Axes have not been changed
- In [270]: print ax.get_xlim()
- (0.0, 1.0)
-
- # but the data limits have been updated to encompass the rectangle
- In [271]: print ax.dataLim.get_bounds()
- (1.0, 1.0, 5.0, 12.0)
-
- # we can manually invoke the auto-scaling machinery
- In [272]: ax.autoscale_view()
-
- # and now the xlim are updated to encompass the rectangle
- In [273]: print ax.get_xlim()
- (1.0, 6.0)
-
- # we have to manually force a figure draw
- In [274]: ax.figure.canvas.draw()
-
-
-There are many, many Axes helper methods for creating primitive
-Artists and adding them to their respective containers. The table
-below summarizes a small sampling of them, the kinds of Artist they
-create, and where they store them
-
-============================== ==================== =======================
-Helper method Artist Container
-============================== ==================== =======================
-ax.annotate - text annotations Annotate ax.texts
-ax.bar - bar charts Rectangle ax.patches
-ax.errorbar - error bar plots Line2D and Rectangle ax.lines and ax.patches
-ax.fill - shared area Polygon ax.patches
-ax.hist - histograms Rectangle ax.patches
-ax.imshow - image data AxesImage ax.images
-ax.legend - axes legends Legend ax.legends
-ax.plot - xy plots Line2D ax.lines
-ax.scatter - scatter charts PolygonCollection ax.collections
-ax.text - text Text ax.texts
-============================== ==================== =======================
-
-
-In addition to all of these Artists, the Axes contains two important
-Artist containers: the XAxis and YAxis, which handle the drawing of
-the ticks and labels. These are stored as instance variables xaxis
-and yaxis. The XAxis and YAxis containers will be detailed below, but
-note that the Axes contains many helper methods which forward calls on
-to the Axis instances so you often do not need to work with them
-directly unless you want to. For example, you can set the fontsize of
-the XAxis ticklabels using the Axes helper method::
-
- for label in ax.get_xticklabels():
- label.set_color('orange')
-
-Below is a summary of the Artists that the Axes contains
-
-============== ======================================
-Axes attribute Description
-============== ======================================
-artists A list of Artist instances
-axesPatch Rectangle instance for Axes background
-collections A list of Collection instances
-images A list of AxesImage
-legends A list of Legend instances
-lines A list of Line2D instances
-patches A list of Patch instances
-texts A list of Text instances
-xaxis matplotlib.axis.XAxis instance
-yaxis matplotlib.axis.YAxis instance
-============== ======================================
-
-The Axis containers
--------------------
-
-The matplotlib.axis.Axis instances handle the drawing of the tick lines, the grid
-lines, the tick labels and the axis label. You can configure the left
-and right ticks separately for the y axis, and the upper and lower
-ticks separately for the x axis. The axis also stores the data and view
-intervals used in auto-scaling, panning and zooming, as well as the
-locator and formatter instances which control where the ticks are
-placed and how they are represented as strings.
-
-Each axis object contains a label attribute (this is what the pylab
-calls to xlabel and ylabel set) as well as a list of major and minor
-ticks. The ticks are XTick and YTick instances, which contain the
-actual line and text primitives that render the ticks and ticklabels.
-Because the ticks are dynamically created as needed (eg when panning
-and zooming), you should access the lists of major and minor ticks
-through their accessor methods axis.get_major_ticks() and
-axis.get_minor_ticks(). Although the ticks contain all the primitives
-and will be covered below, the Axis methods contain accessor methods
-to return the tick lines, tick labels, tick locations etc....::
-
- In [285]: axis = ax.xaxis
-
- In [286]: axis.get_ticklocs()
- Out[286]: array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
-
- In [287]: axis.get_ticklabels()
- Out[287]: <a list of 10 Text major ticklabel objects>
-
- # note there are twice as many ticklines as labels because by
- # default there are tick lines at the top and bottom but only tick
- # labels below the xaxis; this can be customized
- In [288]: axis.get_ticklines()
- Out[288]: <a list of 20 Line2D ticklines objects>
-
- # by default you get the major ticks back
- In [291]: axis.get_ticklines()
- Out[291]: <a list of 20 Line2D ticklines objects>
-
- # but you can also ask for the minor ticks
- In [292]: axis.get_ticklines(minor=True)
- Out[292]: <a list of 0 Line2D ticklines objects>
-
-Here is a summary of some of the useful accessor methods of the Axis
-(these have corresponding setters where useful, such as
-set_major_formatter)
-
-====================== =========================================================
-Accessor method Description
-====================== =========================================================
-get_scale The scale of the axis, eg 'log' or 'linear'
-get_view_interval The interval instance of the axis view limits
-get_data_interval The interval instance of the axis data limits
-get_gridlines A list of grid lines for the Axis
-get_label The axis label - a Text instance
-get_ticklabels A list of Text instances - keyword minor=True|False
-get_ticklines A list of Line2D instances - keyword minor=True|False
-get_ticklocs A list of Tick locations - keyword minor=True|False
-get_major_locator The matplotlib.ticker.Locator instance for major ticks
-get_major_formatter The matplotlib.ticker.Formatter instance for major ticks
-get_minor_locator The matplotlib.ticker.Locator instance for minor ticks
-get_minor_formatter The matplotlib.ticker.Formatter instance for minor ticks
-get_major_ticks A list of Tick instances for major ticks
-get_minor_ticks A list of Tick instances for minor ticks
-grid Turn the grid on or off for the major or minor ticks
-====================== =========================================================
-
-Try creating the figure below
-
-.. image:: figures/fig_axes_customize_simple.png
- :scale: 75
-
-Exercise solution::
-
- import numpy as np
- import matplotlib.pyplot as plt
-
- # plt.figure creates a matplotlib.figure.Figure instance
- fig = plt.figure()
- rect = fig.figurePatch # a rectangle instance
- rect.set_facecolor('lightgoldenrodyellow')
-
- ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4])
- rect = ax1.axesPatch
- rect.set_facecolor('lightslategray')
-
-
- for label in ax1.xaxis.get_ticklabels():
- # label is a Text instance
- label.set_color('red')
- label.set_rotation(45)
- label.set_fontsize(16)
-
- for line in ax1.yaxis.get_ticklines():
- # line is a Line2D instance
- line.set_color('green')
- line.set_markersize(25)
- line.set_markeredgewidth(3)
-
- fig.savefig('figures/fig_axes_customize_simple.png', dpi=150)
- fig.savefig('figures/fig_axes_customize_simple.eps')
- plt.show()
-
-
-
-The Tick containers
--------------------
-
-The matplotlib.axis.Tick is the final container object in our descent
-from the Figure to the Axes to the Axis to the Tick. The Tick
-contains the tick and grid line instances, as well as the label
-instances for the upper and lower ticks. Each of these is accessible
-directly as an attribute of the Tick. In addition, there are boolean
-variables that determine whether the upper labels and ticks are on for
-the xaxis and whether the right labels and ticks are on for the yaxis.
-
-============== ==========================================================
-Tick attribute Description
-============== ==========================================================
-tick1line Line2D instance
-tick2line Line2D instance
-gridline Line2D instance
-label1 Text instance
-label2 Text instance
-gridOn boolean which determines whether to draw the tickline
-tick1On boolean which determines whether to draw the 1st tickline
-tick2On boolean which determines whether to draw the 2nd tickline
-label1On boolean which determines whether to draw tick label
-label2On boolean which determines whether to draw tick label
-============== ==========================================================
-
-Here is an example which sets the formatter for the upper ticks with
-dollar signs and colors them green on the right side of the yaxis::
-
- import numpy as np
- import matplotlib.pyplot as plt
- import matplotlib.ticker as ticker
-
- fig = plt.figure()
- ax = fig.add_subplot(111)
- ax.plot(100*np.random.rand(20))
-
- formatter = ticker.FormatStrFormatter('$%1.2f')
- ax.yaxis.set_major_formatter(formatter)
-
- for tick in ax.yaxis.get_major_ticks():
- tick.label1On = False
- tick.label2On = True
- tick.label2.set_color('green')
-
- plt.show()
-
-
-.. image:: figures/dollar_ticks.png
- :scale: 75
Deleted: trunk/matplotlib/doc/event_handling_tut.txt
===================================================================
--- trunk/matplotlib/doc/event_handling_tut.txt	2008年05月22日 18:16:43 UTC (rev 5216)
+++ trunk/matplotlib/doc/event_handling_tut.txt	2008年05月22日 19:58:22 UTC (rev 5217)
@@ -1,470 +0,0 @@
-Event Handling and Picking Tutorial
-===================================
-
-matplotlib works with 5 user interface toolkits (wxpython, tkinter,
-qt, gtk and fltk) and in order to support features like interactive
-panning and zooming of figures, it is helpful to the developers to
-have an API for interacting with the figure via key presses and mouse
-movements that is "GUI neutral" so we don't have to repeat a lot of
-code across the different user interfaces. Although the event
-handling API is GUI neutral, it is based on the GTK model, which was
-the first user interface matplotlib supported. The events that are
-triggered are also a bit richer vis-a-vis matplotlib than standard GUI
-events, including information like which Axes the event occurred in.
-The events also understand the matplotlib coordinate system, and
-report event locations in both pixel and data coordinates.
-
-
-Event connections
-=================
-
-To receive events, you need to write a callback function and then
-connect your function to the event manager, which is part of the
-FigureCanvas. Here is a simple example that prints the location of
-the mouse click and which button was pressed::
-
- fig = plt.figure()
- ax = fig.add_subplot(111)
- ax.plot(np.random.rand(10))
-
- def onclick(event):
- print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f'%(
- event.button, event.x, event.y, event.xdata, event.ydata)
-
- cid = fig.canvas.mpl_connect('button_press_event', onclick)
-
-The FigureCanvas method mpl_connect returns a connection id which is
-simply an integer. When you want to disconnect the callback, just
-call::
-
- fig.canvas.mpl_disconnect(cid)
-
-Here are the events that you can connect to, the class instances that
-are sent back to you when the event occurs, and the event descriptions
-
-
-===================== =========== ===================================
-Event name Class Description
-===================== =========== ===================================
-button_press_event MouseEvent mouse button is pressed
-button_release_event MouseEvent mouse button is released
-draw_event DrawEvent canvas draw
-key_press_event KeyEvent key is pressed
-key_release_event KeyEvent key is released
-motion_notify_event MouseEvent mouse motion
-pick_event PickEvent an object in the canvas is selected
-resize_event ResizeEvent figure canvas is resized
-scroll_event MouseEvent mouse scroll wheel is rolled
-===================== =========== ===================================
-
-
-Event attributes
-================
-
-All matplotlib events inherit from the base class
-matplotlib.backend_bases.Event, which store the attributes
-
-=============== =================================================
-Event attribute Description
-=============== =================================================
-name the event name
-canvas the FigureCanvas instance generating the event
-guiEvent the GUI event that triggered the matplotlib event
-=============== =================================================
-
-The most common events that are the bread and butter of event handling
-are key press/release events and mouse press/release and movement
-events. The KeyEvent and MouseEvent classes that handle these events
-are both derived from the LocationEvent, which has the following
-attributes
-
-======================= ========================================
-LocationEvent attribute Description
-======================= ========================================
-x x position - pixels from left of canvas
-y y position - pixels from right of canvas
-button button pressed None, 1, 2, 3
-inaxes the Axes instance if mouse us over axes
-xdata x coord of mouse in data coords
-ydata y coord of mouse in data coords
-======================= ========================================
-
-Let's look a simple example of a canvas, where a simple line segment
-is created every time a mouse is pressed::
-
- class LineBuilder:
- def __init__(self, line):
- self.line = line
- self.xs = list(line.get_xdata())
- self.ys = list(line.get_ydata())
- self.cid = line.figure.canvas.mpl_connect('button_press_event', self)
-
- def __call__(self, event):
- print 'click', event
- if event.inaxes!=self.line.axes: return
- self.xs.append(event.xdata)
- self.ys.append(event.ydata)
- self.line.set_data(self.xs, self.ys)
- self.line.figure.canvas.draw()
-
- fig = plt.figure()
- ax = fig.add_subplot(111)
- ax.set_title('click to build line segments')
- line, = ax.plot([0], [0]) # empty line
- linebuilder = LineBuilder(line)
-
-
-
-The MouseEvent that we just used is a LocationEvent, so we have access
-to the data and pixel coordinates in event.x and event.xdata. In
-addition to the LocationEvent attributes, it has
-
-==================== ==============================================================
-MouseEvent attribute Description
-==================== ==============================================================
-button button pressed None, 1, 2, 3
-key the key pressed: None, chr(range(255)), shift, win, or control
-==================== ==============================================================
-
-Draggable Rectangle Exercise
-----------------------------
-
-Write draggable rectangle class that is initialized with a Rectangle
-instance but will move its x,y location when dragged. Hint: you will
-need to store the orginal xy location of the rectangle which is stored
-as rect.xy and connect to the press, motion and release mouse events.
-When the mouse is pressed, check to see if the click occurs over your
-rectangle (see rect.contains) and if it does, store the rectangle xy
-and the location of the mouse click in data coords. In the motion
-event callback, compute the deltax and deltay of the mouse movement,
-and add those deltas to the origin of the rectangle you stored. The
-redraw the figure. On the button release event, just reset all the
-button press data you stored as None.
-
-Here is the solution::
-
- import numpy as np
- import matplotlib.pyplot as plt
-
- class DraggableRectangle:
- def __init__(self, rect):
- self.rect = rect
- self.press = None
-
- def connect(self):
- 'connect to all the events we need'
- self.cidpress = self.rect.figure.canvas.mpl_connect(
- 'button_press_event', self.on_press)
- self.cidrelease = self.rect.figure.canvas.mpl_connect(
- 'button_release_event', self.on_release)
- self.cidmotion = self.rect.figure.canvas.mpl_connect(
- 'motion_notify_event', self.on_motion)
-
- def on_press(self, event):
- 'on button press we will see if the mouse is over us and store some data'
- if event.inaxes != self.rect.axes: return
-
- contains, attrd = self.rect.contains(event)
- if not contains: return
- print 'event contains', self.rect.xy
- x0, y0 = self.rect.xy
- self.press = x0, y0, event.xdata, event.ydata
-
- def on_motion(self, event):
- 'on motion we will move the rect if the mouse is over us'
- if self.press is None: return
- if event.inaxes != self.rect.axes: return
- x0, y0, xpress, ypress = self.press
- dx = event.xdata - xpress
- dy = event.ydata - ypress
- #print 'x0=%f, xpress=%f, event.xdata=%f, dx=%f, x0+dx=%f'%(x0, xpress, event.xdata, dx, x0+dx)
- self.rect.set_x(x0+dx)
- self.rect.set_y(y0+dy)
-
- self.rect.figure.canvas.draw()
-
-
- def on_release(self, event):
- 'on release we reset the press data'
- self.press = None
- self.rect.figure.canvas.draw()
-
- ...
 
[truncated message content]
From: <ds...@us...> - 2008年05月23日 14:37:59
Revision: 5226
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5226&view=rev
Author: dsdale
Date: 2008年05月23日 07:37:51 -0700 (2008年5月23日)
Log Message:
-----------
use mathpng extension rather than mathml
generate html rather than xml
Modified Paths:
--------------
 trunk/matplotlib/doc/api_reference/conf.py
 trunk/matplotlib/doc/api_reference/make.py
 trunk/matplotlib/doc/users_guide/coding_guide.txt
 trunk/matplotlib/doc/users_guide/conf.py
Added Paths:
-----------
 trunk/matplotlib/doc/sphinxext/mathpng.py
Removed Paths:
-------------
 trunk/matplotlib/doc/CODING_GUIDE
Deleted: trunk/matplotlib/doc/CODING_GUIDE
===================================================================
--- trunk/matplotlib/doc/CODING_GUIDE	2008年05月23日 14:13:16 UTC (rev 5225)
+++ trunk/matplotlib/doc/CODING_GUIDE	2008年05月23日 14:37:51 UTC (rev 5226)
@@ -1,317 +0,0 @@
-***************
-Version Control
-***************
-
-svn checkouts
-=============
-
-Checking out everything in the trunk (matplotlib and toolkits)::
-
- svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk \
- matplotlib --username=youruser --password=yourpass
-
-Checking out the main source::
-
- svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/\
- matplotlib matplotlib --username=youruser --password=yourpass
-
-Branch checkouts, eg the maintenance branch::
-
- svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\
- v0_91_maint mplv0_91_maint
-
-Committing changes
-==================
-
-When committing changes to matplotlib, there are a few things to bear
-in mind.
-
-* if your changes are non-trivial, please make an entry in the
- CHANGELOG
-* if you change the API, please document it in API_CHANGES, and
- consider posting to mpl-devel
-* Are your changes python2.3 compatible? We are still trying to
- support 2.3, so avoid 2.4 only features like decorators until we
- remove 2.3 support
-* Can you pass examples/backend_driver.py? This is our poor man's
- unit test.
-* If you have altered extension code, do you pass
- unit/memleak_hawaii.py?
-* if you have added new files or directories, or reorganized
- existing ones, are the new files included in the match patterns in
- MANIFEST.in. This file determines what goes into the src
- distribution of the mpl build.
-* Keep the maintenance branch and trunk in sync where it makes sense.
- If there is a bug on both that needs fixing, use svnmerge.py to
- keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
- basic procedure is:
-
- * install svnmerge.py in your PATH::
-
- 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 -rNNN1,NNN2
-
- where the NNN* are the revision numbers. Ranges arealso acceptable. 
- svnmergy.py automatically creates a file containing the commit messages, 
- so you are ready to make the commit::
-
- > svn commit -F svnmerge-commit-message.txt
-
-***********
-Style Guide
-***********
-
-Importing and name spaces
-=========================
-
-For numpy, use::
-
- import numpy as np
- a = np.array([1,2,3])
-
-For masked arrays, use::
-
- from numpy import ma
-
-(The earlier recommendation, '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
- mpl.rcParams['xtick.major.pad'] = 6
-
-For matplotlib modules (or any other modules), use::
-
- import matplotlib.cbook as cbook
-
- if cbook.iterable(z):
- pass
-
-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.
-
-Naming, spacing, and formatting conventions
-===========================================
-
-In general, we want to hew as closely as possible to the standard
-coding guidelines for python written by Guido in
-http://www.python.org/dev/peps/pep-0008, though we do not do this
-throughout.
-
-* functions and class methods: lower or lower_underscore_separated
-
-* attributes and variables: lower or lowerUpper
-
-* classes: Upper or MixedCase
-
-Personally, I 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.
-
-Please avoid spurious invisible spaces at the ends of lines.
-(Tell your editor to strip whitespace from line ends when saving
-a file.)
-
-Keep docstrings uniformly indented as in the example below, with
-nothing to the left of the triple quotes. The dedent() function
-is needed to remove excess indentation only if something will be
-interpolated into the docstring, again as in the example above.
-
-Limit line length to 80 characters. If a logical line needs to be
-longer, use parentheses to break it; do not use an escaped
-newline. It may be preferable to use a temporary variable
-to replace a single 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. If you are an emacs user, the following in your
-.emacs will cause emacs to strip trailing white space on save for
-python, C and C++::
-
- ; and similarly for c++-mode-hook and c-mode-hook
- (add-hook 'python-mode-hook
- (lambda ()
-	 (add-hook 'write-file-functions 'delete-trailing-whitespace)))
-
-for older versions of emacs (emacs<22) you need to do::
-
- (add-hook 'python-mode-hook
- (lambda ()
- (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
-
-Keyword argument processing
-===========================
-
-Matplotlib makes extensive use of ``**kwargs`` for pass through
-customizations from one function to another. A typical example is in
-pylab.text, The definition of the pylab text function is a simple
-pass-through to axes.Axes.text::
-
- # in pylab.py
- def text(*args, **kwargs):
- ret = gca().text(*args, **kwargs)
- draw_if_interactive()
- return ret
-
-axes.Axes.text in simplified form looks like this, ie it just passes
-them on to text.Text.__init__::
-
- # in axes.py
- def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
- t = Text(x=x, y=y, text=s, **kwargs)
-
-and Text.__init__ (again with liberties for illustration) just passes
-them on to the artist.Artist.update method::
-
- # in text.py
- def __init__(self, x=0, y=0, text='', **kwargs):
- Artist.__init__(self)
- self.update(kwargs)
-
-'update' does the work looking for methods named like 'set_property'
-if 'property' is a keyword argument. Ie, noone looks at the keywords,
-they just get passed through the API to the artist constructor which
-looks for suitably named methods and calls 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.
-
-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 Axes.plot and assume the rest are
-Line2D keyword arguments. As an example of a pop, passthrough
-usage, see Axes.plot::
-
- # in axes.py
- def plot(self, *args, **kwargs):
- scalex = kwargs.pop('scalex', True)
- scaley = kwargs.pop('scaley', True)
- if not self._hold: self.cla()
- lines = []
- for line in self._get_lines(*args, **kwargs):
- self.add_line(line)
- lines.append(line)
-
-The matplotlib.cbook function popd() is rendered
-obsolete by the 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 numbers of
-non-keyword args. In this case, python will not allow you to use
-named keyword args after the ``*args`` usage, so you will be forced to use
-``**kwargs``. An example is matplotlib.contour.ContourLabeler.clabel::
-
- # in contour.py
- def clabel(self, *args, **kwargs):
- fontsize = kwargs.get('fontsize', None)
- inline = kwargs.get('inline', 1)
- self.fmt = kwargs.get('fmt', '%1.3f')
- colors = kwargs.get('colors', None)
- if len(args) == 0:
- levels = self.levels
- indices = range(len(self.levels))
- elif len(args) == 1:
- ...etc...
-
-Documentation and Docstrings
-============================
-
-matplotlib uses artist instrospection 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 Artist
-class. Yes, this is not ideal given python properties or enthought
-traits, but it is a historical legacy for now. The setter methods use
-the docstring with the ACCEPTS token to indicate the type of argument
-the method accepts. Eg in matplotlib.lines.Line2D::
-
- # in lines.py
- def set_linestyle(self, linestyle):
- """
- Set the linestyle of the line
- 
- ACCEPTS: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' | ' ' | '' ]
- """
-
-Since matplotlib uses a lot of pass through kwargs, eg in every
-function that creates a line (plot, semilogx, 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 function that takes a ``**kwargs``. The
-requirements are:
-
-1. single point of configuration so changes to the properties don't
- require multiple docstring edits
-
-2. as automated as possible so that as properties change the docs
- are updated automagically.
-
-I have added a matplotlib.artist.kwdocd and kwdoc() to faciliate this.
-They combines 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 matplotlib.lines::
-
- # in lines.py
- artist.kwdocd['Line2D'] = artist.kwdoc(Line2D)
-
-Then in any function accepting Line2D passthrough kwargs, eg
-matplotlib.axes.Axes.plot::
-
- # in axes.py
- def plot(self, *args, **kwargs):
- """
- Some stuff omitted
- 
- The kwargs are Line2D properties:
- %(Line2D)s
-
- kwargs scalex and scaley, if defined, are passed on
- to autoscale_view to determine whether the x and y axes are
- autoscaled; default True. See Axes.autoscale_view for more
- information
- """
- pass
- plot.__doc__ = cbook.dedent(plot.__doc__) % artist.kwdocd
-
-Note there is a problem for Artist __init__ methods, eg 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
-
-********
-Licenses
-********
-
-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
-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.
\ No newline at end of file
Modified: trunk/matplotlib/doc/api_reference/conf.py
===================================================================
--- trunk/matplotlib/doc/api_reference/conf.py	2008年05月23日 14:13:16 UTC (rev 5225)
+++ trunk/matplotlib/doc/api_reference/conf.py	2008年05月23日 14:37:51 UTC (rev 5226)
@@ -93,7 +93,7 @@
 
 # If nonempty, this is the file name suffix for generated HTML files. The
 # default is ``".html"``.
-html_file_suffix = '.xml'
+#html_file_suffix = '.xhtml'
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
Modified: trunk/matplotlib/doc/api_reference/make.py
===================================================================
--- trunk/matplotlib/doc/api_reference/make.py	2008年05月23日 14:13:16 UTC (rev 5225)
+++ trunk/matplotlib/doc/api_reference/make.py	2008年05月23日 14:37:51 UTC (rev 5226)
@@ -15,7 +15,7 @@
 pass
 
 def figs():
- os.system('cd source/figures/ && python make.py')
+ os.system('cd figures/ && python make.py')
 
 def html():
 check_build()
Added: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py	 (rev 0)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py	2008年05月23日 14:37:51 UTC (rev 5226)
@@ -0,0 +1,107 @@
+import os
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
+ 
+from docutils import nodes
+from docutils.writers.html4css1 import HTMLTranslator
+from sphinx.latexwriter import LaTeXTranslator
+
+# Define LaTeX math node:
+class latex_math(nodes.General, nodes.Element):
+ pass
+
+def math_role(role, rawtext, text, lineno, inliner,
+ options={}, content=[]):
+ i = rawtext.find('`')
+ latex = rawtext[i+1:-1]
+ node = latex_math(rawtext)
+ node['latex'] = latex
+ return [node], []
+
+
+try:
+ from docutils.parsers.rst import Directive
+except ImportError:
+ # Register directive the old way:
+ from docutils.parsers.rst.directives import _directives
+ def math_directive(name, arguments, options, content, lineno,
+ content_offset, block_text, state, state_machine):
+ latex = ''.join(content)
+ node = latex_math(block_text)
+ node['latex'] = latex
+ return [node]
+ math_directive.arguments = None
+ math_directive.options = {}
+ math_directive.content = 1
+ _directives['math'] = math_directive
+else:
+ class math_directive(Directive):
+ has_content = True
+ def run(self): 
+ latex = ' '.join(self.content)
+ node = latex_math(self.block_text)
+ node['latex'] = latex
+ return [node]
+ from docutils.parsers.rst import directives
+ directives.register_directive('math', math_directive)
+
+def setup(app):
+ app.add_node(latex_math)
+ app.add_role('math', math_role)
+
+ # Add visit/depart methods to HTML-Translator:
+ def visit_latex_math_html(self, node):
+ source = self.document.attributes['source']
+ self.body.append(latex2html(node, source))
+ def depart_latex_math_html(self, node):
+ pass
+ HTMLTranslator.visit_latex_math = visit_latex_math_html
+ HTMLTranslator.depart_latex_math = depart_latex_math_html
+
+ # Add visit/depart methods to LaTeX-Translator:
+ def visit_latex_math_latex(self, node):
+ inline = isinstance(node.parent, nodes.TextElement)
+ if inline:
+ self.body.append('$%s$' % node['latex'])
+ else:
+ self.body.extend(['\\begin{equation}',
+ node['latex'],
+ '\\end{equation}'])
+ def depart_latex_math_latex(self, node):
+ pass
+ LaTeXTranslator.visit_latex_math = visit_latex_math_latex
+ LaTeXTranslator.depart_latex_math = depart_latex_math_latex
+
+from os.path import isfile
+# LaTeX to HTML translation stuff:
+def latex2html(node, source):
+ inline = isinstance(node.parent, nodes.TextElement)
+ latex = node['latex']
+ print latex
+ name = 'math-' + md5(latex).hexdigest()[-10:]
+ if not isfile('_static/%s.png' % name):
+ f = open('math.tex', 'w')
+ f.write(r"""\documentclass[12pt]{article}
+ \pagestyle{empty}
+ \begin{document}""")
+ if inline:
+ f.write('$%s$' % latex)
+ else:
+ f.write(r'\[ %s \]' % latex)
+ f.write('\end{document}')
+ f.close()
+ os.system('latex --interaction=nonstopmode math.tex > /dev/null')
+ os.system('dvipng -bgTransparent -Ttight --noghostscript -l10 ' +
+ '-o _static/%s.png math.dvi > /dev/null' % name)
+ path = source.split('/doc/')[-1].count('/') * '../' + '_static'
+ if inline and '_' in latex:
+ align = 'align="absmiddle" '
+ else:
+ align = ''
+ if inline:
+ cls = ''
+ else:
+ cls = 'class="center" '
+ return '<img src="%s/%s.png" %s%s/>' % (path, name, align, cls)
Property changes on: trunk/matplotlib/doc/sphinxext/mathpng.py
___________________________________________________________________
Name: svn:eol-style
 + native
Modified: trunk/matplotlib/doc/users_guide/coding_guide.txt
===================================================================
--- trunk/matplotlib/doc/users_guide/coding_guide.txt	2008年05月23日 14:13:16 UTC (rev 5225)
+++ trunk/matplotlib/doc/users_guide/coding_guide.txt	2008年05月23日 14:37:51 UTC (rev 5226)
@@ -1,3 +1,317 @@
+***************
+Version Control
+***************
 
-.. include:: ../../CODING_GUIDE
+svn checkouts
+=============
 
+Checking out everything in the trunk (matplotlib and toolkits)::
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk \
+ matplotlib --username=youruser --password=yourpass
+
+Checking out the main source::
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/\
+ matplotlib matplotlib --username=youruser --password=yourpass
+
+Branch checkouts, eg the maintenance branch::
+
+ svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\
+ v0_91_maint mplv0_91_maint
+
+Committing changes
+==================
+
+When committing changes to matplotlib, there are a few things to bear
+in mind.
+
+* if your changes are non-trivial, please make an entry in the
+ CHANGELOG
+* if you change the API, please document it in API_CHANGES, and
+ consider posting to mpl-devel
+* Are your changes python2.3 compatible? We are still trying to
+ support 2.3, so avoid 2.4 only features like decorators until we
+ remove 2.3 support
+* Can you pass examples/backend_driver.py? This is our poor man's
+ unit test.
+* If you have altered extension code, do you pass
+ unit/memleak_hawaii.py?
+* if you have added new files or directories, or reorganized
+ existing ones, are the new files included in the match patterns in
+ MANIFEST.in. This file determines what goes into the src
+ distribution of the mpl build.
+* Keep the maintenance branch and trunk in sync where it makes sense.
+ If there is a bug on both that needs fixing, use svnmerge.py to
+ keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
+ basic procedure is:
+
+ * install svnmerge.py in your PATH::
+
+ 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 -rNNN1,NNN2
+
+ where the NNN* are the revision numbers. Ranges arealso acceptable. 
+ svnmergy.py automatically creates a file containing the commit messages, 
+ so you are ready to make the commit::
+
+ > svn commit -F svnmerge-commit-message.txt
+
+***********
+Style Guide
+***********
+
+Importing and name spaces
+=========================
+
+For numpy, use::
+
+ import numpy as np
+ a = np.array([1,2,3])
+
+For masked arrays, use::
+
+ from numpy import ma
+
+(The earlier recommendation, '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
+ mpl.rcParams['xtick.major.pad'] = 6
+
+For matplotlib modules (or any other modules), use::
+
+ import matplotlib.cbook as cbook
+
+ if cbook.iterable(z):
+ pass
+
+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.
+
+Naming, spacing, and formatting conventions
+===========================================
+
+In general, we want to hew as closely as possible to the standard
+coding guidelines for python written by Guido in
+http://www.python.org/dev/peps/pep-0008, though we do not do this
+throughout.
+
+* functions and class methods: lower or lower_underscore_separated
+
+* attributes and variables: lower or lowerUpper
+
+* classes: Upper or MixedCase
+
+Personally, I 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.
+
+Please avoid spurious invisible spaces at the ends of lines.
+(Tell your editor to strip whitespace from line ends when saving
+a file.)
+
+Keep docstrings uniformly indented as in the example below, with
+nothing to the left of the triple quotes. The dedent() function
+is needed to remove excess indentation only if something will be
+interpolated into the docstring, again as in the example above.
+
+Limit line length to 80 characters. If a logical line needs to be
+longer, use parentheses to break it; do not use an escaped
+newline. It may be preferable to use a temporary variable
+to replace a single 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. If you are an emacs user, the following in your
+.emacs will cause emacs to strip trailing white space on save for
+python, C and C++::
+
+ ; and similarly for c++-mode-hook and c-mode-hook
+ (add-hook 'python-mode-hook
+ (lambda ()
+	 (add-hook 'write-file-functions 'delete-trailing-whitespace)))
+
+for older versions of emacs (emacs<22) you need to do::
+
+ (add-hook 'python-mode-hook
+ (lambda ()
+ (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
+
+Keyword argument processing
+===========================
+
+Matplotlib makes extensive use of ``**kwargs`` for pass through
+customizations from one function to another. A typical example is in
+pylab.text, The definition of the pylab text function is a simple
+pass-through to axes.Axes.text::
+
+ # in pylab.py
+ def text(*args, **kwargs):
+ ret = gca().text(*args, **kwargs)
+ draw_if_interactive()
+ return ret
+
+axes.Axes.text in simplified form looks like this, ie it just passes
+them on to text.Text.__init__::
+
+ # in axes.py
+ def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
+ t = Text(x=x, y=y, text=s, **kwargs)
+
+and Text.__init__ (again with liberties for illustration) just passes
+them on to the artist.Artist.update method::
+
+ # in text.py
+ def __init__(self, x=0, y=0, text='', **kwargs):
+ Artist.__init__(self)
+ self.update(kwargs)
+
+'update' does the work looking for methods named like 'set_property'
+if 'property' is a keyword argument. Ie, noone looks at the keywords,
+they just get passed through the API to the artist constructor which
+looks for suitably named methods and calls 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.
+
+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 Axes.plot and assume the rest are
+Line2D keyword arguments. As an example of a pop, passthrough
+usage, see Axes.plot::
+
+ # in axes.py
+ def plot(self, *args, **kwargs):
+ scalex = kwargs.pop('scalex', True)
+ scaley = kwargs.pop('scaley', True)
+ if not self._hold: self.cla()
+ lines = []
+ for line in self._get_lines(*args, **kwargs):
+ self.add_line(line)
+ lines.append(line)
+
+The matplotlib.cbook function popd() is rendered
+obsolete by the 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 numbers of
+non-keyword args. In this case, python will not allow you to use
+named keyword args after the ``*args`` usage, so you will be forced to use
+``**kwargs``. An example is matplotlib.contour.ContourLabeler.clabel::
+
+ # in contour.py
+ def clabel(self, *args, **kwargs):
+ fontsize = kwargs.get('fontsize', None)
+ inline = kwargs.get('inline', 1)
+ self.fmt = kwargs.get('fmt', '%1.3f')
+ colors = kwargs.get('colors', None)
+ if len(args) == 0:
+ levels = self.levels
+ indices = range(len(self.levels))
+ elif len(args) == 1:
+ ...etc...
+
+Documentation and Docstrings
+============================
+
+matplotlib uses artist instrospection 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 Artist
+class. Yes, this is not ideal given python properties or enthought
+traits, but it is a historical legacy for now. The setter methods use
+the docstring with the ACCEPTS token to indicate the type of argument
+the method accepts. Eg in matplotlib.lines.Line2D::
+
+ # in lines.py
+ def set_linestyle(self, linestyle):
+ """
+ Set the linestyle of the line
+ 
+ ACCEPTS: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' | ' ' | '' ]
+ """
+
+Since matplotlib uses a lot of pass through kwargs, eg in every
+function that creates a line (plot, semilogx, 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 function that takes a ``**kwargs``. The
+requirements are:
+
+1. single point of configuration so changes to the properties don't
+ require multiple docstring edits
+
+2. as automated as possible so that as properties change the docs
+ are updated automagically.
+
+I have added a matplotlib.artist.kwdocd and kwdoc() to faciliate this.
+They combines 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 matplotlib.lines::
+
+ # in lines.py
+ artist.kwdocd['Line2D'] = artist.kwdoc(Line2D)
+
+Then in any function accepting Line2D passthrough kwargs, eg
+matplotlib.axes.Axes.plot::
+
+ # in axes.py
+ def plot(self, *args, **kwargs):
+ """
+ Some stuff omitted
+ 
+ The kwargs are Line2D properties:
+ %(Line2D)s
+
+ kwargs scalex and scaley, if defined, are passed on
+ to autoscale_view to determine whether the x and y axes are
+ autoscaled; default True. See Axes.autoscale_view for more
+ information
+ """
+ pass
+ plot.__doc__ = cbook.dedent(plot.__doc__) % artist.kwdocd
+
+Note there is a problem for Artist __init__ methods, eg 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
+
+********
+Licenses
+********
+
+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
+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.
\ No newline at end of file
Modified: trunk/matplotlib/doc/users_guide/conf.py
===================================================================
--- trunk/matplotlib/doc/users_guide/conf.py	2008年05月23日 14:13:16 UTC (rev 5225)
+++ trunk/matplotlib/doc/users_guide/conf.py	2008年05月23日 14:37:51 UTC (rev 5226)
@@ -93,7 +93,7 @@
 
 # If nonempty, this is the file name suffix for generated HTML files. The
 # default is ``".html"``.
-html_file_suffix = '.xml'
+#html_file_suffix = '.xhtml'
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年05月23日 14:53:40
Revision: 5227
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5227&view=rev
Author: mdboom
Date: 2008年05月23日 07:53:33 -0700 (2008年5月23日)
Log Message:
-----------
Add support for syntax-highlighting ipython console sessions.
Modified Paths:
--------------
 trunk/matplotlib/doc/users_guide/artist_api_tut.txt
 trunk/matplotlib/doc/users_guide/conf.py
Added Paths:
-----------
 trunk/matplotlib/doc/sphinxext/ipython_console_highlighting.py
Added: trunk/matplotlib/doc/sphinxext/ipython_console_highlighting.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/ipython_console_highlighting.py	 (rev 0)
+++ trunk/matplotlib/doc/sphinxext/ipython_console_highlighting.py	2008年05月23日 14:53:33 UTC (rev 5227)
@@ -0,0 +1,75 @@
+from pygments.lexer import Lexer, do_insertions
+from pygments.lexers.agile import PythonConsoleLexer, PythonLexer, \
+ PythonTracebackLexer
+from pygments.token import Comment, Generic
+from sphinx import highlighting
+import re
+
+line_re = re.compile('.*?\n')
+
+class IPythonConsoleLexer(Lexer):
+ """
+ For IPython console output or doctests, such as:
+
+ Tracebacks are not currently supported.
+
+ .. sourcecode:: pycon
+
+ In [1]: a = 'foo'
+
+ In [2]: a
+ Out[2]: 'foo'
+
+ In [3]: print a
+ foo
+
+ In [4]: 1 / 0
+ """
+ name = 'IPython console session'
+ aliases = ['ipython']
+ mimetypes = ['text/x-ipython-console']
+ input_prompt = re.compile("(In \[[0-9]+\]: )|( \.\.\.+:)")
+ output_prompt = re.compile("(Out\[[0-9]+\]: )|( \.\.\.+:)")
+ continue_prompt = re.compile(" \.\.\.+:")
+ tb_start = re.compile("\-+")
+
+ def get_tokens_unprocessed(self, text):
+ pylexer = PythonLexer(**self.options)
+ tblexer = PythonTracebackLexer(**self.options)
+
+ curcode = ''
+ insertions = []
+ for match in line_re.finditer(text):
+ line = match.group()
+ input_prompt = self.input_prompt.match(line)
+ continue_prompt = self.continue_prompt.match(line.rstrip())
+ output_prompt = self.output_prompt.match(line)
+ if line.startswith("#"):
+ insertions.append((len(curcode),
+ [(0, Comment, line)]))
+ elif input_prompt is not None:
+ insertions.append((len(curcode),
+ [(0, Generic.Prompt, input_prompt.group())]))
+ curcode += line[input_prompt.end():]
+ elif continue_prompt is not None:
+ insertions.append((len(curcode),
+ [(0, Generic.Prompt, continue_prompt.group())]))
+ curcode += line[continue_prompt.end():]
+ elif output_prompt is not None:
+ insertions.append((len(curcode),
+ [(0, Generic.Output, output_prompt.group())]))
+ curcode += line[output_prompt.end():]
+ else:
+ if curcode:
+ for item in do_insertions(insertions,
+ pylexer.get_tokens_unprocessed(curcode)):
+ yield item
+ curcode = ''
+ insertions = []
+ yield match.start(), Generic.Output, line
+ if curcode:
+ for item in do_insertions(insertions,
+ pylexer.get_tokens_unprocessed(curcode)):
+ yield item
+
+highlighting.lexers['ipython'] = IPythonConsoleLexer()
Modified: trunk/matplotlib/doc/users_guide/artist_api_tut.txt
===================================================================
--- trunk/matplotlib/doc/users_guide/artist_api_tut.txt	2008年05月23日 14:37:51 UTC (rev 5226)
+++ trunk/matplotlib/doc/users_guide/artist_api_tut.txt	2008年05月23日 14:53:33 UTC (rev 5227)
@@ -61,8 +61,10 @@
 Axes) and when you call ax.plot, it creates a Line2D instance and adds
 it the the Axes.lines list. In the interactive ipython session below,
 you can see that Axes.lines list is length one and contains the same
-line that was returned by the "line, ax.plot(x, y, 'o')" call::
+line that was returned by the "line, ax.plot(x, y, 'o')" call:
 
+.. sourcecode:: ipython
+
 In [101]: ax.lines[0]
 Out[101]: <matplotlib.lines.Line2D instance at 0x19a95710>
 
@@ -159,8 +161,9 @@
 inspect the artist properties is to use the matplotlib.artist.getp
 method, which lists the properties and their values (simply "getp") in
 pylab. This works for classes derived from Artist as well, eg Figure
-and Rectangle. Here are the Figure rectangle properties mentioned above::
+and Rectangle. Here are the Figure rectangle properties mentioned above:
 
+.. sourcecode:: ipython
 
 In [149]: matplotlib.artist.getp(fig.figurePatch)
 	alpha = 1.0
@@ -218,8 +221,10 @@
 Rectangle which is stored in fig.figurePatch (where fig is your Figure
 instance). As you add subplots (fig.add_subplot) and axes
 (ax.add_axes)to the figure these will be appended to the fig.axes
-list. These are also returned by the methods that create them::
+list. These are also returned by the methods that create them:
 
+.. sourcecode:: ipython
+
 In [156]: fig = plt.figure()
 
 In [157]: ax1 = fig.add_subplot(211)
@@ -232,7 +237,6 @@
 In [160]: print fig.axes
 [<matplotlib.axes.Subplot instance at 0xd54b26c>, <matplotlib.axes.Axes instance at 0xd3f0b2c>]
 
-
 Because the figure maintains the concept of the "current axes" (see
 Figure.gca and Figure.sca) to support the pylab/pyplot state machine,
 you should not insert or remove axes directly from the axes list, but
@@ -253,8 +257,10 @@
 the Artist you are adding to the figure. More useful is "figure
 coordinates" where 0,0 is the bottom, left of the figure and 1,1 is
 the top, right of the figure which you can obtain by setting the
-Artist transform to fig.transFigure::
+Artist transform to fig.transFigure:
 
+.. sourcecode:: ipython
+
 In [191]: fig = plt.figure()
 
 In [192]: l1 = matplotlib.lines.Line2D([0, 1], [0, 1], transform=fig.transFigure, figure=fig)
@@ -303,8 +309,10 @@
 in arrays or list of values, the method will a matplotlib.lines.Line2D
 instance, update the line with all the Line2D properties passed as
 keyword arguments, add the line to the Axes.lines container, and
-returns it to you::
+returns it to you:
 
+.. sourcecode:: ipython
+
 In [213]: x, y = np.random.rand(2, 100)
 
 In [214]: line, = ax.plot(x, y, '-', color='blue', linewidth=2)
@@ -312,15 +320,18 @@
 ax.plot returns a list of lines because you can pass in multiple x, y
 pairs to plot, and we are unpacking the first element of the length
 one list into the line variable. The line has been added to the
-ax.lines list::
+ax.lines list:
 
+.. sourcecode:: ipython
 
 In [229]: print ax.lines
 [<matplotlib.lines.Line2D instance at 0xd378b0c>]
 
 Similarly, methods that create patches, like ax.bar creates a list of
-rectangles, will add the patches to the ax.patches list::
+rectangles, will add the patches to the ax.patches list:
 
+.. sourcecode:: ipython
+
 In [233]: n, bins, rectangles = ax.hist(np.random.randn(1000), 50, facecolor='yellow')
 
 In [234]: rectangles
@@ -338,8 +349,10 @@
 plotted data. You can, nonetheless, create objects yourself and add
 them directly to the Axes using helper methods like ax.add_line and
 ax.add_patch. Here is an annotated interactive session illustrating
-what is going on::
+what is going on:
 
+.. sourcecode:: ipython
+
 In [261]: fig = plt.figure()
 
 In [262]: ax = fig.add_subplot(111)
@@ -460,8 +473,10 @@
 through their accessor methods axis.get_major_ticks() and
 axis.get_minor_ticks(). Although the ticks contain all the primitives
 and will be covered below, the Axis methods contain accessor methods
-to return the tick lines, tick labels, tick locations etc....::
+to return the tick lines, tick labels, tick locations etc....:
 
+.. sourcecode:: ipython
+
 In [285]: axis = ax.xaxis
 
 In [286]: axis.get_ticklocs()
Modified: trunk/matplotlib/doc/users_guide/conf.py
===================================================================
--- trunk/matplotlib/doc/users_guide/conf.py	2008年05月23日 14:37:51 UTC (rev 5226)
+++ trunk/matplotlib/doc/users_guide/conf.py	2008年05月23日 14:53:33 UTC (rev 5227)
@@ -18,6 +18,10 @@
 # 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
 # ---------------------
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ds...@us...> - 2008年05月23日 16:13:16
Revision: 5228
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5228&view=rev
Author: dsdale
Date: 2008年05月23日 09:12:50 -0700 (2008年5月23日)
Log Message:
-----------
equation rendering is now working using Jens Mortensen's 
mathpng extension. The syntax is illustrated in the
developers guide, in the "Documenting Matplotlib" section
Modified Paths:
--------------
 trunk/matplotlib/doc/api_reference/conf.py
 trunk/matplotlib/doc/sphinxext/mathpng.py
 trunk/matplotlib/doc/users_guide/conf.py
 trunk/matplotlib/doc/users_guide/documenting_mpl.txt
Modified: trunk/matplotlib/doc/api_reference/conf.py
===================================================================
--- trunk/matplotlib/doc/api_reference/conf.py	2008年05月23日 14:53:33 UTC (rev 5227)
+++ trunk/matplotlib/doc/api_reference/conf.py	2008年05月23日 16:12:50 UTC (rev 5228)
@@ -23,7 +23,7 @@
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['mathml', 'sphinx.ext.autodoc']
+extensions = ['mathpng', 'sphinx.ext.autodoc']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
Modified: trunk/matplotlib/doc/sphinxext/mathpng.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/mathpng.py	2008年05月23日 14:53:33 UTC (rev 5227)
+++ trunk/matplotlib/doc/sphinxext/mathpng.py	2008年05月23日 16:12:50 UTC (rev 5228)
@@ -95,7 +95,11 @@
 os.system('latex --interaction=nonstopmode math.tex > /dev/null')
 os.system('dvipng -bgTransparent -Ttight --noghostscript -l10 ' +
 '-o _static/%s.png math.dvi > /dev/null' % name)
- path = source.split('/doc/')[-1].count('/') * '../' + '_static'
+ path = '_static'
+ count = source.split('/doc/')[-1].count('/')
+ for i in range(count):
+ if os.path.exists(path): break
+ path = '../'+path
 if inline and '_' in latex:
 align = 'align="absmiddle" '
 else:
Modified: trunk/matplotlib/doc/users_guide/conf.py
===================================================================
--- trunk/matplotlib/doc/users_guide/conf.py	2008年05月23日 14:53:33 UTC (rev 5227)
+++ trunk/matplotlib/doc/users_guide/conf.py	2008年05月23日 16:12:50 UTC (rev 5228)
@@ -27,7 +27,7 @@
 
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['mathml', 'sphinx.ext.autodoc']
+extensions = ['mathpng', 'sphinx.ext.autodoc']
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
Modified: trunk/matplotlib/doc/users_guide/documenting_mpl.txt
===================================================================
--- trunk/matplotlib/doc/users_guide/documenting_mpl.txt	2008年05月23日 14:53:33 UTC (rev 5227)
+++ trunk/matplotlib/doc/users_guide/documenting_mpl.txt	2008年05月23日 16:12:50 UTC (rev 5228)
@@ -4,8 +4,7 @@
 
 The documentation for matplotlib is generated from ReStructured Text
 using the Sphinx_ documentation generation tool. Sphinx-0.4 or later 
-is required to generate xml files to render mathematical expressions 
-with mathml. Currently this means we need to install from the svn 
+is required. Currently this means we need to install from the svn 
 repository by doing::
 
 svn co http://svn.python.org/projects/doctools/trunk sphinx
@@ -34,10 +33,25 @@
 gets its contents from the CODING_GUIDE file in the trunk: 
 ``.. include:: ../../CODING_GUIDE``.
 
+Mathematical expressions can be rendered as png images in html, and in 
+the usual way by latex. For example:
+
+``math:`sin(x_n^2)`` yields: :math:`sin(x_n^2)`, and::
+
+ .. math::
+
+ \int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}}``
+
+yields:
+
+.. math::
+
+ \int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}} 
+
 The output produced by Sphinx can be configured by editing the conf.py
 files located in the documentation source directories.
 
 The Sphinx website contains plenty of documentation_ concerning ReST
 markup and working with Sphinx in general.
 
-.. _documentation: http://sphinx.pocoo.org/contents.html
\ No newline at end of file
+.. _documentation: http://sphinx.pocoo.org/contents.html
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年05月25日 21:24:27
Revision: 5269
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5269&view=rev
Author: jdh2358
Date: 2008年05月25日 14:24:24 -0700 (2008年5月25日)
Log Message:
-----------
added faq placeholder
Modified Paths:
--------------
 trunk/matplotlib/doc/index.rst
 trunk/matplotlib/doc/make.py
Added Paths:
-----------
 trunk/matplotlib/doc/faq/
 trunk/matplotlib/doc/faq/index.rst
 trunk/matplotlib/doc/faq/installing_faq.rst
 trunk/matplotlib/doc/faq/plotting_faq.rst
Added: trunk/matplotlib/doc/faq/index.rst
===================================================================
--- trunk/matplotlib/doc/faq/index.rst	 (rev 0)
+++ trunk/matplotlib/doc/faq/index.rst	2008年05月25日 21:24:24 UTC (rev 5269)
@@ -0,0 +1,16 @@
+.. _api-index:
+
+####################
+ The Matplotlib FAQ
+####################
+
+:Release: |version|
+:Date: |today|
+
+Frequently asked questions about matplotlib
+
+.. toctree::
+
+ installing_faq.rst
+ plotting_faq.rst
+
Added: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst	 (rev 0)
+++ trunk/matplotlib/doc/faq/installing_faq.rst	2008年05月25日 21:24:24 UTC (rev 5269)
@@ -0,0 +1,7 @@
+****************
+Installation FAQ
+****************
+
+
+
+
Added: trunk/matplotlib/doc/faq/plotting_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/plotting_faq.rst	 (rev 0)
+++ trunk/matplotlib/doc/faq/plotting_faq.rst	2008年05月25日 21:24:24 UTC (rev 5269)
@@ -0,0 +1,5 @@
+************
+Plotting FAQ
+************
+
+
Modified: trunk/matplotlib/doc/index.rst
===================================================================
--- trunk/matplotlib/doc/index.rst	2008年05月25日 21:14:01 UTC (rev 5268)
+++ trunk/matplotlib/doc/index.rst	2008年05月25日 21:24:24 UTC (rev 5269)
@@ -11,6 +11,7 @@
 :maxdepth: 2
 
 users/index.rst
+ faq/index.rst
 devel/index.rst
 api/index.rst
 
Modified: trunk/matplotlib/doc/make.py
===================================================================
--- trunk/matplotlib/doc/make.py	2008年05月25日 21:14:01 UTC (rev 5268)
+++ trunk/matplotlib/doc/make.py	2008年05月25日 21:24:24 UTC (rev 5269)
@@ -6,7 +6,7 @@
 import sys
 
 def check_build():
- build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex', 
+ build_dirs = ['build', 'build/doctrees', 'build/html', 'build/latex',
 '_static', '_templates']
 for d in build_dirs:
 try:
@@ -19,23 +19,26 @@
 
 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 Matplotlib.tex')
 os.system('pdflatex Matplotlib.tex')
 os.system('makeindex -s python.ist Matplotlib.idx')
 os.system('makeindex -s python.ist modMatplotlib.idx')
 os.system('pdflatex Matplotlib.tex')
- 
+
 os.chdir('../..')
 else:
 print 'latex build has not been tested on windows'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年05月25日 21:31:44
Revision: 5270
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5270&view=rev
Author: jdh2358
Date: 2008年05月25日 14:31:43 -0700 (2008年5月25日)
Log Message:
-----------
added readme to describe doc organization
Modified Paths:
--------------
 trunk/matplotlib/doc/conf.py
Added Paths:
-----------
 trunk/matplotlib/doc/README.txt
Added: trunk/matplotlib/doc/README.txt
===================================================================
--- trunk/matplotlib/doc/README.txt	 (rev 0)
+++ trunk/matplotlib/doc/README.txt	2008年05月25日 21:31:43 UTC (rev 5270)
@@ -0,0 +1,35 @@
+maptlotlib documentation
+========================
+
+This is the top level build directory for the matplotlib
+documentation. All of the documentation is written using sphinx, a
+python documentation system built on top of ReST.
+
+If you are looking for plain text documentation, you can read the following
+
+* users - the user documentation, eg plotting tutorials, configuration
+ tips, etc.
+
+* devel - documentation for matplotlib developers
+
+* faq - frequently asked questions
+
+* api - placeholders to automatically generate the api documentation
+
+* make.py - the build script to build the html or PDF docs
+
+* index.rst - the top level include document for matplotlib docs
+
+* conf.py - the sphinx configuration
+
+* _static - used by the sphinx build system
+
+* _templates - used by the sphinx build system
+
+* sphinxext - Sphinx extensions for the mpl docs
+
+* mpl_data - a symbolic link to the matplotlib data for reference by
+ sphinx documentation
+
+* mpl_examples - a link to the matplotlib examples in case any
+ documentation wants to literal include them
Modified: trunk/matplotlib/doc/conf.py
===================================================================
--- trunk/matplotlib/doc/conf.py	2008年05月25日 21:24:24 UTC (rev 5269)
+++ trunk/matplotlib/doc/conf.py	2008年05月25日 21:31:43 UTC (rev 5270)
@@ -141,7 +141,7 @@
 # (source start file, target name, title, author, document class [howto/manual]).
 
 latex_documents = [
- ('index', 'Matplotlib.tex', 'Matplotlib', 'John Hunter, Darren Dale, Michael Droettboom', 'manual'),
+ ('index', 'Matplotlib.tex', 'Matplotlib', 'Darren Dale, Michael Droettboom, Eric Firing, John Hunter', 'manual'),
 ]
 
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年05月30日 16:21:24
Revision: 5320
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5320&view=rev
Author: mdboom
Date: 2008年05月30日 09:21:21 -0700 (2008年5月30日)
Log Message:
-----------
Formatting updates to the docs
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/coding_guide.rst
 trunk/matplotlib/doc/users/artists.rst
 trunk/matplotlib/doc/users/customizing.rst
 trunk/matplotlib/doc/users/index.rst
 trunk/matplotlib/doc/users/pyplot_tutorial.rst
Modified: trunk/matplotlib/doc/devel/coding_guide.rst
===================================================================
--- trunk/matplotlib/doc/devel/coding_guide.rst	2008年05月30日 14:32:29 UTC (rev 5319)
+++ trunk/matplotlib/doc/devel/coding_guide.rst	2008年05月30日 16:21:21 UTC (rev 5320)
@@ -18,7 +18,7 @@
 Branch checkouts, eg the maintenance branch::
 
 svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/\
- v0_91_maint mpl91
+ v0_91_maint mpl91 --username=youruser --password=yourpass
 
 Committing changes
 ==================
@@ -27,26 +27,25 @@
 in mind.
 
 * if your changes are non-trivial, please make an entry in the
- CHANGELOG
-* if you change the API, please document it in API_CHANGES, and
+ :file:`CHANGELOG`
+* if you change the API, please document it in :file:`API_CHANGES`, and
 consider posting to mpl-devel
-* Are your changes python2.3 compatible? We are still trying to
- support 2.3, so avoid 2.4 only features like decorators until we
- remove 2.3 support
-* Can you pass examples/backend_driver.py? This is our poor man's
- unit test.
+* Are your changes python2.4 compatible? We are still trying to
+ support 2.4, so avoid features new to 2.5
+* Can you pass :file:`examples/tests/backend_driver.py`? This is our
+ poor man's unit test.
 * If you have altered extension code, do you pass
- unit/memleak_hawaii.py?
-* if you have added new files or directories, or reorganized
- existing ones, are the new files included in the match patterns in
- MANIFEST.in. This file determines what goes into the src
+ :file:`unit/memleak_hawaii.py`?
+* if you have added new files or directories, or reorganized existing
+ ones, are the new files included in the match patterns in
+ :file:`MANIFEST.in`. This file determines what goes into the source
 distribution of the mpl build.
 * Keep the maintenance branch and trunk in sync where it makes sense.
- If there is a bug on both that needs fixing, use svnmerge.py to
- keep them in sync. http://www.orcaware.com/svn/wiki/Svnmerge.py. The
- basic procedure is:
+ If there is a bug on both that needs fixing, use `svnmerge.py
+ <http://www.orcaware.com/svn/wiki/Svnmerge.py>`_ to keep them in
+ sync. The basic procedure is:
 
- * install svnmerge.py in your PATH::
+ * install ``svnmerge.py`` in your PATH::
 
 wget http://svn.collab.net/repos/svn/trunk/contrib/client-side/\
 svnmerge/svnmerge.py
@@ -56,12 +55,23 @@
 it. Make sure you svn upped on the trunk and have no local
 modifications, and then from the svn trunk do::
 
- > svnmerge.py merge -rNNN1,NNN2
+ > svnmerge.py merge
 
- where the NNN* are the revision numbers. Ranges arealso acceptable. 
- svnmergy.py automatically creates a file containing the commit messages, 
- so you are ready to make the commit::
+ If you wish to merge only specific revisions (in an unusual
+ situation), do::
 
+ > 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.
+
+ ``svnmerge.py`` automatically creates a file containing the commit
+ messages, so you are ready to make the commit::
+
 > svn commit -F svnmerge-commit-message.txt
 
 ***********
@@ -71,7 +81,7 @@
 Importing and name spaces
 =========================
 
-For numpy, use::
+For `numpy <http://www.numpy.org>`_, use::
 
 import numpy as np
 a = np.array([1,2,3])
@@ -80,11 +90,11 @@
 
 from numpy import ma
 
-(The earlier recommendation, '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
+(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::
@@ -99,8 +109,8 @@
 if cbook.iterable(z):
 pass
 
-We prefer this over the equivalent 'from matplotlib import cbook'
-because the latter is ambiguous whether cbook is a module or a
+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.
 
@@ -108,15 +118,16 @@
 ===========================================
 
 In general, we want to hew as closely as possible to the standard
-coding guidelines for python written by Guido in
-http://www.python.org/dev/peps/pep-0008, though we do not do this
+coding guidelines for python written by Guido in `PEP 0008
+<http://www.python.org/dev/peps/pep-0008>`_, though we do not do this
 throughout.
 
-* functions and class methods: lower or lower_underscore_separated
+* functions and class methods: ``lower`` or
+ ``lower_underscore_separated``
 
-* attributes and variables: lower or lowerUpper
+* attributes and variables: ``lower`` or ``lowerUpper``
 
-* classes: Upper or MixedCase
+* classes: ``Upper`` or ``MixedCase``
 
 Personally, I prefer the shortest names that are still readable.
 
@@ -129,28 +140,33 @@
 a file.)
 
 Keep docstrings uniformly indented as in the example below, with
-nothing to the left of the triple quotes. The dedent() function
-is needed to remove excess indentation only if something will be
-interpolated into the docstring, again as in the example above.
+nothing to the left of the triple quotes. The
+:func:`matplotlib.cbook.dedent` function is needed to remove excess
+indentation only if something will be interpolated into the docstring,
+again as in the example above.
 
 Limit line length to 80 characters. If a logical line needs to be
-longer, use parentheses to break it; do not use an escaped
-newline. It may be preferable to use a temporary variable
-to replace a single long line with two shorter and more
-readable lines.
+longer, use parentheses to break it; do not use an escaped newline.
+It may be preferable to use a temporary variable to replace a single
+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. If you are an emacs user, the following in your
-.emacs will cause emacs to strip trailing white space on save for
-python, C and C++::
+noise in svn diffs.
 
+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
 (add-hook 'python-mode-hook
 (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
+
 (add-hook 'python-mode-hook
 (lambda ()
 (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
@@ -160,8 +176,9 @@
 
 Matplotlib makes extensive use of ``**kwargs`` for pass through
 customizations from one function to another. A typical example is in
-pylab.text, The definition of the pylab text function is a simple
-pass-through to axes.Axes.text::
+:func:`matplotlib.pylab.text`. The definition of the pylab text
+function is a simple pass-through to
+:meth:`matplotlib.axes.Axes.text`::
 
 # in pylab.py
 def text(*args, **kwargs):
@@ -169,25 +186,27 @@
 draw_if_interactive()
 return ret
 
-axes.Axes.text in simplified form looks like this, ie it just passes
-them on to text.Text.__init__::
+:meth:`~matplotlib.axes.Axes.text` in simplified form looks like this,
+i.e., it just passes them on to :meth:`matplotlib.text.Text.__init__`::
 
 # in axes.py
 def text(self, x, y, s, fontdict=None, withdash=False, **kwargs):
 t = Text(x=x, y=y, text=s, **kwargs)
 
-and Text.__init__ (again with liberties for illustration) just passes
-them on to the artist.Artist.update method::
+and :meth:`~matplotlib.text.Text.__init__` (again with liberties for
+illustration) just passes them on to the
+:meth:`matplotlib.artist.Artist.update` method::
 
 # in text.py
 def __init__(self, x=0, y=0, text='', **kwargs):
 Artist.__init__(self)
 self.update(kwargs)
 
-'update' does the work looking for methods named like 'set_property'
-if 'property' is a keyword argument. Ie, noone looks at the keywords,
-they just get passed through the API to the artist constructor which
-looks for suitably named methods and calls them with the value.
+``update`` does the work looking for methods named like
+``set_property`` if ``property`` is a keyword argument. I.e., no one
+looks at the keywords, they just get passed through the API to the
+artist constructor which looks for suitably named methods and calls
+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
@@ -197,9 +216,10 @@
 
 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 Axes.plot and assume the rest are
-Line2D keyword arguments. As an example of a pop, passthrough
-usage, see Axes.plot::
+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 axes.py
 def plot(self, *args, **kwargs):
@@ -211,16 +231,17 @@
 self.add_line(line)
 lines.append(line)
 
-The matplotlib.cbook function popd() is rendered
-obsolete by the pop() dictionary method introduced in Python 2.3,
+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 numbers of
-non-keyword args. In this case, python will not allow you to use
-named keyword args after the ``*args`` usage, so you will be forced to use
-``**kwargs``. An example is matplotlib.contour.ContourLabeler.clabel::
+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
+numbers of non-keyword args. In this case, python will not allow you
+to use named keyword args after the ``*args`` usage, so you will be
+forced to use ``**kwargs``. An example is
+:meth:`matplotlib.contour.ContourLabeler.clabel`::
 
 # in contour.py
 def clabel(self, *args, **kwargs):
@@ -238,51 +259,54 @@
 ============================
 
 matplotlib uses artist instrospection 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 Artist
-class. Yes, this is not ideal given python properties or enthought
-traits, but it is a historical legacy for now. The setter methods use
-the docstring with the ACCEPTS token to indicate the type of argument
-the method accepts. Eg in matplotlib.lines.Line2D::
+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
+not ideal given python properties or enthought traits, but it is a
+historical legacy for now. The setter methods use the docstring with
+the ACCEPTS token to indicate the type of argument the method accepts.
+Eg. in :class:`matplotlib.lines.Line2D`::
 
 # in lines.py
 def set_linestyle(self, linestyle):
 """
 Set the linestyle of the line
- 
+
 ACCEPTS: [ '-' | '--' | '-.' | ':' | 'steps' | 'None' | ' ' | '' ]
 """
 
-Since matplotlib uses a lot of pass through kwargs, eg in every
-function that creates a line (plot, semilogx, 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 function that takes a ``**kwargs``. The
-requirements are:
+Since matplotlib uses a lot of pass through ``kwargs``, eg. in every
+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
+function that takes a ``**kwargs``. The requirements are:
 
 1. single point of configuration so changes to the properties don't
- require multiple docstring edits
+ require multiple docstring edits.
 
 2. as automated as possible so that as properties change the docs
 are updated automagically.
 
-I have added a matplotlib.artist.kwdocd and kwdoc() to faciliate this.
-They combines 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 matplotlib.lines::
+I have added a :attr:`matplotlib.artist.kwdocd` and
+:func:`matplotlib.artist.kwdoc` to faciliate 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`::
 
 # in lines.py
 artist.kwdocd['Line2D'] = artist.kwdoc(Line2D)
 
-Then in any function accepting Line2D passthrough kwargs, eg
-matplotlib.axes.Axes.plot::
+Then in any function accepting :class:`~matplotlib.lines.Line2D`
+passthrough ``kwargs``, eg. :meth:`matplotlib.axes.Axes.plot`::
 
 # in axes.py
 def plot(self, *args, **kwargs):
 """
 Some stuff omitted
- 
+
 The kwargs are Line2D properties:
 %(Line2D)s
 
@@ -294,13 +318,14 @@
 pass
 plot.__doc__ = cbook.dedent(plot.__doc__) % artist.kwdocd
 
-Note there is a problem for Artist __init__ methods, eg Patch.__init__
-which supports Patch kwargs, since the artist inspector cannot work
+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
+``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
+before too long.
 
 ********
 Licenses
@@ -314,4 +339,4 @@
 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.
\ No newline at end of file
+you to distribute the license with it.
Modified: trunk/matplotlib/doc/users/artists.rst
===================================================================
--- trunk/matplotlib/doc/users/artists.rst	2008年05月30日 14:32:29 UTC (rev 5319)
+++ trunk/matplotlib/doc/users/artists.rst	2008年05月30日 16:21:21 UTC (rev 5320)
@@ -2,50 +2,69 @@
 Artist tutorial
 ***************
 
-There are three layers to the matplotlib API. The FigureCanvas is the
-area onto which the figure is drawn, the Renderer is the object which
-knows how to draw on the FigureCanvas, and the Artist is the object
-that knows how to use a renderer to paint onto the canvas. The
-FigureCanvas and Renderer handle all the details of talking to user
-interface toolkits like wxpython or drawing languages like postscript,
-and the Artist handles all the high level constructs like
-representing and laying out the figure, text, and lines. The typical
-user will spend 95% of his time working with the Artists.
+There are three layers to the matplotlib API. The
+:class:`matplotlib.backend_bases.FigureCanvas` is the area onto which
+the figure is drawn, the :class:`matplotlib.backend_bases.Renderer` is
+the object which knows how to draw on the
+:class:`~matplotlib.backend_bases.FigureCanvas`, and the
+:class:`matplotlib.artist.Artist` is the object that knows how to use
+a renderer to paint onto the canvas. The
+:class:`~matplotlib.backend_bases.FigureCanvas` and
+:class:`~matplotlib.backend_bases.Renderer` handle all the details of
+talking to user interface toolkits like `wxPython
+<http://www.wxpython.org>`_ or drawing languages like PostScript®, and
+the ``Artist`` handles all the high level constructs like representing
+and laying out the figure, text, and lines. The typical user will
+spend 95% of his time working with the ``Artists``.
 
-There are two types Artists: primitives and containers. The
+There are two types of ``Artists``: primitives and containers. The
 primitives represent the standard graphical objects we want to paint
-onto our canvas: Line2D, Rectangle, Text, AxesImage, etc, and the
-containers are places to put them (Axis, Axes and Figure). The
-standard use is to create a Figure instance, use the Figure to create
-one or more Axes or Subplot instances, and use the Axes instance
-helper methods to create the primitives. In the example below, we
-create a Figure instance using pyplot.figure, which is a convenience
-method for instantiating Figure instances and connecting them with
-your user interface or drawing toolkit FigureCanvas. As we will
-discuss below, this is not necessary, and you can work directly with
-postscript, pdf gtk, or wxpython FigureCanvas es, instantiate your
-Figures directly and connect them yourselves, but since we are
-focusing here on the Artist API we'll let pyplot handle some of those
-details for us::
+onto our canvas: :class:`~matplotlib.lines.Line2D`,
+:class:`~matplotlib.patches.Rectangle`,
+:class:`~matplotlib.text.Text`, :class:`~matplotlib.image.AxesImage`,
+etc., and the containers are places to put them
+(:class:`~matplotlib.axis.Axis`, :class:`~matplotlib.axes.Axes` and
+:class:`~matplotlib.figure.Figure`). The standard use is to create a
+:class:`~matplotlib.figure.Figure` instance, use the ``Figure`` to
+create one or more :class:`~matplotlib.axes.Axes` or
+:class:`~matplotlib.axes.Subplot` instances, and use the ``Axes``
+instance helper methods to create the primitives. In the example
+below, we create a ``Figure`` instance using
+:func:`matplotlib.pyplot.figure`, which is a convenience method for
+instantiating ``Figure`` instances and connecting them with your user
+interface or drawing toolkit ``FigureCanvas``. As we will discuss
+below, this is not necessary, and you can work directly with
+PostScript, PDF Gtk+, or wxPython ``FigureCanvas`` instances. For
+example, instantiate your ``Figures`` directly and connect them
+yourselves, but since we are focusing here on the ``Artist`` API we'll let
+:mod:`~matplotlib.pyplot` handle some of those details for us::
 
 import matplotlib.pyplot as plt
 fig = plt.figure()
 ax = fig.add_subplot(2,1,1) # two rows, one column, first plot
 
-The Axes is probably the most important class in the matplotlib API,
-and the one you will be working with most of the time. This is
-because the Axes is the plotting area into which most of the objects
-go, and the Axes has many special helper methods (ax.plot, ax.text,
-ax.hist, ax.imshow) to create the most common graphics primitives
-(Line2D, Text, Rectangle, Image, respectively). These helper methods
-will take your data (eg numpy arrays and strings) create primitive
-Artist instances as needed (eg Line2D), add them to the relevant
-containers, and draw them when requested. Most of you are probably
-familiar with the Subplot, which is just a special case of an Axes
-that lives on a regular rows by columns grid of Subplot instances. If
-you want to create an Axes at an arbitrary location, simply use the
-add_axes method which takes a list of [left, bottom, width, height]
-values in 0-1 relative figure coordinates::
+The :class:`~matplotlib.axes.Axes` is probably the most important
+class in the matplotlib API, and the one you will be working with most
+of the time. This is because the ``Axes`` is the plotting area into
+which most of the objects go, and the ``Axes`` has many special helper
+methods (:meth:`~matplotlib.axes.Axes.plot`,
+:meth:`~matplotlib.axes.Axes.text`,
+:meth:`~matplotlib.axes.Axes.hist`,
+:meth:`~matplotlib.axes.Axes.imshow`) to create the most common
+graphics primitives (:class:`~matplotlib.lines.Line2D`,
+:class:`~matplotlib.text.Text`,
+:class:`~matplotlib.patches.Rectangle`,
+:class:`~matplotlib.image.Image`, respectively). These helper methods
+will take your data (eg. ``numpy`` arrays and strings) create
+primitive ``Artist`` instances as needed (eg. ``Line2D``), add them to
+the relevant containers, and draw them when requested. Most of you
+are probably familiar with the :class:`~matplotlib.axes.Subplot`,
+which is just a special case of an ``Axes`` that lives on a regular
+rows by columns grid of ``Subplot`` instances. If you want to create
+an ``Axes`` at an arbitrary location, simply use the
+:meth:`~matplotlib.figure.Figure.add_axes` method which takes a list
+of ``[left, bottom, width, height]`` values in 0-1 relative figure
+coordinates::
 
 ax2 = fig.add_axes([0.15, 0.1, 0.7, 0.3])
 
@@ -56,12 +75,14 @@
 s = np.sin(2*np.pi*t)
 line, = ax1.plot(t, s, color='blue', lw=2)
 
-In this example, ax is the Axes instance created by the
-fig.add_subplot call above (remember Subplot is just a subclass of
-Axes) and when you call ax.plot, it creates a Line2D instance and adds
-it the the Axes.lines list. In the interactive ipython session below,
-you can see that Axes.lines list is length one and contains the same
-line that was returned by the "line, ax.plot(x, y, 'o')" call:
+In this example, ``ax`` is the ``Axes`` instance created by the
+``fig.add_subplot`` call above (remember ``Subplot`` is just a
+subclass of ``Axes``) and when you call ``ax.plot``, it creates a
+``Line2D`` instance and adds it the the :attr:`Axes.lines
+<matplotlib.axes.Axes.lines>` list. In the interactive `ipython
+<http://ipython.scipy.org/>`_ session below, you can see that
+``Axes.lines`` list is length one and contains the same line that was
+returned by the ``line, = ax.plot(x, y, 'o')`` call:
 
 .. sourcecode:: ipython
 
@@ -71,7 +92,7 @@
 In [102]: line
 Out[102]: <matplotlib.lines.Line2D instance at 0x19a95710>
 
-If you make subsequent calls to ax.plot (and the hold state is "on"
+If you make subsequent calls to ``ax.plot`` (and the hold state is "on"
 which is the default) then additional lines will be added to the list.
 You can remove lines later simply by calling the list methods; either
 of these will work::
@@ -79,52 +100,60 @@
 del ax.lines[0]
 ax.lines.remove(line) # one or the other, not both!
 
-The Axes also has helper methods to configure and decorate the xaxis
-and yaxis tick, ticklabels and axis labels::
+The Axes also has helper methods to configure and decorate the x-axis
+and y-axis tick, ticklabels and axis labels::
 
 xtext = ax.set_xlabel('my xdata') # returns a Text instance
 ytext = ax.set_ylabel('my xdata')
 
-When you call ax.set_xlabel, it passes the information on the Text
-instance of the XAxis. Each Axes instance contains an xaxis and a
-yaxis instance, which handle the layout and drawing of the ticks, tick
-labels and axis labels.
+When you call :meth:`ax.set_xlabel <matplotlib.axes.Axes.set_xlabel>`,
+it passes the information on the :class:`~matplotlib.text.Text`
+instance of the :class:`~matplotlib.axis.XAxis`. Each ``Axes``
+instance contains an :class:`~matplotlib.axis.XAxis` and a
+:class:`~matplotlib.axis.YAxis` instance, which handle the layout and
+drawing of the ticks, tick labels and axis labels.
 
-Here are the most important matplotlib modules that contain the
-classes referenced above
+.. I'm commenting this out, since the new Sphinx cross-references
+.. sort of take care of this above - MGD
 
-=============== ==================
-Artist Module
-=============== ==================
-Artist matplotlib.artist
-Rectangle matplotlib.patches
-Line2D matplotlib.lines
-Axes matplotlib.axes
-XAxis and YAxis matplotlib.axis
-Figure matplotlib.figure
-Text	 matplotlib.text
-=============== ==================
+.. Here are the most important matplotlib modules that contain the
+.. classes referenced above
 
-Try creating the figure below
+.. =============== ==================
+.. Artist Module
+.. =============== ==================
+.. Artist matplotlib.artist
+.. Rectangle matplotlib.patches
+.. Line2D matplotlib.lines
+.. Axes matplotlib.axes
+.. XAxis and YAxis matplotlib.axis
+.. Figure matplotlib.figure
+.. Text	 matplotlib.text
+.. =============== ==================
 
+Try creating the figure below.
+
 .. image:: figures/fig_axes_labels_simple.png
 :scale: 75
 
 Customizing your objects
 ========================
 
-Every element in the figure is represented by a matplotlib Artist, and
-each has an extensive list of properties to configure its appearance.
-The figure itself contains a Rectangle exactly the size of the figure,
+Every element in the figure is represented by a matplotlib
+:class:`~matplotlib.artist.Artist`, and each has an extensive list of
+properties to configure its appearance. The figure itself contains a
+:class:`~matplotlib.patches.Rectangle` exactly the size of the figure,
 which you can use to set the background color and transparency of the
-figures. Likewise, each Axes bounding box (the standard white box
-with black edges in the typical matplotlib plot, has a Rectangle
-instance that determines the color, transparency, and other properties
-of the Axes. These instances are stored as member variables
-Figure.figurePatch and Axes.axesPatch ("Patch" is a name inherited
-from Matlab, and is a 2D "patch" of color on the figure, eg
-rectangles, circles and polygons). Every matplotlib Artist has the
-following properties
+figures. Likewise, each :class:`~matplotlib.axes.Axes` bounding box
+(the standard white box with black edges in the typical matplotlib
+plot, has a ``Rectangle`` instance that determines the color,
+transparency, and other properties of the Axes. These instances are
+stored as member variables :attr:`Figure.figurePatch
+<matplotlib.figure.Figure.figurePatch>` and :attr:`Axes.axesPatch
+<matplotlib.axes.Axes.axesPatch>` ("Patch" is a name inherited from
+MATLABTM, and is a 2D "patch" of color on the figure, eg. rectangles,
+circles and polygons). Every matplotlib ``Artist`` has the following
+properties
 
 ========== ======================================================================
 Property Description
@@ -145,7 +174,7 @@
 ========== ======================================================================
 
 Each of the properties is accessed with an old-fashioned setter or
-getter (yes we know this irritates pythonistas and we plan to support
+getter (yes we know this irritates Pythonistas and we plan to support
 direct access via properties or traits but it hasn't been done yet).
 For example, to multiply the current alpha by a half::
 
@@ -153,15 +182,17 @@
 o.set_alpha(0.5*a)
 
 If you want to set a number of properties at once, you can also use
-the "set" method with keyword arguments. For example::
+the ``set`` method with keyword arguments. For example::
 
 o.set(alpha=0.5, zorder=2)
 
 If you are working interactively at the python shell, a handy way to
-inspect the artist properties is to use the matplotlib.artist.getp
-method, which lists the properties and their values (simply "getp") in
-pylab. This works for classes derived from Artist as well, eg Figure
-and Rectangle. Here are the Figure rectangle properties mentioned above:
+inspect the ``Artist`` properties is to use the
+:func:`matplotlib.artist.getp` function (simply
+:func:`~matplotlib.pylab.getp` in pylab), which lists the properties
+and their values. This works for classes derived from ``Artist`` as
+well, eg. ``Figure`` and ``Rectangle``. Here are the ``Figure`` rectangle
+properties mentioned above:
 
 .. sourcecode:: ipython
 
@@ -192,7 +223,9 @@
 	y = 0
 	zorder = 1
 
-The docstrings for all of the classes also contain the artist
+.. TODO: Update these URLs
+
+The docstrings for all of the classes also contain the ``Artist``
 properties, so you can consult the interactive "help", the online html
 docs at http://matplotlib.sourceforge.net/classdocs.html or PDF documentation
 at http://matplotlib.sourceforge.net/api.pdf for a listing of
@@ -201,27 +234,32 @@
 Object containers
 =================
 
-Now that we know how to inspect set the properties of a given
-object we want to configure, we need to now how to get at that
-object. As mentioned in the introduction, there are two kinds of
-objects: primitives and containers. The primitives are usually the
-things you want to configure (the font of a Text instance, the width
-of a Line2D) although the containers also have some properties as
-well -- for example the Axes Artist is a container that contains many
-of the primitives in your plot, but it also has properties like the
-xscale to control whether the xaxis is 'linear' or 'log'. In this
-section we'll review where the various container objects store the
-Artists that you want to get at.
+Now that we know how to inspect set the properties of a given object
+we want to configure, we need to now how to get at that object. As
+mentioned in the introduction, there are two kinds of objects:
+primitives and containers. The primitives are usually the things you
+want to configure (the font of a :class:`~matplotlib.text.Text`
+instance, the width of a :class:`~matplotlib.lines.Line2D`) although
+the containers also have some properties as well -- for example the
+:class:`~matplotlib.axes.Axes` :class:`~matplotlib.artist.Artist` is a
+container that contains many of the primitives in your plot, but it
+also has properties like the ``xscale`` to control whether the xaxis is
+'linear' or 'log'. In this section we'll review where the various
+container objects store the ``Artists`` that you want to get at.
 
 Figure container
 ----------------
 
-The top level container Artist is the matplotlib.figure.Figure, and it
-contains everything in the figure. The background of the figure is a
-Rectangle which is stored in fig.figurePatch (where fig is your Figure
-instance). As you add subplots (fig.add_subplot) and axes
-(ax.add_axes)to the figure these will be appended to the fig.axes
-list. These are also returned by the methods that create them:
+The top level container ``Artist`` is the
+:class:`matplotlib.figure.Figure`, and it contains everything in the
+figure. The background of the figure is a
+:class:`~matplotlib.patches.Rectangle` which is stored in
+:attr:`Figure.figurePatch <matplotlib.figure.Figure.figurePatch>`. As
+you add subplots (:meth:`~matplotlib.figure.Figure.add_subplot`) and
+axes (:meth:`~matplotlib.figure.Figure.add_axes`) to the figure
+these will be appended to the :attr:`Figure.axes
+<matplotlib.figure.Figure.axes>`. These are also returned by the
+methods that create them:
 
 .. sourcecode:: ipython
 
@@ -238,13 +276,16 @@
 [<matplotlib.axes.Subplot instance at 0xd54b26c>, <matplotlib.axes.Axes instance at 0xd3f0b2c>]
 
 Because the figure maintains the concept of the "current axes" (see
-Figure.gca and Figure.sca) to support the pylab/pyplot state machine,
-you should not insert or remove axes directly from the axes list, but
-rather use the Figure.add_axes and Figure.add_subplot method to
-insert, and the Figure.delaxes methods to delete. You are free
-however, to iterate over the list of axes or index into it to get
-access to Axes instances you want to customize. Here is an example
-which turns all the axes grids on::
+:meth:`Figure.gca <matplotlib.figure.Figure.gca>` and
+:meth:`Figure.sca <matplotlib.figure.Figure.sca>`) to support the
+pylab/pyplot state machine, you should not insert or remove axes
+directly from the axes list, but rather use the
+:meth:`~matplotlib.figure.Figure.add_subplot` and
+:meth:`~matplotlib.figure.Figure.add_axes` methods to insert, and the
+:meth:`~matplotlib.figure.Figure.delaxes` method to delete. You are
+free however, to iterate over the list of axes or index into it to get
+access to ``Axes`` instances you want to customize. Here is an
+example which turns all the axes grids on::
 
 for ax in fig.axes:
 ax.grid(True)
@@ -252,21 +293,25 @@
 
 The figure also has its own text, lines, patches and images, which you
 can use to add primitives directly. The default coordinate system for
-the Figure will simply be in pixels (which is not usually what you
+the ``Figure`` will simply be in pixels (which is not usually what you
 want) but you can control this by setting the transform property of
-the Artist you are adding to the figure. More useful is "figure
-coordinates" where 0,0 is the bottom, left of the figure and 1,1 is
-the top, right of the figure which you can obtain by setting the
-Artist transform to fig.transFigure:
+the ``Artist`` you are adding to the figure.
 
+.. TODO: Is that still true?
+
+More useful is "figure coordinates" where (0, 0) is the bottom-left of
+the figure and (1, 1) is the top-right of the figure which you can
+obtain by setting the ``Artist`` transform to :attr:`fig.transFigure
+<matplotlib.figure.Figure.transFigure>`:
+
 .. sourcecode:: ipython
 
 In [191]: fig = plt.figure()
 
- In [192]: l1 = matplotlib.lines.Line2D([0, 1], [0, 1], 
+ In [192]: l1 = matplotlib.lines.Line2D([0, 1], [0, 1],
 transform=fig.transFigure, figure=fig)
 
- In [193]: l2 = matplotlib.lines.Line2D([0, 1], [1, 0], 
+ In [193]: l2 = matplotlib.lines.Line2D([0, 1], [1, 0],
 transform=fig.transFigure, figure=fig)
 
 In [194]: fig.lines.extend([l1, l2])
@@ -279,6 +324,8 @@
 
 Here is a summary of the Artists the figure contains
 
+.. TODO: Add xrefs to this table
+
 ================ ===============================================================
 Figure attribute Description
 ================ ===============================================================
@@ -295,23 +342,28 @@
 Axes container
 --------------
 
-The matplotlib.axes.Axes is the center of the matplotlib universe --
-it contains the vast majority of all the Artists used in a figure with
-many helper methods to create and these Artists to itself, as well as
-helper methods to access and customize the Artists it contains. Like
-the Figure, it contains a Patch ax.axesPatch which is Rectangle for
-Cartesian coordinates and a Circle for polar coordinates; this patch
+The :class:`matplotlib.axes.Axes` is the center of the matplotlib
+universe -- it contains the vast majority of all the ``Artists`` used
+in a figure with many helper methods to create and add these
+``Artists`` to itself, as well as helper methods to access and
+customize the ``Artists`` it contains. Like the
+:class:`~matplotlib.figure.Figure`, it contains a
+:class:`~matplotlib.patches.Patch`
+:attr:`~matplotlib.axes.Axes.axesPatch` which is a
+:class:`~matplotlib.patches.Rectangle` for Cartesian coordinates and a
+:class:`~matplotlib.patches.Circle` for polar coordinates; this patch
 determines the shape, background and border of the plotting region::
 
 ax = fig.add_subplot(111)
 rect = ax.axesPatch # a Rectangle instance
 rect.set_facecolor('green')
 
-When you call a plotting method, eg the canonical "ax.plot" and pass
-in arrays or list of values, the method will a matplotlib.lines.Line2D
-instance, update the line with all the Line2D properties passed as
-keyword arguments, add the line to the Axes.lines container, and
-returns it to you:
+When you call a plotting method, eg. the canonical
+:meth:`~matplotlib.axes.Axes.plot` and pass in arrays or lists of
+values, the method will create a :meth:`matplotlib.lines.Line2D`
+instance, update the line with all the ``Line2D`` properties passed as
+keyword arguments, add the line to the :attr:`Axes.lines
+<matplotlib.axes.Axes.lines>` container, and returns it to you:
 
 .. sourcecode:: ipython
 
@@ -319,18 +371,20 @@
 
 In [214]: line, = ax.plot(x, y, '-', color='blue', linewidth=2)
 
-ax.plot returns a list of lines because you can pass in multiple x, y
+``plot`` returns a list of lines because you can pass in multiple x, y
 pairs to plot, and we are unpacking the first element of the length
 one list into the line variable. The line has been added to the
-ax.lines list:
+``Axes.lines`` list:
 
 .. sourcecode:: ipython
 
 In [229]: print ax.lines
 [<matplotlib.lines.Line2D instance at 0xd378b0c>]
 
-Similarly, methods that create patches, like ax.bar creates a list of
-rectangles, will add the patches to the ax.patches list:
+Similarly, methods that create patches, like
+:meth:`~matplotlib.axes.Axes.bar` creates a list of rectangles, will
+add the patches to the :attr:`Axes.patches
+<matplotlib.axes.Axes.patches>` list:
 
 .. sourcecode:: ipython
 
@@ -341,17 +395,19 @@
 
 In [235]: print len(ax.patches)
 
-You should not add objects directly to the ax.lines or ax.patches
-unless you know exactly what you are doing, because the Axes needs to
-do a few things when it creates and adds an object. It sets the figure
-and axes property of the Artist, as well as the default Axes
-transformation (unless a transformation is set). It also inspects the
-data contained in the Artist to update the data structures controlling
-auto-scaling, so that the view limits can be adjusted to contain the
-plotted data. You can, nonetheless, create objects yourself and add
-them directly to the Axes using helper methods like ax.add_line and
-ax.add_patch. Here is an annotated interactive session illustrating
-what is going on:
+You should not add objects directly to the ``Axes.lines`` or
+``Axes.patches`` lists unless you know exactly what you are doing,
+because the ``Axes`` needs to do a few things when it creates and adds
+an object. It sets the figure and axes property of the ``Artist``, as
+well as the default ``Axes`` transformation (unless a transformation
+is set). It also inspects the data contained in the ``Artist`` to
+update the data structures controlling auto-scaling, so that the view
+limits can be adjusted to contain the plotted data. You can,
+nonetheless, create objects yourself and add them directly to the
+``Axes`` using helper methods like
+:meth:`~matplotlib.axes.Axes.add_line` and
+:meth:`~matplotlib.axes.Axes.add_patch`. Here is an annotated
+interactive session illustrating what is going on:
 
 .. sourcecode:: ipython
 
@@ -405,9 +461,9 @@
 In [274]: ax.figure.canvas.draw()
 
 
-There are many, many Axes helper methods for creating primitive
-Artists and adding them to their respective containers. The table
-below summarizes a small sampling of them, the kinds of Artist they
+There are many, many ``Axes`` helper methods for creating primitive
+``Artists`` and adding them to their respective containers. The table
+below summarizes a small sampling of them, the kinds of ``Artist`` they
 create, and where they store them
 
 ============================== ==================== =======================
@@ -426,14 +482,18 @@
 ============================== ==================== =======================
 
 
-In addition to all of these Artists, the Axes contains two important
-Artist containers: the XAxis and YAxis, which handle the drawing of
-the ticks and labels. These are stored as instance variables xaxis
-and yaxis. The XAxis and YAxis containers will be detailed below, but
-note that the Axes contains many helper methods which forward calls on
-to the Axis instances so you often do not need to work with them
-directly unless you want to. For example, you can set the fontsize of
-the XAxis ticklabels using the Axes helper method::
+In addition to all of these ``Artists``, the ``Axes`` contains two
+important ``Artist`` containers: the :class:`~matplotlib.axis.XAxis`
+and :class:`~matplotlib.axis.YAxis`, which handle the drawing of the
+ticks and labels. These are stored as instance variables
+:attr:`~matplotlib.axes.Axes.xaxis` and
+:attr:`~matplotlib.axes.Axes.yaxis`. The ``XAxis`` and ``YAxis``
+containers will be detailed below, but note that the ``Axes`` contains
+many helper methods which forward calls on to the
+:class:`~matplotlib.axis.Axis` instances so you often do not need to
+work with them directly unless you want to. For example, you can set
+the font size of the ``XAxis`` ticklabels using the ``Axes`` helper
+method::
 
 for label in ax.get_xticklabels():
 label.set_color('orange')
@@ -458,24 +518,29 @@
 Axis containers
 ---------------
 
-The matplotlib.axis.Axis instances handle the drawing of the tick lines, the grid
-lines, the tick labels and the axis label. You can configure the left
-and right ticks separately for the y axis, and the upper and lower
-ticks separately for the x axis. The axis also stores the data and view
-intervals used in auto-scaling, panning and zooming, as well as the
-locator and formatter instances which control where the ticks are
-placed and how they are represented as strings.
+The :class:`matplotlib.axis.Axis` instances handle the drawing of the
+tick lines, the grid lines, the tick labels and the axis label. You
+can configure the left and right ticks separately for the y-axis, and
+the upper and lower ticks separately for the x-axis. The ``Axis``
+also stores the data and view intervals used in auto-scaling, panning
+and zooming, as well as the :class:`~matplotlib.ticker.Locator` and
+:class:`~matplotlib.ticker.Formatter` instances which control where
+the ticks are placed and how they are represented as strings.
 
-Each axis object contains a label attribute (this is what the pylab
-calls to xlabel and ylabel set) as well as a list of major and minor
-ticks. The ticks are XTick and YTick instances, which contain the
-actual line and text primitives that render the ticks and ticklabels.
-Because the ticks are dynamically created as needed (eg when panning
-and zooming), you should access the lists of major and minor ticks
-through their accessor methods axis.get_major_ticks() and
-axis.get_minor_ticks(). Although the ticks contain all the primitives
-and will be covered below, the Axis methods contain accessor methods
-to return the tick lines, tick labels, tick locations etc....:
+Each ``Axis`` object contains a :attr:`~matplotlib.axis.Axis.label`
+attribute (this is what the :mod:`~matplotlib.pylab` calls to
+:func:`~matplotlib.pylab.xlabel` and :func:`~matplotlib.pylab.ylabel`
+set) as well as a list of major and minor ticks. The ticks are
+:class:`~matplotlib.axis.XTick` and :class:`~matplotlib.axis.YTick`
+instances, which contain the actual line and text primitives that
+render the ticks and ticklabels. Because the ticks are dynamically
+created as needed (eg. when panning and zooming), you should access
+the lists of major and minor ticks through their accessor methods
+:meth:`~matplotlib.axis.Axis.get_major_ticks` and
+:meth:`~matplotlib.axis.Axis.get_minor_ticks`. Although the ticks
+contain all the primitives and will be covered below, the ``Axis`` methods
+contain accessor methods to return the tick lines, tick labels, tick
+locations etc.:
 
 .. sourcecode:: ipython
 
@@ -501,7 +566,7 @@
 In [292]: axis.get_ticklines(minor=True)
 Out[292]: <a list of 0 Line2D ticklines objects>
 
-Here is a summary of some of the useful accessor methods of the Axis
+Here is a summary of some of the useful accessor methods of the ``Axis``
 (these have corresponding setters where useful, such as
 set_major_formatter)
 
@@ -538,13 +603,15 @@
 Tick containers
 ---------------
 
-The matplotlib.axis.Tick is the final container object in our descent
-from the Figure to the Axes to the Axis to the Tick. The Tick
-contains the tick and grid line instances, as well as the label
-instances for the upper and lower ticks. Each of these is accessible
-directly as an attribute of the Tick. In addition, there are boolean
-variables that determine whether the upper labels and ticks are on for
-the xaxis and whether the right labels and ticks are on for the yaxis.
+The :class:`matplotlib.axis.Tick` is the final container object in our
+descent from the :class:`~matplotlib.figure.Figure` to the
+:class:`~matplotlib.axes.Axes` to the :class:`~matplotlib.axis.Axis`
+to the :class:`~matplotlib.axis.Tick`. The ``Tick`` contains the tick
+and grid line instances, as well as the label instances for the upper
+and lower ticks. Each of these is accessible directly as an attribute
+of the ``Tick``. In addition, there are boolean variables that determine
+whether the upper labels and ticks are on for the x-axis and whether
+the right labels and ticks are on for the y-axis.
 
 ============== ==========================================================
 Tick attribute Description
Modified: trunk/matplotlib/doc/users/customizing.rst
===================================================================
--- trunk/matplotlib/doc/users/customizing.rst	2008年05月30日 14:32:29 UTC (rev 5319)
+++ trunk/matplotlib/doc/users/customizing.rst	2008年05月30日 16:21:21 UTC (rev 5320)
@@ -23,4 +23,4 @@
 A sample matplotlibrc file
 --------------------------
 
-.. literalinclude:: ../mpl_data/matplotlibrc
\ No newline at end of file
+.. literalinclude:: ../mpl_data/matplotlibrc
Modified: trunk/matplotlib/doc/users/index.rst
===================================================================
--- trunk/matplotlib/doc/users/index.rst	2008年05月30日 14:32:29 UTC (rev 5319)
+++ trunk/matplotlib/doc/users/index.rst	2008年05月30日 16:21:21 UTC (rev 5320)
@@ -9,8 +9,8 @@
 
 matplotlib is a library for making 2D plots of arrays in `Python
 <http://www.python.org>`_. Although it has its origins in emulating
-the `Matlab (TM) <http://www.mathworks.com>`_ graphics commands, it does
-not require MATLAB (TM), and can be used in a Pythonic, object oriented
+the `MATLABTM <http://www.mathworks.com>`_ graphics commands, it does
+not require MATLAB, and can be used in a Pythonic, object oriented
 way. Although matplotlib is written primarily in pure Python, it
 makes heavy use of `NumPy <http://www.numpy.org>`_ and other extension
 code to provide good performance even for large arrays.
@@ -22,14 +22,14 @@
 should just work.
 
 For years, I used to use MATLAB exclusively for data analysis and
-visualization. Matlab excels at making nice looking plots easy. When
+visualization. MATLAB excels at making nice looking plots easy. When
 I began working with EEG data, I found that I needed to write
 applications to interact with my data, and developed and EEG analysis
-application in Matlab. As the application grew in complexity,
+application in MATLAB. As the application grew in complexity,
 interacting with databases, http servers, manipulating complex data
-structures, I began to strain against the limitations of Matlab as a
+structures, I began to strain against the limitations of MATLAB as a
 programming language, and decided to start over in Python. Python
-more than makes up for all of matlab's deficiencies as a programming
+more than makes up for all of MATLAB's deficiencies as a programming
 language, but I was having difficulty finding a 2D plotting package
 (for 3D `VTK <http://www.vtk.org/>`_) more than exceeds all of my needs).
 
@@ -52,9 +52,9 @@
 Finding no package that suited me just right, I did what any
 self-respecting Python programmer would do: rolled up my sleeves and
 dived in. Not having any real experience with computer graphics, I
-decided to emulate Matlab's plotting capabilities because that is
-something Matlab does very well. This had the added advantage that
-many people have a lot of Matlab experience, and thus they can
+decided to emulate MATLAB's plotting capabilities because that is
+something MATLAB does very well. This had the added advantage that
+many people have a lot of MATLAB experience, and thus they can
 quickly get up to steam plotting in python. From a developer's
 perspective, having a fixed user interface (the pylab interface) has
 been very useful, because the guts of the code base can be redesigned
@@ -63,7 +63,7 @@
 The matplotlib code is conceptually divided into three parts: the
 *pylab interface* is the set of functions provided by
 :mod:`matplotlib.pylab` which allow the user to create plots with code
-quite similar to Matlab figure generating code. The *matplotlib
+quite similar to MATLAB figure generating code. The *matplotlib
 frontend* or *matplotlib API* is the set of classes that do the heavy
 lifting, creating and managing figures, text, lines, plots and so on.
 This is an abstract interface that knows nothing about output. The
@@ -86,7 +86,7 @@
 to a printer or publishers. Others deploy matplotlib on a web
 application server to generate PNG output for inclusion in
 dynamically-generated web pages. Some use matplotlib interactively
-from the Python shell in Tkinter on Windows (TM) My primary use is to
+from the Python shell in Tkinter on WindowsTM. My primary use is to
 embed matplotlib in a Gtk+ EEG application that runs on Windows, Linux
 and Macintosh OS X.
 
Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst
===================================================================
--- trunk/matplotlib/doc/users/pyplot_tutorial.rst	2008年05月30日 14:32:29 UTC (rev 5319)
+++ trunk/matplotlib/doc/users/pyplot_tutorial.rst	2008年05月30日 16:21:21 UTC (rev 5320)
@@ -27,7 +27,7 @@
 :func:`~matplotlib.pyplot.plot` is a versatile command, and will take
 an arbitrary number of arguments. For example, to plot x versus y,
 you can issue the command::
- 
+
 plt.plot([1,2,3,4], [1,4,9,16])
 
 For every x, y pair of arguments, there is a optional third argument
@@ -70,7 +70,7 @@
 several ways to set line properties
 
 * Use keyword args::
- 
+
 plt.plot(x, y, linewidth=2.0)
 
 
@@ -208,7 +208,7 @@
 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 to add text in the indicated locations.
 
 .. literalinclude:: figures/pyplot_text.py
 
@@ -339,4 +339,4 @@
 
 
 
- 
\ 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: <md...@us...> - 2008年06月02日 14:17:18
Revision: 5357
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5357&view=rev
Author: mdboom
Date: 2008年06月02日 07:17:14 -0700 (2008年6月02日)
Log Message:
-----------
Fix STIX fonts table (just use a raw image).
Modified Paths:
--------------
 trunk/matplotlib/doc/users/mathtext.rst
Added Paths:
-----------
 trunk/matplotlib/doc/_static/stix_fonts.png
Added: trunk/matplotlib/doc/_static/stix_fonts.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/doc/_static/stix_fonts.png
___________________________________________________________________
Name: svn:mime-type
 + application/octet-stream
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst	2008年06月02日 14:08:58 UTC (rev 5356)
+++ trunk/matplotlib/doc/users/mathtext.rst	2008年06月02日 14:17:14 UTC (rev 5357)
@@ -156,17 +156,11 @@
 ``\mathcal`` :math:`\mathcal{CALLIGRAPHY}`
 =============== =================================
 
-.. When using the STIX fonts, you also have the choice of:
-..
-.. ================ =================================
-.. Command Result
-.. ================ =================================
-.. ``\mathbb`` :math:`\mathbb{Blackboard}`
-.. ``\mathcircled`` :math:`\mathcircled{Circled}`
-.. ``\mathfrak`` :math:`\mathfrak{Fraktur}`
-.. ``\mathsf`` :math:`\mathsf{sans-serif}`
-.. ================ =================================
+When using the STIX fonts, you also have the choice of:
 
+.. image:: ../_static/stix_fonts.png
+
+
 Accents
 -------
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年06月02日 17:58:07
Revision: 5364
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5364&view=rev
Author: mdboom
Date: 2008年06月02日 10:57:28 -0700 (2008年6月02日)
Log Message:
-----------
Add examples of different mathtext font sets.
Modified Paths:
--------------
 trunk/matplotlib/doc/users/mathtext.rst
Added Paths:
-----------
 trunk/matplotlib/doc/_static/cm_fontset.png
 trunk/matplotlib/doc/_static/stix_fontset.png
 trunk/matplotlib/doc/_static/stixsans_fontset.png
Added: trunk/matplotlib/doc/_static/cm_fontset.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/doc/_static/cm_fontset.png
___________________________________________________________________
Name: svn:mime-type
 + application/octet-stream
Added: trunk/matplotlib/doc/_static/stix_fontset.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/doc/_static/stix_fontset.png
___________________________________________________________________
Name: svn:mime-type
 + application/octet-stream
Added: trunk/matplotlib/doc/_static/stixsans_fontset.png
===================================================================
(Binary files differ)
Property changes on: trunk/matplotlib/doc/_static/stixsans_fontset.png
___________________________________________________________________
Name: svn:mime-type
 + application/octet-stream
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst	2008年06月02日 17:40:19 UTC (rev 5363)
+++ trunk/matplotlib/doc/users/mathtext.rst	2008年06月02日 17:57:28 UTC (rev 5364)
@@ -160,7 +160,21 @@
 
 .. image:: ../_static/stix_fonts.png
 
+There are also three global "font sets" to choose from, which are
+selected using the ``mathtext.fontset`` parameter in ``matplotibrc``.
 
+``cm``: **Computer Modern (TeX)**
+
+.. image:: ../_static/cm_fontset.png
+
+``stix``: **STIX** (designed to blend well with Times)
+
+.. image:: ../_static/stix_fontset.png
+
+``stixsans``: **STIX sans-serif**
+
+.. image:: ../_static/stixsans_fontset.png
+
 Accents
 -------
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年06月02日 18:53:14
Revision: 5366
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5366&view=rev
Author: jdh2358
Date: 2008年06月02日 11:52:09 -0700 (2008年6月02日)
Log Message:
-----------
a couple of FAQs
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/documenting_mpl.rst
 trunk/matplotlib/doc/devel/index.rst
 trunk/matplotlib/doc/faq/howto_faq.rst
 trunk/matplotlib/doc/faq/installing_faq.rst
 trunk/matplotlib/doc/faq/troubleshooting_faq.rst
 trunk/matplotlib/doc/users/artists.rst
 trunk/matplotlib/doc/users/index.rst
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月02日 18:26:43 UTC (rev 5365)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月02日 18:52:09 UTC (rev 5366)
@@ -77,3 +77,30 @@
 
 .. literalinclude:: ../mpl_data/matplotlibrc
 
+
+Internal section references
+===========================
+
+To maximize internal consistency in section labeling and references,
+use hypen separated, descriptive labels for section references, eg::
+
+ .. _howto-webapp:
+
+and refer to it using the standard reference syntax::
+
+ See :ref:`howto-webapp`
+
+Keep in mind that we may want to reorganize the contents later, so
+let's avoid top level names in references like ``user`` or ``devel``
+or ``faq`` unless necesssary, because for example the FAQ "what is a
+backend?" could later become part of the users guide, so the label::
+
+ .. _what-is-a-backend
+
+is better than::
+
+ .. _faq-backend
+
+In addition, since underscores are widely used by Sphinx itself, let's prefer hyphens to separate words.
+
+
Modified: trunk/matplotlib/doc/devel/index.rst
===================================================================
--- trunk/matplotlib/doc/devel/index.rst	2008年06月02日 18:26:43 UTC (rev 5365)
+++ trunk/matplotlib/doc/devel/index.rst	2008年06月02日 18:52:09 UTC (rev 5366)
@@ -1,4 +1,4 @@
-.. _developers_guide-index:
+.. _developers-guide-index:
 
 ###################################
 The Matplotlib Developers's Guide
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月02日 18:26:43 UTC (rev 5365)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月02日 18:52:09 UTC (rev 5366)
@@ -2,6 +2,33 @@
 HOWTO
 *****
 
+.. _howto-ticks:
+
+How do I configure the tick linewidths?
+=======================================
+
+In matplotlib, the ticks are *markers*. All
+:class:`~matplotlib.lines.Line2D` objects support a line (solid,
+dashed, etc) and a marker (circle, square, tick). The tick linewidth
+is controlled by the "markeredgewidth" property::
+
+ import matplotlib.pyplot as plt
+ fig = plt.figure()
+ ax = fig.add_subplot(111)
+ ax.plot(range(10))
+
+ for line in ax.get_xticklines() + ax.get_yticklines():
+ line.set_markersize(10)
+
+ plt.show()
+
+The other properties that control the tick marker, and all markers,
+are ``markerfacecolor``, ``markeredgecolor``, ``markeredgewidth``,
+``markersize``. For more information on configuring ticks, see
+:ref:`artist-tut-axis` and :ref:`artist-tut-tick`.
+
+.. _howto-webapp:
+
 How do I use matplotlib in a web application server?
 ====================================================
 
@@ -24,6 +51,9 @@
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt
 
+For more on configuring your backend, see
+:ref:`what-is-a-backend`.
+
 Alternatively, you can avoid pylab/pyplot altogeher, which will give
 you a little more control, by calling the API directly as shown in
 `agg_oo.py <http://matplotlib.sf.net/examples/api/agg_oo.py>`_ .
@@ -50,7 +80,7 @@
 
 TODO
 
-How do I use matplotlib with dhango?
+How do I use matplotlib with django?
 ------------------------------------
 
 TODO
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月02日 18:26:43 UTC (rev 5365)
+++ trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月02日 18:52:09 UTC (rev 5366)
@@ -2,10 +2,12 @@
 Installation FAQ
 ==================
 
+
+
 How do I report a compilation problem?
 ======================================
 
-See :ref:`reporting_problems`.
+See :ref:`reporting-problems`.
 
 How do I cleanly rebuild and reinstall everything?
 ==================================================
@@ -26,4 +28,98 @@
 find the location of this directory by doing::
 
 import matplotlib
- print matplotlib.get_configdir()
\ No newline at end of file
+ print matplotlib.get_configdir()
+
+.. _what-is-a-backend:
+
+What is a backend?
+==================
+
+A lot of documentation on the website and in the mailing lists refers
+to the "backend" and many new users are confused by this term.
+matplotlib targets many different use cases and output formats. Some
+people use matplotlib interactively from the python shell and have
+plotting windows pop up when they type commands. Some people embed
+matplotlib into graphical user interfaces like wxpython or pygtk to
+build rich applications. Others use matplotlib in batch scripts, to
+generate postscript images from some numerical simulations, and still
+others in web application servers to dynamically serve up graphs.
+
+To support all of these use cases, matplotlib can target different
+outputs, and each of these capabililities is called a backend (the
+"frontend" is the user facing code, ie the plotting code, whereas the
+"backend" does all the dirty work behind the scenes to make the
+figure. There are two types of backends: user interface backends (for
+use in pygtk, wxpython, tkinter, qt or fltk) and hardcopy backends to
+make image files (PNG, SVG, PDF, PS).
+
+There are a two primary ways to configure your backend. One is to set
+the ``backend`` parameter in you ``matplotlibrc`` file (see
+link:Configuring)::
+
+ backend : WXAgg # use wxpython with antigrain (agg) rendering 
+
+The other is to use the matplotlib :func:`~matplotlib.use` directive::
+
+ import matplotlib
+ matplotlib.use('PS') # generate postscript output by default
+
+If you use the ``use`` directive, this must be done before importing
+:mod:`matplotlib.pyplot` or :mod:`matplotlib.pylab`.
+
+If you are unsure what to do, and just want to get cranking, just set
+your backend to `TkAgg`. This will do the right thing for 95% of the
+users. It gives you the option of running your scripts in batch or
+working interactively from the python shell, with the least amount of
+hassles, and is smart enough to do the right thing when you ask for
+postscript, or pdf, or other image formats.
+
+If however, you want to write graphical user interfaces, or a web
+application server (:ref:`howto-webapp`), or need a better
+understanding of what is going on, read on. To make things a little
+more customizable for graphical user interfaces, matplotlib separates
+the concept of the renderer (the thing that actually does the drawing)
+from the canvas (the place where the drawing goes). The canonical
+renderer for user interfaces is ``Agg`` which uses the `antigrain
+<http://antigrain.html>`_ C++ library to make a raster (pixel) image
+of the figure. All of the user interfaces can be used with agg
+rendering, eg ``WXAgg``, ``GTKAgg``, ``QTAgg``, ``TkAgg``. In
+addition, some of the user interfaces support other rendering engines.
+For example, with GTK, you can also select GDK rendering (backend
+``GTK``) or Cairo rendering (backend ``GTKCairo``).
+
+For the rendering engines, one can also distinguish between vector or
+raster renderers. Vector issue drawing commands like "draw a line
+from this point to this point" and hence are scale free, and raster
+backends generate a pixel represenation of the line whose accuracy
+depends on a DPI setting.
+
+Here is a summary of the matplotlib rendering backends:
+
+=============================== =====================================================================================
+Renderer (Filetypes) Description
+=============================== =====================================================================================
+Agg (png) raster - high quality images using the `antigrain <http://antigrain.html>`_ engine
+PS (ps, eps) vector - postscript output
+PDF (pdf) vector - portable document format
+SVG (svg) vector - scalar vector graphics
+Cairo (png, ps, pdf, svn, ...) vector - `cairo graphics <http://cairographics.org>`_
+GDK (png, jpg, tiff..) raster - the GDK drawing API for GTK
+=============================== =====================================================================================
+
+And here are the user interfaces and renderer combinations supported:
+
+============ ===================================================================================================
+Backend Description 
+============ ===================================================================================================
+GTKAgg Agg rendering to a GTK canvas (`pygtk <http://www.pygtk.org>`_)
+GTK GDK rendering to a GTK canvas (not recommended) (`pygtk <http://www.pygtk.org>`_)
+GTKCairo Cairo rendering to a GTK Canvas (`pygtk <http://www.pygtk.org>`_)
+WXAgg Agg rendering to to a WX canvas (`wxpython <http://www.wxpython.org>`_)
+WX Native WX drawing to a WX Canvas (not recommended) (`wxpython <http://www.wxpython.org>`_)
+TkAgg Agg rendering to a Tkinter canvas (`tkinter <http://wiki.python.org/moin/TkInter>`_)
+QtAgg Agg rendering to a Qt canvas (`pyqt <http://www.riverbankcomputing.co.uk/software/pyqt/intro>`_)
+Qt4Agg Agg rendering to a Qt4 canvas (`pyqt <http://www.riverbankcomputing.co.uk/software/pyqt/intro>`_)
+FLTKAgg Agg rendering to a FLTK canvas (`pyfltk <http://pyfltk.sourceforge.net>`)_
+============ ===================================================================================================
+
Modified: trunk/matplotlib/doc/faq/troubleshooting_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月02日 18:26:43 UTC (rev 5365)
+++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月02日 18:52:09 UTC (rev 5366)
@@ -2,7 +2,7 @@
 Troubleshooting FAQ
 ===================
 
-.. _reporting_problems:
+.. _reporting-problems:
 
 How do I report a problem?
 ==========================
Modified: trunk/matplotlib/doc/users/artists.rst
===================================================================
--- trunk/matplotlib/doc/users/artists.rst	2008年06月02日 18:26:43 UTC (rev 5365)
+++ trunk/matplotlib/doc/users/artists.rst	2008年06月02日 18:52:09 UTC (rev 5366)
@@ -247,6 +247,8 @@
 'linear' or 'log'. In this section we'll review where the various
 container objects store the ``Artists`` that you want to get at.
 
+.. _figure-container:
+
 Figure container
 ----------------
 
@@ -338,6 +340,7 @@
 texts A list Figure Text instances
 ================ ===============================================================
 
+.. _axes-container:
 
 Axes container
 --------------
@@ -515,6 +518,8 @@
 yaxis matplotlib.axis.YAxis instance
 ============== ======================================
 
+.. _axis-container:
+
 Axis containers
 ---------------
 
@@ -599,6 +604,7 @@
 :scale: 75
 
 
+.. _tick-container:
 
 Tick containers
 ---------------
Modified: trunk/matplotlib/doc/users/index.rst
===================================================================
--- trunk/matplotlib/doc/users/index.rst	2008年06月02日 18:26:43 UTC (rev 5365)
+++ trunk/matplotlib/doc/users/index.rst	2008年06月02日 18:52:09 UTC (rev 5366)
@@ -1,4 +1,4 @@
-.. _users_guide-index:
+.. _users-guide-index:
 
 #############################
 The Matplotlib User's Guide
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年06月02日 21:01:55
Revision: 5367
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5367&view=rev
Author: jdh2358
Date: 2008年06月02日 14:01:47 -0700 (2008年6月02日)
Log Message:
-----------
some more doc updates
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/add_new_projection.rst
 trunk/matplotlib/doc/devel/coding_guide.rst
 trunk/matplotlib/doc/devel/documenting_mpl.rst
 trunk/matplotlib/doc/devel/index.rst
 trunk/matplotlib/doc/faq/howto_faq.rst
 trunk/matplotlib/doc/faq/index.rst
 trunk/matplotlib/doc/faq/installing_faq.rst
 trunk/matplotlib/doc/faq/troubleshooting_faq.rst
 trunk/matplotlib/doc/users/artists.rst
 trunk/matplotlib/doc/users/customizing.rst
 trunk/matplotlib/doc/users/event_handling.rst
 trunk/matplotlib/doc/users/index.rst
 trunk/matplotlib/doc/users/mathtext.rst
 trunk/matplotlib/doc/users/navigation_toolbar.rst
 trunk/matplotlib/doc/users/pyplot_tutorial.rst
Modified: trunk/matplotlib/doc/devel/add_new_projection.rst
===================================================================
--- trunk/matplotlib/doc/devel/add_new_projection.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/devel/add_new_projection.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _adding-new-scales:
+
 ***********************************************
 Adding new scales and projections to matplotlib
 ***********************************************
@@ -28,6 +30,7 @@
 within a plot script, in third-party code, or in the matplotlib source
 tree itself.
 
+.. _creating-new-scale:
 
 Creating a new scale
 ====================
@@ -63,6 +66,8 @@
 in :mod:`matplotlib.scale` that may be used as starting points.
 
 
+.. _creating-new-projection:
+
 Creating a new projection
 =========================
 
Modified: trunk/matplotlib/doc/devel/coding_guide.rst
===================================================================
--- trunk/matplotlib/doc/devel/coding_guide.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/devel/coding_guide.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,9 +1,16 @@
-***************
+.. _coding-guide:
+
+************
+Coding Guide
+************
+
+.. _version-control:
+
 Version Control
-***************
+===============
 
 svn checkouts
-=============
+-------------
 
 Checking out everything in the trunk (matplotlib and toolkits)::
 
@@ -21,7 +28,7 @@
 v0_91_maint mpl91 --username=youruser --password=yourpass
 
 Committing changes
-==================
+------------------
 
 When committing changes to matplotlib, there are a few things to bear
 in mind.
@@ -74,12 +81,14 @@
 
 > svn commit -F svnmerge-commit-message.txt
 
-***********
+
+.. _style-guide:
+
 Style Guide
-***********
+===========
 
 Importing and name spaces
-=========================
+-------------------------
 
 For `numpy <http://www.numpy.org>`_, use::
 
@@ -115,7 +124,7 @@
 you are importing a module or package.
 
 Naming, spacing, and formatting conventions
-===========================================
+-------------------------------------------
 
 In general, we want to hew as closely as possible to the standard
 coding guidelines for python written by Guido in `PEP 0008
@@ -172,7 +181,7 @@
 (add-hook 'local-write-file-hooks 'delete-trailing-whitespace)))
 
 Keyword argument processing
-===========================
+---------------------------
 
 Matplotlib makes extensive use of ``**kwargs`` for pass through
 customizations from one function to another. A typical example is in
@@ -255,6 +264,8 @@
 elif len(args) == 1:
 ...etc...
 
+.. _docstrings:
+
 Documentation and Docstrings
 ============================
 
@@ -327,9 +338,11 @@
 point" requirement above; hopefully we'll find a more elegant solution
 before too long.
 
-********
+
+.. _licenses:
+
 Licenses
-********
+========
 
 Matplotlib only uses BSD compatible code. If you bring in code from
 another project make sure it has a PSF, BSD, MIT or compatible
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _documenting-matplotlib:
+
 **********************
 Documenting Matplotlib
 **********************
@@ -56,6 +58,8 @@
 
 .. _documentation: http://sphinx.pocoo.org/contents.html
 
+.. _referring-to-mpl-docs:
+
 Referring to mpl documents
 ==========================
 
@@ -78,6 +82,8 @@
 .. literalinclude:: ../mpl_data/matplotlibrc
 
 
+.. _internal-section-refs:
+
 Internal section references
 ===========================
 
@@ -103,4 +109,39 @@
 
 In addition, since underscores are widely used by Sphinx itself, let's prefer hyphens to separate words.
 
+.. _emacs-helpers:
 
+Emacs helpers
+=============
+
+There is an emacs mode `rst.el
+<http://docutils.sourceforge.net/tools/editors/emacs/rst.el>`_ which
+automates many important ReST tasks like building and updateing
+table-of-contents, and promoting or demoting section headings. Here
+is the basic ``.emacs`` configuration::
+
+ (require 'rst)
+ (setq auto-mode-alist
+ (append '(("\\.txt$" . rst-mode)
+ ("\\.rst$" . rst-mode)
+ ("\\.rest$" . rst-mode)) auto-mode-alist))
+
+
+Some helpful functions::
+
+ C-c TAB - rst-toc-insert
+
+ Insert table of contents at point
+ 
+ C-c C-u - rst-toc-update
+
+ Update the table of contents at point
+
+ C-c C-l rst-shift-region-left
+
+ Shift region to the left
+
+ C-c C-r rst-shift-region-right
+
+ Shift region to the right
+
Modified: trunk/matplotlib/doc/devel/index.rst
===================================================================
--- trunk/matplotlib/doc/devel/index.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/devel/index.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -7,8 +7,6 @@
 :Release: |version|
 :Date: |today|
 
-Introduction to developer's guide here **TODO**.
-
 .. toctree::
 
 coding_guide.rst
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.._ howto-faq:
+
 *****
 HOWTO
 *****
@@ -25,7 +27,7 @@
 The other properties that control the tick marker, and all markers,
 are ``markerfacecolor``, ``markeredgecolor``, ``markeredgewidth``,
 ``markersize``. For more information on configuring ticks, see
-:ref:`artist-tut-axis` and :ref:`artist-tut-tick`.
+:ref:`axis-container` and :ref:`tick-container`.
 
 .. _howto-webapp:
 
Modified: trunk/matplotlib/doc/faq/index.rst
===================================================================
--- trunk/matplotlib/doc/faq/index.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/faq/index.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,4 +1,4 @@
-.. _api-index:
+.. _faq-index:
 
 ####################
 The Matplotlib FAQ
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _installing-faq:
+
 ==================
 Installation FAQ
 ==================
@@ -2,4 +4,2 @@
 
-
-
 How do I report a compilation problem?
@@ -22,7 +22,13 @@
 * delete the ``build`` directory in the source tree 
 * delete ``site-packages/matplotlib`` directory in the Python
 installation. The location of ``site-packages`` is
- platform-specific.
+ platform-specific. You can find out where matplotlib is installed by doing::
+
+ > python -c 'import matplotlib; print matplotlib.__file__'
+
+ and then making sure you remove the matplotlib directory (and
+ any matplotlib*.egg files) you find there.
+
 * you may also want to clear some of the cache data that
 matplotlib stores in your ``.matplotlib`` directory. You can
 find the location of this directory by doing::
@@ -55,7 +61,7 @@
 
 There are a two primary ways to configure your backend. One is to set
 the ``backend`` parameter in you ``matplotlibrc`` file (see
-link:Configuring)::
+:ref:`customizing-matplotlib`)::
 
 backend : WXAgg # use wxpython with antigrain (agg) rendering 
 
Modified: trunk/matplotlib/doc/faq/troubleshooting_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _troubleshooting-faq:
+
 ===================
 Troubleshooting FAQ
 ===================
@@ -2,2 +4,3 @@
 
+
 .. _reporting-problems:
@@ -16,17 +19,27 @@
 <http://lists.sourceforge.net/mailman/listinfo/matplotlib-users>`_:
 
 * your operating system; on Linux/UNIX post the output of ``uname -a``
- * matplotlib version : ``import matplotlib; print matplotlib.__version__``
+
+ * matplotlib version::
+
+ python -c `import matplotlib; print matplotlib.__version__`
+
 * where you obtained matplotlib (e.g. your Linux distribution's
 packages or the matplotlib Sourceforge site)
- * any customizations to your ``matplotlibrc`` file
+
+ * any customizations to your ``matplotlibrc`` file (see
+ :ref:`customizing-matplotlib`).
+
 * if the problem is reproducible, please try to provide a *minimal*,
 standalone Python script that demonstrates the problem
+
 * you can get very helpful debugging output from matlotlib by
 running your script with a ``verbose-helpful`` or
 ``--verbose-debug`` flags and posting the verbose output the
- lists.
+ lists::
 
+ > python simple_plot.py --verbose-helpful > output.txt
+
 If you compiled matplotlib yourself, please also provide 
 
 * any changes you have made to ``setup.py`` or ``setupext.py``
Modified: trunk/matplotlib/doc/users/artists.rst
===================================================================
--- trunk/matplotlib/doc/users/artists.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/users/artists.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _artist-tutorial:
+
 ***************
 Artist tutorial
 ***************
@@ -136,6 +138,8 @@
 .. image:: figures/fig_axes_labels_simple.png
 :scale: 75
 
+.. _customizing-artists:
+
 Customizing your objects
 ========================
 
@@ -231,6 +235,8 @@
 at http://matplotlib.sourceforge.net/api.pdf for a listing of
 properties for a give object.
 
+.. _object-containers:
+
 Object containers
 =================
 
Modified: trunk/matplotlib/doc/users/customizing.rst
===================================================================
--- trunk/matplotlib/doc/users/customizing.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/users/customizing.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _customizing-matplotlib:
+
 Customizing matplotlib
 ======================
 
@@ -20,6 +22,8 @@
 matplotlib.rc('lines', linewidth=2, color='r')
 
 
+.. _matplotlibrc-sample:
+
 A sample matplotlibrc file
 --------------------------
 
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/users/event_handling.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _event-handling-tutorial:
+
 ***********************************
 Event Handling and Picking Tutorial
 ***********************************
@@ -15,6 +17,7 @@
 The events also understand the matplotlib coordinate system, and
 report event locations in both pixel and data coordinates.
 
+.. _event-connections:
 
 Event connections
 =================
@@ -58,6 +61,7 @@
 scroll_event MouseEvent mouse scroll wheel is rolled
 ===================== =========== ===================================
 
+.. _event-attributes:
 
 Event attributes
 ================
@@ -316,6 +320,8 @@
 plt.show()
 
 
+.. _object-picking:
+
 Object Picking
 ==============
 
Modified: trunk/matplotlib/doc/users/index.rst
===================================================================
--- trunk/matplotlib/doc/users/index.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/users/index.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -7,6 +7,16 @@
 :Release: |version|
 :Date: |today|
 
+.. toctree::
+
+ pyplot_tutorial.rst
+ mathtext.rst
+ navigation_toolbar.rst
+ customizing.rst
+ artists.rst
+ event_handling.rst
+
+
 matplotlib is a library for making 2D plots of arrays in `Python
 <http://www.python.org>`_. Although it has its origins in emulating
 the `MATLABTM <http://www.mathworks.com>`_ graphics commands, it does
@@ -90,12 +100,3 @@
 embed matplotlib in a Gtk+ EEG application that runs on Windows, Linux
 and Macintosh OS X.
 
-.. toctree::
-
- pyplot_tutorial.rst
- mathtext.rst
- navigation_toolbar.rst
- customizing.rst
- artists.rst
- event_handling.rst
-
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/users/mathtext.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,6 +1,9 @@
+.. _mathtext-tutorial:
+
 Writing mathematical expressions
 ================================
 
+
 You can use TeX markup in any matplotlib text string; see the
 :mod:`matplotlib.mathtext` module documentation for details. Note
 that you do not need to have TeX installed, since matplotlib ships its
@@ -35,6 +38,7 @@
 
 .. TODO: Include a complete list here
 
+
 Subscripts and superscripts
 ---------------------------
 
Modified: trunk/matplotlib/doc/users/navigation_toolbar.rst
===================================================================
--- trunk/matplotlib/doc/users/navigation_toolbar.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/users/navigation_toolbar.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _navigation-toolbar:
+
 Interactive navigation
 ======================
 
Modified: trunk/matplotlib/doc/users/pyplot_tutorial.rst
===================================================================
--- trunk/matplotlib/doc/users/pyplot_tutorial.rst	2008年06月02日 18:52:09 UTC (rev 5366)
+++ trunk/matplotlib/doc/users/pyplot_tutorial.rst	2008年06月02日 21:01:47 UTC (rev 5367)
@@ -1,3 +1,5 @@
+.. _pyplot-tutorial:
+
 ***************
 pyplot tutorial
 ***************
@@ -62,6 +64,8 @@
 
 
 
+.. _controlling-line-properties:
+
 Controlling line properties
 ===========================
 
@@ -147,6 +151,8 @@
 antialiased or aa: [True | False]
 ...snip
 
+.. _multiple-figs-axes:
+
 Working with multiple figure and axes
 =====================================
 
@@ -202,6 +208,8 @@
 You can clear the current figure with :func:`~matplotlib.pyplot.clf`
 and the current axes with :func:`~matplotlib.pyplot.cla`.
 
+.. _working-with-text:
+
 Working with text
 =================
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年06月02日 21:21:32
Revision: 5368
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5368&view=rev
Author: jdh2358
Date: 2008年06月02日 14:21:29 -0700 (2008年6月02日)
Log Message:
-----------
moved intro into separate doc
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/coding_guide.rst
 trunk/matplotlib/doc/faq/installing_faq.rst
 trunk/matplotlib/doc/faq/troubleshooting_faq.rst
 trunk/matplotlib/doc/users/index.rst
Added Paths:
-----------
 trunk/matplotlib/doc/users/intro.rst
Modified: trunk/matplotlib/doc/devel/coding_guide.rst
===================================================================
--- trunk/matplotlib/doc/devel/coding_guide.rst	2008年06月02日 21:01:47 UTC (rev 5367)
+++ trunk/matplotlib/doc/devel/coding_guide.rst	2008年06月02日 21:21:29 UTC (rev 5368)
@@ -172,7 +172,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
 
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月02日 21:01:47 UTC (rev 5367)
+++ trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月02日 21:21:29 UTC (rev 5368)
@@ -19,7 +19,7 @@
 does not properly clean the build directory, and does nothing to the
 install directory. To cleanly rebuild:
 
- * delete the ``build`` directory in the source tree 
+ * delete the ``build`` directory in the source tree
 * delete ``site-packages/matplotlib`` directory in the Python
 installation. The location of ``site-packages`` is
 platform-specific. You can find out where matplotlib is installed by doing::
@@ -63,7 +63,7 @@
 the ``backend`` parameter in you ``matplotlibrc`` file (see
 :ref:`customizing-matplotlib`)::
 
- backend : WXAgg # use wxpython with antigrain (agg) rendering 
+ backend : WXAgg # use wxpython with antigrain (agg) rendering
 
 The other is to use the matplotlib :func:`~matplotlib.use` directive::
 
@@ -74,7 +74,7 @@
 :mod:`matplotlib.pyplot` or :mod:`matplotlib.pylab`.
 
 If you are unsure what to do, and just want to get cranking, just set
-your backend to `TkAgg`. This will do the right thing for 95% of the
+your backend to ``TkAgg``. This will do the right thing for 95% of the
 users. It gives you the option of running your scripts in batch or
 working interactively from the python shell, with the least amount of
 hassles, and is smart enough to do the right thing when you ask for
@@ -100,7 +100,8 @@
 backends generate a pixel represenation of the line whose accuracy
 depends on a DPI setting.
 
-Here is a summary of the matplotlib rendering backends:
+Here is a summary of the matplotlib renders (there is an eponymous
+backed for each):
 
 =============================== =====================================================================================
 Renderer (Filetypes) Description
@@ -116,7 +117,7 @@
 And here are the user interfaces and renderer combinations supported:
 
 ============ ===================================================================================================
-Backend Description 
+Backend Description
 ============ ===================================================================================================
 GTKAgg Agg rendering to a GTK canvas (`pygtk <http://www.pygtk.org>`_)
 GTK GDK rendering to a GTK canvas (not recommended) (`pygtk <http://www.pygtk.org>`_)
@@ -129,3 +130,30 @@
 FLTKAgg Agg rendering to a FLTK canvas (`pyfltk <http://pyfltk.sourceforge.net>`)_
 ============ ===================================================================================================
 
+
+OS X Questions
+==============
+
+.. _easy-install-osx-egg:
+
+How can I easy_install my egg?
+------------------------------
+
+I downloaded the egg for 0.98 from the matplotlib webpages,
+and I am trying to ``easy_install`` it, but I am getting an error::
+
+ > easy_install ./matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg
+ Processing matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg
+ removing '/Library/Python/2.5/site-packages/matplotlib-0.98.0-py2.5-
+ ...snip...
+ Reading http://matplotlib.sourceforge.net
+ Reading http://cheeseshop.python.org/pypi/matplotlib/0.91.3
+ No local packages or download links found for matplotlib==0.98.0
+ error: Could not find suitable distribution for
+ Requirement.parse('matplotlib==0.98.0')
+
+If you rename ``matplotlib-0.98.0-py2.5-macosx-10.3-fat.egg`` to
+``matplotlib-0.98.0-py2.5.egg``, ``easy_install`` will install it from
+the disk. Many Mac OS X eggs with cruft at the end of the filename,
+which prevents their installation through easy_install. Renaming is
+all it takes to install them; still, it's annoying.
Modified: trunk/matplotlib/doc/faq/troubleshooting_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月02日 21:01:47 UTC (rev 5367)
+++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月02日 21:21:29 UTC (rev 5368)
@@ -63,3 +63,4 @@
 a bug and can not be quickly solved, you may be asked to file a bug in
 the tracker so the issue doesn't get lost.
 
+
Modified: trunk/matplotlib/doc/users/index.rst
===================================================================
--- trunk/matplotlib/doc/users/index.rst	2008年06月02日 21:01:47 UTC (rev 5367)
+++ trunk/matplotlib/doc/users/index.rst	2008年06月02日 21:21:29 UTC (rev 5368)
@@ -9,6 +9,7 @@
 
 .. toctree::
 
+ intro.rst
 pyplot_tutorial.rst
 mathtext.rst
 navigation_toolbar.rst
@@ -17,86 +18,3 @@
 event_handling.rst
 
 
-matplotlib is a library for making 2D plots of arrays in `Python
-<http://www.python.org>`_. Although it has its origins in emulating
-the `MATLABTM <http://www.mathworks.com>`_ graphics commands, it does
-not require MATLAB, and can be used in a Pythonic, object oriented
-way. Although matplotlib is written primarily in pure Python, it
-makes heavy use of `NumPy <http://www.numpy.org>`_ and other extension
-code to provide good performance even for large arrays.
-
-matplotlib is designed with the philosophy that you should be able to
-create simple plots with just a few commands, or just one! If you
-want to see a histogram of your data, you shouldn't need to
-instantiate objects, call methods, set properties, and so on; it
-should just work.
-
-For years, I used to use MATLAB exclusively for data analysis and
-visualization. MATLAB excels at making nice looking plots easy. When
-I began working with EEG data, I found that I needed to write
-applications to interact with my data, and developed and EEG analysis
-application in MATLAB. As the application grew in complexity,
-interacting with databases, http servers, manipulating complex data
-structures, I began to strain against the limitations of MATLAB as a
-programming language, and decided to start over in Python. Python
-more than makes up for all of MATLAB's deficiencies as a programming
-language, but I was having difficulty finding a 2D plotting package
-(for 3D `VTK <http://www.vtk.org/>`_) more than exceeds all of my needs).
-
-When I went searching for a Python plotting package, I had several
-requirements:
-
-* Plots should look great - publication quality. One important
- requirement for me is that the text looks good (antialiased, etc.)
-
-* Postscript output for inclusion with TeX documents
-
-* Embeddable in a graphical user interface for application
- development
-
-* Code should be easy enough that I can understand it and extend
- it
-
-* Making plots should be easy
-
-Finding no package that suited me just right, I did what any
-self-respecting Python programmer would do: rolled up my sleeves and
-dived in. Not having any real experience with computer graphics, I
-decided to emulate MATLAB's plotting capabilities because that is
-something MATLAB does very well. This had the added advantage that
-many people have a lot of MATLAB experience, and thus they can
-quickly get up to steam plotting in python. From a developer's
-perspective, having a fixed user interface (the pylab interface) has
-been very useful, because the guts of the code base can be redesigned
-without affecting user code.
-
-The matplotlib code is conceptually divided into three parts: the
-*pylab interface* is the set of functions provided by
-:mod:`matplotlib.pylab` which allow the user to create plots with code
-quite similar to MATLAB figure generating code. The *matplotlib
-frontend* or *matplotlib API* is the set of classes that do the heavy
-lifting, creating and managing figures, text, lines, plots and so on.
-This is an abstract interface that knows nothing about output. The
-*backends* are device dependent drawing devices, aka renderers, that
-transform the frontend representation to hardcopy or a display device.
-Example backends: PS creates `PostScript®
-<http://http://www.adobe.com/products/postscript/>`_ hardcopy, SVG
-creates `Scalable Vector Graphics <http://www.w3.org/Graphics/SVG/>`_
-hardcopy, Agg creates PNG output using the high quality `Anti-Grain
-Geometry <http://www.antigrain.com>`_ library that ships with
-matplotlib, GTK embeds matplotlib in a `Gtk+ <http://www.gtk.org/>`_
-application, GTKAgg uses the Anti-Grain renderer to create a figure
-and embed it a Gtk+ application, and so on for `PDF
-<http://www.adobe.com/products/acrobat/adobepdf.html>`_, `WxWidgets
-<http://www.wxpython.org/>`_, `Tkinter
-<http://docs.python.org/lib/module-Tkinter.html>`_ etc.
-
-matplotlib is used by many people in many different contexts. Some
-people want to automatically generate PostScript® files to send
-to a printer or publishers. Others deploy matplotlib on a web
-application server to generate PNG output for inclusion in
-dynamically-generated web pages. Some use matplotlib interactively
-from the Python shell in Tkinter on WindowsTM. My primary use is to
-embed matplotlib in a Gtk+ EEG application that runs on Windows, Linux
-and Macintosh OS X.
-
Added: trunk/matplotlib/doc/users/intro.rst
===================================================================
--- trunk/matplotlib/doc/users/intro.rst	 (rev 0)
+++ trunk/matplotlib/doc/users/intro.rst	2008年06月02日 21:21:29 UTC (rev 5368)
@@ -0,0 +1,86 @@
+Introduction
+============
+
+matplotlib is a library for making 2D plots of arrays in `Python
+<http://www.python.org>`_. Although it has its origins in emulating
+the `MATLABTM <http://www.mathworks.com>`_ graphics commands, it does
+not require MATLAB, and can be used in a Pythonic, object oriented
+way. Although matplotlib is written primarily in pure Python, it
+makes heavy use of `NumPy <http://www.numpy.org>`_ and other extension
+code to provide good performance even for large arrays.
+
+matplotlib is designed with the philosophy that you should be able to
+create simple plots with just a few commands, or just one! If you
+want to see a histogram of your data, you shouldn't need to
+instantiate objects, call methods, set properties, and so on; it
+should just work.
+
+For years, I used to use MATLAB exclusively for data analysis and
+visualization. MATLAB excels at making nice looking plots easy. When
+I began working with EEG data, I found that I needed to write
+applications to interact with my data, and developed and EEG analysis
+application in MATLAB. As the application grew in complexity,
+interacting with databases, http servers, manipulating complex data
+structures, I began to strain against the limitations of MATLAB as a
+programming language, and decided to start over in Python. Python
+more than makes up for all of MATLAB's deficiencies as a programming
+language, but I was having difficulty finding a 2D plotting package
+(for 3D `VTK <http://www.vtk.org/>`_) more than exceeds all of my needs).
+
+When I went searching for a Python plotting package, I had several
+requirements:
+
+* Plots should look great - publication quality. One important
+ requirement for me is that the text looks good (antialiased, etc.)
+
+* Postscript output for inclusion with TeX documents
+
+* Embeddable in a graphical user interface for application
+ development
+
+* Code should be easy enough that I can understand it and extend
+ it
+
+* Making plots should be easy
+
+Finding no package that suited me just right, I did what any
+self-respecting Python programmer would do: rolled up my sleeves and
+dived in. Not having any real experience with computer graphics, I
+decided to emulate MATLAB's plotting capabilities because that is
+something MATLAB does very well. This had the added advantage that
+many people have a lot of MATLAB experience, and thus they can
+quickly get up to steam plotting in python. From a developer's
+perspective, having a fixed user interface (the pylab interface) has
+been very useful, because the guts of the code base can be redesigned
+without affecting user code.
+
+The matplotlib code is conceptually divided into three parts: the
+*pylab interface* is the set of functions provided by
+:mod:`matplotlib.pylab` which allow the user to create plots with code
+quite similar to MATLAB figure generating code. The *matplotlib
+frontend* or *matplotlib API* is the set of classes that do the heavy
+lifting, creating and managing figures, text, lines, plots and so on.
+This is an abstract interface that knows nothing about output. The
+*backends* are device dependent drawing devices, aka renderers, that
+transform the frontend representation to hardcopy or a display device.
+Example backends: PS creates `PostScript®
+<http://http://www.adobe.com/products/postscript/>`_ hardcopy, SVG
+creates `Scalable Vector Graphics <http://www.w3.org/Graphics/SVG/>`_
+hardcopy, Agg creates PNG output using the high quality `Anti-Grain
+Geometry <http://www.antigrain.com>`_ library that ships with
+matplotlib, GTK embeds matplotlib in a `Gtk+ <http://www.gtk.org/>`_
+application, GTKAgg uses the Anti-Grain renderer to create a figure
+and embed it a Gtk+ application, and so on for `PDF
+<http://www.adobe.com/products/acrobat/adobepdf.html>`_, `WxWidgets
+<http://www.wxpython.org/>`_, `Tkinter
+<http://docs.python.org/lib/module-Tkinter.html>`_ etc.
+
+matplotlib is used by many people in many different contexts. Some
+people want to automatically generate PostScript® files to send
+to a printer or publishers. Others deploy matplotlib on a web
+application server to generate PNG output for inclusion in
+dynamically-generated web pages. Some use matplotlib interactively
+from the Python shell in Tkinter on WindowsTM. My primary use is to
+embed matplotlib in a Gtk+ EEG application that runs on Windows, Linux
+and Macintosh OS X.
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年06月05日 17:33:58
Revision: 5404
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5404&view=rev
Author: mdboom
Date: 2008年06月05日 10:33:24 -0700 (2008年6月05日)
Log Message:
-----------
Add some CSS so that there are lines above classes and methods in the
auto-generated docs.
Modified Paths:
--------------
 trunk/matplotlib/doc/conf.py
Added Paths:
-----------
 trunk/matplotlib/doc/_static/matplotlib.css
Added: trunk/matplotlib/doc/_static/matplotlib.css
===================================================================
--- trunk/matplotlib/doc/_static/matplotlib.css	 (rev 0)
+++ trunk/matplotlib/doc/_static/matplotlib.css	2008年06月05日 17:33:24 UTC (rev 5404)
@@ -0,0 +1,9 @@
+@import "default.css";
+
+dl.class, dl.function {
+ border-top: 2px solid #888;
+}
+
+dl.method, dl.attribute {
+ border-top: 1px solid #aaa;
+}
\ No newline at end of file
Modified: trunk/matplotlib/doc/conf.py
===================================================================
--- trunk/matplotlib/doc/conf.py	2008年06月05日 17:09:04 UTC (rev 5403)
+++ trunk/matplotlib/doc/conf.py	2008年06月05日 17:33:24 UTC (rev 5404)
@@ -80,7 +80,7 @@
 # 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 = 'default.css'
+html_style = 'matplotlib.css'
 
 # The name for this set of Sphinx documents. If None, it defaults to
 # "<project> v<release> documentation".
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ds...@us...> - 2008年06月07日 21:41:54
Revision: 5416
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5416&view=rev
Author: dsdale
Date: 2008年06月07日 14:41:51 -0700 (2008年6月07日)
Log Message:
-----------
updated documentation guide
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/documenting_mpl.rst
Added Paths:
-----------
 trunk/matplotlib/doc/static_figs/
 trunk/matplotlib/doc/static_figs/README
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月07日 21:02:24 UTC (rev 5415)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月07日 21:41:51 UTC (rev 5416)
@@ -4,6 +4,9 @@
 Documenting Matplotlib
 **********************
 
+Getting Started
+===============
+
 The documentation for matplotlib is generated from ReStructured Text
 using the Sphinx_ documentation generation tool. Sphinx-0.4 or later
 is required. Currently this means we need to install from the svn
@@ -15,56 +18,100 @@
 
 .. _Sphinx: http://sphinx.pocoo.org/
 
-The documentation sources are found in the doc/ directory in the trunk.
-To build the users guid in html format, cd into doc/users_guide and do::
+The documentation sources are found in the `doc/` directory in the trunk.
+To build the users guide in html format, cd into `doc/users_guide` and do::
 
 python make.py html
 
+or::
+
+ ./make.py html
+
 you can also pass a ``latex`` flag to make.py to build a pdf, or pass no
-arguments to build everything. The same procedure can be followed for
-the sources in doc/api_reference.
+arguments to build everything.
 
-The actual ReStructured Text files are kept in doc/users_guide/source
-and doc/api_reference/source. The main entry point is index.rst.
-Additional files can be added by including their base file name
-(dropping the .rst extension) in the table of contents. It is also
-possible to include other documents through the use of an include
-statement. For example, in the Developers Guide, index.rst lists
-coding_guide, which automatically inserts coding_guide.rst.
+The output produced by Sphinx can be configured by editing the `conf.py`
+file located in the `doc\`.
 
-Sphinx does not support tables with column- or row-spanning cells for
-latex output. Such tables can not be used when documenting matplotlib.
+Organization of Matplotlib's Documentation
+==========================================
 
-Mathematical expressions can be rendered as png images in html, and in
-the usual way by latex. For example:
+The actual ReStructured Text files are kept in `doc/users`, `doc/devel`,
+`doc/api` and `doc/faq`. The main entry point is `doc/index.rst`, which pulls
+in the `index.rst` file for the users guide, developers guide, api reference,
+and faqs. The documentation suite is built as a single document in order to
+make the most effective use of cross referencing, we want to make navigating
+the Matplotlib documentation as easy as possible.
 
-``math:`sin(x_n^2)`` yields: :math:`sin(x_n^2)`, and::
+Additional files can be added to the various guides by including their base
+file name (the .rst extension is not necessary) in the table of contents.
+It is also possible to include other documents through the use of an include
+statement, such as::
 
+ .. include:: ../../TODO
+
+Formatting
+==========
+
+The Sphinx website contains plenty of documentation_ concerning ReST markup and
+working with Sphinx in general. Here are a few additional things to keep in mind:
+
+* Sphinx does not support tables with column- or row-spanning cells for
+ latex output. Such tables can not be used when documenting matplotlib.
+
+* Mathematical expressions can be rendered as png images in html, and in
+ the usual way by latex. For example:
+
+ ``math:`sin(x_n^2)`` yields: :math:`sin(x_n^2)`, and::
+
 .. math::
 
 \int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}}``
 
-yields:
+ yields:
 
-.. math::
+ .. math::
 
- \int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}}
+ \int_{-\infty}^{\infty}\frac{e^{i\phi}}{1+x^2\frac{e^{i\phi}}{1+x^2}}
 
-The output produced by Sphinx can be configured by editing the conf.py
-files located in the documentation source directories.
+* Interactive IPython sessions can be illustrated in the documentation using
+ the following directive::
 
-The Sphinx website contains plenty of documentation_ concerning ReST
-markup and working with Sphinx in general.
+ .. sourcecode:: ipython
 
+ In [69]: lines = plot([1,2,3])
+
+which would yield::
+
+.. sourcecode:: ipython
+
+ In [69]: lines = plot([1,2,3])
+
 .. _documentation: http://sphinx.pocoo.org/contents.html
 
+
+Figures
+=======
+
+Each guide will have its own figures directory for scripts to generate images
+to be included in the dcoumentation. It is not necessary to explicitly save
+the figure in the script, a figure will be saved with the same name as the
+filename when the documentation is generated.
+
+Any figures that rely on optional system configurations should be generated
+with a script residing in doc/static_figs. The resulting figures will be saved
+to doc/_static, and will be named based on the name of the script, so we can
+avoid unintentionally overwriting any existing figures. Please add a line to
+the README in doc/static-figs for any additional requirements necessary to
+generate a new figure.
+
 .. _referring-to-mpl-docs:
 
 Referring to mpl documents
 ==========================
 
 In the documentation, you may want to include to a document in the
-matplotlib src, eg a license file, an image file from ``mpl-data``, or an
+matplotlib src, eg a license file, an image file from `mpl-data`, or an
 example. When you include these files, include them using a symbolic
 link from the documentation parent directory. This way, if we
 relocate the mpl documentation directory, all of the internal pointers
@@ -77,7 +124,9 @@
 mpl_examples -> ../examples
 
 
-In the ``users`` subdirectory, if I want to refer to a file in the mpl-data directory, I use the symlink direcotry. For example, from ``customizing.rst``::
+In the `users` subdirectory, if I want to refer to a file in the mpl-data
+directory, I use the symlink directory. For example, from
+``customizing.rst``::
 
 .. literalinclude:: ../mpl_data/matplotlibrc
 
@@ -107,7 +156,8 @@
 
 .. _faq-backend
 
-In addition, since underscores are widely used by Sphinx itself, let's prefer hyphens to separate words.
+In addition, since underscores are widely used by Sphinx itself, let's prefer
+hyphens to separate words.
 
 .. _emacs-helpers:
 
Added: trunk/matplotlib/doc/static_figs/README
===================================================================
--- trunk/matplotlib/doc/static_figs/README	 (rev 0)
+++ trunk/matplotlib/doc/static_figs/README	2008年06月07日 21:41:51 UTC (rev 5416)
@@ -0,0 +1,4 @@
+Scripts that require optional system configurations to generate scripts should go here. The 
+figures will be generated in doc/_static, and will be named based on the name of the script, 
+so we can avoid unintentionally overwriting any existing figures. Please add a line to this 
+file for any additional requirements necessary to generate a new figure.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ds...@us...> - 2008年06月08日 18:20:28
Revision: 5424
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5424&view=rev
Author: dsdale
Date: 2008年06月08日 11:20:21 -0700 (2008年6月08日)
Log Message:
-----------
documentation work
Modified Paths:
--------------
 trunk/matplotlib/doc/faq/environment_variables_faq.rst
 trunk/matplotlib/doc/users/usetex.rst
Modified: trunk/matplotlib/doc/faq/environment_variables_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/environment_variables_faq.rst	2008年06月08日 18:01:58 UTC (rev 5423)
+++ trunk/matplotlib/doc/faq/environment_variables_faq.rst	2008年06月08日 18:20:21 UTC (rev 5424)
@@ -8,7 +8,7 @@
 Environment Variable Description
 ====================== =======================================================
 .. envvar:: PATH The list of directories searched to find executable
- programs 
+ programs
 .. envvar:: PYTHONPATH The list of directories that is searched to find Python
 packages and modules
 ====================== =======================================================
Modified: trunk/matplotlib/doc/users/usetex.rst
===================================================================
--- trunk/matplotlib/doc/users/usetex.rst	2008年06月08日 18:01:58 UTC (rev 5423)
+++ trunk/matplotlib/doc/users/usetex.rst	2008年06月08日 18:20:21 UTC (rev 5424)
@@ -103,7 +103,7 @@
 installation may be the only external dependency.
 
 = In the event that things dont work =
- * Try deleting `tex.cache` from your :envvar:`MATPLOTLIBDATA` directory
+ * Try deleting `tex.cache` from your `~/.matplotlib` directory
 
 * Make sure LaTeX, dvipng and ghostscript are each working and on your PATH.
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年06月09日 16:50:53
Revision: 5432
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5432&view=rev
Author: jdh2358
Date: 2008年06月09日 09:48:50 -0700 (2008年6月09日)
Log Message:
-----------
update mathtext on review and added notes to the outline
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/outline.rst
 trunk/matplotlib/doc/users/mathtext.rst
 trunk/matplotlib/doc/users/usetex.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst	2008年06月09日 15:58:45 UTC (rev 5431)
+++ trunk/matplotlib/doc/devel/outline.rst	2008年06月09日 16:48:50 UTC (rev 5432)
@@ -28,7 +28,7 @@
 legends ? no author ?
 animation John has author ?
 collections ? no author ?
-mathtext Michael ? submitted John
+mathtext Michael in review John
 fonts et al Michael ? no author Darren
 pyplot tut John submitted Eric
 usetex Darren submitted ?
@@ -95,3 +95,28 @@
 to be an expert in the subject you are editing -- you should know
 something about it and be willing to read, test, give feedback and
 pester!
+
+Reviewer notes
+==============
+
+If you want to make notes for the authorwhen you have reviewed a
+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)
+--------------------------------------
+
+This looks good -- 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
+user's guide tutorial work.
+
+#. This section might also benefit from a little more detail on the
+customizations that are possible (eg an example fleshing out the rc
+options a little bit). Admittedly, this is pretty clear from readin
+ghte rc file, but it might be helpful to a newbie.
+
+#. There is still a TODO in the file to include a complete list of symbols
+
Modified: trunk/matplotlib/doc/users/mathtext.rst
===================================================================
--- trunk/matplotlib/doc/users/mathtext.rst	2008年06月09日 15:58:45 UTC (rev 5431)
+++ trunk/matplotlib/doc/users/mathtext.rst	2008年06月09日 16:48:50 UTC (rev 5432)
@@ -11,7 +11,7 @@
 is a fairly direct adaptation of the layout algorithms in Donald
 Knuth's TeX, so the quality is quite good (matplotlib also provides a
 ``usetex`` option for those who do want to call out to TeX to generate
-their text).
+their text (see :ref:`usetex-tutorial`).
 
 Any text element can use math text. You need to use raw strings
 (preceed the quotes with an ``'r'``), and surround the string text
@@ -20,7 +20,8 @@
 Modern fonts (from (La)TeX), `STIX <http://www.aip.org/stixfonts/>`_
 fonts (with are designed to blend well with Times) or a Unicode font
 that you provide. The mathtext font can be selected with the
-customization variable ``mathtext.fontset``.
+customization variable ``mathtext.fontset`` (see
+:ref:`customizing-matplotlib`)
 
 Here is a simple example::
 
@@ -165,7 +166,8 @@
 .. image:: ../_static/stix_fonts.png
 
 There are also three global "font sets" to choose from, which are
-selected using the ``mathtext.fontset`` parameter in ``matplotibrc``.
+selected using the ``mathtext.fontset`` parameter in
+::ref:`matplotlibrc <matplotlibrc-sample>`.
 
 ``cm``: **Computer Modern (TeX)**
 
Modified: trunk/matplotlib/doc/users/usetex.rst
===================================================================
--- trunk/matplotlib/doc/users/usetex.rst	2008年06月09日 15:58:45 UTC (rev 5431)
+++ trunk/matplotlib/doc/users/usetex.rst	2008年06月09日 16:48:50 UTC (rev 5432)
@@ -7,16 +7,17 @@
 Matplotlib has the option to use LaTeX to manage all text layout. This
 option is available with the following backends:
 
-* \*Agg
+* Agg
 * PS
 * PDF
 
-The LaTeX option is activated by setting text.usetex : true in your rc
-settings. Text handling with matplotlib's LaTeX support is slower than
-matplotlib's very capable :ref:`mathtext <mathtext-tutorial>`, but is more
-flexible, since different LaTeX packages (font packages, math packages, etc.)
-can be used. The results can be striking, especially when you take care to use
-the same fonts in your figures as in the main document.
+The LaTeX option is activated by setting ``text.usetex : True`` in
+your rc settings. Text handling with matplotlib's LaTeX support is
+slower than matplotlib's very capable :ref:`mathtext
+<mathtext-tutorial>`, but is more flexible, since different LaTeX
+packages (font packages, math packages, etc.) can be used. The
+results can be striking, especially when you take care to use the same
+fonts in your figures as in the main document.
 
 Matplotlib's LaTeX support requires a working LaTeX_ installation, dvipng_
 (which may be included with your LaTeX installation), and Ghostscript_
@@ -126,4 +127,4 @@
 .. _Ghostscript: http://www.cs.wisc.edu/~ghost/
 .. _PSNFSS: http://www.ctan.org/tex-archive/macros/latex/required/psnfss/psnfss2e.pdf
 .. _Poppler: http://poppler.freedesktop.org/
-.. _Xpdf: http://www.foolabs.com/xpdf
\ No newline at end of file
+.. _Xpdf: http://www.foolabs.com/xpdf
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:15
Revision: 5437
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5437&view=rev
Author: jdh2358
Date: 2008年06月09日 10:47:43 -0700 (2008年6月09日)
Log Message:
-----------
added date index plot faq
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/outline.rst
 trunk/matplotlib/doc/faq/howto_faq.rst
 trunk/matplotlib/doc/make.py
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst	2008年06月09日 17:47:32 UTC (rev 5436)
+++ trunk/matplotlib/doc/devel/outline.rst	2008年06月09日 17:47:43 UTC (rev 5437)
@@ -22,7 +22,7 @@
 date plots John has author ?
 working with data John has author Darren
 custom ticking ? no author ?
-masked data Eric has author ?
+masked data Eric has author ?
 text ? no author ?
 patches ? no author ?
 legends ? no author ?
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月09日 17:47:32 UTC (rev 5436)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月09日 17:47:43 UTC (rev 5437)
@@ -91,3 +91,41 @@
 ----------------------------------
 
 TODO
+
+
+.. _date-index-plots:
+
+How do I skip dates where there is no data?
+===========================================
+
+When plotting time series, eg financial time series, one often wants
+to leave out days on which there is no data, eg weekends. By passing
+in dates on the x-xaxis, you get large horizontal gaps on periods when
+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
+
+ 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
+
+ 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()
Modified: trunk/matplotlib/doc/make.py
===================================================================
--- trunk/matplotlib/doc/make.py	2008年06月09日 17:47:32 UTC (rev 5436)
+++ trunk/matplotlib/doc/make.py	2008年06月09日 17:47:43 UTC (rev 5437)
@@ -14,6 +14,10 @@
 except OSError:
 pass
 
+def sf():
+ 'push a copy to the sf site'
+ os.system('cd build; rsync -avz html jd...@ma...:/home/groups/m/ma/matplotlib/htdocs/doc/ -essh')
+
 def figs():
 os.system('cd users/figures/ && python make.py')
 
@@ -56,6 +60,7 @@
 'html':html,
 'latex':latex,
 'clean':clean,
+ 'sf':sf,
 'all':all,
 }
 
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 (2008年6月09日)
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: <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 (2008年6月10日)
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: <jd...@us...> - 2008年06月11日 01:26:34
Revision: 5467
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5467&view=rev
Author: jdh2358
Date: 2008年06月10日 18:26:29 -0700 (2008年6月10日)
Log Message:
-----------
added usetex review
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/coding_guide.rst
 trunk/matplotlib/doc/devel/documenting_mpl.rst
 trunk/matplotlib/doc/devel/outline.rst
 trunk/matplotlib/doc/users/usetex.rst
Modified: trunk/matplotlib/doc/devel/coding_guide.rst
===================================================================
--- trunk/matplotlib/doc/devel/coding_guide.rst	2008年06月11日 00:29:14 UTC (rev 5466)
+++ trunk/matplotlib/doc/devel/coding_guide.rst	2008年06月11日 01:26:29 UTC (rev 5467)
@@ -1,12 +1,12 @@
 .. _coding-guide:
 
 ************
-Coding Guide
+Coding guide
 ************
 
 .. _version-control:
 
-Version Control
+Version control
 ===============
 
 svn checkouts
@@ -35,18 +35,25 @@
 
 * if your changes are non-trivial, please make an entry in the
 :file:`CHANGELOG`
-* if you change the API, please document it in :file:`API_CHANGES`, and
- consider posting to mpl-devel
-* Are your changes python2.4 compatible? We are still trying to
- support 2.4, so avoid features new to 2.5
+
+* if you change the API, please document it in :file:`API_CHANGES`,
+ and consider posting to `mpl-devel
+ <http://lists.sourceforge.net/mailman/listinfo/matplotlib-devel>`_
+
+* Are your changes python2.4 compatible? We still support 2.4, so
+ avoid features new to 2.5
+
 * Can you pass :file:`examples/tests/backend_driver.py`? This is our
 poor man's unit test.
+
 * If you have altered extension code, do you pass
 :file:`unit/memleak_hawaii.py`?
+
 * if you have added new files or directories, or reorganized existing
 ones, are the new files included in the match patterns in
 :file:`MANIFEST.in`. This file determines what goes into the source
 distribution of the mpl build.
+
 * Keep the maintenance branch and trunk in sync where it makes sense.
 If there is a bug on both that needs fixing, use `svnmerge.py
 <http://www.orcaware.com/svn/wiki/Svnmerge.py>`_ to keep them in
@@ -58,6 +65,7 @@
 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::
@@ -87,7 +95,7 @@
 
 .. _style-guide:
 
-Style Guide
+Style guide
 ===========
 
 Importing and name spaces
@@ -278,7 +286,7 @@
 
 .. _docstrings:
 
-Documentation and Docstrings
+Documentation and docstrings
 ============================
 
 matplotlib uses artist introspection of docstrings to support
Modified: trunk/matplotlib/doc/devel/documenting_mpl.rst
===================================================================
--- trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月11日 00:29:14 UTC (rev 5466)
+++ trunk/matplotlib/doc/devel/documenting_mpl.rst	2008年06月11日 01:26:29 UTC (rev 5467)
@@ -1,10 +1,10 @@
 .. _documenting-matplotlib:
 
 **********************
-Documenting Matplotlib
+Documenting matplotlib
 **********************
 
-Getting Started
+Getting started
 ===============
 
 The documentation for matplotlib is generated from ReStructured Text
@@ -33,7 +33,7 @@
 The output produced by Sphinx can be configured by editing the `conf.py`
 file located in the `doc/`.
 
-Organization of Matplotlib's Documentation
+Organization of matplotlib's documentation
 ==========================================
 
 The actual ReStructured Text files are kept in `doc/users`, `doc/devel`,
@@ -96,8 +96,14 @@
 Each guide will have its own `figures/` directory for scripts to generate images
 to be included in the dcoumentation. It is not necessary to explicitly save
 the figure in the script, a figure will be saved with the same name as the
-filename when the documentation is generated.
+filename when the documentation is generated. For example, use::
 
+ .. literalinclude:: figures/pyplot_simple.py
+
+ .. image:: figures/pyplot_simple.png
+ :scale: 75
+
+
 Any figures that rely on optional system configurations should be generated
 with a script residing in doc/static_figs. The resulting figures will be saved
 to doc/_static, and will be named based on the name of the script, so we can
@@ -105,6 +111,8 @@
 the README in doc/static-figs for any additional requirements necessary to
 generate a new figure.
 
+
+
 .. _referring-to-mpl-docs:
 
 Referring to mpl documents
@@ -131,6 +139,8 @@
 .. literalinclude:: ../mpl_data/matplotlibrc
 
 
+
+
 .. _internal-section-refs:
 
 Internal section references
@@ -161,6 +171,13 @@
 
 .. _emacs-helpers:
 
+Section names, etc
+==================
+
+For everything but top level chapters, please use ``Upper lower`` for
+section titles, eg ``Possible hangups`` rather than ``Possible
+Hangups``
+
 Emacs helpers
 =============
 
@@ -182,7 +199,7 @@
 C-c TAB - rst-toc-insert
 
 Insert table of contents at point
- 
+
 C-c C-u - rst-toc-update
 
 Update the table of contents at point
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst	2008年06月11日 00:29:14 UTC (rev 5466)
+++ trunk/matplotlib/doc/devel/outline.rst	2008年06月11日 01:26:29 UTC (rev 5467)
@@ -28,7 +28,7 @@
 animation John has author ?
 collections ? no author ?
 text - mathtext Michael in review John
-text - usetex Darren submitted ?
+text - usetex Darren in review John
 text - annotations John submitted ?
 fonts et al Michael ? no author Darren
 pyplot tut John submitted Eric
@@ -177,4 +177,40 @@
 sub-packages with the gamut of licenses, GPL to MIT?
 
 
+usetex user's guide-- reviewed by JDH
+-------------------------------------
 
+Review of :ref:`usetex-tutorial`:
+
+#. In the section on the ps distiller, you might mention that it is
+ the rasterization which some users find objectionable, and the
+ distiller pram (eg 6000) is a dpi setting for the rasterizer. Not
+ everyone will immediately grasp the controversy surrounding dumping
+ high res bitmaps into a ps file.
+
+#. ``= Possible Hangups =`` - this is moin, not rest. I have fixed
+ this already, just wanted to point it out. Also, for everything
+ but top level chapters, I refer ``Upper lower`` for section
+ titles, eg ``Possible hangups``.
+
+#. in the troubleshooting section, could you add a FAQ showing how to
+ find their .matplotlib dir (matplotlib.get_data_path) and link to
+ it. Also link to the PATH var and properly format
+ ``text.latex.preample``. For the dirs, do we want `tex.cache` or
+ ``tex.cache``? I've been using the latter. We could use rest
+ specific markup for files and dirs, but I've been resisting goin
+ whle hog onthe markup... But we may eventually decide that is the
+ better choice.
+
+#. try and use internal reference links for every section and be
+ generous with the sections. Eg, I added a section headers and
+ internal linka for the postscript and unicode sections (we will
+ want to be able to refer people to these easily from FAQs and mail
+ list posts, etc)::
+
+ .. _usetex-postscript:
+
+ Postscript options
+ ==================
+
+Looks good!
Modified: trunk/matplotlib/doc/users/usetex.rst
===================================================================
--- trunk/matplotlib/doc/users/usetex.rst	2008年06月11日 00:29:14 UTC (rev 5466)
+++ trunk/matplotlib/doc/users/usetex.rst	2008年06月11日 01:26:29 UTC (rev 5467)
@@ -52,7 +52,7 @@
 
 Here is the standard example, `tex_demo.py`:
 
- .. literalinclude:: ../mpl_examples/pylab_examples/tex_demo.py
+.. literalinclude:: ../mpl_examples/pylab_examples/tex_demo.py
 
 .. image:: ../_static/tex_demo.png
 
@@ -60,13 +60,22 @@
 command ``\displaystyle``, as in `tex_demo.py`, will produce the same
 results.
 
+.. _usetex-unicode:
+
+usetex with unicode
+===================
 It is also possible to use unicode strings with the LaTeX text manager, here is
 an example taken from `tex_unicode_demo.py`:
 
- .. literalinclude:: ../mpl_examples/pylab_examples/tex_unicode_demo.py
+.. literalinclude:: ../mpl_examples/pylab_examples/tex_unicode_demo.py
 
 .. image:: ../_static/tex_unicode_demo.png
 
+.. _usetex-postscript:
+
+Postscript options
+==================
+
 In order to produce encapsulated postscript files that can be embedded in a new
 LaTeX document, the default behavior of matplotlib is to distill the output,
 which removes some postscript operators used by LaTeX that are illegal in an
@@ -77,51 +86,60 @@
 alternative produces postscript with text that can be edited in Adobe
 Illustrator, and searched text in pdf documents.
 
+.. _usetex-hangups:
 
-= Possible Hangups =
+Possible hangups
+================
 
- * On Windows, the PATH environment variable may need to be modified to find
- the latex, dvipng and ghostscript executables. This is done by going to the
- control panel, selecting the "system" icon, selecting the "advanced" tab,
- and clicking the "environment variables" button (and people think Linux is
- complicated. Sheesh.) Select the PATH variable, and add the appropriate
- directories.
+* On Windows, the PATH environment variable may need to be modified to
+ find the latex, dvipng and ghostscript executables. This is done by
+ going to the control panel, selecting the "system" icon, selecting
+ the "advanced" tab, and clicking the "environment variables" button
+ (and people think Linux is complicated. Sheesh.) Select the PATH
+ variable, and add the appropriate directories.
 
- * Using MiKTeX with Computer Modern fonts, if you get odd -Agg and PNG
- results, go to MiKTeX/Options and update your format files
+* Using MiKTeX with Computer Modern fonts, if you get odd -Agg and PNG
+ results, go to MiKTeX/Options and update your format files
 
- * The fonts look terrible on screen. You are probably running Mac OS, and
- there is some funny business with dvipng on the mac. Set text.dvipnghack :
- True in your matplotlibrc file.
+* The fonts look terrible on screen. You are probably running Mac OS,
+ and there is some funny business with dvipng on the mac. Set
+ text.dvipnghack : True in your matplotlibrc file.
 
- * On Ubuntu and Gentoo, the base texlive install does not ship with the
- type1cm package. You may need to install some of the extra packages to get
- all the goodies that come bundled with other latex distributions.
+* On Ubuntu and Gentoo, the base texlive install does not ship with
+ the type1cm package. You may need to install some of the extra
+ packages to get all the goodies that come bundled with other latex
+ distributions.
 
- * Some progress has been made so Matplotlib uses the dvi files directly for
- text layout. This allows latex to be used for text layout with the pdf and
- svg backends, as well as the \*Agg and PS backends. In the future, a latex
- installation may be the only external dependency.
+* Some progress has been made so Matplotlib uses the dvi files
+ directly for text layout. This allows latex to be used for text
+ layout with the pdf and svg backends, as well as the \*Agg and PS
+ backends. In the future, a latex installation may be the only
+ external dependency.
 
-= In the event that things dont work =
- * Try deleting `tex.cache` from your `~/.matplotlib` directory
+.. _usetex-troubleshooting:
 
- * Make sure LaTeX, dvipng and ghostscript are each working and on your PATH.
+Trouble shooting
+================
 
- * Make sure what you are trying to do is possible in a LaTeX document, that
- your LaTeX syntax is valid and that you are using raw strings if necessary
- to avoid unintended escape sequences.
+* Try deleting `tex.cache` from your `~/.matplotlib` directory
 
- * Most problems reported on the mailing list have been cleared up by
- upgrading Ghostscript_. If possible, please try upgrading to the latest
- release before reporting problems to the list.
+* Make sure LaTeX, dvipng and ghostscript are each working and on your PATH.
 
- * The text.latex.preample rc setting is not officially supported. This option
- provides lots of flexibility, and lots of ways to cause problems. Please
- disable this option before reporting problems to the mailing list.
+* Make sure what you are trying to do is possible in a LaTeX document,
+ that your LaTeX syntax is valid and that you are using raw strings
+ if necessary to avoid unintended escape sequences.
 
- * If you still need help, please see :ref:`reporting-problems`
+* Most problems reported on the mailing list have been cleared up by
+ upgrading Ghostscript_. If possible, please try upgrading to the
+ latest release before reporting problems to the list.
 
+* The text.latex.preample rc setting is not officially supported. This
+ option provides lots of flexibility, and lots of ways to cause
+ problems. Please disable this option before reporting problems to
+ the mailing list.
+
+* If you still need help, please see :ref:`reporting-problems`
+
 .. _LaTeX: http://www.tug.org
 .. _dvipng: http://sourceforge.net/projects/dvipng
 .. _Ghostscript: http://www.cs.wisc.edu/~ghost/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <md...@us...> - 2008年06月12日 14:29:43
Revision: 5481
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5481&view=rev
Author: mdboom
Date: 2008年06月12日 07:29:42 -0700 (2008年6月12日)
Log Message:
-----------
Fix latex doc build by removing some more obscure symbols that aren't
likely to be installed and adding "txfonts" to preamble.
Modified Paths:
--------------
 trunk/matplotlib/doc/conf.py
 trunk/matplotlib/doc/sphinxext/math_symbol_table.py
Modified: trunk/matplotlib/doc/conf.py
===================================================================
--- trunk/matplotlib/doc/conf.py	2008年06月12日 13:38:00 UTC (rev 5480)
+++ trunk/matplotlib/doc/conf.py	2008年06月12日 14:29:42 UTC (rev 5481)
@@ -154,6 +154,7 @@
 \usepackage{amsmath}
 \usepackage{amsfonts}
 \usepackage{amssymb}
+ \usepackage{txfonts}
 """
 
 # Documents to append as an appendix to all manuals.
Modified: trunk/matplotlib/doc/sphinxext/math_symbol_table.py
===================================================================
--- trunk/matplotlib/doc/sphinxext/math_symbol_table.py	2008年06月12日 13:38:00 UTC (rev 5480)
+++ trunk/matplotlib/doc/sphinxext/math_symbol_table.py	2008年06月12日 14:29:42 UTC (rev 5481)
@@ -55,11 +55,8 @@
 \succnapprox \subsetneqq \nvDash \precnsim \succnsim \supsetneqq
 \nvdash \lnapprox \gnapprox \ntriangleleft \ntrianglelefteq
 \lneqq \gneqq \ntriangleright \lnsim \gnsim \ntrianglerighteq
- \approxident \origof \imageof \coloneq \triangleeq \stareq \nsime
- \dotminus \eqsim \nequiv \Equiv \measeq \napprox \eqless
- \kernelcontraction \nsupset \doublebarwedge \nVdash \arceq
- \backcong \Doteq \eqdef \wedgeq \questeq \eqgtr \cupdot
- \veeeq \nsubset \eqcolon \ne
+ \coloneq \eqsim \nequiv \napprox \nsupset \doublebarwedge \nVdash
+ \Doteq \nsubset \eqcolon \ne
 """],
 ["Arrow symbols",
 2,
@@ -82,21 +79,17 @@
 \upharpoonright \downharpoonright \rightsquigarrow \nleftarrow
 \nrightarrow \nLeftarrow \nRightarrow \nleftrightarrow
 \nLeftrightarrow \to \Swarrow \Searrow \Nwarrow \Nearrow
- \barleftarrow \mapsup \mapsdown \mapsfrom \rightarrowbar
- \twoheaduparrow \updownarrowbar \leftsquigarrow \rightzigzagarrow
- \twoheaddownarrow \downzigzagarrow
+ \leftsquigarrow
 """],
 ["Miscellaneous symbols",
 3,
- r"""\neg \invnot \turnednot \infty \forall \wp \exists \bigstar
- \angle \partial \nexists \measuredangle \eth \emptyset
- \sphericalangle \clubsuit \varnothing \complement \diamondsuit
- \imath \Finv \triangledown \heartsuit \jmath \Game \spadesuit
- \ell \hbar \vartriangle \cdots \hslash \vdots \blacksquare \ldots
- \blacktriangle \ddots \sharp \prime \blacktriangledown \Im \flat
- \backprime \Re \natural \circledS \P \O \copyright \ss \Ldsh
- \frakZ \l \carriagereturn \circledR \S \sterling \L \yen \danger
- \d \OE \AA \AE \scurel \oe \o \checkmark \Rdsh \ae \ac \prurel \$
+ r"""\neg \infty \forall \wp \exists \bigstar \angle \partial
+ \nexists \measuredangle \eth \emptyset \sphericalangle \clubsuit
+ \varnothing \complement \diamondsuit \imath \Finv \triangledown
+ \heartsuit \jmath \Game \spadesuit \ell \hbar \vartriangle \cdots
+ \hslash \vdots \blacksquare \ldots \blacktriangle \ddots \sharp
+ \prime \blacktriangledown \Im \flat \backprime \Re \natural
+ \circledS \P \copyright \ss \circledR \S \yen \AA \checkmark \$
 \iiint \iint \iint \oiiint"""]
 ]
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ds...@us...> - 2008年06月12日 14:48:56
Revision: 5483
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5483&view=rev
Author: dsdale
Date: 2008年06月12日 07:48:18 -0700 (2008年6月12日)
Log Message:
-----------
responded to JDH review comments on usetex.rst
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/outline.rst
 trunk/matplotlib/doc/faq/environment_variables_faq.rst
 trunk/matplotlib/doc/faq/howto_faq.rst
 trunk/matplotlib/doc/users/customizing.rst
 trunk/matplotlib/doc/users/usetex.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst	2008年06月12日 14:39:09 UTC (rev 5482)
+++ trunk/matplotlib/doc/devel/outline.rst	2008年06月12日 14:48:18 UTC (rev 5483)
@@ -32,7 +32,7 @@
 text - annotations John submitted ?
 fonts et al Michael ? no author Darren
 pyplot tut John submitted Eric
-configuration Darren preliminary ?
+configuration Darren submitted ?
 win32 install Charlie ? no author Darren
 os x install Charlie ? no author ?
 linux install Darren has author ?
@@ -245,27 +245,48 @@
 
 Review of :ref:`usetex-tutorial`:
 
-#. In the section on the ps distiller, you might mention that it is
- the rasterization which some users find objectionable, and the
- distiller pram (eg 6000) is a dpi setting for the rasterizer. Not
- everyone will immediately grasp the controversy surrounding dumping
- high res bitmaps into a ps file.
+#. DONE - In the section on the ps distiller, you might mention that it is the
+ rasterization which some users find objectionable, and the distiller pram
+ (eg 6000) is a dpi setting for the rasterizer. Not everyone will
+ immediately grasp the controversy surrounding dumping high res bitmaps into
+ a ps file.
 
-#. ``= Possible Hangups =`` - this is moin, not rest. I have fixed
- this already, just wanted to point it out. Also, for everything
- but top level chapters, I refer ``Upper lower`` for section
- titles, eg ``Possible hangups``.
+#. DONE - ``= Possible Hangups =`` - this is moin, not rest. I have
+ fixed this already, just wanted to point it out. Also, for everything but
+ top level chapters, I refer ``Upper lower`` for section titles, eg
+ ``Possible hangups``.
 
-#. in the troubleshooting section, could you add a FAQ showing how to
+#. DONE - in the troubleshooting section, could you add a FAQ showing how to
 find their .matplotlib dir (matplotlib.get_data_path) and link to
- it. Also link to the PATH var and properly format
- ``text.latex.preample``. For the dirs, do we want `tex.cache` or
+ it.
+
+ I think you mean mpl.get_configdir. I added this to the faq/HOWTO, and
+ linked to it from usetex.rst and customizing.rst. I also added the
+ MPLCONFIGDIR environment variable to environment_variables_faq.rst.
+
+ DONE - Also link to the PATH var and properly format
+ ``text.latex.preample``.
+
+ DONE - For the dirs, do we want `tex.cache` or
 ``tex.cache``? I've been using the latter. We could use rest
 specific markup for files and dirs, but I've been resisting goin
 whle hog onthe markup... But we may eventually decide that is the
 better choice.
 
-#. try and use internal reference links for every section and be
+ I think we should use the directive provided by sphinx::
+
+ :file:`tex.cache`
+
+ I don't think that looks too ugly in ascii, its clear what it means. If you
+ don't like it, I think we should use::
+
+ ``tex.cache``
+
+ which is formatted most
+ similarly to the :file: directive in html. Let me know if you don't want to
+ use the file directive.
+
+#. DONE - try and use internal reference links for every section and be
 generous with the sections. Eg, I added a section headers and
 internal linka for the postscript and unicode sections (we will
 want to be able to refer people to these easily from FAQs and mail
@@ -277,3 +298,5 @@
 ==================
 
 Looks good!
+
+Thanks!
Modified: trunk/matplotlib/doc/faq/environment_variables_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/environment_variables_faq.rst	2008年06月12日 14:39:09 UTC (rev 5482)
+++ trunk/matplotlib/doc/faq/environment_variables_faq.rst	2008年06月12日 14:48:18 UTC (rev 5483)
@@ -17,10 +17,17 @@
 The list of directories that is added to Python's standard search list when
 importing packages and modules
 
+.. envvar:: MPLCONFIGDIR
 
-Setting Environment Variables in Linux
-======================================
+ This is the directory used to store user customizations to matplotlib, as
+ well as some caches to improve performance. If :envvar:`MPLCONFIGDIR` is not
+ defined, :file:`{HOME}/.matplotlib` is used by default.
+ 
+.. _setting-linux-osx-environment-variables:
 
+Setting Environment Variables in Linux and OS-X
+===============================================
+
 To list the current value of :envvar:`PYTHONPATH`, which may be empty, try::
 
 echo $PYTHONPATH
@@ -71,6 +78,7 @@
 To make your changes available in the future, add the commands to your
 `~/.cshrc` file.
 
+.. _setting-windows-environment-variables:
 
 Setting Environment Variables in Windows
 ========================================
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月12日 14:39:09 UTC (rev 5482)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月12日 14:48:18 UTC (rev 5483)
@@ -4,6 +4,25 @@
 HOWTO
 *****
 
+.. _locating-matplotlib-config-dir:
+
+Where is my .matplotlib directory?
+==================================
+
+Each user has a :file:`.matplotlib/` directory which may contain a
+:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file and various
+caches to improve matplotlib's performance. To locate your :file:`.matplotlib/`
+directory, use :func:`matplotlib.get_configdir`:
+
+ >>> import matplotlib as mpl
+ >>> mpl.get_configdir()
+ '/home/darren/.matplotlib'
+
+This directory is generally located in your :envvar:`HOME` directory, but if
+you would like to use a configuration directory other than
+:file:`{HOME}/.matplotlib/`, you can do so by specifying the location in your
+:envvar:`MPLCONFIGDIR` environment variable.
+
 .. _howto-ticks:
 
 How do I configure the tick linewidths?
Modified: trunk/matplotlib/doc/users/customizing.rst
===================================================================
--- trunk/matplotlib/doc/users/customizing.rst	2008年06月12日 14:39:09 UTC (rev 5482)
+++ trunk/matplotlib/doc/users/customizing.rst	2008年06月12日 14:48:18 UTC (rev 5483)
@@ -4,6 +4,8 @@
 Customizing matplotlib
 **********************
 
+.. _customizing-with-matplotlibrc-files:
+
 The matplotlibrc File
 =====================
 
@@ -16,8 +18,8 @@
 
 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
+2. :file:`.matplotlib/matplotlibrc`, for the user's default customizations. See
+ :ref:`locating-matplotlib-config-dir`.
 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
@@ -27,6 +29,8 @@
 
 See below for a sample :ref:`matplotlibrc file<matplotlibrc-sample>`.
 
+.. _customizing-with-dynamic-rc-settings:
+
 Dynamic rc Settings
 ===================
 
Modified: trunk/matplotlib/doc/users/usetex.rst
===================================================================
--- trunk/matplotlib/doc/users/usetex.rst	2008年06月12日 14:39:09 UTC (rev 5482)
+++ trunk/matplotlib/doc/users/usetex.rst	2008年06月12日 14:48:18 UTC (rev 5483)
@@ -79,38 +79,40 @@
 In order to produce encapsulated postscript files that can be embedded in a new
 LaTeX document, the default behavior of matplotlib is to distill the output,
 which removes some postscript operators used by LaTeX that are illegal in an
-eps file. This step produces fonts which may be unacceptable to some users. One
-workaround is to to set ``ps.distiller.res`` to a higher value (perhaps 6000) in
-your rc settings. A better workaround, which requires Poppler_ or Xpdf_, can be
+eps file. This step produces results which may be unacceptable to some users,
+because the text is coarsely rasterized and converted to bitmaps, which are not
+scalable like standard postscript, and the text is not searchable. One
+workaround is to to set ``ps.distiller.res`` to a higher value (perhaps 6000)
+in your rc settings, which will produce larger files but may look better and
+scale reasonably. A better workaround, which requires Poppler_ or Xpdf_, can be
 activated by changing the ``ps.usedistiller`` rc setting to ``xpdf``. This
-alternative produces postscript with text that can be edited in Adobe
-Illustrator, and searched text in pdf documents.
+alternative produces postscript without rasterizing text, so it scales
+properly, can be edited in Adobe Illustrator, and searched text in pdf
+documents.
 
 .. _usetex-hangups:
 
 Possible hangups
 ================
 
-* On Windows, the PATH environment variable may need to be modified to
- find the latex, dvipng and ghostscript executables. This is done by
- going to the control panel, selecting the "system" icon, selecting
- the "advanced" tab, and clicking the "environment variables" button
- (and people think Linux is complicated. Sheesh.) Select the PATH
- variable, and add the appropriate directories.
+* On Windows, the :envvar:`PATH` environment variable may need to be modified
+ to include the directories containing the latex, dvipng and ghostscript
+ executables. See :ref:`environment-variables` and
+ :ref:`setting-windows-environment-variables` for details.
 
-* Using MiKTeX with Computer Modern fonts, if you get odd -Agg and PNG
+* Using MiKTeX with Computer Modern fonts, if you get odd \*Agg and PNG
 results, go to MiKTeX/Options and update your format files
 
-* The fonts look terrible on screen. You are probably running Mac OS,
- and there is some funny business with dvipng on the mac. Set
- text.dvipnghack : True in your matplotlibrc file.
+* The fonts look terrible on screen. You are probably running Mac OS, and there
+ is some funny business with older versions of dvipng on the mac. Set
+ ``text.dvipnghack : True`` in your matplotlibrc file.
 
 * On Ubuntu and Gentoo, the base texlive install does not ship with
 the type1cm package. You may need to install some of the extra
 packages to get all the goodies that come bundled with other latex
 distributions.
 
-* Some progress has been made so Matplotlib uses the dvi files
+* Some progress has been made so matplotlib uses the dvi files
 directly for text layout. This allows latex to be used for text
 layout with the pdf and svg backends, as well as the \*Agg and PS
 backends. In the future, a latex installation may be the only
@@ -118,12 +120,15 @@
 
 .. _usetex-troubleshooting:
 
-Trouble shooting
-================
+Troubleshooting
+===============
 
-* Try deleting `tex.cache` from your `~/.matplotlib` directory
+* Try deleting your :file:`.matplotlib/tex.cache` directory. If you don't know
+ where to find :file:`.matplotlib`, see
+ :ref:`locating-matplotlib-config-dir`.
 
-* Make sure LaTeX, dvipng and ghostscript are each working and on your PATH.
+* Make sure LaTeX, dvipng and ghostscript are each working and on your
+ :envvar:`PATH`.
 
 * Make sure what you are trying to do is possible in a LaTeX document,
 that your LaTeX syntax is valid and that you are using raw strings
@@ -133,7 +138,7 @@
 upgrading Ghostscript_. If possible, please try upgrading to the
 latest release before reporting problems to the list.
 
-* The text.latex.preample rc setting is not officially supported. This
+* The ``text.latex.preamble`` rc setting is not officially supported. This
 option provides lots of flexibility, and lots of ways to cause
 problems. Please disable this option before reporting problems to
 the mailing list.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <jd...@us...> - 2008年06月12日 16:39:05
Revision: 5486
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5486&view=rev
Author: jdh2358
Date: 2008年06月12日 09:38:47 -0700 (2008年6月12日)
Log Message:
-----------
some minor doc fixes and reorg, closed usetex review (thanks darren!)
Modified Paths:
--------------
 trunk/matplotlib/doc/devel/outline.rst
 trunk/matplotlib/doc/faq/environment_variables_faq.rst
 trunk/matplotlib/doc/faq/howto_faq.rst
 trunk/matplotlib/doc/faq/installing_faq.rst
 trunk/matplotlib/doc/faq/troubleshooting_faq.rst
 trunk/matplotlib/doc/users/customizing.rst
 trunk/matplotlib/doc/users/event_handling.rst
Modified: trunk/matplotlib/doc/devel/outline.rst
===================================================================
--- trunk/matplotlib/doc/devel/outline.rst	2008年06月12日 16:19:14 UTC (rev 5485)
+++ trunk/matplotlib/doc/devel/outline.rst	2008年06月12日 16:38:47 UTC (rev 5486)
@@ -27,8 +27,8 @@
 legends ? no author ?
 animation John has author ?
 collections ? no author ?
-text - mathtext Michael in review John
-text - usetex Darren in review John
+text - mathtext Michael accepted John
+text - usetex Darren accepted John
 text - annotations John submitted ?
 fonts et al Michael ? no author Darren
 pyplot tut John submitted Eric
@@ -173,7 +173,7 @@
 Validation is actually built into RcParams. This was done
 just prior to development of the traited config, validation is done using
 the mechanisms developed in rcsetup. For example::
- 
+
 >>> rcParams['a.b']=1
 ---------------------------------------------------------------------------
 KeyError Traceback (most recent call last)
@@ -214,7 +214,7 @@
 ValueError: Could not convert "" to boolean
 
 
- 
+
 #. DONE - You give the example::
 
 import matplotlib.cbook as cbook
@@ -286,6 +286,8 @@
 similarly to the :file: directive in html. Let me know if you don't want to
 use the file directive.
 
+ - JDH: let's go with the file directive.
+
 #. DONE - try and use internal reference links for every section and be
 generous with the sections. Eg, I added a section headers and
 internal linka for the postscript and unicode sections (we will
Modified: trunk/matplotlib/doc/faq/environment_variables_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/environment_variables_faq.rst	2008年06月12日 16:19:14 UTC (rev 5485)
+++ trunk/matplotlib/doc/faq/environment_variables_faq.rst	2008年06月12日 16:38:47 UTC (rev 5486)
@@ -22,10 +22,10 @@
 This is the directory used to store user customizations to matplotlib, as
 well as some caches to improve performance. If :envvar:`MPLCONFIGDIR` is not
 defined, :file:`{HOME}/.matplotlib` is used by default.
- 
+
 .. _setting-linux-osx-environment-variables:
 
-Setting Environment Variables in Linux and OS-X
+Setting environment variables in Linux and OS-X
 ===============================================
 
 To list the current value of :envvar:`PYTHONPATH`, which may be empty, try::
@@ -37,8 +37,8 @@
 should be able to determine which by running at the command prompt::
 
 echo $SHELL
- 
 
+
 BASH/KSH
 --------
 
@@ -50,13 +50,14 @@
 
 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::
+The search order may be important to you, do you want :file:`~/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.
+:file:`~/.bashrc` file.
 
 
 CSH/TCSH
@@ -70,19 +71,19 @@
 
 setenv PATH ~/bin:${PATH}
 
-The search order may be important to you, do you want `~/bin` to be searched
+The search order may be important to you, do you want :file:`~/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.
+:file:`~/.cshrc` file.
 
 .. _setting-windows-environment-variables:
 
-Setting Environment Variables in Windows
+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
+button. You can edit or add to the `user variables`.
Modified: trunk/matplotlib/doc/faq/howto_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月12日 16:19:14 UTC (rev 5485)
+++ trunk/matplotlib/doc/faq/howto_faq.rst	2008年06月12日 16:38:47 UTC (rev 5486)
@@ -1,28 +1,10 @@
-.._ howto-faq:
+.. _howto-faq:
 
 *****
 HOWTO
 *****
 
-.. _locating-matplotlib-config-dir:
 
-Where is my .matplotlib directory?
-==================================
-
-Each user has a :file:`.matplotlib/` directory which may contain a
-:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file and various
-caches to improve matplotlib's performance. To locate your :file:`.matplotlib/`
-directory, use :func:`matplotlib.get_configdir`:
-
- >>> import matplotlib as mpl
- >>> mpl.get_configdir()
- '/home/darren/.matplotlib'
-
-This directory is generally located in your :envvar:`HOME` directory, but if
-you would like to use a configuration directory other than
-:file:`{HOME}/.matplotlib/`, you can do so by specifying the location in your
-:envvar:`MPLCONFIGDIR` environment variable.
-
 .. _howto-ticks:
 
 How do I configure the tick linewidths?
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月12日 16:19:14 UTC (rev 5485)
+++ trunk/matplotlib/doc/faq/installing_faq.rst	2008年06月12日 16:38:47 UTC (rev 5486)
@@ -4,6 +4,8 @@
 Installation FAQ
 ******************
 
+
+
 How do I report a compilation problem?
 ======================================
 
@@ -131,7 +133,7 @@
 ============ ===================================================================================================
 
 
-OS X Questions
+OS-X questions
 ==============
 
 .. _easy-install-osx-egg:
Modified: trunk/matplotlib/doc/faq/troubleshooting_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月12日 16:19:14 UTC (rev 5485)
+++ trunk/matplotlib/doc/faq/troubleshooting_faq.rst	2008年06月12日 16:38:47 UTC (rev 5486)
@@ -4,7 +4,59 @@
 Troubleshooting FAQ
 ===================
 
+.. _matplotlib-version:
 
+What is my matplotlib version?
+==============================
+
+To find out your matplotlib version number, import it and print the
+``__version__`` attribute::
+
+ >>> import matplotlib
+ >>> matplotlib.__version__
+ '0.98.0'
+
+
+.. _locating-matplotlib-install:
+
+Where is matplotlib installed?
+==============================
+
+You can find what directory matplotlib is installed in by importing it
+and printing the ``__file__`` attribute::
+
+ >>> import matplotlib
+ >>> matplotlib.__file__
+ '/home/jdhunter/dev/lib64/python2.5/site-packages/matplotlib/__init__.pyc'
+
+.. _locating-matplotlib-config-dir:
+
+Where is my .matplotlib directory?
+==================================
+
+Each user has a :file:`.matplotlib/` directory which may contain a
+:ref:`matplotlibrc <customizing-with-matplotlibrc-files>` file and various
+caches to improve matplotlib's performance. To locate your :file:`.matplotlib/`
+directory, use :func:`matplotlib.get_configdir`:
+
+ >>> import matplotlib as mpl
+ >>> mpl.get_configdir()
+ '/home/darren/.matplotlib'
+
+On unix like systems, this directory is generally located in your
+:envvar:`HOME` directory. On windows, it is in your documents and
+settings directory by default::
+
+ >>> import matplotlib
+ >>> mpl.get_configdir()
+ 'C:\\Documents and Settings\\jdhunter\\.matplotlib'
+
+If you would like to use a different configuration directory, you can
+do so by specifying the location in your :envvar:`MPLCONFIGDIR`
+environment variable -- see
+:ref:`setting-linux-osx-environment-variables`.
+
+
 .. _reporting-problems:
 
 How do I report a problem?
@@ -40,7 +92,7 @@
 
 > python simple_plot.py --verbose-helpful > output.txt
 
-If you compiled matplotlib yourself, please also provide 
+If you compiled matplotlib yourself, please also provide
 
 * any changes you have made to ``setup.py`` or ``setupext.py``
 * the output of::
@@ -50,7 +102,7 @@
 
 The beginning of the build output contains lots of details about your
 platform that are useful for the matplotlib developers to diagnose
- your problem. 
+ your problem.
 
 * your compiler version -- eg, ``gcc --version``
 
Modified: trunk/matplotlib/doc/users/customizing.rst
===================================================================
--- trunk/matplotlib/doc/users/customizing.rst	2008年06月12日 16:19:14 UTC (rev 5485)
+++ trunk/matplotlib/doc/users/customizing.rst	2008年06月12日 16:38:47 UTC (rev 5486)
@@ -20,18 +20,20 @@
 specific customizations that you do not want to apply elsewhere.
 2. :file:`.matplotlib/matplotlibrc`, for the user's default customizations. See
 :ref:`locating-matplotlib-config-dir`.
-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`.
+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 you
+ :file:`.matplotlib` directory.
 
+
 See below for a sample :ref:`matplotlibrc file<matplotlibrc-sample>`.
 
 .. _customizing-with-dynamic-rc-settings:
 
-Dynamic rc Settings
+Dynamic rc settings
 ===================
 
 You can also dynamically change the default rc settings in a python script or
Modified: trunk/matplotlib/doc/users/event_handling.rst
===================================================================
--- trunk/matplotlib/doc/users/event_handling.rst	2008年06月12日 16:19:14 UTC (rev 5485)
+++ trunk/matplotlib/doc/users/event_handling.rst	2008年06月12日 16:38:47 UTC (rev 5486)
@@ -141,7 +141,7 @@
 ``key``
 the key pressed: None, chr(range(255), 'shift', 'win', or 'control'
 
-Draggable Rectangle Exercise
+Draggable rectangle exercise
 ----------------------------
 
 Write draggable rectangle class that is initialized with a
@@ -332,7 +332,7 @@
 
 .. _object-picking:
 
-Object Picking
+Object picking
 ==============
 
 You can enable picking by setting the ``picker`` property of an
@@ -436,7 +436,7 @@
 plt.show()
 
 
-Picking Exercise
+Picking exercise
 ----------------
 
 Create a data set of 100 arrays of 1000 Gaussian random numbers and
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
From: <ds...@us...> - 2008年06月12日 17:16:17
Revision: 5487
 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5487&view=rev
Author: dsdale
Date: 2008年06月12日 10:16:15 -0700 (2008年6月12日)
Log Message:
-----------
added customization api, fixed a few errors in docs
Modified Paths:
--------------
 trunk/matplotlib/doc/api/index.rst
 trunk/matplotlib/doc/users/customizing.rst
 trunk/matplotlib/doc/users/usetex.rst
Modified: trunk/matplotlib/doc/api/index.rst
===================================================================
--- trunk/matplotlib/doc/api/index.rst	2008年06月12日 16:38:47 UTC (rev 5486)
+++ trunk/matplotlib/doc/api/index.rst	2008年06月12日 17:16:15 UTC (rev 5487)
@@ -9,6 +9,7 @@
 
 .. toctree::
 
+ matplotlib_configuration_api.rst
 artist_api.rst
 axes_api.rst
 pyplot_api.rst
Modified: trunk/matplotlib/doc/users/customizing.rst
===================================================================
--- trunk/matplotlib/doc/users/customizing.rst	2008年06月12日 16:38:47 UTC (rev 5486)
+++ trunk/matplotlib/doc/users/customizing.rst	2008年06月12日 17:16:15 UTC (rev 5487)
@@ -23,7 +23,7 @@
 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
+ :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 you
 :file:`.matplotlib` directory.
Modified: trunk/matplotlib/doc/users/usetex.rst
===================================================================
--- trunk/matplotlib/doc/users/usetex.rst	2008年06月12日 16:38:47 UTC (rev 5486)
+++ trunk/matplotlib/doc/users/usetex.rst	2008年06月12日 17:16:15 UTC (rev 5487)
@@ -124,8 +124,7 @@
 ===============
 
 * Try deleting your :file:`.matplotlib/tex.cache` directory. If you don't know
- where to find :file:`.matplotlib`, see
- :ref:`locating-matplotlib-config-dir`.
+ where to find :file:`.matplotlib`, see :ref:`locating-matplotlib-config-dir`.
 
 * Make sure LaTeX, dvipng and ghostscript are each working and on your
 :envvar:`PATH`.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
1 2 > >> (Page 1 of 2)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /