SF.net SVN: matplotlib: [4762] branches/transforms/lib/matplotlib/scale.py
Revision: 4762
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4762&view=rev
Author: mdboom
Date: 2007-12-18 05:02:33 -0800 (Tue, 18 Dec 2007)
Log Message:
---
Minor speed improvement
Modified Paths:
--
branches/transforms/lib/matplotlib/scale.py
Modified: branches/transforms/lib/matplotlib/scale.py
===
--- branches/transforms/lib/matplotlib/scale.py 2007-12-17 18:29:04 UTC (rev
4761)
+++ branches/transforms/lib/matplotlib/scale.py 2007-12-18 13:02:33 UTC (rev
4762)
@@ -301,7 +301,10 @@
def transform(self, a):
masked = ma.masked_where((a < -self.thresh) | (a > self.thresh), a)
-return ma.log(ma.tan(masked) + 1.0 / ma.cos(masked))
+if masked.mask.any():
+return ma.log(ma.abs(ma.tan(masked) + 1.0 / ma.cos(masked)))
+else:
+return npy.log(npy.abs(npy.tan(a) + 1.0 / npy.cos(a)))
def inverted(self):
return MercatorLatitudeScale.InvertedMercatorLatitudeTransform()
@@ -346,6 +349,7 @@
def limit_range_for_scale(self, vmin, vmax, minpos):
return max(vmin, -self.thresh), min(vmax, self.thresh)
+
_scale_mapping = {
'linear': LinearScale,
'log' : LogScale,
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4763] branches/transforms/src
Revision: 4763
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4763&view=rev
Author: mdboom
Date: 2007-12-18 05:08:04 -0800 (Tue, 18 Dec 2007)
Log Message:
---
Don't allocate the clipping path buffers unless we need them.
Modified Paths:
--
branches/transforms/src/_backend_agg.cpp
branches/transforms/src/_backend_agg.h
Modified: branches/transforms/src/_backend_agg.cpp
===
--- branches/transforms/src/_backend_agg.cpp2007-12-18 13:02:33 UTC (rev
4762)
+++ branches/transforms/src/_backend_agg.cpp2007-12-18 13:08:04 UTC (rev
4763)
@@ -239,27 +239,22 @@
height(height),
dpi(dpi),
NUMBYTES(width*height*4),
+ alphaBuffer(NULL),
+ alphaMaskRenderingBuffer(NULL),
+ alphaMask(NULL),
+ pixfmtAlphaMask(NULL),
+ rendererBaseAlphaMask(NULL),
+ rendererAlphaMask(NULL),
+ scanlineAlphaMask(NULL),
debug(debug)
{
_VERBOSE("RendererAgg::RendererAgg");
unsigned stride(width*4);
-
pixBuffer = new agg::int8u[NUMBYTES];
renderingBuffer = new agg::rendering_buffer;
renderingBuffer->attach(pixBuffer, width, height, stride);
- alphaBuffer = new agg::int8u[NUMBYTES];
- alphaMaskRenderingBuffer = new agg::rendering_buffer;
- alphaMaskRenderingBuffer->attach(alphaBuffer, width, height, stride);
- alphaMask = new alpha_mask_type(*alphaMaskRenderingBuffer);
-
- pixfmtAlphaMask = new agg::pixfmt_gray8(*alphaMaskRenderingBuffer);
- rendererBaseAlphaMask = new
renderer_base_alpha_mask_type(*pixfmtAlphaMask);
- rendererAlphaMask = new
renderer_alpha_mask_type(*rendererBaseAlphaMask);
- scanlineAlphaMask = new agg::scanline_p8();
-
-
slineP8 = new scanline_p8;
slineBin = new scanline_bin;
@@ -275,6 +270,21 @@
};
+void RendererAgg::create_alpha_buffers() {
+ if (!alphaBuffer) {
+unsigned stride(width*4);
+alphaBuffer = new agg::int8u[NUMBYTES];
+alphaMaskRenderingBuffer = new agg::rendering_buffer;
+alphaMaskRenderingBuffer->attach(alphaBuffer, width, height, stride);
+alphaMask = new alpha_mask_type(*alphaMaskRenderingBuffer);
+
+pixfmtAlphaMask = new agg::pixfmt_gray8(*alphaMaskRenderingBuffer);
+rendererBaseAlphaMask = new
renderer_base_alpha_mask_type(*pixfmtAlphaMask);
+rendererAlphaMask = new
renderer_alpha_mask_type(*rendererBaseAlphaMask);
+scanlineAlphaMask = new agg::scanline_p8();
+ }
+}
+
template
void
RendererAgg::set_clipbox(const Py::Object& cliprect, R rasterizer) {
@@ -442,6 +452,7 @@
if (has_clippath &&
(clippath.ptr() != lastclippath.ptr() ||
clippath_trans != lastclippath_transform)) {
+create_alpha_buffers();
agg::trans_affine trans(clippath_trans);
trans *= agg::trans_affine_scaling(1.0, -1.0);
trans *= agg::trans_affine_translation(0.0, (double)height);
@@ -617,7 +628,7 @@
_color(color) {
}
- void generate(color_type* output_span, int x, int y, unsigned len)
+ inline void generate(color_type* output_span, int x, int y, unsigned len)
{
_allocator.allocate(len);
child_color_type* input_span = _allocator.span();
Modified: branches/transforms/src/_backend_agg.h
===
--- branches/transforms/src/_backend_agg.h 2007-12-18 13:02:33 UTC (rev
4762)
+++ branches/transforms/src/_backend_agg.h 2007-12-18 13:08:04 UTC (rev
4763)
@@ -77,7 +77,7 @@
SafeSnap() : first(true), xsnap(0.0), lastx(0.0), lastxsnap(0.0),
ysnap(0.0), lasty(0.0), lastysnap(0.0) {}
SnapData snap (const float& x, const float& y);
-
+
private:
bool first;
float xsnap, lastx, lastxsnap, ysnap, lasty, lastysnap;
@@ -87,7 +87,7 @@
// a class in the swig wrapper
class BufferRegion : public Py::PythonExtension {
public:
- BufferRegion(const agg::rect_i &r, bool freemem=true) :
+ BufferRegion(const agg::rect_i &r, bool freemem=true) :
rect(r), freemem(freemem) {
width = r.x2 - r.x1;
height = r.y2 - r.y1;
@@ -99,7 +99,7 @@
int width;
int height;
int stride;
-
+
bool freemem;
Py::Object to_string(const Py::Tuple &args);
@@ -151,7 +151,7 @@
//struct AMRenderer {
-//
+//
//}
// the renderer
@@ -246,6 +246,7 @@
const Py::SeqBase&antialiaseds);
private:
+ void create_alpha_buffers();
Py::Object lastclippath;
agg::trans_affine lastclippath_transform;
};
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
SF.net SVN: matplotlib: [4764] branches/transforms/src/_path.cpp
Revision: 4764
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4764&view=rev
Author: mdboom
Date: 2007-12-18 07:29:53 -0800 (Tue, 18 Dec 2007)
Log Message:
---
Fix bug in calculating minpos.
Modified Paths:
--
branches/transforms/src/_path.cpp
Modified: branches/transforms/src/_path.cpp
===
--- branches/transforms/src/_path.cpp 2007-12-18 13:08:04 UTC (rev 4763)
+++ branches/transforms/src/_path.cpp 2007-12-18 15:29:53 UTC (rev 4764)
@@ -277,20 +277,12 @@
{
if ((code & agg::path_cmd_end_poly) == agg::path_cmd_end_poly)
continue;
-if (x < *x0)
-{
-*x0 = x;
-if (x > 0.0)
-*xm = x;
-}
-if (y < *y0)
-{
-*y0 = y;
-if (y > 0.0)
-*ym = y;
-}
+if (x < *x0) *x0 = x;
+if (y < *y0) *y0 = y;
if (x > *x1) *x1 = x;
if (y > *y1) *y1 = y;
+if (x > 0.0 && x < *xm) *xm = x;
+if (y > 0.0 && y < *ym) *ym = y;
}
}
@@ -435,8 +427,8 @@
args.verify_length(5);
//segments, trans, clipbox, colors, linewidths, antialiaseds
-agg::trans_affinemaster_transform =
py_to_agg_transformation_matrix(args[0]);
-Py::SeqBase paths = args[1];
+agg::trans_affine master_transform =
py_to_agg_transformation_matrix(args[0]);
+Py::SeqBase paths = args[1];
Py::SeqBase transforms_obj = args[2];
Py::Object offsets_obj = args[3];
agg::trans_affine offset_trans =
py_to_agg_transformation_matrix(args[4], false);
@@ -523,11 +515,11 @@
args.verify_length(9);
//segments, trans, clipbox, colors, linewidths, antialiaseds
-double x= Py::Float(args[0]);
-double y= Py::Float(args[1]);
+double x= Py::Float(args[0]);
+double y= Py::Float(args[1]);
double radius = Py::Float(args[2]);
-agg::trans_affinemaster_transform =
py_to_agg_transformation_matrix(args[3]);
-Py::SeqBase paths = args[4];
+agg::trans_affine master_transform =
py_to_agg_transformation_matrix(args[3]);
+Py::SeqBase paths = args[4];
Py::SeqBase transforms_obj = args[5];
Py::SeqBase offsets_obj = args[6];
agg::trans_affine offset_trans =
py_to_agg_transformation_matrix(args[7]);
@@ -541,9 +533,9 @@
throw Py::ValueError("Offsets array must be Nx2");
}
-size_t Npaths = paths.length();
+size_t Npaths = paths.length();
size_t Noffsets= offsets->dimensions[0];
-size_t N= std::max(Npaths, Noffsets);
+size_t N = std::max(Npaths, Noffsets);
size_t Ntransforms = std::min(transforms_obj.length(), N);
size_t i;
@@ -919,10 +911,6 @@
f = *(double*)(row1);
}
-// I would have preferred to use PyArray_FromDims here, but on
-// 64-bit platforms, PyArray_DIMS() does not return the same thing
-// that PyArray_FromDims wants, requiring a copy, which I would
-// like to avoid in this critical section.
result = (PyArrayObject*)PyArray_SimpleNew
(PyArray_NDIM(vertices), PyArray_DIMS(vertices),
PyArray_DOUBLE);
if (PyArray_NDIM(vertices) == 2)
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4765] branches/transforms/lib/matplotlib
Revision: 4765 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4765&view=rev Author: mdboom Date: 2007-12-18 07:35:06 -0800 (Tue, 18 Dec 2007) Log Message: --- Fix log scaling of polar plots. Modified Paths: -- branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/projections/polar.py Modified: branches/transforms/lib/matplotlib/axes.py === --- branches/transforms/lib/matplotlib/axes.py 2007-12-18 15:29:53 UTC (rev 4764) +++ branches/transforms/lib/matplotlib/axes.py 2007-12-18 15:35:06 UTC (rev 4765) @@ -1287,13 +1287,10 @@ return if scalex: -xl = self.get_xbound() XL = self.xaxis.get_major_locator().autoscale() self.set_xbound(XL) if scaley: -ylocator = self.yaxis.get_major_locator() -yl = self.get_ybound() -YL = ylocator.autoscale() +YL = self.yaxis.get_major_locator().autoscale() self.set_ybound(YL) def update_layout(self, renderer): Modified: branches/transforms/lib/matplotlib/projections/polar.py === --- branches/transforms/lib/matplotlib/projections/polar.py 2007-12-18 15:29:53 UTC (rev 4764) +++ branches/transforms/lib/matplotlib/projections/polar.py 2007-12-18 15:35:06 UTC (rev 4765) @@ -74,19 +74,21 @@ The affine part of the polar projection. Scales the output so that maximum radius rests on the edge of the axes circle. """ -def __init__(self, limits): +def __init__(self, scale_transform, limits): """ limits is the view limit of the data. The only part of its bounds that is used is ymax (for the radius maximum). """ Affine2DBase.__init__(self) +self._scale_transform = scale_transform self._limits = limits -self.set_children(limits) +self.set_children(scale_transform, limits) self._mtx = None def get_matrix(self): if self._invalid: -ymax = self._limits.ymax +limits_scaled = self._limits.transformed(self._scale_transform) +ymax = limits_scaled.ymax affine = Affine2D() \ .scale(0.5 / ymax) \ .translate(0.5, 0.5) @@ -193,7 +195,7 @@ # An affine transformation on the data, generally to limit the # range of the axes -self.transProjectionAffine = self.PolarAffine(self.viewLim) +self.transProjectionAffine = self.PolarAffine(self.transScale, self.viewLim) # The complete data transformation stack -- from data all the # way to display coordinates @@ -205,7 +207,7 @@ # the edge of the axis circle. self._xaxis_transform = ( self.transProjection + -self.PolarAffine(Bbox.unit()) + +self.PolarAffine(IdentityTransform(), Bbox.unit()) + self.transAxes) # The theta labels are moved from radius == 0.0 to radius == 1.1 self._theta_label1_position = Affine2D().translate(0.0, 1.1) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4766] branches/transforms/lib/matplotlib/scale.py
Revision: 4766
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4766&view=rev
Author: mdboom
Date: 2007-12-18 09:36:11 -0800 (Tue, 18 Dec 2007)
Log Message:
---
Improved documentation and efficiency...
Modified Paths:
--
branches/transforms/lib/matplotlib/scale.py
Modified: branches/transforms/lib/matplotlib/scale.py
===
--- branches/transforms/lib/matplotlib/scale.py 2007-12-18 15:35:06 UTC (rev
4765)
+++ branches/transforms/lib/matplotlib/scale.py 2007-12-18 17:36:11 UTC (rev
4766)
@@ -7,10 +7,23 @@
from transforms import Transform, IdentityTransform
class ScaleBase(object):
+def get_transform(self):
+"""
+Return the transform object associated with this scale.
+"""
+raise NotImplementedError
+
def set_default_locators_and_formatters(self, axis):
+"""
+Set the locators and formatters that go with this scale.
+"""
raise NotImplementedError
def limit_range_for_scale(self, vmin, vmax, minpos):
+"""
+Returns the range vmin, vmax, limited to the domain supported
+by this scale.
+"""
return vmin, vmax
class LinearScale(ScaleBase):
@@ -285,6 +298,10 @@
The inverse scale function:
atan(sinh(y))
+Since the Mercator scale tends to infinity at +/- 90 degrees,
+there is user-defined threshold, above and below which nothing
+will be plotted. This defaults to +/- 85 degrees.
+
source:
http://en.wikipedia.org/wiki/Mercator_projection
"""
@@ -302,23 +319,27 @@
def transform(self, a):
masked = ma.masked_where((a < -self.thresh) | (a > self.thresh), a)
if masked.mask.any():
-return ma.log(ma.abs(ma.tan(masked) + 1.0 / ma.cos(masked)))
+return ma.log(npy.abs(ma.tan(masked) + 1.0 / ma.cos(masked)))
else:
return npy.log(npy.abs(npy.tan(a) + 1.0 / npy.cos(a)))
def inverted(self):
-return MercatorLatitudeScale.InvertedMercatorLatitudeTransform()
+return
MercatorLatitudeScale.InvertedMercatorLatitudeTransform(self.thresh)
class InvertedMercatorLatitudeTransform(Transform):
input_dims = 1
output_dims = 1
is_separable = True
+def __init__(self, thresh):
+Transform.__init__(self)
+self.thresh = thresh
+
def transform(self, a):
return npy.arctan(npy.sinh(a))
def inverted(self):
-return MercatorLatitudeScale.MercatorLatitudeTransform()
+return MercatorLatitudeScale.MercatorLatitudeTransform(self.thresh)
def __init__(self, axis, **kwargs):
thresh = kwargs.pop("thresh", (85 / 180.0) * npy.pi)
@@ -328,11 +349,7 @@
self._transform = self.MercatorLatitudeTransform(thresh)
def set_default_locators_and_formatters(self, axis):
-class ThetaFormatter(Formatter):
-"""
-Used to format the theta tick labels. Converts the native
-unit of radians into degrees and adds a degree symbol.
-"""
+class DegreeFormatter(Formatter):
def __call__(self, x, pos=None):
# \u00b0 : degree symbol
return u"%d\u00b0" % ((x / npy.pi) * 180.0)
@@ -340,8 +357,8 @@
deg2rad = npy.pi / 180.0
axis.set_major_locator(FixedLocator(
npy.arange(-90, 90, 10) * deg2rad))
-axis.set_major_formatter(ThetaFormatter())
-axis.set_minor_formatter(ThetaFormatter())
+axis.set_major_formatter(DegreeFormatter())
+axis.set_minor_formatter(DegreeFormatter())
def get_transform(self):
return self._transform
@@ -366,6 +383,12 @@
return _scale_mapping[scale](axis, **kwargs)
+def register_scale(scale_class):
+"""
+Register a new kind of scale.
+"""
+_scale_mapping[scale_class.name] = scale_class
+
def get_scale_names():
names = _scale_mapping.keys()
names.sort()
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4767] branches/transforms
Revision: 4767
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4767&view=rev
Author: mdboom
Date: 2007-12-18 09:46:01 -0800 (Tue, 18 Dec 2007)
Log Message:
---
Preliminary version of "adding new scales and projections" document.
(In reST, since that appears to be where mpl documentation is
heading.)
Added Paths:
---
branches/transforms/doc/
branches/transforms/doc/devel/
branches/transforms/doc/devel/add_new_projection.rst
Added: branches/transforms/doc/devel/add_new_projection.rst
===
--- branches/transforms/doc/devel/add_new_projection.rst
(rev 0)
+++ branches/transforms/doc/devel/add_new_projection.rst2007-12-18
17:46:01 UTC (rev 4767)
@@ -0,0 +1,192 @@
+===
+Adding new scales and projections to matplotlib
+===
+
+.. ::author Michael Droettboom
+
+Matplotlib supports the addition of new transformations that transform
+the data before it is displayed. Separable transformations, that work
+on a single dimension are called "scales", and non-separable
+transformations, that take data in two or more dimensions as input are
+called "projections".
+
+This document is intended for developers and advanced users who need
+to add more scales and projections to matplotlib.
+
+From the user's perspective, the scale of a plot can be set with
+``set_xscale`` and ``set_yscale``. Choosing the projection
+currently has no *standardized* method. [MGDTODO]
+
+Creating a new scale
+
+
+Adding a new scale consists of defining a subclass of ``ScaleBase``,
+that brings together the following elements:
+
+ - A transformation from data space into plot space.
+
+ - An inverse of that transformation. For example, this is used to
+convert mouse positions back into data space.
+
+ - A function to limit the range of the axis to acceptable values. 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.
+
+ - Formatters (major and minor) that specify how the tick labels
+should be drawn.
+
+There are a number of ``Scale`` classes in ``scale.py`` that may be
+used as starting points for new scales. As an example, this document
+presents adding a new scale ``MercatorLatitudeScale`` which can be
+used to plot latitudes in a Mercator_ projection. For simplicity,
+this scale assumes that it has a fixed center at the equator. The
+code presented here is a simplification of actual code in
+``matplotlib``, with complications added only for the sake of
+optimization removed.
+
+First define a new subclass of ``ScaleBase``::
+
+class MercatorLatitudeScale(ScaleBase):
+"""
+Scales data in range -pi/2 to pi/2 (-90 to 90 degrees) using
+the system used to scale latitudes in a Mercator projection.
+
+The scale function:
+ ln(tan(y) + sec(y))
+
+The inverse scale function:
+ atan(sinh(y))
+
+Since the Mercator scale tends to infinity at +/- 90 degrees,
+there is user-defined threshold, above and below which nothing
+will be plotted. This defaults to +/- 85 degrees.
+
+source:
+http://en.wikipedia.org/wiki/Mercator_projection
+"""
+name = 'mercator_latitude'
+
+This class must have a member ``name`` that defines the string used to
+select the scale. For example,
+``gca().set_yscale("mercator_latitude")`` would be used to select the
+Mercator latitude scale.
+
+Next define two nested classes: one for the data transformation and
+one for its inverse. Both of these classes must be subclasses of
+``Transform`` (defined in ``transforms.py``).::
+
+class MercatorLatitudeTransform(Transform):
+input_dims = 1
+output_dims = 1
+
+There are two class-members that must be defined. ``input_dims`` and
+``output_dims`` specify number of input dimensions and output
+dimensions to the transformation. These are used by the
+transformation framework to do some error checking and prevent
+incompatible transformations from being connected together. When
+defining transforms for a scale, which are by definition separable and
+only have one dimension, these members should always be 1.
+
+``MercatorLatitudeTransform`` has a simple constructor that takes and
+stores the *threshold* for the Mercator projection (to limit its range
+to prevent plotting to infinity).::
+
+def __init__(self, thresh):
+Transform.__init__(self)
+self.thresh = thresh
+
+The ``transform`` method is where the real work happens: It takes an N
+x 1 ``numpy`` array and returns a transformed copy. Since the r
SF.net SVN: matplotlib: [4768] trunk/matplotlib/setup.cfg.template
Revision: 4768 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4768&view=rev Author: mdboom Date: 2007-12-18 11:17:13 -0800 (Tue, 18 Dec 2007) Log Message: --- Update information about the backends (Ps and Pdf were not mentioned.) Modified Paths: -- trunk/matplotlib/setup.cfg.template Modified: trunk/matplotlib/setup.cfg.template === --- trunk/matplotlib/setup.cfg.template 2007-12-18 17:46:01 UTC (rev 4767) +++ trunk/matplotlib/setup.cfg.template 2007-12-18 19:17:13 UTC (rev 4768) @@ -13,12 +13,12 @@ #verbose = True [provide_packages] -# By default, matplotlib checks for a few dependencies and -# installs them if missing. This feature can be turned off +# By default, matplotlib checks for a few dependencies and +# installs them if missing. This feature can be turned off # by uncommenting the following lines. Acceptible values are: # True: install, overwrite an existing installation # False: do not install -# auto: install only if the package is unavailable. This +# auto: install only if the package is unavailable. This # is the default behavior # ## Date/timezone support: @@ -30,28 +30,28 @@ #configobj = False [gui_support] -# Matplotlib supports multiple GUI toolkits, including Cocoa, -# GTK, Fltk, Qt, Qt4, Tk, and WX. Support for many of these -# toolkits requires AGG, the Anti-Grain Geometry library, which +# Matplotlib supports multiple GUI toolkits, including Cocoa, +# GTK, Fltk, Qt, Qt4, Tk, and WX. Support for many of these +# toolkits requires AGG, the Anti-Grain Geometry library, which # is provided by matplotlib and built by default. # -# Some backends are written in pure Python, and others require -# extension code to be compiled. By default, matplotlib checks -# for these GUI toolkits during installation and, if present, -# compiles the required extensions to support the toolkit. GTK -# support requires the GTK runtime environment and PyGTK. Wx -# support requires wxWidgets and wxPython. Tk support requires -# Tk and Tkinter. The other GUI toolkits do not require any -# extension code, and can be used as long as the libraries are +# Some backends are written in pure Python, and others require +# extension code to be compiled. By default, matplotlib checks +# for these GUI toolkits during installation and, if present, +# compiles the required extensions to support the toolkit. GTK +# support requires the GTK runtime environment and PyGTK. Wx +# support requires wxWidgets and wxPython. Tk support requires +# Tk and Tkinter. The other GUI toolkits do not require any +# extension code, and can be used as long as the libraries are # installed on your system. -# +# # You can uncomment any the following lines if you know you do # not want to use the GUI toolkit. Acceptible values are: -# True: build the extension. Exits with a warning if the +# True: build the extension. Exits with a warning if the # required dependencies are not available # False: do not build the extension # auto: build if the required dependencies are available, -# otherwise skip silently. This is the default +# otherwise skip silently. This is the default # behavior # #gtk = False @@ -62,18 +62,20 @@ [rc_options] # User-configurable options # -# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, -# GTKCairo, FltkAgg, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg. -# Only the Agg and SVG backends do not require external -# dependencies. Do not choose GTK, GTKAgg, GTKCairo, TkAgg or -# WXAgg if you have disabled the relevent extension modules. -# Agg will be used by default. +# Default backend, one of: Agg, Cairo, CocoaAgg, GTK, GTKAgg, +# GTKCairo, FltkAgg, Pdf, Ps, QtAgg, Qt4Agg, SVG, TkAgg, WX, WXAgg. +# +# The Agg, Ps, Pdf and SVG backends do not require external +# dependencies. Do not choose GTK, GTKAgg, GTKCairo, TkAgg or WXAgg if +# you have disabled the relevent extension modules. Agg will be used +# by default. +# #backend = Agg # -# The numerix module was historically used to provide +# The numerix module was historically used to provide # compatibility between the Numeric, numarray, and NumPy array -# packages. Now that NumPy has emerge as the universal array -# package for python, numerix is not really necessary and is -# maintained to provide backward compatibility. Do not change +# packages. Now that NumPy has emerge as the universal array +# package for python, numerix is not really necessary and is +# maintained to provide backward compatibility. Do not change # this unless you have a compelling reason to do so. #numerix = numpy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out t
SF.net SVN: matplotlib: [4769] trunk/matplotlib/lib/matplotlib/mathtext.py
Revision: 4769 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4769&view=rev Author: mdboom Date: 2007-12-18 12:57:40 -0800 (Tue, 18 Dec 2007) Log Message: --- Update list of supported math symbols. Modified Paths: -- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py === --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-18 19:17:13 UTC (rev 4768) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-18 20:57:40 UTC (rev 4769) @@ -81,35 +81,81 @@ Allowed TeX symbols: - [MGDTODO: This list is no longer exhaustive and needs to be updated] + $ \% \AA \AE \BbbC \BbbN \BbbP \BbbQ \BbbR \BbbZ \Bumpeq \Cap \Colon + \Cup \Delta \Doteq \Downarrow \Equiv \Finv \Gamma \H \Im \L \Lambda + \Ldsh \Leftarrow \Leftrightarrow \Lleftarrow \Lsh \Nearrow \Nwarrow + \O \OE \Omega \P \Phi \Pi \Psi \Rdsh \Re \Rightarrow \Rrightarrow + \Rsh \S \Searrow \Sigma \Subset \Supset \Swarrow \Theta \Uparrow + \Updownarrow \Upsilon \Vdash \Vert \Vvdash \Xi \_ \__sqrt__ \ac + \acute \acwopencirclearrow \adots \ae \aleph \alpha \angle \approx + \approxeq \approxident \arceq \ast \asymp \backcong \backprime + \backsim \backsimeq \backslash \bar \barleftarrow \barwedge \because + \beta \beth \between \bigcap \bigcirc \bigcup \bigodot \bigoplus + \bigotimes \bigstar \bigtriangledown \bigtriangleup \biguplus + \bigvee \bigwedge \blacksquare \blacktriangle \blacktriangledown + \blacktriangleleft \blacktriangleright \bot \bowtie \boxbar \boxdot + \boxminus \boxplus \boxtimes \breve \bullet \bumpeq \c \candra \cap + \carriagereturn \cdot \cdotp \cdots \check \checkmark \chi \circ + \circeq \circledR \circledS \circledast \circledcirc \circleddash + \circumflexaccent \clubsuit \clubsuitopen \colon \coloneq + \combiningacuteaccent \combiningbreve \combiningdiaeresis + \combiningdotabove \combininggraveaccent \combiningoverline + \combiningrightarrowabove \combiningtilde \complement \cong \coprod + \copyright \cup \cupdot \curlyeqprec \curlyeqsucc \curlyvee + \curlywedge \curvearrowleft \curvearrowright \cwopencirclearrow \d + \dag \daleth \danger \dashv \ddag \ot \dddot \ddot \ddots + \degree \delta \diamond \diamondsuit \digamma \div \divideontimes + \dot \doteq \dotminus \dotplus \dots \doublebarwedge ? \downarrow + \downdownarrows \downharpoonleft \downharpoonright \downzigzagarrow + \ell \emdash \emptyset \endash \enspace \epsilon \eqcirc \eqcolon + \eqdef \eqgtr \eqless \eqsim \equiv \eta \eth \exists \fallingdotseq + \flat \forall \frakC \frakZ \frown \gamma \geq \geqq \gg \ggg \gimel + \gneqq \gnsim \grave \greater \gtrdot \gtreqless \gtrless \gtrsim + \hat \heartsuit \hookleftarrow \hookrightarrow \i \iiint \iint + \imageof \imath \in \infty \int \intercal \invnot \iota \jmath \k + \kappa \kernelcontraction \l \lambda \lambdabar \lasp \lbrace + \lbrack \lceil \leftangle \leftarrow \leftarrowtail \leftbrace + \leftharpoonaccent \leftharpoondown \leftharpoonup \leftleftarrows + \leftparen \leftrightarrow \leftrightarrows \leftrightharpoons + \leftthreetimes \leq \leqq \less \lessdot \lesseqgtr \lessgtr + \lesssim \lfloor \ll \llcorner \lll \lneqq \lnsim \looparrowleft + \looparrowright \lq \lrcorner \ltimes \maltese \mapsdown \mapsfrom + \mapsto \mapsup \measeq \measuredangle \mho \mid \minus \models \mp + \mu \multimap \nLeftarrow \nLeftrightarrow \nRightarrow \nVDash + \nVdash \nabla \napprox \natural \ncong \ne \nearrow \neg \nequiv + \nexists \ngeq \ngtr \ni \nleftarrow \nleftrightarrow \nleq \nless + \nmid \not \notin \nparallel \nprec \nrightarrow \nsim \nsime + \nsubset \nsubseteq \nsucc \nsupset \nsupseteq \ntriangleleft + \ntrianglelefteq \ntriangleright \ntrianglerighteq \nu \nvDash + \nvdash \nwarrow \o \obar \ocirc \odot \oe \oiiint \oiint \oint + \omega \ominus \oplus \origof \oslash \otimes \overarc + \overleftarrow \overleftrightarrow \parallel \partial \phi \pi + \pitchfork \pm \prec \preccurlyeq \preceq \precnsim \precsim \prime + \prod \propto \prurel \psi \quad \questeq \rasp \rbrace \rbrack + \rceil \rfloor \rho \rightangle \rightarrow \rightarrowbar + \rightarrowtail \rightbrace \rightharpoonaccent \rightharpoondown + \rightharpoonup \rightleftarrows \rightleftharpoons \rightparen + \rightrightarrows \rightthreetimes \rightzigzagarrow \risingdotseq + \rq \rtimes \scrB \scrE \scrF \scrH \scrI \scrL \scrM \scrR \scre + \scrg \scro \scurel \searrow \sharp \sigma \sim \simeq \slash + \smallsetminus \smile \solbar \spadesuit \spadesuitopen + \sphericalangle \sqcap \sqcup \sqsubset \sqsubseteq \sqsupset + \sqsupseteq \ss \star \stareq \sterling \subset \subseteq \subsetneq + \succ \succcurlyeq \succeq \succnsim \succsim \sum \supset \supseteq + \supsetneq \swarrow \t \tau \textasciiacute \textasciicircum + \textasciigrave \textasciitilde \textexclamdown \textquestiondown + \textquotedbll
SF.net SVN: matplotlib: [4770] trunk/matplotlib/lib/matplotlib/mathtext.py
Revision: 4770 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4770&view=rev Author: mdboom Date: 2007-12-18 12:59:56 -0800 (Tue, 18 Dec 2007) Log Message: --- Update list of supported backends. Modified Paths: -- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py === --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-18 20:57:40 UTC (rev 4769) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-12-18 20:59:56 UTC (rev 4770) @@ -158,17 +158,8 @@ BACKENDS - mathtext currently works with GTK, Agg, GTKAgg, TkAgg and WxAgg and - PS, though only horizontal and vertical rotations are supported in - *Agg + mathtext currently works with all backends. - mathtext now embeds the TrueType computer modern fonts into the PS - file, so what you see on the screen should be what you get on paper. - - Backends which don't support mathtext will just render the TeX - string as a literal. Stay tuned. - - KNOWN ISSUES: - Certainly there are some... This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4771] branches/transforms/doc/devel/ add_new_projection.rst
Revision: 4771 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4771&view=rev Author: mdboom Date: 2007-12-18 13:08:19 -0800 (Tue, 18 Dec 2007) Log Message: --- Minor changes. Modified Paths: -- branches/transforms/doc/devel/add_new_projection.rst Modified: branches/transforms/doc/devel/add_new_projection.rst === --- branches/transforms/doc/devel/add_new_projection.rst2007-12-18 20:59:56 UTC (rev 4770) +++ branches/transforms/doc/devel/add_new_projection.rst2007-12-18 21:08:19 UTC (rev 4771) @@ -5,18 +5,19 @@ .. ::author Michael Droettboom Matplotlib supports the addition of new transformations that transform -the data before it is displayed. Separable transformations, that work -on a single dimension are called "scales", and non-separable -transformations, that take data in two or more dimensions as input are -called "projections". +the data before it is displayed. In ``matplotlib`` nomenclature, +separable transformations, working on a single dimension, are called +"scales", and non-separable transformations, that take handle data in +two or more dimensions at a time, are called "projections". -This document is intended for developers and advanced users who need -to add more scales and projections to matplotlib. - From the user's perspective, the scale of a plot can be set with ``set_xscale`` and ``set_yscale``. Choosing the projection currently has no *standardized* method. [MGDTODO] +This document is intended for developers and advanced users who need +to add more scales and projections to matplotlib. + + Creating a new scale This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. - SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib: [4772] branches/transforms/lib/matplotlib
Revision: 4772
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4772&view=rev
Author: mdboom
Date: 2007-12-18 13:09:25 -0800 (Tue, 18 Dec 2007)
Log Message:
---
Better docstrings for set_x/yscale and friends.
Modified Paths:
--
branches/transforms/lib/matplotlib/axes.py
branches/transforms/lib/matplotlib/pyplot.py
branches/transforms/lib/matplotlib/scale.py
Modified: branches/transforms/lib/matplotlib/axes.py
===
--- branches/transforms/lib/matplotlib/axes.py 2007-12-18 21:08:19 UTC (rev
4771)
+++ branches/transforms/lib/matplotlib/axes.py 2007-12-18 21:09:25 UTC (rev
4772)
@@ -1651,25 +1651,18 @@
", ".join(mscale.get_scale_names()))
return self.xaxis.get_scale()
-# MGDTODO: Update docstring
def set_xscale(self, value, **kwargs):
"""
SET_XSCALE(value)
-Set the xscaling: %(scale)s
+Set the scaling of the x-axis: %(scale)s
-If value is 'log', the additional kwargs have the following meaning
-
-* basex: base of the logarithm
-
-* subsx: a sequence of the location of the minor ticks;
- None defaults to autosubs, which depend on the number of
- decades in the plot. Eg for base 10, subsx=(1,2,5) will
- put minor ticks on 1,2,5,11,12,15,21, To turn off
- minor ticking, set subsx=[]
-
ACCEPTS: [%(scale)s]
-""" % {'scale': ' | '.join([repr(x) for x in
mscale.get_scale_names()])}
+
+Different kwargs are accepted, depending on the scale:
+%(scale_docs)s
+""" % {'scale': ' | '.join([repr(x) for x in
mscale.get_scale_names()]),
+ 'scale_docs': mscale.get_scale_docs().strip()}
self.xaxis.set_scale(value, **kwargs)
self.autoscale_view()
self._update_transScale()
@@ -1815,22 +1808,16 @@
def set_yscale(self, value, **kwargs):
"""
-SET_YSCALE(value, basey=10, subsy=None)
+SET_YSCALE(value)
-Set the yscaling: %(scale)s
+Set the scaling of the y-axis: %(scale)s
-If value is 'log', the additional kwargs have the following meaning
+ACCEPTS: [%(scale)s]
-* basey: base of the logarithm
-
-* subsy: a sequence of the location of the minor ticks;
- None defaults to autosubs, which depend on the number of
- decades in the plot. Eg for base 10, subsy=(1,2,5) will
- put minor ticks on 1,2,5,11,12,15, 21, To turn off
- minor ticking, set subsy=[]
-
-ACCEPTS: %(scale)s
-""" % {'scale': ' | '.join([repr(x) for x in
mscale.get_scale_names()])}
+Different kwargs are accepted, depending on the scale:
+%(scale_docs)s
+""" % {'scale': ' | '.join([repr(x) for x in
mscale.get_scale_names()]),
+ 'scale_docs': mscale.get_scale_docs().strip()}
self.yaxis.set_scale(value, **kwargs)
self.autoscale_view()
self._update_transScale()
Modified: branches/transforms/lib/matplotlib/pyplot.py
===
--- branches/transforms/lib/matplotlib/pyplot.py2007-12-18 21:08:19 UTC
(rev 4771)
+++ branches/transforms/lib/matplotlib/pyplot.py2007-12-18 21:09:25 UTC
(rev 4772)
@@ -12,7 +12,7 @@
from matplotlib.axes import Axes
from matplotlib.projections import PolarAxes
from matplotlib import mlab # for csv2rec in plotfile
-from matplotlib.scale import get_scale_names
+from matplotlib.scale import get_scale_docs, get_scale_names
from matplotlib import cm
from matplotlib.cm import get_cmap
@@ -727,26 +727,34 @@
return ret
-# MGDTODO: Update docstring
def xscale(*args, **kwargs):
"""
SET_XSCALE(value)
-Set the xscaling: %(scale)s
-""" % {'scale': ' | '.join([repr(x) for x in get_scale_names()])}
+Set the scaling for the x-axis: %(scale)s
+
+Different keywords may be accepted, depending on the scale:
+
+%(scale_docs)s
+""" % {'scale': ' | '.join([repr(x) for x in get_scale_names()]),
+ 'scale_docs': get_scale_docs()}
ax = gca()
ret = ax.set_xscale(*args, **kwargs)
draw_if_interactive()
return ret
-# MGDTODO: Update docstring
def yscale(*args, **kwargs):
"""
SET_YSCALE(value)
-Set the yscaling: %(scale)s
-""" % {'scale': ' | '.join([repr(x) for x in get_scale_names()])}
+Set the scaling for the y-axis: %(scale)s
+
+Different keywords may be accepted, depending on the scale:
+
+%(scale_docs)s
+""" % {'scale': ' | '.join([repr(x) for x in get_scale_names()]),
+ 'scale_docs': get_scale_docs()}
ax = gca()
ret = ax.set_yscale(*args, **kwargs)
draw_if_interactive()
Modified: branches/transforms/lib/matplotlib/scale.py
=
SF.net SVN: matplotlib: [4773] branches/transforms
Revision: 4773 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4773&view=rev Author: mdboom Date: 2007-12-18 13:10:20 -0800 (Tue, 18 Dec 2007) Log Message: --- Merged revisions 4758-4772 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib r4768 | mdboom | 2007-12-18 14:17:13 -0500 (Tue, 18 Dec 2007) | 2 lines Update information about the backends (Ps and Pdf were not mentioned.) r4769 | mdboom | 2007-12-18 15:57:40 -0500 (Tue, 18 Dec 2007) | 2 lines Update list of supported math symbols. r4770 | mdboom | 2007-12-18 15:59:56 -0500 (Tue, 18 Dec 2007) | 2 lines Update list of supported backends. Modified Paths: -- branches/transforms/lib/matplotlib/mathtext.py branches/transforms/setup.cfg.template Property Changed: branches/transforms/ Property changes on: branches/transforms ___ Name: svnmerge-integrated - /trunk/matplotlib:1-4757 + /trunk/matplotlib:1-4772 Modified: branches/transforms/lib/matplotlib/mathtext.py === --- branches/transforms/lib/matplotlib/mathtext.py 2007-12-18 21:09:25 UTC (rev 4772) +++ branches/transforms/lib/matplotlib/mathtext.py 2007-12-18 21:10:20 UTC (rev 4773) @@ -81,48 +81,85 @@ Allowed TeX symbols: - [MGDTODO: This list is no longer exhaustive and needs to be updated] + $ \% \AA \AE \BbbC \BbbN \BbbP \BbbQ \BbbR \BbbZ \Bumpeq \Cap \Colon + \Cup \Delta \Doteq \Downarrow \Equiv \Finv \Gamma \H \Im \L \Lambda + \Ldsh \Leftarrow \Leftrightarrow \Lleftarrow \Lsh \Nearrow \Nwarrow + \O \OE \Omega \P \Phi \Pi \Psi \Rdsh \Re \Rightarrow \Rrightarrow + \Rsh \S \Searrow \Sigma \Subset \Supset \Swarrow \Theta \Uparrow + \Updownarrow \Upsilon \Vdash \Vert \Vvdash \Xi \_ \__sqrt__ \ac + \acute \acwopencirclearrow \adots \ae \aleph \alpha \angle \approx + \approxeq \approxident \arceq \ast \asymp \backcong \backprime + \backsim \backsimeq \backslash \bar \barleftarrow \barwedge \because + \beta \beth \between \bigcap \bigcirc \bigcup \bigodot \bigoplus + \bigotimes \bigstar \bigtriangledown \bigtriangleup \biguplus + \bigvee \bigwedge \blacksquare \blacktriangle \blacktriangledown + \blacktriangleleft \blacktriangleright \bot \bowtie \boxbar \boxdot + \boxminus \boxplus \boxtimes \breve \bullet \bumpeq \c \candra \cap + \carriagereturn \cdot \cdotp \cdots \check \checkmark \chi \circ + \circeq \circledR \circledS \circledast \circledcirc \circleddash + \circumflexaccent \clubsuit \clubsuitopen \colon \coloneq + \combiningacuteaccent \combiningbreve \combiningdiaeresis + \combiningdotabove \combininggraveaccent \combiningoverline + \combiningrightarrowabove \combiningtilde \complement \cong \coprod + \copyright \cup \cupdot \curlyeqprec \curlyeqsucc \curlyvee + \curlywedge \curvearrowleft \curvearrowright \cwopencirclearrow \d + \dag \daleth \danger \dashv \ddag \ot \dddot \ddot \ddots + \degree \delta \diamond \diamondsuit \digamma \div \divideontimes + \dot \doteq \dotminus \dotplus \dots \doublebarwedge ? \downarrow + \downdownarrows \downharpoonleft \downharpoonright \downzigzagarrow + \ell \emdash \emptyset \endash \enspace \epsilon \eqcirc \eqcolon + \eqdef \eqgtr \eqless \eqsim \equiv \eta \eth \exists \fallingdotseq + \flat \forall \frakC \frakZ \frown \gamma \geq \geqq \gg \ggg \gimel + \gneqq \gnsim \grave \greater \gtrdot \gtreqless \gtrless \gtrsim + \hat \heartsuit \hookleftarrow \hookrightarrow \i \iiint \iint + \imageof \imath \in \infty \int \intercal \invnot \iota \jmath \k + \kappa \kernelcontraction \l \lambda \lambdabar \lasp \lbrace + \lbrack \lceil \leftangle \leftarrow \leftarrowtail \leftbrace + \leftharpoonaccent \leftharpoondown \leftharpoonup \leftleftarrows + \leftparen \leftrightarrow \leftrightarrows \leftrightharpoons + \leftthreetimes \leq \leqq \less \lessdot \lesseqgtr \lessgtr + \lesssim \lfloor \ll \llcorner \lll \lneqq \lnsim \looparrowleft + \looparrowright \lq \lrcorner \ltimes \maltese \mapsdown \mapsfrom + \mapsto \mapsup \measeq \measuredangle \mho \mid \minus \models \mp + \mu \multimap \nLeftarrow \nLeftrightarrow \nRightarrow \nVDash + \nVdash \nabla \napprox \natural \ncong \ne \nearrow \neg \nequiv + \nexists \ngeq \ngtr \ni \nleftarrow \nleftrightarrow \nleq \nless + \nmid \not \notin \nparallel \nprec \nrightarrow \nsim \nsime + \nsubset \nsubseteq \nsucc \nsupset \nsupseteq \ntriangleleft + \ntrianglelefteq \ntriangleright \ntrianglerighteq \nu \nvDash + \nvdash \nwarrow \o \obar \ocirc \odot \oe \oiiint \oiint \oint + \omega \ominus \oplus \origof \oslash \otimes \overarc + \overleftarrow \overleftrightarrow \parallel \partial \phi \pi + \pitchfork \pm \prec \preccurlyeq \preceq \precnsim \precsim \prime + \prod \propto \prurel \psi \quad \questeq \rasp \rbrace \rbrack + \rc
