Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix a number of issues in the doc build #2041

Merged
merged 7 commits into from

4 participants

@mdboom
Owner

Incorporates #2031.

@mdboom mdboom referenced this pull request
Closed

Update screenshots page #2031

@pelson pelson commented on the diff
doc/users/screenshots.rst
((20 lines not shown))
.. image:: ../_static/eeg_small.png
+
+The lower axes uses :func:`~matplotlib.pyplot.specgram`
+to plot the spectrogram of one of the EEG channels.
+
+For examples of how to embed matplotlib in different toolkits, see:
+
+ * :ref:`user_interfaces-embedding_in_gtk2`
+ * :ref:`user_interfaces-embedding_in_wx2`
+ * :ref:`user_interfaces-mpl_with_glade`
+ * :ref:`user_interfaces-embedding_in_qt`
+ * :ref:`user_interfaces-embedding_in_tk`
+
+XKCD-style sketch plots
@pelson Collaborator
pelson added a note

I agree with having this here, but as a mental note to self as much as anything else, the screenshots page is not another gallery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/matplotlib/dates.py
((5 lines not shown))
Like Python's datetime, mpl uses the Gregorian calendar for all conversions
between dates and floating point numbers. This practice is not universal,
and calendar differences can cause confusing differences between what
Python and mpl give as the number of days since 0001-01-01 and what other
software and databases yield. For example, the `US Naval Observatory
- <http://www.usno.navy.mil/USNO/astronomical-applications/
-data-services/jul-date>`_
+ <http://www.usno.navy.mil/USNO/astronomical-applications/data-services/jul-date>`_
@pelson Collaborator
pelson added a note

I think the pep8 test will shout at you for this. I don't know the best way to handle this url...@nellev?

@NelleV Collaborator
NelleV added a note

Long URL are a bit annoying: one solution could be to use a url shortener.

@mdboom Owner
mdboom added a note

In this particular instance, we might be able to just do without the link...

@pelson Collaborator
pelson added a note

:+1: for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
lib/matplotlib/colorbar.py
((13 lines not shown))
The orientation of the colorbar. Typically, this keyword shouldn't
- be used, as it can be derived from the **location** keyword.
+ be used, as it can be derived from the `location` keyword.
@pelson Collaborator
pelson added a note

Pretty sure this is supposed to be double back quote marks, not single.

@mdboom Owner
mdboom added a note

In the new numpydoc format that we're trying to move to, it's single. This isn't quite a numpydoc comment yet, so it's questionable whether that's right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@mdboom mdboom referenced this pull request
Merged

Tweak image path #2048

@pelson
Collaborator

Just amend the typo in 1cf5aae and we can merge :+1:

@mdboom mdboom merged commit 8ea183b into matplotlib:master
@mdboom mdboom deleted the mdboom:doc-fixes-1-3 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2013
  1. @tonysyu
  2. @tonysyu

    Tweak aesthetics of plots in screenshots page.

    tonysyu authored
    These changes also cleanup the code a bit, as described by MEP 12.
  3. @tonysyu
  4. @mdboom

    Merge remote-tracking branch 'tonysyu/screenshots-update' into doc-fi…

    mdboom authored
    …xes-1-3
    
    Conflicts:
    	doc/users/screenshots.rst
  5. @mdboom
Commits on May 22, 2013
  1. @mdboom

    double backticks

    mdboom authored
  2. @mdboom

    Remove long URL

    mdboom authored
This page is out of date. Refresh to see the latest.
View
12 INSTALL
@@ -183,7 +183,7 @@ the libraries themselves.
`Download python <http://www.python.org/download/>`_.
:term:`numpy` |minimum_numpy_version| (or later)
- array support for python (`download <http://numpy.org>`_)
+ array support for python (`download numpy <http://numpy.org>`_)
libpng 1.2 (or later)
library for loading and saving :term:`PNG` files (`download
@@ -201,7 +201,7 @@ libpng 1.2 (or later)
easy_install or installing from source, the installer will attempt
to download and install `python_dateutil` from PyPI.
-:term:`pyparsing`
+`pyparsing`
Required for matplotlib's mathtext math rendering support. If
using pip, easy_install or installing from source, the installer
will attempt to download and install `pyparsing` from PyPI.
@@ -216,9 +216,6 @@ backends and the capabilities they provide.
:term:`tk` 8.3 or later
The TCL/Tk widgets library used by the TkAgg backend
-:term:`pyqt` 3.1 or later
- The Qt3 widgets library python wrappers for the QtAgg backend
-
:term:`pyqt` 4.0 or later
The Qt4 widgets library python wrappers for the Qt4Agg backend
@@ -230,9 +227,6 @@ backends and the capabilities they provide.
The python wrappers for the wx widgets library for use with the
WX or WXAgg backend
-:term:`pyfltk` 1.0 or later
- The python wrappers of the FLTK widgets library for use with FLTKAgg
-
**Required libraries that ship with matplotlib**
:term:`agg` 2.4
@@ -240,7 +234,7 @@ backends and the capabilities they provide.
agg template source statically, so it will not affect anything on
your system outside of matplotlib.
-:term:`PyCXX` 6.2.4
+`PyCXX` 6.2.4
A library for writing Python extensions in C++.
.. _build_osx:
View
2  doc/api/index.rst
@@ -31,9 +31,9 @@
font_manager_api.rst
gridspec_api.rst
legend_api.rst
+ markers_api.rst
mathtext_api.rst
mlab_api.rst
- nxutils_api.rst
path_api.rst
pyplot_api.rst
sankey_api.rst
View
6 doc/api/markers_api.rst
@@ -1,10 +1,10 @@
*******
-Markers*
-******
+Markers
+*******
:mod:`matplotlib.markers`
-========================
+=========================
.. automodule:: matplotlib.markers
:members:
View
4 doc/devel/release_guide.rst
@@ -1,8 +1,8 @@
.. _release-guide:
-*************************
+**************************
Doing a matplotlib release
-*************************
+**************************
A guide for developers who are doing a matplotlib release.
View
38 doc/pyplots/tex_demo.py
@@ -1,5 +1,6 @@
-#!/usr/bin/env python
"""
+Demo of TeX rendering.
+
You can use TeX to render all of your matplotlib text if the rc
parameter text.usetex is set. This works currently on the agg and ps
backends, and requires that you have tex and the other dependencies
@@ -10,26 +11,25 @@
~/.tex.cache
"""
-from matplotlib import rc
-from numpy import arange, cos, pi
-from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
- grid, savefig, show
+import numpy as np
+import matplotlib.pyplot as plt
-rc('text', usetex=True)
-rc('font', family='serif')
-figure(1, figsize=(6,4))
-ax = axes([0.1, 0.1, 0.8, 0.7])
-t = arange(0.0, 1.0+0.01, 0.01)
-s = cos(2*2*pi*t)+2
-plot(t, s)
+# Example data
+t = np.arange(0.0, 1.0 + 0.01, 0.01)
+s = np.cos(4 * np.pi * t) + 2
-xlabel(r'\textbf{time (s)}')
-ylabel(r'\textit{voltage (mV)}',fontsize=16)
-title(r"\TeX\ is Number $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
- fontsize=16, color='r')
-grid(True)
-savefig('tex_demo')
+plt.rc('text', usetex=True)
+plt.rc('font', family='serif')
+plt.plot(t, s)
+plt.xlabel(r'\textbf{time} (s)')
+plt.ylabel(r'\textit{voltage} (mV)',fontsize=16)
+plt.title(r"\TeX\ is Number "
+ r"$\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
+ fontsize=16, color='gray')
+# Make room for the ridiculously large title.
+plt.subplots_adjust(top=0.8)
-show()
+plt.savefig('tex_demo')
+plt.show()
View
53 doc/users/github_stats.rst
@@ -1,5 +1,6 @@
.. _github-stats:
+
Github stats
============
@@ -102,7 +103,7 @@ The following 90 authors contributed 1618 commits.
We closed a total of 1222 issues, 435 pull requests and 787 regular issues;
-this is the full list (generated with the script
+this is the full list (generated with the script
:file:`tools/github_stats.py`):
Pull Requests (435):
@@ -151,7 +152,7 @@ Pull Requests (435):
* :ghpull:`1762`: Make cbook safe to import while removing duplicate is_string_like;
* :ghpull:`1252`: Properly passing on horiz-/vertOn to Cursor()
* :ghpull:`1686`: Fix lost ticks
-* :ghpull:`1640`: Fix bugs in legend positioning with loc='best'
+* :ghpull:`1640`: Fix bugs in legend positioning with loc='best'
* :ghpull:`1687`: Update lib/matplotlib/backends/backend_cairo.py
* :ghpull:`1760`: Improved the subplot function documentation and fixed the autogeneration from boilerplate.
* :ghpull:`1716`: PEP8 fixes on the figure module
@@ -202,7 +203,7 @@ Pull Requests (435):
* :ghpull:`1657`: Add EventCollection and eventplot
* :ghpull:`1641`: PEP8 fixes on the rcsetup module
* :ghpull:`1650`: _png.read_png crashes on Python 3 with urllib.request object
-* :ghpull:`1568`: removed deprecated methods from the axes module.
+* :ghpull:`1568`: removed deprecated methods from the axes module.
* :ghpull:`1589`: Fix shifted ylabels (Issue #1571)
* :ghpull:`1634`: add scatterpoints to rcParam
* :ghpull:`1654`: added explicit 'zorder' kwarg to `Colection` and `LineCollection`.
@@ -353,7 +354,7 @@ Pull Requests (435):
* :ghpull:`1333`: PEP8 fixes on collections.py
* :ghpull:`1336`: PEP8 fixes to colorbar.py
* :ghpull:`1347`: Remove nonfunctioning cbook.isvector
-* :ghpull:`1327`: plt.subplots: Set the visibility of the offset text to false on the shared axes.
+* :ghpull:`1327`: plt.subplots: Set the visibility of the offset text to false on the shared axes.
* :ghpull:`1335`: PEP8 fixes on cbook.py
* :ghpull:`1334`: PEP8 fixes on blocking_input.py
* :ghpull:`1332`: PEP8 fixes on cm.py
@@ -371,7 +372,7 @@ Pull Requests (435):
* :ghpull:`1285`: Hide Tk root window until later
* :ghpull:`1305`: Fix pointer syntax error
* :ghpull:`1294`: Update lib/mpl_toolkits/mplot3d/axes3d.py
-* :ghpull:`1300`: Pcolormesh and colorbar documentation.
+* :ghpull:`1300`: Pcolormesh and colorbar documentation.
* :ghpull:`1296`: Make Container._remove_method call correctly
* :ghpull:`1293`: Fixed to contour to support the _as_mpl_transform api.
* :ghpull:`1284`: Fix Image Tutorial: plt.imshow instead of mpimg.imshow.
@@ -383,7 +384,7 @@ Pull Requests (435):
* :ghpull:`1277`: Fixed bug in MaxNLocator.bin_boundaries
* :ghpull:`1273`: Handled baseline image folder identification for non matplotlib projects...
* :ghpull:`1230`: Fix dpi issue for bitmaps on the OS X backend
-* :ghpull:`1251`: backend_pgf. Enable custom dashstyles in the pgf backend
+* :ghpull:`1251`: backend_pgf. Enable custom dashstyles in the pgf backend
* :ghpull:`1264`: Re-added the matplotlib.dates import on axes
* :ghpull:`1271`: Set axis limits in test_stackplot
* :ghpull:`1269`: Fix typo in docstring
@@ -406,7 +407,7 @@ Pull Requests (435):
* :ghpull:`1231`: fix Typesetting in plot() docstring
* :ghpull:`1215`: PEP8 on lib/matplotlib.afm.py
* :ghpull:`1216`: PEP8 fixes on the animation module
-* :ghpull:`1208`: FAIL: matplotlib.tests.test_text.test_contains.test
+* :ghpull:`1208`: FAIL: matplotlib.tests.test_text.test_contains.test
* :ghpull:`1209`: Pass linewidth to Mac context properly
* :ghpull:`847`: Add stacked kwarg to hist and implement stacked hists for step histtype
* :ghpull:`1228`: backend_pgf: pep8 edits
@@ -469,7 +470,7 @@ Pull Requests (435):
* :ghpull:`983`: Issues with dateutil and pytz
* :ghpull:`1133`: figure.py: import warnings, and make imports absolute
* :ghpull:`1132`: clean out obsolete matplotlibrc-related bits to close #1123
-* :ghpull:`1131`: Cleanup after the gca test.
+* :ghpull:`1131`: Cleanup after the gca test.
* :ghpull:`563`: sankey.add() has mutable defaults
* :ghpull:`731`: Plot limit with transform
* :ghpull:`1107`: Added %s support for labels.
@@ -526,7 +527,7 @@ Pull Requests (435):
* :ghpull:`898`: Added warnings for easily confusable subplot/subplots invocations
* :ghpull:`963`: Add detection of file extension for file-like objects
* :ghpull:`973`: Fix sankey.py pep8 and py3 compatibility
-* :ghpull:`972`: Force closing PIL image files
+* :ghpull:`972`: Force closing PIL image files
* :ghpull:`981`: Fix pathpatch3d_demo.py on Python 3
* :ghpull:`980`: Fix basic_units.py on Python 3. PEP8 and PyLint cleanup.
* :ghpull:`1014`: qt4: remove duplicate file save button; and remove trailing whitespace
@@ -540,7 +541,7 @@ Pull Requests (435):
* :ghpull:`851`: Simple GUI interface enhancements
* :ghpull:`979`: Fix test_mouseclicks.py on Python 3
* :ghpull:`977`: Fix lasso_selector_demo.py on Python 3
-* :ghpull:`970`: Fix tiff and jpeg export via PIL
+* :ghpull:`970`: Fix tiff and jpeg export via PIL
* :ghpull:`961`: Issue 807 auto minor locator
Issues (787):
@@ -632,7 +633,7 @@ Issues (787):
* :ghissue:`1252`: Properly passing on horiz-/vertOn to Cursor()
* :ghissue:`1632`: Fix build on Ubuntu 12.10
* :ghissue:`1686`: Fix lost ticks
-* :ghissue:`1640`: Fix bugs in legend positioning with loc='best'
+* :ghissue:`1640`: Fix bugs in legend positioning with loc='best'
* :ghissue:`1687`: Update lib/matplotlib/backends/backend_cairo.py
* :ghissue:`1760`: Improved the subplot function documentation and fixed the autogeneration from boilerplate.
* :ghissue:`1647`: WIP: Deprecation of the cbook module
@@ -725,7 +726,7 @@ Issues (787):
* :ghissue:`1657`: Add EventCollection and eventplot
* :ghissue:`1641`: PEP8 fixes on the rcsetup module
* :ghissue:`1650`: _png.read_png crashes on Python 3 with urllib.request object
-* :ghissue:`1568`: removed deprecated methods from the axes module.
+* :ghissue:`1568`: removed deprecated methods from the axes module.
* :ghissue:`1571`: Y-labels shifted
* :ghissue:`1589`: Fix shifted ylabels (Issue #1571)
* :ghissue:`1276`: Fix overwriting suptitle
@@ -748,7 +749,7 @@ Issues (787):
* :ghissue:`1582`: Linear tri interpolator
* :ghissue:`1637`: change cbook to relative import
* :ghissue:`1645`: add get_segments method to collections.LineCollection - updated
-* :ghissue:`1639`: Rename web_static to web_backend in setup.py
+* :ghissue:`1639`: Rename web_static to web_backend in setup.py
* :ghissue:`1618`: Mplot3d/crashfixes
* :ghissue:`1636`: hexbin log scale is broken in matplotlib 1.2.0
* :ghissue:`1624`: implemented inverse transform for Mollweide axes
@@ -756,13 +757,13 @@ Issues (787):
* :ghissue:`1139`: Make Axes.stem take at least one argument.
* :ghissue:`1426`: WebAgg backend
* :ghissue:`1606`: Document the C/C++ code guidelines
-* :ghissue:`1622`: zorder is not respected by all parts of `errorbar`
+* :ghissue:`1622`: zorder is not respected by all parts of `errorbar`
* :ghissue:`1628`: Fix errorbar zorder v1.2
* :ghissue:`1625`: saving pgf to a stream is not supported
* :ghissue:`1588`: Annotations appear in incorrect locations
* :ghissue:`1620`: Fix bug in _AnnotationBase
* :ghissue:`1621`: Package for python 3.3 on OS X
-* :ghissue:`1616`: Legend: Also calc the bbox of the legend when the frame is not drawn.
+* :ghissue:`1616`: Legend: Also calc the bbox of the legend when the frame is not drawn.
* :ghissue:`1587`: Mac OS X 10.5 needs an autoreleasepool here to avoid memory leaks. Newer...
* :ghissue:`1597`: new MatplotlibDeprecationWarning class (against master)
* :ghissue:`1596`: new MatplotlibDeprecationWarning class (against 1.2.x)
@@ -918,7 +919,7 @@ Issues (787):
* :ghissue:`1424`: pcolor fails if edgecolors is not a string
* :ghissue:`1427`: Fix AttrituteError for .lower on tuple of strings
* :ghissue:`1425`: Rebase of #1418 on v1.2.x
-* :ghissue:`1418`: Tables: Fix get_window_extent for table
+* :ghissue:`1418`: Tables: Fix get_window_extent for table
* :ghissue:`1411`: Fix transparent markers in PDF backend. Closes #1410
* :ghissue:`1410`: Open markers incorrect in PDF output
* :ghissue:`1416`: backend_pdf: optional rgbFace arg in fillp replaces code in draw_markers. Closes #1410
@@ -981,7 +982,7 @@ Issues (787):
* :ghissue:`1333`: PEP8 fixes on collections.py
* :ghissue:`1336`: PEP8 fixes to colorbar.py
* :ghissue:`1347`: Remove nonfunctioning cbook.isvector
-* :ghissue:`1327`: plt.subplots: Set the visibility of the offset text to false on the shared axes.
+* :ghissue:`1327`: plt.subplots: Set the visibility of the offset text to false on the shared axes.
* :ghissue:`1335`: PEP8 fixes on cbook.py
* :ghissue:`1334`: PEP8 fixes on blocking_input.py
* :ghissue:`1332`: PEP8 fixes on cm.py
@@ -1005,7 +1006,7 @@ Issues (787):
* :ghissue:`156`: Multicursor not displayed with zoom on
* :ghissue:`1320`: Cursor widget now uses widgetlock; closes Issue #156
* :ghissue:`1321`: pgf backend. Y-labels in subplot are not alligned after baseline but bottom of letter
-* :ghissue:`1301`: Colorbar Add kw arguement to colorbar to reenable edges around faces
+* :ghissue:`1301`: Colorbar Add kw arguement to colorbar to reenable edges around faces
* :ghissue:`1315`: Add documentation of colorbar issue #1188 to colorbar documentation.
* :ghissue:`1303`: twinx/twiny misses settings axes
* :ghissue:`1307`: Marker not round with markersize=3
@@ -1017,8 +1018,8 @@ Issues (787):
* :ghissue:`1294`: Update lib/mpl_toolkits/mplot3d/axes3d.py
* :ghissue:`159`: Autoscale in hist() with step and log
* :ghissue:`167`: windows x64 support in _tkagg.so
-* :ghissue:`1300`: Pcolormesh and colorbar documentation.
-* :ghissue:`1178`: Make colorbar draw edge with facecolor around the faces.
+* :ghissue:`1300`: Pcolormesh and colorbar documentation.
+* :ghissue:`1178`: Make colorbar draw edge with facecolor around the faces.
* :ghissue:`1205`: New 'gridon' keyword in plotfile
* :ghissue:`1295`: Exception when using Container.remove
* :ghissue:`1296`: Make Container._remove_method call correctly
@@ -1052,7 +1053,7 @@ Issues (787):
* :ghissue:`1273`: Handled baseline image folder identification for non matplotlib projects...
* :ghissue:`1230`: Fix dpi issue for bitmaps on the OS X backend
* :ghissue:`1274`: backend_pgf: Custom dashstyles and consistency with other backends
-* :ghissue:`1251`: backend_pgf. Enable custom dashstyles in the pgf backend
+* :ghissue:`1251`: backend_pgf. Enable custom dashstyles in the pgf backend
* :ghissue:`1264`: Re-added the matplotlib.dates import on axes
* :ghissue:`1271`: Set axis limits in test_stackplot
* :ghissue:`1269`: Fix typo in docstring
@@ -1086,7 +1087,7 @@ Issues (787):
* :ghissue:`1231`: fix Typesetting in plot() docstring
* :ghissue:`1215`: PEP8 on lib/matplotlib.afm.py
* :ghissue:`1216`: PEP8 fixes on the animation module
-* :ghissue:`1208`: FAIL: matplotlib.tests.test_text.test_contains.test
+* :ghissue:`1208`: FAIL: matplotlib.tests.test_text.test_contains.test
* :ghissue:`786`: savefig() renders paths and text differently than show()
* :ghissue:`1209`: Pass linewidth to Mac context properly
* :ghissue:`847`: Add stacked kwarg to hist and implement stacked hists for step histtype
@@ -1179,7 +1180,7 @@ Issues (787):
* :ghissue:`1141`: backend_pgf: fix parentheses typo
* :ghissue:`1114`: Make grid accept alpha rcParam
* :ghissue:`1118`: ERROR: matplotlib.tests.test_backend_pgf.test_pdflatex on Python 3.x
-* :ghissue:`1116`: ERROR: matplotlib.tests.test_backend_pgf.test_xelatex
+* :ghissue:`1116`: ERROR: matplotlib.tests.test_backend_pgf.test_xelatex
* :ghissue:`1124`: PGF backend, fix #1116, #1118 and #1128
* :ghissue:`745`: Cannot run tests with Python 3.x on MacOS 10.7
* :ghissue:`983`: Issues with dateutil and pytz
@@ -1188,7 +1189,7 @@ Issues (787):
* :ghissue:`1133`: figure.py: import warnings, and make imports absolute
* :ghissue:`1123`: Rationalize the number of ancillary (default matplotlibrc) files
* :ghissue:`1132`: clean out obsolete matplotlibrc-related bits to close #1123
-* :ghissue:`1131`: Cleanup after the gca test.
+* :ghissue:`1131`: Cleanup after the gca test.
* :ghissue:`563`: sankey.add() has mutable defaults
* :ghissue:`238`: patch for qt4 backend
* :ghissue:`731`: Plot limit with transform
@@ -1298,7 +1299,7 @@ Issues (787):
* :ghissue:`898`: Added warnings for easily confusable subplot/subplots invocations
* :ghissue:`963`: Add detection of file extension for file-like objects
* :ghissue:`973`: Fix sankey.py pep8 and py3 compatibility
-* :ghissue:`972`: Force closing PIL image files
+* :ghissue:`972`: Force closing PIL image files
* :ghissue:`981`: Fix pathpatch3d_demo.py on Python 3
* :ghissue:`980`: Fix basic_units.py on Python 3. PEP8 and PyLint cleanup.
* :ghissue:`996`: macosx backend broken by #901: QuadMesh fails so colorbar fails
@@ -1322,7 +1323,7 @@ Issues (787):
* :ghissue:`851`: Simple GUI interface enhancements
* :ghissue:`979`: Fix test_mouseclicks.py on Python 3
* :ghissue:`977`: Fix lasso_selector_demo.py on Python 3
-* :ghissue:`970`: Fix tiff and jpeg export via PIL
+* :ghissue:`970`: Fix tiff and jpeg export via PIL
* :ghissue:`707`: key_press_event in pyqt4 embedded matplotlib
* :ghissue:`243`: Debug version/symbols for win32
* :ghissue:`255`: Classes in _transforms.h in global namespace
View
195 doc/users/screenshots.rst
@@ -4,13 +4,13 @@
Screenshots
**********************
-Here you will find a host of example figures with the code that
-generated them
+Here you'll find a host of example plots with the code that
+generated them.
Simple Plot
===========
-The most basic :func:`~matplotlib.pyplot.plot`, with text labels
+Here's a very basic :func:`~matplotlib.pyplot.plot` with text labels:
.. plot:: mpl_examples/pylab_examples/simple_plot.py
@@ -19,8 +19,8 @@ The most basic :func:`~matplotlib.pyplot.plot`, with text labels
Subplot demo
============
-Multiple regular axes (numrows by numcolumns) are created with the
-:func:`~matplotlib.pyplot.subplot` command.
+Multiple axes (i.e. subplots) are created with the
+:func:`~matplotlib.pyplot.subplot` command:
.. plot:: mpl_examples/subplots_axes_and_figures/subplot_demo.py
@@ -30,7 +30,7 @@ Histograms
==========
The :func:`~matplotlib.pyplot.hist` command automatically generates
-histograms and will return the bin counts or probabilities
+histograms and returns the bin counts or probabilities:
.. plot:: mpl_examples/statistics/histogram_demo_features.py
@@ -40,8 +40,8 @@ histograms and will return the bin counts or probabilities
Path demo
=========
-You can add arbitrary paths in matplotlib as of release 0.98. See
-the :mod:`matplotlib.path`.
+You can add arbitrary paths in matplotlib using the
+:mod:`matplotlib.path` module:
.. plot:: mpl_examples/shapes_and_collections/path_patch_demo.py
@@ -52,27 +52,41 @@ mplot3d
The mplot3d toolkit (see :ref:`toolkit_mplot3d-tutorial` and
:ref:`mplot3d-examples-index`) has support for simple 3d graphs
-including surface, wireframe, scatter, and bar charts (added in
-matlpotlib-0.99). Thanks to John Porter, Jonathon Taylor and Reinier
-Heeres for the mplot3d toolkit. The toolkit is included with all
-standard matplotlib installs.
+including surface, wireframe, scatter, and bar charts.
.. plot:: mpl_examples/mplot3d/surface3d_demo.py
+Thanks to John Porter, Jonathon Taylor, Reinier Heeres, and Ben Root for
+the `mplot3d` toolkit. This toolkit is included with all standard matplotlib
+installs.
+
.. _screenshots_ellipse_demo:
+Streamplot
+==========
+
+The :meth:`~matplotlib.pyplot.streamplot` function plots the streamlines of
+a vector field. In addition to simply plotting the streamlines, it allows you
+to map the colors and/or line widths of streamlines to a separate parameter,
+such as the speed or local intensity of the vector field.
+
+.. plot:: mpl_examples/images_contours_and_fields/streamplot_demo_features.py
+
+This feature complements the :meth:`~matplotlib.pyplot.quiver` function for
+plotting vector fields. Thanks to Tom Flannaghan and Tony Yu for adding the
+streamplot function.
+
+
Ellipses
========
In support of the
`Phoenix <http://www.jpl.nasa.gov/news/phoenix/main.php>`_ mission to
-Mars, which used matplotlib in ground tracking of the spacecraft,
-Michael Droettboom built on work by Charlie Moad to provide an
-extremely accurate 8-spline approximation to elliptical arcs (see
-:class:`~matplotlib.patches.Arc`) in the viewport. This
-provides a scale free, accurate graph of the arc regardless of zoom
-level
+Mars (which used matplotlib to display ground tracking of spacecraft),
+Michael Droettboom built on work by Charlie Moad to provide an extremely
+accurate 8-spline approximation to elliptical arcs (see
+:class:`~matplotlib.patches.Arc`), which are insensitive to zoom level.
.. plot:: mpl_examples/pylab_examples/ellipse_demo.py
@@ -81,27 +95,29 @@ level
Bar charts
==========
-The :func:`~matplotlib.pyplot.bar`
-command takes error bars as an optional argument. You can also use up
-and down bars, stacked bars, candlestick bars, etc, ... See
-`bar_stacked.py <examples/pylab_examples/bar_stacked.py>`_ for another example.
-You can make horizontal bar charts with the
-:func:`~matplotlib.pyplot.barh` command.
+Bar charts are simple to create using the :func:`~matplotlib.pyplot.bar`
+command, which includes customizations such as error bars:
.. plot:: mpl_examples/pylab_examples/barchart_demo.py
+It's also simple to create stacked bars
+(`bar_stacked.py <mpl_examples/pylab_examples/bar_stacked.html>`_),
+candlestick bars
+(`finance_demo.py <mpl_examples/pylab_examples/finance_demo.html>`_),
+and horizontal bar charts
+(`barh_demo.py <mpl_examples/lines_bars_and_markers/barh_demo.html>`_).
+
.. _screenshots_pie_demo:
Pie charts
==========
-The :func:`~matplotlib.pyplot.pie` command
-uses a MATLAB compatible syntax to produce pie charts. Optional
-features include auto-labeling the percentage of area, exploding one
-or more wedges out from the center of the pie, and a shadow effect.
-Take a close look at the attached code that produced this figure; nine
-lines of code.
+The :func:`~matplotlib.pyplot.pie` command allows you to easily create pie
+charts. Optional features include auto-labeling the percentage of area,
+exploding one or more wedges from the center of the pie, and a shadow effect.
+Take a close look at the attached code, which generates this figure in just
+a few lines of code.
.. plot:: mpl_examples/pie_and_polar_charts/pie_demo_features.py
@@ -110,23 +126,23 @@ lines of code.
Table demo
==========
-The :func:`~matplotlib.pyplot.table` command will place a text table
-on the axes
+The :func:`~matplotlib.pyplot.table` command adds a text table
+to an axes.
.. plot:: mpl_examples/pylab_examples/table_demo.py
.. _screenshots_scatter_demo:
+
Scatter demo
============
The :func:`~matplotlib.pyplot.scatter` command makes a scatter plot
-with (optional) size and color arguments. This example plots changes
-in Google stock price from one day to the next with the sizes coding
-trading volume and the colors coding price change in day i. Here the
-alpha attribute is used to make semitransparent circle markers with
-the Agg backend (see :ref:`what-is-a-backend`)
+with (optional) size and color arguments. This example plots changes
+in Google's stock price, with marker sizes reflecting the
+trading volume and colors varying with time. Here, the
+alpha attribute is used to make semitransparent circle markers.
.. plot:: mpl_examples/pylab_examples/scatter_demo2.py
@@ -138,8 +154,8 @@ Slider demo
Matplotlib has basic GUI widgets that are independent of the graphical
user interface you are using, allowing you to write cross GUI figures
-and widgets. See matplotlib.widgets and the widget `examples
-<examples/widgets>`
+and widgets. See :mod:`matplotlib.widgets` and the
+`widget examples <../examples/widgets/index.html>`_.
.. plot:: mpl_examples/widgets/slider_demo.py
@@ -150,34 +166,33 @@ Fill demo
=========
The :func:`~matplotlib.pyplot.fill` command lets you
-plot filled polygons. Thanks to Andrew Straw for providing this
-function
+plot filled curves and polygons:
.. plot:: mpl_examples/lines_bars_and_markers/fill_demo.py
+Thanks to Andrew Straw for adding this function.
.. _screenshots_date_demo:
Date demo
=========
-You can plot date data with major and minor ticks and custom tick
-formatters for both the major and minor ticks; see matplotlib.ticker
-and matplotlib.dates for details and usage.
+You can plot date data with major and minor ticks and custom tick formatters
+for both.
.. plot:: mpl_examples/api/date_demo.py
+See :mod:`matplotlib.ticker` and :mod:`matplotlib.dates` for details and usage.
+
.. _screenshots_jdh_demo:
Financial charts
================
-You can make much more sophisticated financial plots. This example
-emulates one of the `ChartDirector
-<http://www.advsofteng.com/gallery_finance.html>`_ financial plots.
-Some of the data in the plot, are real financial data, some are random
-traces that I used since the goal was to illustrate plotting
-techniques, not market analysis!
+You can make sophisticated financial plots by combining the various
+plot functions, layout commands, and labeling tools provided by matplotlib.
+The following example emulates one of the financial plots in
+`ChartDirector <http://www.advsofteng.com/gallery_finance.html>`_:
.. plot:: mpl_examples/pylab_examples/finance_work2.py
@@ -188,9 +203,7 @@ techniques, not market analysis!
Basemap demo
============
-Jeff Whitaker's :ref:`toolkit_basemap` add-on toolkit makes it possible to plot data on many
-different map projections. This example shows how to plot contours, markers and text
-on an orthographic projection, with NASA's "blue marble" satellite image as a background.
+Jeff Whitaker's :ref:`toolkit_basemap` add-on toolkit makes it possible to plot data on many different map projections. This example shows how to plot contours, markers and text on an orthographic projection, with NASA's "blue marble" satellite image as a background.
.. plot:: pyplots/plotmap.py
@@ -201,16 +214,14 @@ Log plots
The :func:`~matplotlib.pyplot.semilogx`,
:func:`~matplotlib.pyplot.semilogy` and
-:func:`~matplotlib.pyplot.loglog` functions generate log scaling on the
-respective axes. The lower subplot uses a base10 log on the xaxis and
-a base 4 log on the yaxis. Thanks to Andrew Straw, Darren Dale and
-Gregory Lielens for contributions to the log scaling
-infrastructure.
-
-
+:func:`~matplotlib.pyplot.loglog` functions simplify the creation of
+logarithmic plots.
.. plot:: mpl_examples/pylab_examples/log_demo.py
+Thanks to Andrew Straw, Darren Dale and Gregory Lielens for contributions
+log-scaling infrastructure.
+
.. _screenshots_polar_demo:
Polar plots
@@ -222,40 +233,43 @@ The :func:`~matplotlib.pyplot.polar` command generates polar plots.
.. _screenshots_legend_demo:
+
Legends
=======
The :func:`~matplotlib.pyplot.legend` command automatically
-generates figure legends, with MATLAB compatible legend placement
-commands. Thanks to Charles Twardy for input on the legend
-command
+generates figure legends, with MATLAB-compatible legend placement
+commands.
.. plot:: mpl_examples/pylab_examples/legend_demo.py
+Thanks to Charles Twardy for input on the legend command.
+
.. _screenshots_mathtext_examples_demo:
Mathtext_examples
=================
-A sampling of the many TeX expressions now supported by matplotlib's
-internal mathtext engine. The mathtext module provides TeX style
-mathematical expressions using `freetype2
-<http://freetype.sourceforge.net/index2.html>`_ and the BaKoMa
-computer modern or `STIX <http://www.stixfonts.org>`_ fonts. See the
-:mod:`matplotlib.mathtext` module for additional. matplotlib mathtext
-is an independent implementation, and does not required TeX or any
-external packages installed on your computer. See the tutorial at
-:ref:`mathtext-tutorial`.
+Below is a sampling of the many TeX expressions now supported by matplotlib's
+internal mathtext engine. The mathtext module provides TeX style mathematical
+expressions using `freetype2 <http://freetype.sourceforge.net/index2.html>`_
+and the BaKoMa computer modern or `STIX <http://www.stixfonts.org>`_ fonts.
+See the :mod:`matplotlib.mathtext` module for additional details.
.. plot:: mpl_examples/pylab_examples/mathtext_examples.py
+Matplotlib's mathtext infrastructure is an independent implementation and
+does not require TeX or any external packages installed on your computer. See
+the tutorial at :ref:`mathtext-tutorial`.
+
+
.. _screenshots_tex_demo:
Native TeX rendering
====================
Although matplotlib's internal math rendering engine is quite
-powerful, sometimes you need TeX, and matplotlib supports external TeX
+powerful, sometimes you need TeX. Matplotlib supports external TeX
rendering of strings with the *usetex* option.
.. plot:: pyplots/tex_demo.py
@@ -265,17 +279,28 @@ rendering of strings with the *usetex* option.
EEG demo
=========
-You can embed matplotlib into pygtk, wxpython, Tk, or Qt4
-applications. Here is a screenshot of an eeg viewer called pbrain
-which is part of the NeuroImaging in Python suite `NIPY
-<http://neuroimaging.scipy.org>`_. Pbrain is written in pygtk using
-matplotlib. The lower axes uses :func:`~matplotlib.pyplot.specgram`
-to plot the spectrogram of one of the EEG channels. For an example of
-how to use the navigation toolbar in your applications, see
-:ref:`user_interfaces-embedding_in_gtk2`. If you want to use
-matplotlib in a wx application, see
-:ref:`user_interfaces-embedding_in_wx2`. If you want to work with
-`glade <http://glade.gnome.org>`_, see
-:ref:`user_interfaces-mpl_with_glade`.
+You can embed matplotlib into pygtk, wx, Tk, FLTK, or Qt
+applications. Here is a screenshot of an EEG viewer called pbrain,
+which is part of the NeuroImaging in Python suite
+`NIPY <http://nipy.sourceforge.net/nipy/stable/index.html>`_.
.. image:: ../_static/eeg_small.png
+
+The lower axes uses :func:`~matplotlib.pyplot.specgram`
+to plot the spectrogram of one of the EEG channels.
+
+For examples of how to embed matplotlib in different toolkits, see:
+
+ * :ref:`user_interfaces-embedding_in_gtk2`
+ * :ref:`user_interfaces-embedding_in_wx2`
+ * :ref:`user_interfaces-mpl_with_glade`
+ * :ref:`user_interfaces-embedding_in_qt`
+ * :ref:`user_interfaces-embedding_in_tk`
+
+XKCD-style sketch plots
@pelson Collaborator
pelson added a note

I agree with having this here, but as a mental note to self as much as anything else, the screenshots page is not another gallery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+=======================
+
+matplotlib supports plotting in the style of `xkcd
+<http://www.xkcd.com/>`.
+
+.. plot:: mpl_examples/showcase/xkcd.py
View
13 doc/users/whats_new.rst
@@ -30,6 +30,17 @@ not been in a working state for a long time have been removed.
Highlights include removing the Qt version 3 backends, and the FltkAgg
and Emf backends. See :ref:`changes_in_1_3` for a complete list.
+New setup script
+----------------
+
+matplotlib 1.3 includes an entirely rewritten setup script. We now
+ship fewer dependencies with the tarballs and installers themselves.
+Notably, `pytz`, `dateutil` and `pyparsing` are no longer included
+with matplotlib. You can either install them manually first, or let
+`pip` install them as depdencies along with matplotlib. It is now
+possible to not include certain subcomponents, such as the unit test
+data, in the install. See `setup.cfg.template` for more information.
+
`xkcd`-style sketch plotting
----------------------------
@@ -48,7 +59,7 @@ Michael Droettboom, Phil Elson and others have developed a new
backend, WebAgg, to display figures in a web browser. It works with
animations as well as being fully interactive.
-.. image:: _static/webagg_screenshot.png
+.. image:: /_static/webagg_screenshot.png
Future versions of matplotlib will integrate this backend with the
IPython notebook for a fully web browser based plotting frontend.
View
65 examples/api/legend_demo.py
@@ -1,41 +1,42 @@
+"""
+Demo of the legend function with a few features.
+
+In addition to the basic legend, this demo shows a few optional features:
+
+ * Custom legend placement.
+ * A keyword argument to a drop-shadow.
+ * Setting the background color.
+ * Setting the font size.
+ * Setting the line width.
+"""
import numpy as np
import matplotlib.pyplot as plt
-a = np.arange(0,3,.02)
-b = np.arange(0,3,.02)
+
+# Example data
+a = np.arange(0,3, .02)
+b = np.arange(0,3, .02)
c = np.exp(a)
d = c[::-1]
-fig = plt.figure()
-ax = fig.add_subplot(111)
-ax.plot(a,c,'k--',a,d,'k:',a,c+d,'k')
-leg = ax.legend(('Model length', 'Data length', 'Total message length'),
- 'upper center', shadow=True)
-ax.set_ylim([-1,20])
-ax.grid(False)
-ax.set_xlabel('Model complexity --->')
-ax.set_ylabel('Message length --->')
-ax.set_title('Minimum Message Length')
-
-ax.set_yticklabels([])
-ax.set_xticklabels([])
-
-# set some legend properties. All the code below is optional. The
-# defaults are usually sensible but if you need more control, this
-# shows you how
-
-# the matplotlib.patches.Rectangle instance surrounding the legend
-frame = leg.get_frame()
-frame.set_facecolor('0.80') # set the frame face color to light gray
-
-# matplotlib.text.Text instances
-for t in leg.get_texts():
- t.set_fontsize('small') # the legend text fontsize
-
-# matplotlib.lines.Line2D instances
-for l in leg.get_lines():
- l.set_linewidth(1.5) # the legend line width
-plt.show()
+# Create plots with pre-defined labels.
+# Alternatively, you can pass labels explicitly when calling `legend`.
+fig, ax = plt.subplots()
+ax.plot(a, c, 'k--', label='Model length')
+ax.plot(a, d, 'k:', label='Data length')
+ax.plot(a, c+d, 'k', label='Total message length')
+
+# Now add the legend with some customizations.
+legend = ax.legend(loc='upper center', shadow=True)
+# The frame is matplotlib.patches.Rectangle instance surrounding the legend.
+frame = legend.get_frame()
+frame.set_facecolor('0.90')
+# Set the fontsize
+for label in legend.get_texts():
+ label.set_fontsize('large')
+for label in legend.get_lines():
+ label.set_linewidth(1.5) # the legend line width
+plt.show()
View
1  examples/lines_bars_and_markers/barh_demo.py
@@ -2,7 +2,6 @@
Simple demo of a horizontal bar chart.
"""
import matplotlib.pyplot as plt; plt.rcdefaults()
-from mpltools import style; style.use('gallery')
import numpy as np
import matplotlib.pyplot as plt
View
61 examples/pylab_examples/barchart_demo.py
@@ -1,44 +1,43 @@
-
-#!/usr/bin/env python
+"""
+Bar chart demo with pairs of bars grouped for easy comparison.
+"""
import numpy as np
import matplotlib.pyplot as plt
-N = 5
-menMeans = (20, 35, 30, 35, 27)
-menStd = (2, 3, 4, 1, 2)
-ind = np.arange(N) # the x locations for the groups
-width = 0.35 # the width of the bars
+n_groups = 5
+means_men = (20, 35, 30, 35, 27)
+std_men = (2, 3, 4, 1, 2)
-plt.subplot(111)
-rects1 = plt.bar(ind, menMeans, width,
- color='r',
- yerr=menStd,
- error_kw=dict(elinewidth=6, ecolor='pink'))
+means_women = (25, 32, 34, 20, 25)
+std_women = (3, 5, 2, 3, 3)
-womenMeans = (25, 32, 34, 20, 25)
-womenStd = (3, 5, 2, 3, 3)
-rects2 = plt.bar(ind+width, womenMeans, width,
- color='y',
- yerr=womenStd,
- error_kw=dict(elinewidth=6, ecolor='yellow'))
+index = np.arange(n_groups)
+bar_width = 0.35
-# add some
-plt.ylabel('Scores')
-plt.title('Scores by group and gender')
-plt.xticks(ind+width, ('G1', 'G2', 'G3', 'G4', 'G5') )
+opacity = 0.4
+error_config = {'ecolor': '0.3'}
-plt.legend( (rects1[0], rects2[0]), ('Men', 'Women') )
+rects1 = plt.bar(index, means_men, bar_width,
+ alpha=opacity,
+ color='b',
+ yerr=std_men,
+ error_kw=error_config,
+ label='Men')
-def autolabel(rects):
- # attach some text labels
- for rect in rects:
- height = rect.get_height()
- plt.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
- ha='center', va='bottom')
+rects2 = plt.bar(index + bar_width, means_women, bar_width,
+ alpha=opacity,
+ color='r',
+ yerr=std_women,
+ error_kw=error_config,
+ label='Women')
-autolabel(rects1)
-autolabel(rects2)
+plt.xlabel('Group')
+plt.ylabel('Scores')
+plt.title('Scores by group and gender')
+plt.xticks(index + bar_width, ('A', 'B', 'C', 'D', 'E'))
+plt.legend()
+plt.tight_layout()
plt.show()
View
68 examples/pylab_examples/legend_demo.py
@@ -1,46 +1,42 @@
-#!/usr/bin/env python
-# Thanks to Charles Twardy for this example
-#
-#See http://matplotlib.org/examples/pylab_examples/legend_demo2.html
-# for an example controlling which lines the legend uses and the order
-# they are drawn in.
+"""
+Demo of the legend function with a few features.
+In addition to the basic legend, this demo shows a few optional features:
+
+ * Custom legend placement.
+ * A keyword argument to a drop-shadow.
+ * Setting the background color.
+ * Setting the font size.
+ * Setting the line width.
+"""
import numpy as np
import matplotlib.pyplot as plt
-a = np.arange(0,3,.02)
-b = np.arange(0,3,.02)
+
+# Example data
+a = np.arange(0,3, .02)
+b = np.arange(0,3, .02)
c = np.exp(a)
d = c[::-1]
-ax = plt.subplot(111)
-plt.plot(a,c,'k--',a,d,'k:',a,c+d,'k')
-plt.legend(('Model length', 'Data length', 'Total message length'),
- 'upper center', shadow=True, fancybox=True)
-plt.ylim([-1,20])
-plt.grid(False)
-plt.xlabel('Model complexity --->')
-plt.ylabel('Message length --->')
-plt.title('Minimum Message Length')
-
-plt.setp(plt.gca(), 'yticklabels', [])
-plt.setp(plt.gca(), 'xticklabels', [])
-
-# set some legend properties. All the code below is optional. The
-# defaults are usually sensible but if you need more control, this
-# shows you how
-leg = plt.gca().get_legend()
-ltext = leg.get_texts() # all the text.Text instance in the legend
-llines = leg.get_lines() # all the lines.Line2D instance in the legend
-frame = leg.get_frame() # the patch.Rectangle instance surrounding the legend
-
-# see text.Text, lines.Line2D, and patches.Rectangle for more info on
-# the settable properties of lines, text, and rectangles
-frame.set_facecolor('0.80') # set the frame face color to light gray
-plt.setp(ltext, fontsize='small') # the legend text fontsize
-plt.setp(llines, linewidth=1.5) # the legend linewidth
-#leg.draw_frame(False) # don't draw the legend frame
-plt.show()
+# Create plots with pre-defined labels.
+# Alternatively, you can pass labels explicitly when calling `legend`.
+fig, ax = plt.subplots()
+ax.plot(a, c, 'k--', label='Model length')
+ax.plot(a, d, 'k:', label='Data length')
+ax.plot(a, c+d, 'k', label='Total message length')
+# Now add the legend with some customizations.
+legend = ax.legend(loc='upper center', shadow=True)
+# The frame is matplotlib.patches.Rectangle instance surrounding the legend.
+frame = legend.get_frame()
+frame.set_facecolor('0.90')
+# Set the fontsize
+for label in legend.get_texts():
+ label.set_fontsize('large')
+
+for label in legend.get_lines():
+ label.set_linewidth(1.5) # the legend line width
+plt.show()
View
46 examples/pylab_examples/mathtext_examples.py
@@ -7,51 +7,15 @@
import gc
stests = [
- r'$a+b+\dots+\dot{s}+\ldots$',
- r'$x \doteq y$',
- r'\$100.00 $\alpha \_$',
- r'$\frac{\$100.00}{y}$',
- r'$x y$',
- r'$x+y\ x=y\ x<y\ x:y\ x,y\ x@y$',
- r'$100\%y\ x*y\ x/y x\$y$',
- r'$x\leftarrow y\ x\forall y\ x-y$',
- r'$x \sf x \bf x {\cal X} \rm x$',
- r'$x\ x\,x\;x\quad x\qquad x\!x\hspace{ 0.5 }y$',
- r'$\{ \rm braces \}$',
r'$\left[\left\lfloor\frac{5}{\frac{\left(3\right)}{4}} y\right)\right]$',
- r'$\left(x\right)$',
- r'$\sin(x)$',
- r'$x_2$',
- r'$x^2$',
- r'$x^2_y$',
- r'$x_y^2$',
- r'$\prod_{i=\alpha_{i+1}}^\infty$',
- r'$x = \frac{x+\frac{5}{2}}{\frac{y+3}{8}}$',
- r'$dz/dt = \gamma x^2 + {\rm sin}(2\pi y+\phi)$',
- r'Foo: $\alpha_{i+1}^j = {\rm sin}(2\pi f_j t_i) e^{-5 t_i/\tau}$',
- r'$\mathcal{R}\prod_{i=\alpha_{i+1}}^\infty a_i \sin(2 \pi f x_i)$',
-# r'$\bigodot \bigoplus {\sf R} a_i{\rm sin}(2 \pi f x_i)$',
- r'Variable $i$ is good',
- r'$\Delta_i^j$',
- r'$\Delta^j_{i+1}$',
- r'$\ddot{o}\acute{e}\grave{e}\hat{O}\breve{\imath}\tilde{n}\vec{q}$',
- r'$_i$',
- r"$\arccos((x^i))$",
r"$\gamma = \frac{x=\frac{6}{8}}{y} \delta$",
r'$\limsup_{x\to\infty}$',
r'$\oint^\infty_0$',
- r"$f^'$",
- r'$\frac{x_2888}{y}$',
- r"$\sqrt[3]{\frac{X_2}{Y}}=5$",
r"$\sqrt[5]{\prod^\frac{x}{2\pi^2}_\infty}$",
- r"$\sqrt[3]{x}=5$",
- r'$\frac{X}{\frac{X}{Y}}$',
# From UTR #25
r"$W^{3\beta}_{\delta_1 \rho_1 \sigma_2} = U^{3\beta}_{\delta_1 \rho_1} + \frac{1}{8 \pi 2} \int^{\alpha_2}_{\alpha_2} d \alpha^\prime_2 \left[\frac{ U^{2\beta}_{\delta_1 \rho_1} - \alpha^\prime_2U^{1\beta}_{\rho_1 \sigma_2} }{U^{0\beta}_{\rho_1 \sigma_2}}\right]$",
r'$\mathcal{H} = \int d \tau \left(\epsilon E^2 + \mu H^2\right)$',
r'$\widehat{abc}\widetilde{def}$',
- r'$\Gamma \Delta \Theta \Lambda \Xi \Pi \Sigma \Upsilon \Phi \Psi \Omega$',
- r'$\alpha \beta \gamma \delta \epsilon \zeta \eta \theta \iota \lambda \mu \nu \xi \pi \kappa \rho \sigma \tau \upsilon \phi \chi \psi$',
#ur'Generic symbol: $\u23ce$',
]
@@ -64,16 +28,12 @@
def doall():
tests = stests
- figure(figsize=(8, (len(tests) * 1) + 2))
- plot([0, 0], 'r')
- grid(False)
- axis([0, 3, -len(tests), 0])
- yticks(arange(len(tests)) * -1)
+ figure(figsize=(8, (len(tests) * 1.0) + 2), facecolor='w')
for i, s in enumerate(tests):
print (i, s)
- text(0.1, -i, s, fontsize=20)
+ figtext(0.1, float(i + 1) / (len(tests) + 2), s, fontsize=20)
- #savefig('mathtext_examples')
+ savefig('mathtext_examples')
#close('all')
show()
View
69 examples/pylab_examples/polar_demo.py
@@ -1,64 +1,17 @@
-#!/usr/bin/env python
-#
-# matplotlib now has a PolarAxes class and a polar function in the
-# matplotlib interface. This is considered alpha and the interface
-# may change as we work out how polar axes should best be integrated
-#
-# The only function that has been tested on polar axes is "plot" (the
-# pylab interface function "polar" calls ax.plot where ax is a
-# PolarAxes) -- other axes plotting functions may work on PolarAxes
-# but haven't been tested and may need tweaking.
-#
-# you can get a PolarSubplot instance by doing, for example
-#
-# subplot(211, polar=True)
-#
-# or a PolarAxes instance by doing
-# axes([left, bottom, width, height], polar=True)
-#
-# The view limits (eg xlim and ylim) apply to the lower left and upper
-# right of the rectangular box that surrounds to polar axes. e.g., if
-# you have
-#
-# r = arange(0,1,0.01)
-# theta = 2*pi*r
-#
-# the lower left corner is 5/4pi, sqrt(2) and the
-# upper right corner is 1/4pi, sqrt(2)
-#
-# you could change the radial bounding box (zoom out) by setting the
-# ylim (radial coordinate is the second argument to the plot command,
-# as in MATLAB, though this is not advised currently because it is not
-# clear to me how the axes should behave in the change of view limits.
-# Please advise me if you have opinions. Likewise, the pan/zoom
-# controls probably do not do what you think they do and are better
-# left alone on polar axes. Perhaps I will disable them for polar
-# axes unless we come up with a meaningful, useful and functional
-# implementation for them.
-#
-# See the pylab rgrids and thetagrids functions for
-# information on how to customize the grid locations and labels
-import matplotlib
+"""
+Demo of a line plot on a polar axis.
+"""
import numpy as np
-from matplotlib.pyplot import figure, show, rc, grid
+import matplotlib.pyplot as plt
-# radar green, solid grid lines
-rc('grid', color='#316931', linewidth=1, linestyle='-')
-rc('xtick', labelsize=15)
-rc('ytick', labelsize=15)
-
-# force square figure and square axes looks better for polar, IMO
-width, height = matplotlib.rcParams['figure.figsize']
-size = min(width, height)
-# make a square figure
-fig = figure(figsize=(size, size))
-ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#d5de9c')
r = np.arange(0, 3.0, 0.01)
-theta = 2*np.pi*r
-ax.plot(theta, r, color='#ee8d18', lw=3)
+theta = 2 * np.pi * r
+
+ax = plt.subplot(111, polar=True)
+ax.plot(theta, r, color='r', linewidth=3)
ax.set_rmax(2.0)
-grid(True)
+ax.grid(True)
-ax.set_title("And there was much rejoicing!", fontsize=20)
-show()
+ax.set_title("A line plot on a polar axis", va='bottom')
+plt.show()
View
29 examples/pylab_examples/scatter_demo2.py
@@ -1,38 +1,33 @@
"""
-make a scatter plot with varying color and size arguments
+Demo of scatter plot with varying marker colors and sizes.
"""
-import matplotlib
import numpy as np
import matplotlib.pyplot as plt
-import matplotlib.mlab as mlab
import matplotlib.cbook as cbook
-# load a numpy record array from yahoo csv data with fields date,
+# Load a numpy record array from yahoo csv data with fields date,
# open, close, volume, adj_close from the mpl-data/example directory.
# The record array stores python datetime.date as an object array in
# the date column
datafile = cbook.get_sample_data('goog.npy')
-r = np.load(datafile).view(np.recarray)
-r = r[-250:] # get the most recent 250 trading days
+price_data = np.load(datafile).view(np.recarray)
+price_data = price_data[-250:] # get the most recent 250 trading days
-delta1 = np.diff(r.adj_close)/r.adj_close[:-1]
+delta1 = np.diff(price_data.adj_close)/price_data.adj_close[:-1]
-# size in points ^2
-volume = (15*r.volume[:-2]/r.volume[0])**2
-close = 0.003*r.close[:-2]/0.003*r.open[:-2]
+# Marker size in units of points^2
+volume = (15 * price_data.volume[:-2] / price_data.volume[0])**2
+close = 0.003 * price_data.close[:-2] / 0.003 * price_data.open[:-2]
-fig = plt.figure()
-ax = fig.add_subplot(111)
-ax.scatter(delta1[:-1], delta1[1:], c=close, s=volume, alpha=0.75)
-
-#ticks = arange(-0.06, 0.061, 0.02)
-#xticks(ticks)
-#yticks(ticks)
+fig, ax = plt.subplots()
+ax.scatter(delta1[:-1], delta1[1:], c=close, s=volume, alpha=0.5)
ax.set_xlabel(r'$\Delta_i$', fontsize=20)
ax.set_ylabel(r'$\Delta_{i+1}$', fontsize=20)
ax.set_title('Volume and percent change')
+
ax.grid(True)
+fig.tight_layout()
plt.show()
View
121 examples/pylab_examples/table_demo.py
@@ -1,57 +1,9 @@
-#!/usr/bin/env python
-import matplotlib
+"""
+Demo of table function to display a table within a plot.
+"""
+import numpy as np
+import matplotlib.pyplot as plt
-from pylab import *
-from matplotlib.colors import colorConverter
-
-
-#Some simple functions to generate colours.
-def pastel(colour, weight=2.4):
- """ Convert colour into a nice pastel shade"""
- rgb = asarray(colorConverter.to_rgb(colour))
- # scale colour
- maxc = max(rgb)
- if maxc < 1.0 and maxc > 0:
- # scale colour
- scale = 1.0 / maxc
- rgb = rgb * scale
- # now decrease saturation
- total = sum(rgb)
- slack = 0
- for x in rgb:
- slack += 1.0 - x
-
- # want to increase weight from total to weight
- # pick x s.t. slack * x == weight - total
- # x = (weight - total) / slack
- x = (weight - total) / slack
-
- rgb = [c + (x * (1.0-c)) for c in rgb]
-
- return rgb
-
-def get_colours(n):
- """ Return n pastel colours. """
- base = asarray([[1,0,0], [0,1,0], [0,0,1]])
-
- if n <= 3:
- return base[0:n]
-
- # how many new colours to we need to insert between
- # red and green and between green and blue?
- needed = (((n - 3) + 1) / 2, (n - 3) / 2)
-
- colours = []
- for start in (0, 1):
- for x in linspace(0, 1, needed[start]+2):
- colours.append((base[start] * (1.0 - x)) +
- (base[start+1] * x))
-
- return [pastel(c) for c in colours[0:n]]
-
-
-
-axes([0.2, 0.2, 0.7, 0.6]) # leave room below the axes for the table
data = [[ 66386, 174296, 75131, 577908, 32015],
[ 58230, 381139, 78045, 99308, 160454],
@@ -59,34 +11,45 @@ def get_colours(n):
[ 78415, 81858, 150656, 193263, 69638],
[ 139361, 331509, 343164, 781380, 52269]]
-colLabels = ('Freeze', 'Wind', 'Flood', 'Quake', 'Hail')
-rowLabels = ['%d year' % x for x in (100, 50, 20, 10, 5)]
+columns = ('Freeze', 'Wind', 'Flood', 'Quake', 'Hail')
+rows = ['%d year' % x for x in (100, 50, 20, 10, 5)]
+
+values = np.arange(0, 2500, 500)
+value_increment = 1000
-# Get some pastel shades for the colours
-colours = get_colours(len(colLabels))
-colours.reverse()
-rows = len(data)
+# Get some pastel shades for the colors
+colors = plt.cm.BuPu(np.linspace(0, 0.5, len(columns)))
+n_rows = len(data)
-ind = arange(len(colLabels)) + 0.3 # the x locations for the groups
-cellText = []
-width = 0.4 # the width of the bars
-yoff = array([0.0] * len(colLabels)) # the bottom values for stacked bar chart
-for row in range(rows):
- bar(ind, data[row], width, bottom=yoff, color=colours[row])
- yoff = yoff + data[row]
- cellText.append(['%1.1f' % (x/1000.0) for x in yoff])
+index = np.arange(len(columns)) + 0.3
+bar_width = 0.4
+
+# Initialize the vertical-offset for the stacked bar chart.
+y_offset = np.array([0.0] * len(columns))
+
+# Plot bars and create text labels for the table
+cell_text = []
+for row in range(n_rows):
+ plt.bar(index, data[row], bar_width, bottom=y_offset, color=colors[row])
+ y_offset = y_offset + data[row]
+ cell_text.append(['%1.1f' % (x/1000.0) for x in y_offset])
+# Reverse colors and text labels to display the last value at the top.
+colors = colors[::-1]
+cell_text.reverse()
# Add a table at the bottom of the axes
-colours.reverse()
-cellText.reverse()
-the_table = table(cellText=cellText,
- rowLabels=rowLabels, rowColours=colours,
- colLabels=colLabels,
- loc='bottom')
-ylabel("Loss $1000's")
-vals = arange(0, 2500, 500)
-yticks(vals*1000, ['%d' % val for val in vals])
-xticks([])
-title('Loss by Disaster')
+the_table = plt.table(cellText=cell_text,
+ rowLabels=rows,
+ rowColours=colors,
+ colLabels=columns,
+ loc='bottom')
+
+# Adjust layout to make room for the table:
+plt.subplots_adjust(left=0.2, bottom=0.2)
+
+plt.ylabel("Loss in ${0}'s".format(value_increment))
+plt.yticks(values * value_increment, ['%d' % val for val in values])
+plt.xticks([])
+plt.title('Loss by Disaster')
-show()
+plt.show()
View
1  examples/shapes_and_collections/artist_reference.py
@@ -9,7 +9,6 @@
BSD License
"""
import matplotlib.pyplot as plt; plt.rcdefaults()
-from mpltools import style; style.use('gallery')
import numpy as np
import matplotlib.pyplot as plt
View
27 lib/matplotlib/axes.py
@@ -3180,7 +3180,8 @@ def get_title(self, loc="center"):
@docstring.dedent_interpd
def set_title(self, label, fontdict=None, loc="center", **kwargs):
- """Set a title for the axes.
+ """
+ Set a title for the axes.
Set one of the three available axes titles. The available titles
are positioned above the axes in the center, flush with the left
@@ -3190,12 +3191,15 @@ def set_title(self, label, fontdict=None, loc="center", **kwargs):
----------
label : str
Text to use for the title
+
fontdict : dict
A dictionary controlling the appearance of the title text,
- the default `fontdict` is:
- {'fontsize': rcParams['axes.titlesize'],
- 'verticalalignment': 'baseline',
- 'horizontalalignment': loc}
+ the default `fontdict` is::
+
+ {'fontsize': rcParams['axes.titlesize'],
+ 'verticalalignment': 'baseline',
+ 'horizontalalignment': loc}
+
loc : {'center', 'left', 'right'}, str, optional
Which title to set, defaults to 'center'
@@ -3209,7 +3213,6 @@ def set_title(self, label, fontdict=None, loc="center", **kwargs):
Other keyword arguments are text properties, see
:class:`~matplotlib.text.Text` for a list of valid text
properties.
-
"""
try:
title = {'left': self._left_title,
@@ -3304,7 +3307,7 @@ def text(self, x, y, s, fontdict=None,
coordinates.
Parameters
- -----------
+ ----------
s : string
text
@@ -3322,6 +3325,7 @@ def text(self, x, y, s, fontdict=None,
Other parameters
----------------
kwargs : `~matplotlib.text.Text` properties.
+ Other miscellaneous text parameters.
Examples
--------
@@ -3345,7 +3349,6 @@ def text(self, x, y, s, fontdict=None,
properties. For example::
>>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
-
"""
default = {
'verticalalignment': 'baseline',
@@ -4634,7 +4637,7 @@ def legend(self, *args, **kwargs):
Users can specify any arbitrary location for the legend using the
*bbox_to_anchor* keyword argument. bbox_to_anchor can be an instance
of BboxBase(or its derivatives) or a tuple of 2 or 4 floats.
- For example,
+ For example::
loc = 'upper right', bbox_to_anchor = (0.5, 0.5)
@@ -4647,7 +4650,6 @@ def legend(self, *args, **kwargs):
The loc itslef can be a 2-tuple giving x,y of the lower-left corner of
the legend in axes coords (*bbox_to_anchor* is ignored).
-
Keyword arguments:
*prop*: [ *None* | FontProperties | dict ]
@@ -8070,6 +8072,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
If an integer is given, `bins + 1` bin edges are returned,
consistently with :func:`numpy.histogram` for numpy version >=
1.3.
+
Unequally spaced bins are supported if `bins` is a sequence.
range : tuple, optional, default: None
@@ -8158,7 +8161,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
Returns
-------
- (n, bins, patches) or ([n0, n1, ...], bins, [patches0, patches1,...])
+ tuple : (n, bins, patches) or ([n0, n1, ...], bins, [patches0, patches1,...])
Other Parameters
----------------
@@ -8173,7 +8176,7 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
Until numpy release 1.5, the underlying numpy histogram function was
incorrect with `normed`=`True` if bin sizes were unequal. MPL
inherited that error. It is now corrected within MPL when using
- earlier numpy versions
+ earlier numpy versions.
Examples
--------
View
8 lib/matplotlib/colorbar.py
@@ -970,14 +970,14 @@ def make_axes(parents, location=None, orientation=None, fraction=0.15,
Keyword arguments may include the following (with defaults):
- *location*: [**None**|'left'|'right'|'top'|'bottom']
+ location : [`None`|'left'|'right'|'top'|'bottom']
The position, relative to **parents**, where the colorbar axes
should be created. If None, the value will either come from the
- given **orientation**, else it will default to 'right'.
+ given ``orientation``, else it will default to 'right'.
- *orientation*: [**None**|'vertical'|'horizontal']
+ orientation : [`None`|'vertical'|'horizontal']
The orientation of the colorbar. Typically, this keyword shouldn't
- be used, as it can be derived from the **location** keyword.
+ be used, as it can be derived from the ``location`` keyword.
%s
View
20 lib/matplotlib/dates.py
@@ -9,16 +9,16 @@
easy conversion to and from :mod:`datetime` and numeric ranges.
.. note::
- Like Python's datetime, mpl uses the Gregorian calendar for all conversions
- between dates and floating point numbers. This practice is not universal,
- and calendar differences can cause confusing differences between what
- Python and mpl give as the number of days since 0001-01-01 and what other
- software and databases yield. For example, the `US Naval Observatory
- <http://www.usno.navy.mil/USNO/astronomical-applications/
-data-services/jul-date>`_
- uses a calendar that switches from Julian to Gregorian in October, 1582.
- Hence, using their calculator, the number of days between 0001-01-01 and
- 2006-04-01 is 732403, whereas using the Gregorian calendar via the datetime
+
+ Like Python's datetime, mpl uses the Gregorian calendar for all
+ conversions between dates and floating point numbers. This practice
+ is not universal, and calendar differences can cause confusing
+ differences between what Python and mpl give as the number of days
+ since 0001-01-01 and what other software and databases yield. For
+ example, the US Naval Observatory uses a calendar that switches
+ from Julian to Gregorian in October, 1582. Hence, using their
+ calculator, the number of days between 0001-01-01 and 2006-04-01 is
+ 732403, whereas using the Gregorian calendar via the datetime
module we find::
In [31]:date(2006,4,1).toordinal() - date(1,1,1).toordinal()
View
2  lib/matplotlib/lines.py
@@ -703,7 +703,7 @@ def get_data(self, orig=True):
"""
Return the xdata, ydata.
- If *orig* is *True*, return the original data
+ If *orig* is *True*, return the original data.
"""
return self.get_xdata(orig=orig), self.get_ydata(orig=orig)
View
2  lib/matplotlib/pyplot.py
@@ -1264,8 +1264,6 @@ def box(on=None):
def title(s, *args, **kwargs):
"""
- title(label, fontdict=None, loc='center', **kwargs)
-
Set a title of the current axes.
Set one of the three available axes titles. The available titles are
View
6 lib/matplotlib/textpath.py
@@ -435,9 +435,9 @@ def __init__(self, xy, s, size=None, prop=None,
prop, s,
usetex=usetex)
- self.should_simplify = False
- self.simplify_threshold = rcParams['path.simplify_threshold']
- self.has_nonfinite = False
+ self._should_simplify = False
+ self._simplify_threshold = rcParams['path.simplify_threshold']
+ self._has_nonfinite = False
self._interpolation_steps = _interpolation_steps
def set_size(self, size):
View
14 lib/mpl_toolkits/mplot3d/axes3d.py
@@ -464,7 +464,7 @@ def autoscale_view(self, tight=None, scalex=True, scaley=True,
.. versionchanged :: 1.1.0
Function signature was changed to better match the 2D version.
*tight* is now explicitly a kwarg and placed first.
-
+
.. versionchanged :: 1.2.1
This is now fully functional.
@@ -668,7 +668,7 @@ def set_zlim3d(self, bottom=None, top=None, emit=True, auto=False, **kw):
Set 3D z limits.
See :meth:`matplotlib.axes.Axes.set_ylim` for full documentation
-
+
"""
if 'zmin' in kw:
bottom = kw.pop('zmin')
@@ -752,7 +752,7 @@ def get_zscale(self) :
# We need to slightly redefine these to pass scalez=False
# to their calls of autoscale_view.
def set_xscale(self, value, **kwargs) :
- self.xaxis.set_scale(value, **kwargs)
+ self.xaxis._set_scale(value, **kwargs)
self.autoscale_view(scaley=False, scalez=False)
self._update_transScale()
set_xscale.__doc__ = maxes.Axes.set_xscale.__doc__ + """
@@ -762,7 +762,7 @@ def set_xscale(self, value, **kwargs) :
"""
def set_yscale(self, value, **kwargs) :
- self.yaxis.set_scale(value, **kwargs)
+ self.yaxis._set_scale(value, **kwargs)
self.autoscale_view(scalex=False, scalez=False)
self._update_transScale()
set_yscale.__doc__ = maxes.Axes.set_yscale.__doc__ + """
@@ -793,7 +793,7 @@ def set_zscale(self, value, **kwargs) :
.. versionadded :: 1.1.0
This function was added, but not tested. Please report any bugs.
"""
- self.zaxis.set_scale(value, **kwargs)
+ self.zaxis._set_scale(value, **kwargs)
self.autoscale_view(scalex=False, scaley=False)
self._update_transScale()
@@ -1035,9 +1035,9 @@ def cla(self):
self.zaxis.minor = self._sharez.zaxis.minor
z0, z1 = self._sharez.get_zlim()
self.set_zlim(z0, z1, emit=False, auto=None)
- self.zaxis.set_scale(self._sharez.zaxis.get_scale())
+ self.zaxis._set_scale(self._sharez.zaxis.get_scale())
else:
- self.zaxis.set_scale('linear')
+ self.zaxis._set_scale('linear')
self._autoscaleZon = True
self._zmargin = 0
Something went wrong with that request. Please try again.