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

Skip to content

Commit c179759

Browse files
committed
added Nick's picker patch
svn path=/trunk/matplotlib/; revision=1431
1 parent f4b4314 commit c179759

4 files changed

Lines changed: 17 additions & 8 deletions

File tree

lib/matplotlib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"""
143143
from __future__ import generators
144144

145-
__version__ = '0.81rc1'
145+
__version__ = '0.81'
146146
__revision__ = '$Revision$'
147147
__date__ = '$Date$'
148148

@@ -578,7 +578,7 @@ def validate_tex_engine(s):
578578
'ps.papersize' : [ 'letter', validate_ps_papersize], # Set the papersize/type
579579
'ps.useafm' : [ False, validate_bool], # Set PYTHONINSPECT
580580
'ps.usedistiller' : [ False, validate_bool], # use ghostscript to distill ps output
581-
'ps.distiller.res' : [600, validate_int], # dpi
581+
'ps.distiller.res' : [6000, validate_int], # dpi
582582
'plugins.directory' : ['.matplotlib_plugins', str], # where plugin directory is locate
583583

584584
}

lib/matplotlib/axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3621,7 +3621,7 @@ def dist(a):
36213621
return dist_x_y(xywin, asarray(xt), asarray(yt))
36223622

36233623
artists = self.lines + self.patches + self.texts
3624-
if callable(among):
3624+
if among is not None and callable(among):
36253625
artists = filter(test, artists)
36263626
elif iterable(among):
36273627
amongd = dict([(k,1) for k in among])

lib/matplotlib/backends/backend_agg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,10 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath):
215215
font.set_text(s, angle)
216216
font.draw_glyphs_to_bitmap()
217217

218+
#print x, y, int(x), int(y)
219+
218220
self._renderer.draw_text(font, int(x), int(y), gc)
219-
221+
220222

221223
def get_text_width_height(self, s, prop, ismath, rgb=(0,0,0)):
222224
"""

src/_backend_agg.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,10 +1460,17 @@ RendererAgg::draw_text(const Py::Tuple& args) {
14601460

14611461

14621462
FT2Font *font = static_cast<FT2Font*>(args[0].ptr());
1463-
1464-
int x = Py::Int( args[1] );
1465-
int y = Py::Int( args[2] );
1466-
1463+
1464+
int x(0),y(0);
1465+
try {
1466+
x = Py::Int( args[1] );
1467+
y = Py::Int( args[2] );
1468+
}
1469+
catch (Py::TypeError) {
1470+
//x,y out of range; todo issue warning?
1471+
return Py::Object();
1472+
}
1473+
14671474
GCAgg gc = GCAgg(args[3], dpi);
14681475

14691476
set_clipbox_rasterizer( gc.cliprect);

0 commit comments

Comments
 (0)