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

Skip to content

Commit 3755230

Browse files
committed
Merged revisions 7489-7490,7498-7502,7506,7517,7519,7521-7523 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint ........ r7489 | jdh2358 | 2009-08-15 10:40:27 -0700 (Sat, 15 Aug 2009) | 1 line some doc reorg ........ r7490 | jdh2358 | 2009-08-15 10:56:44 -0700 (Sat, 15 Aug 2009) | 1 line added transformations tut, did some reorg ........ r7498 | jdh2358 | 2009-08-17 20:48:21 -0700 (Mon, 17 Aug 2009) | 1 line added path tut ........ r7499 | jdh2358 | 2009-08-17 22:15:21 -0700 (Mon, 17 Aug 2009) | 1 line added looking glass demo ........ r7500 | mdboom | 2009-08-18 07:00:28 -0700 (Tue, 18 Aug 2009) | 2 lines Fix some minor typos in the transforms tutorial ........ r7501 | mdboom | 2009-08-18 07:01:41 -0700 (Tue, 18 Aug 2009) | 2 lines Fix some minor typos in the transforms tutorial ........ r7502 | mdboom | 2009-08-18 07:08:27 -0700 (Tue, 18 Aug 2009) | 2 lines Fix some minor typos in the paths tutorial ........ r7506 | ryanmay | 2009-08-19 00:56:33 -0700 (Wed, 19 Aug 2009) | 1 line Remove calls to np.asarray(). This was breaking the use of masked arrays in calls to set_[x|y]data() and is handled appropriately already by set_data(). ........ r7517 | jdh2358 | 2009-08-21 17:02:15 -0700 (Fri, 21 Aug 2009) | 1 line fixed a fifo bug for the new transforms infrastructure ........ r7519 | jouni | 2009-08-21 23:25:07 -0700 (Fri, 21 Aug 2009) | 2 lines Fix typos found by Marc Desmarais and Nicolas Pinto ........ r7521 | jdh2358 | 2009-08-22 15:50:55 -0700 (Sat, 22 Aug 2009) | 1 line added Ariel's max install patch ........ r7522 | jdh2358 | 2009-08-22 16:19:44 -0700 (Sat, 22 Aug 2009) | 1 line applied Ariel's mlab.cohere_pairs fixes ........ r7523 | jdh2358 | 2009-08-22 16:20:30 -0700 (Sat, 22 Aug 2009) | 1 line fix osx epd formatting bug in rest ........ svn path=/trunk/matplotlib/; revision=7524
2 parents 5132d75 + 29f82f2 commit 3755230

19 files changed

Lines changed: 968 additions & 123 deletions

CXX/IndirectPythonInterface.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,6 @@ void _XINCREF( PyObject *op );
193193
void _XDECREF( PyObject *op );
194194

195195
char *__Py_PackageContext();
196-
};
196+
}
197197

198198
#endif // __CXX_INDIRECT_PYTHON_INTERFACE__HXX__

agg24/include/agg_basics.h

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Anti-Grain Geometry - Version 2.4
33
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
44
//
5-
// Permission to copy, use, modify, sell and distribute this software
6-
// is granted provided this copyright notice appears in all copies.
5+
// Permission to copy, use, modify, sell and distribute this software
6+
// is granted provided this copyright notice appears in all copies.
77
// This software is provided "as is" without express or implied
88
// warranty, and with no claim as to its suitability for any purpose.
99
//
@@ -25,12 +25,12 @@
2525
#else
2626
namespace agg
2727
{
28-
// The policy of all AGG containers and memory allocation strategy
28+
// The policy of all AGG containers and memory allocation strategy
2929
// in general is that no allocated data requires explicit construction.
3030
// It means that the allocator can be really simple; you can even
31-
// replace new/delete to malloc/free. The constructors and destructors
32-
// won't be called in this case, however everything will remain working.
33-
// The second argument of deallocate() is the size of the allocated
31+
// replace new/delete to malloc/free. The constructors and destructors
32+
// won't be called in this case, however everything will remain working.
33+
// The second argument of deallocate() is the size of the allocated
3434
// block. You can use this information if you wish.
3535
//------------------------------------------------------------pod_allocator
3636
template<class T> struct pod_allocator
@@ -40,8 +40,8 @@ namespace agg
4040
};
4141

4242
// Single object allocator. It's also can be replaced with your custom
43-
// allocator. The difference is that it can only allocate a single
44-
// object and the constructor and destructor must be called.
43+
// allocator. The difference is that it can only allocate a single
44+
// object and the constructor and destructor must be called.
4545
// In AGG there is no need to allocate an array of objects with
4646
// calling their constructors (only single ones). So that, if you
4747
// replace these new/delete to malloc/free make sure that the in-place
@@ -213,23 +213,23 @@ namespace agg
213213
enum cover_scale_e
214214
{
215215
cover_shift = 8, //----cover_shift
216-
cover_size = 1 << cover_shift, //----cover_size
217-
cover_mask = cover_size - 1, //----cover_mask
218-
cover_none = 0, //----cover_none
219-
cover_full = cover_mask //----cover_full
216+
cover_size = 1 << cover_shift, //----cover_size
217+
cover_mask = cover_size - 1, //----cover_mask
218+
cover_none = 0, //----cover_none
219+
cover_full = cover_mask //----cover_full
220220
};
221221

222222
//----------------------------------------------------poly_subpixel_scale_e
223-
// These constants determine the subpixel accuracy, to be more precise,
224-
// the number of bits of the fractional part of the coordinates.
223+
// These constants determine the subpixel accuracy, to be more precise,
224+
// the number of bits of the fractional part of the coordinates.
225225
// The possible coordinate capacity in bits can be calculated by formula:
226226
// sizeof(int) * 8 - poly_subpixel_shift, i.e, for 32-bit integers and
227227
// 8-bits fractional part the capacity is 24 bits.
228228
enum poly_subpixel_scale_e
229229
{
230230
poly_subpixel_shift = 8, //----poly_subpixel_shift
231-
poly_subpixel_scale = 1<<poly_subpixel_shift, //----poly_subpixel_scale
232-
poly_subpixel_mask = poly_subpixel_scale-1, //----poly_subpixel_mask
231+
poly_subpixel_scale = 1<<poly_subpixel_shift, //----poly_subpixel_scale
232+
poly_subpixel_mask = poly_subpixel_scale-1 //----poly_subpixel_mask
233233
};
234234

235235
//----------------------------------------------------------filling_rule_e
@@ -253,7 +253,7 @@ namespace agg
253253
{
254254
return rad * 180.0 / pi;
255255
}
256-
256+
257257
//----------------------------------------------------------------rect_base
258258
template<class T> struct rect_base
259259
{
@@ -265,9 +265,9 @@ namespace agg
265265
rect_base(T x1_, T y1_, T x2_, T y2_) :
266266
x1(x1_), y1(y1_), x2(x2_), y2(y2_) {}
267267

268-
void init(T x1_, T y1_, T x2_, T y2_)
268+
void init(T x1_, T y1_, T x2_, T y2_)
269269
{
270-
x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_;
270+
x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_;
271271
}
272272

273273
const self_type& normalize()
@@ -299,17 +299,17 @@ namespace agg
299299
};
300300

301301
//-----------------------------------------------------intersect_rectangles
302-
template<class Rect>
302+
template<class Rect>
303303
inline Rect intersect_rectangles(const Rect& r1, const Rect& r2)
304304
{
305305
Rect r = r1;
306306

307-
// First process x2,y2 because the other order
308-
// results in Internal Compiler Error under
309-
// Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in
307+
// First process x2,y2 because the other order
308+
// results in Internal Compiler Error under
309+
// Microsoft Visual C++ .NET 2003 69462-335-0000007-18038 in
310310
// case of "Maximize Speed" optimization option.
311311
//-----------------
312-
if(r.x2 > r2.x2) r.x2 = r2.x2;
312+
if(r.x2 > r2.x2) r.x2 = r2.x2;
313313
if(r.y2 > r2.y2) r.y2 = r2.y2;
314314
if(r.x1 < r2.x1) r.x1 = r2.x1;
315315
if(r.y1 < r2.y1) r.y1 = r2.y1;
@@ -318,7 +318,7 @@ namespace agg
318318

319319

320320
//---------------------------------------------------------unite_rectangles
321-
template<class Rect>
321+
template<class Rect>
322322
inline Rect unite_rectangles(const Rect& r1, const Rect& r2)
323323
{
324324
Rect r = r1;
@@ -336,26 +336,26 @@ namespace agg
336336
//---------------------------------------------------------path_commands_e
337337
enum path_commands_e
338338
{
339-
path_cmd_stop = 0, //----path_cmd_stop
340-
path_cmd_move_to = 1, //----path_cmd_move_to
341-
path_cmd_line_to = 2, //----path_cmd_line_to
342-
path_cmd_curve3 = 3, //----path_cmd_curve3
343-
path_cmd_curve4 = 4, //----path_cmd_curve4
339+
path_cmd_stop = 0, //----path_cmd_stop
340+
path_cmd_move_to = 1, //----path_cmd_move_to
341+
path_cmd_line_to = 2, //----path_cmd_line_to
342+
path_cmd_curve3 = 3, //----path_cmd_curve3
343+
path_cmd_curve4 = 4, //----path_cmd_curve4
344344
path_cmd_curveN = 5, //----path_cmd_curveN
345345
path_cmd_catrom = 6, //----path_cmd_catrom
346346
path_cmd_ubspline = 7, //----path_cmd_ubspline
347347
path_cmd_end_poly = 0x0F, //----path_cmd_end_poly
348-
path_cmd_mask = 0x0F //----path_cmd_mask
348+
path_cmd_mask = 0x0F //----path_cmd_mask
349349
};
350350

351351
//------------------------------------------------------------path_flags_e
352352
enum path_flags_e
353353
{
354-
path_flags_none = 0, //----path_flags_none
355-
path_flags_ccw = 0x10, //----path_flags_ccw
356-
path_flags_cw = 0x20, //----path_flags_cw
354+
path_flags_none = 0, //----path_flags_none
355+
path_flags_ccw = 0x10, //----path_flags_ccw
356+
path_flags_cw = 0x20, //----path_flags_cw
357357
path_flags_close = 0x40, //----path_flags_close
358-
path_flags_mask = 0xF0 //----path_flags_mask
358+
path_flags_mask = 0xF0 //----path_flags_mask
359359
};
360360

361361
//---------------------------------------------------------------is_vertex
@@ -372,7 +372,7 @@ namespace agg
372372

373373
//-----------------------------------------------------------------is_stop
374374
inline bool is_stop(unsigned c)
375-
{
375+
{
376376
return c == path_cmd_stop;
377377
}
378378

@@ -416,7 +416,7 @@ namespace agg
416416
inline bool is_close(unsigned c)
417417
{
418418
return (c & ~(path_flags_cw | path_flags_ccw)) ==
419-
(path_cmd_end_poly | path_flags_close);
419+
(path_cmd_end_poly | path_flags_close);
420420
}
421421

422422
//------------------------------------------------------------is_next_poly
@@ -440,19 +440,19 @@ namespace agg
440440
//-------------------------------------------------------------is_oriented
441441
inline bool is_oriented(unsigned c)
442442
{
443-
return (c & (path_flags_cw | path_flags_ccw)) != 0;
443+
return (c & (path_flags_cw | path_flags_ccw)) != 0;
444444
}
445445

446446
//---------------------------------------------------------------is_closed
447447
inline bool is_closed(unsigned c)
448448
{
449-
return (c & path_flags_close) != 0;
449+
return (c & path_flags_close) != 0;
450450
}
451451

452452
//----------------------------------------------------------get_close_flag
453453
inline unsigned get_close_flag(unsigned c)
454454
{
455-
return c & path_flags_close;
455+
return c & path_flags_close;
456456
}
457457

458458
//-------------------------------------------------------clear_orientation
@@ -513,7 +513,7 @@ namespace agg
513513
int x1, x2;
514514
const T* ptr;
515515
const_row_info() {}
516-
const_row_info(int x1_, int x2_, const T* ptr_) :
516+
const_row_info(int x1_, int x2_, const T* ptr_) :
517517
x1(x1_), x2(x2_), ptr(ptr_) {}
518518
};
519519

doc/_templates/indexsidebar.html

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,33 @@ <h3>News</h3>
88
pathto('users/installing') }}">installing</a>
99
</p>
1010

11-
<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">video lecture</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>Machine Learning Open Source Software</i></a>.
11+
<p>Build websites like matplotlib's,
12+
with <a href="http://sphinx.pocoo.org/">sphinx</a> and extensions for
13+
mpl plots, math, inheritance diagrams -- try
14+
the <a href="http://matplotlib.sf.net/sampledoc">sampledoc</a>
15+
tutorial.
1216
</p>
1317

18+
19+
<h3>Videos</h3>
20+
21+
<p>Watch the <a href="http://conference.scipy.org/">SciPy</a> 2009 <a href="http://www.archive.org/details/scipy09_introTutorialDay2_1">intro</a> and <a href="http://www.archive.org/details/scipy09_advancedTutorialDay1_3">advanced</a> matplotlib tutorials
22+
</p>
23+
24+
<p>Watch a <a href="http://videolectures.net/mloss08_hunter_mat">talk</a> about matplotlib presented at <a href="http://videolectures.net/mloss08_whistler">NIPS 08 Workshop</a> <i>MLOSS</i></a>.
25+
</p>
26+
27+
28+
<h3>Toolkits</h3>
29+
1430
<p>There are several matplotlib addon <a href="{{
1531
pathto('users/toolkits') }}">toolkits</a>, including the projection
1632
and mapping toolkit
1733
<a href="http://matplotlib.sf.net/basemap/doc/html">basemap</a>, 3d plotting with <a href="{{
18-
pathto('mpl_toolkits/mplot3d/index') }}">mplot3d</a>, wild and wonderful axes and axis helpers in <a href="{{
34+
pathto('mpl_toolkits/mplot3d/index') }}">mplot3d</a>, axes and axis helpers in <a href="{{
1935
pathto('mpl_toolkits/axes_grid/index') }}">axes_grid</a> and more.
2036
</p>
2137

22-
2338
<h3>Need help?</h3>
2439

2540
<p>Check the <a href="{{ pathto('users/index') }}">user guide</a>,

doc/_templates/layout.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33

44
{% block rootrellink %}
5-
<li><a href="{{ pathto('index') }}">matplotlib&nbsp;home</a>|&nbsp;</li>
5+
<li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
66
<li><a href="{{ pathto('search') }}">search</a>|&nbsp;</li>
7+
<li><a href="examples/index.html">examples</a>|&nbsp;</li>
78
<li><a href="{{ pathto('gallery') }}">gallery</a>|&nbsp;</li>
8-
<li><a href="{{ pathto('contents') }}">documentation </a> &raquo;</li>
9+
<li><a href="{{ pathto('contents') }}">docs</a> &raquo;</li>
910
{% endblock %}
1011

1112

doc/faq/installing_faq.rst

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ Installing OSX binaries
295295
If you want to install matplotlib from one of the binary installers we
296296
build, you have two choices: a dmg installer, which is a typical
297297
Installer.app, or an binary OSX egg, which you can install via
298-
setuptools easy_install.
299-
298+
setuptools easy_install.
299+
300300
The mkpg installer will have a "dmg" extension, and will have a name
301301
like :file:`matplotlib-0.99.0-py2.5-macosx10.5.dmg` depending on the
302302
python, matplotlib, and OSX versions. Save this file and double
@@ -318,10 +318,24 @@ If you get an error like::
318318

319319
then you will need to set your PYTHONPATH, eg::
320320

321-
export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages:$PYTHONPATH
321+
export PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages:$PYTHONPATH
322322

323323
See also :ref:`environment-variables`.
324324

325+
326+
If you are upgrading your matplotlib using the dmg installer over an
327+
Enthought Python Distribution, you may get an error like "You must use
328+
a framework install of python". EPD puts their python in a directory
329+
like :file:``//Library/Frameworks/Python.framework/Versions/4.3.0``
330+
where 4.3.0 is an EPD version number. The mpl installer needs the
331+
`python` version number, so you need to create a symlink pointing your
332+
python version to the EPS version before installing matplotlib. For
333+
example, for python veersion 2.5 and EPD version 4.3.0::
334+
335+
> cd /Library/Frameworks/Python.framework/Versions
336+
> ln -s 4.3.0 2.5
337+
338+
325339
.. _easy-install-osx-egg:
326340

327341
easy_install from egg
@@ -342,7 +356,7 @@ download the latest egg from our `download site
342356
<http://sourceforge.net/projects/matplotlib/files/>`_ directly to your
343357
harddrive, and manually install it with
344358

345-
> easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg
359+
> easy_install --install-dir=~/dev/lib/python2.5/site-packages/ matplotlib-0.99.0.rc1-py2.5-macosx-10.5-i386.egg
346360

347361

348362
Some users have reported problems with the egg for 0.98 from the
@@ -364,6 +378,66 @@ the disk. Many Mac OS X eggs with cruft at the end of the filename,
364378
which prevents their installation through easy_install. Renaming is
365379
all it takes to install them; still, it's annoying.
366380

381+
382+
.. _install_from_source_on_osx_epd:
383+
384+
Building and installing from source on OSX with EPD
385+
---------------------------------------------------
386+
387+
If you have the EPD installed (:ref:`which-python-for-osx`), it might turn out
388+
to be rather tricky to install a new version of matplotlib from source on the
389+
Mac OS 10.5 . Here's a procedure that seems to work, at least sometimes:
390+
391+
0. Remove the ~/.matplotlib folder ("rm -rf ~/.matplotlib").
392+
393+
1. Edit the file (make a backup before you start, just in case):
394+
``/Library/Frameworks/Python.framework/Versions/Current/lib/python2.5/config/Makefile``,
395+
removing all occurrences of the string ``-arch ppc``, changing the line
396+
``MACOSX_DEPLOYMENT_TARGET=10.3`` to ``MACOSX_DEPLOYMENT_TARGET=10.5`` and
397+
changing the occurrences of ``MacOSX10.4u.sdk`` into ``MacOSX10.5.sdk``
398+
399+
2. In
400+
``/Library/Frameworks/Python.framework/Versions/Current/lib/pythonX.Y/site-packages/easy-install.pth``,
401+
(where X.Y is the version of Python you are building against)
402+
Comment out the line containing the name of the directory in which the
403+
previous version of MPL was installed (Looks something like ``./matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg``).
404+
405+
3. Save the following as a shell script , for example ``./install-matplotlib-epd-osx.sh`` ::
406+
407+
NAME=matplotlib
408+
VERSION=0_99
409+
PREFIX=$HOME
410+
#branch="release"
411+
branch="trunk"
412+
if [ $branch = "trunk" ]
413+
then
414+
echo getting the trunk
415+
svn co https://matplotlib.svn.sourceforge.net/svnroot/$NAME/trunk/$NAME $NAME
416+
cd $NAME
417+
418+
fi
419+
if [ $branch = "release" ]
420+
then
421+
echo getting the maintenance branch
422+
svn co https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v${VERSION}_maint $NAME$VERSION
423+
cd $NAME$VERSION
424+
fi
425+
export CFLAGS="-Os -arch i386"
426+
export LDFLAGS="-Os -arch i386"
427+
export PKG_CONFIG_PATH="/usr/x11/lib/pkgconfig"
428+
export ARCHFLAGS="-arch i386"
429+
python setup.py build
430+
python setup.py install #--prefix=$PREFIX #Use this if you don't want it installed into your default location
431+
cd ..
432+
433+
Run this script (for example ``sh ./install-matplotlib-epd-osx.sh``) in the
434+
directory in which you want the source code to be placed, or simply type the
435+
commands in the terminal command line. This script sets some local variable
436+
(CFLAGS, LDFLAGS, PKG_CONFIG_PATH, ARCHFLAGS), removes previous installations,
437+
checks out the source from svn, builds and installs it. The backend seems to be
438+
set to MacOSX.
439+
440+
367441
Windows questions
368442
=================
369443

0 commit comments

Comments
 (0)