Menu

[r8835]: / branches / mathtex / doc / users / screenshots.rst  Maximize  Restore  History

Download this file

286 lines (189 with data), 8.0 kB

Screenshots

Here you will find a host of example figures with the code that generated them

Simple Plot

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.

Histograms

The :func:`~matplotlib.pyplot.hist` command automatically generates histograms and will return the bin counts or probabilities

Path demo

You can add aribitrary paths in matplotlib as of release 0.98. See the :mod:`matplotlib.path`.

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.

Ellipses

In support of the Phoenix 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

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 for another example. You can make horizontal bar charts with the :func:`~matplotlib.pyplot.barh` command.

Pie charts

The :func:`~matplotlib.pyplot.pie` command uses a matlab(TM) 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.

Table demo

The :func:`~matplotlib.pyplot.table` command will place a text table on the axes

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`)

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>

Fill demo

The :func:`~matplotlib.pyplot.fill` command lets you plot filled polygons. Thanks to Andrew Straw for providing this function

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.

Financial charts

You can make much more sophisticated financial plots. This example emulates one of the ChartDirector 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!

Basemap demo

Jeff Whitaker provided this example showing how to efficiently plot a collection of lines over a colormap image using the :ref:`toolkit_basemap` . Many map projections are handled via the proj4 library: cylindrical equidistant, mercator, lambert conformal conic, lambert azimuthal equal area, albers equal area conic and stereographic. See the tutorial entry on the wiki.

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.

Polar plots

The :func:`~matplotlib.pyplot.polar` command generates polar plots.

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

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 and the BaKoMa computer modern or STIX 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`.

Native TeX rendering

Although matplotlib's internal math rendering engine is quite powerful, sometimes you need TeX, and matplotlib supports external TeX rendering of strings with the usetex option.

EEG demo

You can embed matplotlib into pygtk, wxpython, 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. 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, see :ref:`user_interfaces-mpl_with_glade`.

../_static/eeg_small.png
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.