Skip to content

Commit

Permalink
fixed tkagg blit problem
Browse files Browse the repository at this point in the history
svn path=/trunk/matplotlib/; revision=1876
  • Loading branch information
jdh2358 committed Nov 18, 2005
1 parent 4a595e0 commit a7425ff
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 32 deletions.
32 changes: 19 additions & 13 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
2005-11-16 Changed the default default linewidth in rc to 1.0

2005-11-16 Replaced agg_to_gtk_drawable with pure pygtk pixbuf code in
backend_gtkagg. When the equivalent is doe for blit, the
agg extension code will no longer be needed

2005-11-16 Added a maxdict item to cbook to prevent caches from
growing w/o bounds

2005-11-15 Fixed a colorup/colordown reversal bug in finance.py --
Thanks Gilles

2005-11-15 New entries should be added at the top 2005-08-14 Applied
Jouni K Steppanen's boxplot patch SF patch#1349997 - JDH
2005-11-15 Applied Jouni K Steppanen's boxplot patch SF patch#1349997
- JDH


2005-11-09 added axisbelow attr for Axes to determine whether ticks and such
are above or below the actors

2005-11-08 Added Nicolas' irregularly spaced image patch


2005-11-08 Deprecated HorizontalSpanSelector and replaced with
SpanSelection that takes a third arg, direction. The
new SpanSelector supports horizontal and vertical span
selection, and the appropriate min/max is returned. - CM

2005-11-16 Added a maxdict item to cbook to prevent caches from
growing w/o bounds

2005-11-09 added axisbelow attr for Axes to determine whether ticks and such
are above or below the actors

2005-11-08 Added lineprops dialog for gtk

2005-11-03 Added FIFOBuffer class to mlab to support real time feeds
Expand All @@ -33,10 +37,9 @@
2005-10-26 Added support for scatter legends - thanks John Gill

2005-10-20 Fixed image clipping bug that made some tex labels
disappear. Closes bug - JDH
disappear. JDH

2005-10-14 Removed aqrt from dvipng 1.6 alpha channel mask. Where did
that come from?
2005-10-14 Removed sqrt from dvipng 1.6 alpha channel mask.

2005-10-14 Added width kwarg to hist function

Expand All @@ -54,6 +57,9 @@
colorbar will follow suit. Fixed a bug introduced in
0.84, in which contourf(...,colors=...) was broken - EF

=======================================================================
2005-09-19 Released 0.84

2005-09-14 Added a new 'resize_event' which triggers a callback with a
backend_bases.ResizeEvent object - JDH

Expand Down Expand Up @@ -89,7 +95,7 @@
Added two new keyword args (cspacing and clabels) that are
only relevant for ContourMappable images - JSWHIT

2005-08-24 Fixes a PS image bug reported by Darren - JDH
2005-08-24 Fixed a PS image bug reported by Darren - JDH

2005-08-23 colors.py: change hex2color() to accept unicode strings as well as
normal strings. Use isinstance() instead of types.IntType etc - SC
Expand Down Expand Up @@ -118,7 +124,7 @@

2005-07-03 Fixed a bug related to TeX commands in backend_ps

2005-08-03 Fixed SVG images to respect uppoer and lower origins.
2005-08-03 Fixed SVG images to respect upper and lower origins.

2005-08-03 Added flipud method to image and removed it from to_str.

Expand Down
20 changes: 10 additions & 10 deletions LICENSE/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LICENSE AGREEMENT FOR MATPLOTLIB 0.84
LICENSE AGREEMENT FOR MATPLOTLIB 0.85
--------------------------------------

1. This LICENSE AGREEMENT is between John D. Hunter ("JDH"), and the
Expand All @@ -9,30 +9,30 @@ documentation.
2. Subject to the terms and conditions of this License Agreement, JDH
hereby grants Licensee a nonexclusive, royalty-free, world-wide license
to reproduce, analyze, test, perform and/or display publicly, prepare
derivative works, distribute, and otherwise use matplotlib 0.84
derivative works, distribute, and otherwise use matplotlib 0.85
alone or in any derivative version, provided, however, that JDH's
License Agreement and JDH's notice of copyright, i.e., "Copyright (c)
2002-2005 John D. Hunter; All Rights Reserved" are retained in
matplotlib 0.84 alone or in any derivative version prepared by
matplotlib 0.85 alone or in any derivative version prepared by
Licensee.

3. In the event Licensee prepares a derivative work that is based on or
incorporates matplotlib 0.84 or any part thereof, and wants to
incorporates matplotlib 0.85 or any part thereof, and wants to
make the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to matplotlib 0.84.
the changes made to matplotlib 0.85.

4. JDH is making matplotlib 0.84 available to Licensee on an "AS
4. JDH is making matplotlib 0.85 available to Licensee on an "AS
IS" basis. JDH MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, JDH MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.84
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF MATPLOTLIB 0.85
WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.

5. JDH SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF MATPLOTLIB
0.84 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
0.85 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING
MATPLOTLIB 0.84, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
MATPLOTLIB 0.85, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF
THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material
Expand All @@ -44,6 +44,6 @@ Licensee. This License Agreement does not grant permission to use JDH
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.

8. By copying, installing or otherwise using matplotlib 0.84,
8. By copying, installing or otherwise using matplotlib 0.85,
Licensee agrees to be bound by the terms and conditions of this License
Agreement.
4 changes: 3 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -733,4 +733,6 @@ ZeroDivisionError: SeparableTransformation::eval_scalars yin interval is zero; c
-- John Gill's patch!

-- Fix latex texmanager caching bug that is preventing the cache from
recognizing a font change
recognizing a font change

-- handle lineprops.glade install file
21 changes: 18 additions & 3 deletions examples/mpl_with_glade.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def on_buttonClickMe_clicked(event):

class WidgetsWrapper:
def __init__(self):
self.widgets = gtk.glade.XML('test.glade')
self.widgets = gtk.glade.XML('mpl_with_glade.glade')
self.widgets.signal_autoconnect(GladeHandlers.__dict__)

self['windowMain'].connect('destroy', lambda x: gtk.main_quit())
Expand All @@ -55,12 +55,27 @@ def __init__(self):
self.canvas = FigureCanvas(self.figure) # a gtk.DrawingArea
self.canvas.show()
self.canvas.set_size_request(600, 400)
self.canvas.set_events(
gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.KEY_PRESS_MASK |
gtk.gdk.KEY_RELEASE_MASK
)
self.canvas.set_flags(gtk.HAS_FOCUS|gtk.CAN_FOCUS)
self.canvas.grab_focus()

def keypress(widget, event):
print 'key press'
def buttonpress(widget, event):
print 'button press'

self.canvas.connect('key_press_event', keypress)
self.canvas.connect('button_press_event', buttonpress)

def onselect(xmin, xmax):
print xmin, xmax

span = HorizontalSpanSelector(self.axis, onselect, useblit=False,
rectprops=dict(alpha=0.5, facecolor='red') )
#span = HorizontalSpanSelector(self.axis, onselect, useblit=False,
# rectprops=dict(alpha=0.5, facecolor='red') )


self['vboxMain'].pack_start(self.canvas, True, True)
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
from __future__ import generators


__version__ = '0.85.cvs'
__version__ = '0.85'
__revision__ = '$Revision$'
__date__ = '$Date$'

Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __init__(self,
facecolor = None, # defaults to rc figure.facecolor
edgecolor = None, # defaults to rc figure.edgecolor
linewidth = 1.0, # the default linewidth of the frame
frameon = True,
frameon = True, # whether or not to draw the figure frame
subplotpars = None, # default to rc
):
"""
Expand Down
2 changes: 1 addition & 1 deletion matplotlibrc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ timezone : UTC # a pytz timezone string, eg US/Central or Europe/Pari
### LINES
# See http://matplotlib.sourceforge.net/matplotlib.lines.html for more
# information on line properties.
lines.linewidth : 0.5 # line width in points
lines.linewidth : 1.0 # line width in points
lines.linestyle : - # solid line
lines.color : blue
lines.marker : None # the default marker
Expand Down
6 changes: 5 additions & 1 deletion src/_tkagg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
/* get array (or object that can be converted to array) pointer */
aggo = (PyObject*)atol(argv[2]);
RendererAgg *aggRenderer = (RendererAgg *)aggo;
int srcstride = aggRenderer->get_width()*4;
int srcwidth = (int)aggRenderer->get_width();
int srcheight = (int)aggRenderer->get_height();

/* XXX insert aggRenderer type check */

Expand All @@ -88,7 +91,8 @@ PyAggImagePhoto(ClientData clientdata, Tcl_Interp* interp,
t = bbox->ur_api()->y_api()->val();

destx = (int)l;
desty = (int)b;
desty = srcheight-(int)t;
//desty = (int)b;
destwidth = (int)(r-l);
destheight = (int)(t-b);
deststride = 4*destwidth;
Expand Down
2 changes: 1 addition & 1 deletion src/ft2font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ FT2Font::set_text(const Py::Tuple & args) {


Py::String text( args[0] );
std::string stdtext;
std::string stdtext="";
Py_UNICODE* pcode=NULL;
size_t N = 0;
if (PyUnicode_Check(text.ptr())) {
Expand Down

0 comments on commit a7425ff

Please sign in to comment.