Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fixing osx makefile #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Editor temporary/working/backup files #
#########################################
.#*
[#]*#
*~
*$
*.bak

# Compiled source #
###################
*.a
*.com
*.class
*.dll
*.exe
*.o
*.py[ocd]
*.so

# Python files #
################
# setup.py working directory
build
# sphinx build directory
doc/_build
# setup.py dist directory
dist
# Egg metadata
*.egg-info

# OS generated files #
######################
.gdb_history
.DS_Store?
ehthumbs.db
Icon?
Thumbs.db

# Things specific to this project #
###################################
lib/matplotlib/mpl-data/matplotlib.conf
lib/matplotlib/mpl-data/matplotlibrc
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2011-02-20 clabel accepts a callable as an fmt kwarg; modified
patch by Daniel Hyams. - EF

2011-02-18 scatter([], []) is now valid. Also fixed issues
with empty collections - BVR

Expand Down
2 changes: 1 addition & 1 deletion README.osx
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ lib, png or freetype on your system

Example usage::

PREFIX=/Users/jdhunter/dev make -f make.osx fetch deps mpl_install
PREFIX=/Users/jdhunter/dev [PYVERSION=2.6] make -f make.osx fetch deps mpl_install

268 changes: 134 additions & 134 deletions doc/devel/add_new_projection.rst
Original file line number Diff line number Diff line change
@@ -1,134 +1,134 @@
.. _adding-new-scales:
***********************************************
Adding new scales and projections to matplotlib
***********************************************
.. ::author Michael Droettboom
Matplotlib supports the addition of custom procedures that transform
the data before it is displayed.
There is an important distinction between two kinds of
transformations. Separable transformations, working on a single
dimension, are called "scales", and non-separable transformations,
that handle data in two or more dimensions at a time, are called
"projections".
From the user's perspective, the scale of a plot can be set with
:meth:`~matplotlib.axes.Axes.set_xscale` and
:meth:`~matplotlib.axes.Axes.set_xscale`. Projections can be chosen
using the ``projection`` keyword argument to the
:func:`~matplotlib.pylab.plot` or :func:`~matplotlib.pylab.subplot`
functions, e.g.::
plot(x, y, projection="custom")
This document is intended for developers and advanced users who need
to create new scales and projections for matplotlib. The necessary
code for scales and projections can be included anywhere: directly
within a plot script, in third-party code, or in the matplotlib source
tree itself.
.. _creating-new-scale:
Creating a new scale
====================
Adding a new scale consists of defining a subclass of
:class:`matplotlib.scale.ScaleBase`, that includes the following
elements:
- A transformation from data coordinates into display coordinates.
- An inverse of that transformation. This is used, for example, to
convert mouse positions from screen space back into data space.
- A function to limit the range of the axis to acceptable values
(``limit_range_for_scale()``). A log scale, for instance, would
prevent the range from including values less than or equal to
zero.
- Locators (major and minor) that determine where to place ticks in
the plot, and optionally, how to adjust the limits of the plot to
some "good" values. Unlike ``limit_range_for_scale()``, which is
always enforced, the range setting here is only used when
automatically setting the range of the plot.
- Formatters (major and minor) that specify how the tick labels
should be drawn.
Once the class is defined, it must be registered with matplotlib so
that the user can select it.
A full-fledged and heavily annotated example is in
:file:`examples/api/custom_scale_example.py`. There are also some classes
in :mod:`matplotlib.scale` that may be used as starting points.
.. _creating-new-projection:
Creating a new projection
=========================
Adding a new projection consists of defining a subclass of
:class:`matplotlib.axes.Axes`, that includes the following elements:
- A transformation from data coordinates into display coordinates.
- An inverse of that transformation. This is used, for example, to
convert mouse positions from screen space back into data space.
- Transformations for the gridlines, ticks and ticklabels. Custom
projections will often need to place these elements in special
locations, and matplotlib has a facility to help with doing so.
- Setting up default values (overriding
:meth:`~matplotlib.axes.Axes.cla`), since the defaults for a
rectilinear axes may not be appropriate.
- Defining the shape of the axes, for example, an elliptical axes,
that will be used to draw the background of the plot and for
clipping any data elements.
- Defining custom locators and formatters for the projection. For
example, in a geographic projection, it may be more convenient to
display the grid in degrees, even if the data is in radians.
- Set up interactive panning and zooming. This is left as an
"advanced" feature left to the reader, but there is an example of
this for polar plots in :mod:`matplotlib.projections.polar`.
- Any additional methods for additional convenience or features.
Once the class is defined, it must be registered with matplotlib
so that the user can select it.
A full-fledged and heavily annotated example is in
:file:`examples/api/custom_projection_example.py`. The polar plot
functionality in :mod:`matplotlib.projections.polar` may also be of
interest.
API documentation
=================
matplotlib.scale
----------------
.. automodule:: matplotlib.scale
:members:
:show-inheritance:
matplotlib.projections
----------------------
.. automodule:: matplotlib.projections
:members:
:show-inheritance:
matplotlib.projections.polar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. automodule:: matplotlib.projections.polar
:members:
:show-inheritance:
.. _adding-new-scales:

***********************************************
Adding new scales and projections to matplotlib
***********************************************

.. ::author Michael Droettboom

Matplotlib supports the addition of custom procedures that transform
the data before it is displayed.

There is an important distinction between two kinds of
transformations. Separable transformations, working on a single
dimension, are called "scales", and non-separable transformations,
that handle data in two or more dimensions at a time, are called
"projections".

From the user's perspective, the scale of a plot can be set with
:meth:`~matplotlib.axes.Axes.set_xscale` and
:meth:`~matplotlib.axes.Axes.set_xscale`. Projections can be chosen
using the ``projection`` keyword argument to the
:func:`~matplotlib.pylab.plot` or :func:`~matplotlib.pylab.subplot`
functions, e.g.::

plot(x, y, projection="custom")

This document is intended for developers and advanced users who need
to create new scales and projections for matplotlib. The necessary
code for scales and projections can be included anywhere: directly
within a plot script, in third-party code, or in the matplotlib source
tree itself.

.. _creating-new-scale:

Creating a new scale
====================

Adding a new scale consists of defining a subclass of
:class:`matplotlib.scale.ScaleBase`, that includes the following
elements:

- A transformation from data coordinates into display coordinates.

- An inverse of that transformation. This is used, for example, to
convert mouse positions from screen space back into data space.

- A function to limit the range of the axis to acceptable values
(``limit_range_for_scale()``). A log scale, for instance, would
prevent the range from including values less than or equal to
zero.

- Locators (major and minor) that determine where to place ticks in
the plot, and optionally, how to adjust the limits of the plot to
some "good" values. Unlike ``limit_range_for_scale()``, which is
always enforced, the range setting here is only used when
automatically setting the range of the plot.

- Formatters (major and minor) that specify how the tick labels
should be drawn.

Once the class is defined, it must be registered with matplotlib so
that the user can select it.

A full-fledged and heavily annotated example is in
:file:`examples/api/custom_scale_example.py`. There are also some classes
in :mod:`matplotlib.scale` that may be used as starting points.


.. _creating-new-projection:

Creating a new projection
=========================

Adding a new projection consists of defining a subclass of
:class:`matplotlib.axes.Axes`, that includes the following elements:

- A transformation from data coordinates into display coordinates.

- An inverse of that transformation. This is used, for example, to
convert mouse positions from screen space back into data space.

- Transformations for the gridlines, ticks and ticklabels. Custom
projections will often need to place these elements in special
locations, and matplotlib has a facility to help with doing so.

- Setting up default values (overriding
:meth:`~matplotlib.axes.Axes.cla`), since the defaults for a
rectilinear axes may not be appropriate.

- Defining the shape of the axes, for example, an elliptical axes,
that will be used to draw the background of the plot and for
clipping any data elements.

- Defining custom locators and formatters for the projection. For
example, in a geographic projection, it may be more convenient to
display the grid in degrees, even if the data is in radians.

- Set up interactive panning and zooming. This is left as an
"advanced" feature left to the reader, but there is an example of
this for polar plots in :mod:`matplotlib.projections.polar`.

- Any additional methods for additional convenience or features.

Once the class is defined, it must be registered with matplotlib
so that the user can select it.

A full-fledged and heavily annotated example is in
:file:`examples/api/custom_projection_example.py`. The polar plot
functionality in :mod:`matplotlib.projections.polar` may also be of
interest.

API documentation
=================

matplotlib.scale
----------------

.. automodule:: matplotlib.scale
:members:
:show-inheritance:

matplotlib.projections
----------------------

.. automodule:: matplotlib.projections
:members:
:show-inheritance:

matplotlib.projections.polar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. automodule:: matplotlib.projections.polar
:members:
:show-inheritance:
62 changes: 31 additions & 31 deletions examples/api/font_family_rc.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
"""
You can explicitly set which font family is picked up for a given font
style (eg 'serif', 'sans-serif', or 'monospace').
In the example below, we only allow one font family (Tahoma) for the
san-serif font style. You the default family with the font.family rc
param, eg::
rcParams['font.family'] = 'sans-serif'
and for the font.family you set a list of font styles to try to find
in order::
rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans', 'Lucida Grande', 'Verdana']
"""
# -*- noplot -*-
from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Tahoma']
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3], label='test')
ax.legend()
plt.show()
"""
You can explicitly set which font family is picked up for a given font
style (eg 'serif', 'sans-serif', or 'monospace').

In the example below, we only allow one font family (Tahoma) for the
san-serif font style. You the default family with the font.family rc
param, eg::

rcParams['font.family'] = 'sans-serif'

and for the font.family you set a list of font styles to try to find
in order::

rcParams['font.sans-serif'] = ['Tahoma', 'Bitstream Vera Sans', 'Lucida Grande', 'Verdana']

"""

# -*- noplot -*-

from matplotlib import rcParams
rcParams['font.family'] = 'sans-serif'
rcParams['font.sans-serif'] = ['Tahoma']
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3], label='test')

ax.legend()
plt.show()

2 changes: 1 addition & 1 deletion examples/misc/sample_data_demo.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
Grab mpl data from the ~/.matplotlib/sample_data cache if it exists, else
fetch it from svn and cache it
fetch it from github and cache it
"""
import matplotlib.cbook as cbook
import matplotlib.pyplot as plt
Expand Down
Loading