Skip to content

Commit acc110b

Browse files
committed
fixed a distance bug in arrow
svn path=/trunk/matplotlib/; revision=3509
1 parent 5aa9374 commit acc110b

File tree

6 files changed

+24
-39
lines changed

6 files changed

+24
-39
lines changed

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
2007-07-13 Added legend.loc as configurable option that could in future default to 'best'. - NN
1+
2007-07-13 Added legend.loc as configurable option that could in
2+
future default to 'best'. - NN
23

34
2007-07-12 Bugfixes in mlab.py to coerce inputs into numpy arrays. -ADS
45

CODING_GUIDE

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ and standards. Please edit and extend this document.
55

66
== svn checkouts ==
77

8-
# checking out the main src
9-
svn co https://svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib
10-
118
# checking out everything (toolkits, user's guide, htdocs, etc..)
12-
svn co https://svn.sourceforge.net/svnroot/matplotlib/trunk matplotlib
9+
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk matplotlib --username=youruser --password=yourpass
10+
11+
12+
# checking out the main src
13+
svn co https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/trunk/matplotlib matplotlib --username=youruser --password=yourpass
1314

1415
== Committing changes ==
1516

lib/matplotlib/mpl-data/matplotlibrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ numerix : numpy # numpy, Numeric or numarray
268268
# svg backend params
269269
#svg.image_inline : True # write raster image data directly into the svg file
270270
#svg.image_noscale : False # suppress scaling of raster data embedded in SVG
271+
#svg.embed_chars : False # embed character outlines in the SVG file
271272

272273
# Set the verbose flags. This controls how much information
273274
# matplotlib gives you at runtime and where it goes. The verbosity

lib/matplotlib/patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def get_verts(self):
675675

676676
# a point on the segment 20% of the distance from the tip to the base
677677
theta = math.atan2(y2-y1, x2-x1)
678-
r = math.sqrt((y2-y1)**2. + (x2-x1)*2.)
678+
r = math.sqrt((y2-y1)**2. + (x2-x1)**2.)
679679
xm = x1 + self.frac * r * math.cos(theta)
680680
ym = y1 + self.frac * r * math.sin(theta)
681681
xc1, yc1, xc2, yc2 = self.getpoints(x1, y1, xm, ym, k1)

src/_transforms.cpp

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
#include <functional>
22
#include <limits>
3-
3+
#include <math.h>
44

55
#include "_transforms.h"
66
#include "mplutils.h"
77
#include "MPL_isnan.h"
88

9-
#ifdef NUMARRAY
10-
# include "numarray/arrayobject.h"
11-
#else
12-
# ifdef NUMERIC
13-
# include "Numeric/arrayobject.h"
14-
# else
15-
# define PY_ARRAY_TYPES_PREFIX NumPy
16-
# include "numpy/arrayobject.h"
17-
# endif
18-
#endif
9+
10+
#include "numpy/arrayobject.h"
11+
#include "numpy/ufuncobject.h"
12+
13+
14+
bool skip_float(double x) {
15+
return !MPL_isnan64(x) && !isinf(x);
16+
}
1917

2018
Value::~Value() {
2119
_VERBOSE("Value::~Value");
@@ -169,16 +167,17 @@ Interval::update(const Py::Tuple &args) {
169167
double minx = _val1->val();
170168
double maxx = _val2->val();
171169

170+
171+
172172
double thisval;
173-
if (ignore) {
174-
thisval = Py::Float(vals[0]);
173+
thisval = Py::Float(vals[0]);
174+
if (ignore) {
175175
minx = thisval;
176176
maxx = thisval;
177177
}
178178

179179

180180
for (size_t i=0; i<Nval; ++i) {
181-
thisval = Py::Float(vals[i]);
182181
if (thisval<minx) minx = thisval;
183182
if (thisval>maxx) maxx = thisval;
184183
_minpos->update(thisval);
@@ -2403,28 +2402,11 @@ NonseparableTransformation::init_type()
24032402

24042403
extern "C"
24052404
DL_EXPORT(void)
2406-
#ifdef NUMARRAY
2407-
init_na_transforms(void)
2408-
#else
2409-
# ifdef NUMERIC
2410-
init_nc_transforms(void)
2411-
# else
2412-
init_ns_transforms(void)
2413-
# endif
2414-
#endif
2405+
init_ns_transforms(void)
24152406
{
24162407
static _transforms_module* _transforms = new _transforms_module;
24172408

2418-
#ifdef NUMARRAY
2419-
_VERBOSE("init_na_transforms");
2420-
#else
2421-
# ifdef NUMERIC
2422-
_VERBOSE("init_nc_transforms");
2423-
# else
24242409
_VERBOSE("init_ns_transforms");
2425-
# endif
2426-
#endif
2427-
24282410
import_array();
24292411

24302412
Py::Dict d = _transforms->moduleDictionary();

unit/memleak_hawaii3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
rand = nx.mlab.rand
1414

15-
indStart, indEnd = 30, 201
15+
indStart, indEnd = 200, 401
1616
for i in range(indEnd):
1717

1818
fig = figure(1)

0 commit comments

Comments
 (0)