Skip to content

Commit 9979d2b

Browse files
committed
fixed ps color bug
svn path=/trunk/matplotlib/; revision=980
1 parent 9f1d839 commit 9979d2b

14 files changed

+358
-230
lines changed

API_CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ API CHANGES in matplotlib-0.73
44

55
Removed all error handling from the verbose object
66

7+
figure num of zero is now allowed
8+
79
API CHANGES in matplotlib-0.72
810

911
Line2D, Text, and Patch copy_properties renamed update_from and

CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
New entries should be added at the top
22

3+
2005-02-121 fixed ps color bug - JDH
4+
5+
2005-02-15 fixed missing qt file
6+
37
2005-02-15 banished error_msg and report_error. Internal backend
48
methods like error_msg_gtk are preserved. backend writers,
59
check your backends, and diff against 0.72 to make sure I

LICENSE/LICENSE_enthought.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Copyright (c) 2001, 2002 Enthought, Inc.
2+
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
a. Redistributions of source code must retain the above copyright notice,
9+
this list of conditions and the following disclaimer.
10+
b. Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
c. Neither the name of the Enthought nor the names of its contributors
14+
may be used to endorse or promote products derived from this software
15+
without specific prior written permission.
16+
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
22+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
28+
DAMAGE.
29+

MANIFEST

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ CHANGELOG
44
INSTALL
55
INTERACTIVE
66
KNOWN_BUGS
7-
MANIFEST
87
MANIFEST.in
98
Makefile
109
NUMARRAY_ISSUES
@@ -331,6 +330,7 @@ examples/major_minor_demo1.py
331330
examples/major_minor_demo2.py
332331
examples/mathtext_demo.py
333332
examples/matplotlib_icon.py
333+
examples/matshow.py
334334
examples/movie_demo.py
335335
examples/mpl_with_glade.glade
336336
examples/mpl_with_glade.py
@@ -528,7 +528,6 @@ lib/matplotlib/image.py
528528
lib/matplotlib/legend.py
529529
lib/matplotlib/lines.py
530530
lib/matplotlib/mathtext.py
531-
lib/matplotlib/matlab.py
532531
lib/matplotlib/mlab.py
533532
lib/matplotlib/patches.py
534533
lib/matplotlib/path.py
@@ -551,13 +550,62 @@ lib/matplotlib/backends/backend_gtkagg.py
551550
lib/matplotlib/backends/backend_gtkcairo.py
552551
lib/matplotlib/backends/backend_paint.py
553552
lib/matplotlib/backends/backend_ps.py
553+
lib/matplotlib/backends/backend_qt.py
554554
lib/matplotlib/backends/backend_qtagg.py
555555
lib/matplotlib/backends/backend_svg.py
556556
lib/matplotlib/backends/backend_template.py
557557
lib/matplotlib/backends/backend_tkagg.py
558558
lib/matplotlib/backends/backend_wx.py
559559
lib/matplotlib/backends/backend_wxagg.py
560560
lib/matplotlib/backends/tkagg.py
561+
lib/matplotlib/enthought/__init__.py
562+
lib/matplotlib/enthought/resource/__init__.py
563+
lib/matplotlib/enthought/resource/resource_factory.py
564+
lib/matplotlib/enthought/resource/resource_manager.py
565+
lib/matplotlib/enthought/resource/resource_path.py
566+
lib/matplotlib/enthought/resource/resource_reference.py
567+
lib/matplotlib/enthought/traits/__init__.py
568+
lib/matplotlib/enthought/traits/category.py
569+
lib/matplotlib/enthought/traits/ctraits.c
570+
lib/matplotlib/enthought/traits/has_traits.py
571+
lib/matplotlib/enthought/traits/info_traits.py
572+
lib/matplotlib/enthought/traits/standard.py
573+
lib/matplotlib/enthought/traits/trait_base.py
574+
lib/matplotlib/enthought/traits/trait_db.py
575+
lib/matplotlib/enthought/traits/trait_errors.py
576+
lib/matplotlib/enthought/traits/trait_handlers.py
577+
lib/matplotlib/enthought/traits/trait_notifiers.py
578+
lib/matplotlib/enthought/traits/trait_numeric.py
579+
lib/matplotlib/enthought/traits/traits.py
580+
lib/matplotlib/enthought/traits/ui/__init__.py
581+
lib/matplotlib/enthought/traits/ui/editor.py
582+
lib/matplotlib/enthought/traits/ui/editor_factory.py
583+
lib/matplotlib/enthought/traits/ui/editors.py
584+
lib/matplotlib/enthought/traits/ui/group.py
585+
lib/matplotlib/enthought/traits/ui/handler.py
586+
lib/matplotlib/enthought/traits/ui/help.py
587+
lib/matplotlib/enthought/traits/ui/help_template.py
588+
lib/matplotlib/enthought/traits/ui/helper.py
589+
lib/matplotlib/enthought/traits/ui/include.py
590+
lib/matplotlib/enthought/traits/ui/item.py
591+
lib/matplotlib/enthought/traits/ui/menu.py
592+
lib/matplotlib/enthought/traits/ui/toolkit.py
593+
lib/matplotlib/enthought/traits/ui/tree_node.py
594+
lib/matplotlib/enthought/traits/ui/ui.py
595+
lib/matplotlib/enthought/traits/ui/ui_info.py
596+
lib/matplotlib/enthought/traits/ui/ui_traits.py
597+
lib/matplotlib/enthought/traits/ui/undo.py
598+
lib/matplotlib/enthought/traits/ui/view.py
599+
lib/matplotlib/enthought/traits/ui/view_element.py
600+
lib/matplotlib/enthought/traits/ui/view_elements.py
601+
lib/matplotlib/enthought/traits/ui/null/__init__.py
602+
lib/matplotlib/enthought/traits/ui/null/color_trait.py
603+
lib/matplotlib/enthought/traits/ui/null/font_trait.py
604+
lib/matplotlib/enthought/traits/ui/null/rgb_color_trait.py
605+
lib/matplotlib/enthought/traits/ui/null/rgba_color_trait.py
606+
lib/matplotlib/enthought/traits/ui/null/toolkit.py
607+
lib/matplotlib/enthought/util/__init__.py
608+
lib/matplotlib/enthought/util/resource.py
561609
lib/matplotlib/numerix/__init__.py
562610
lib/matplotlib/numerix/_na_imports.py
563611
lib/matplotlib/numerix/_nc_imports.py

TODO

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ ZeroDivisionError: SeparableTransformation::eval_scalars yin interval is zero; c
535535

536536
-- user events and nav event clashing on tkagg coords_demo/win32
537537

538-
-- check signal connect and disconnect in interactive use with
538+
-- DONE check signal connect and disconnect in interactive use with
539539
multiple figure creation / deletion etc.
540540

541541
-- DONE add xlim, ylim
@@ -583,13 +583,13 @@ ZeroDivisionError: SeparableTransformation::eval_scalars yin interval is zero; c
583583

584584
-- Humufr errobar
585585

586-
-- why is tkagg loading init 2x
586+
-- DONE why is tkagg loading init 2x
587587

588588
-- DONE add ishold and spy
589589

590590
-- Humufr's shared ticker bug
591591

592-
-- figure should increment the figure if one already exists
592+
-- DONE figure should increment the figure if one already exists
593593

594594
-- CLOSED oplot
595595

@@ -644,5 +644,13 @@ ZeroDivisionError: SeparableTransformation::eval_scalars yin interval is zero; c
644644

645645
-- DONE make subplot delaxes on other subplots under it.
646646

647-
-- fix transoffset->operator calls in _backend_agg.cpp to handle
647+
-- DONE fix transoffset->operator calls in _backend_agg.cpp to handle
648648
exceptions
649+
650+
-- keypress mods on pan/zoom broken in QT in linux
651+
652+
-- linestyles in contour
653+
654+
-- check stabar in wx with toolbar = None or classic
655+
656+
-- nan handling?

lib/matplotlib/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from __future__ import generators
21
"""
32
This is a matlab(TM) style functional interface the matplotlib.
43
@@ -140,6 +139,8 @@
140139
Most of the other commands are from the Numeric, MLab and FFT, with
141140
the exception of those in mlab.py provided by matplotlib.
142141
"""
142+
from __future__ import generators
143+
143144
__version__ = '0.72'
144145
__revision__ = '$Revision$'
145146
__date__ = '$Date$'

lib/matplotlib/axes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,6 +2459,11 @@ def set_position(self, pos):
24592459
in relative 0,1 coords
24602460
24612461
ACCEPTS: len(4) sequence of floats"""
2462+
l,b,w,h = pos
2463+
r = b+w
2464+
t = l+h
2465+
if w==0 or h==0:
2466+
raise ValueError('zero width or height illegal')
24622467
for num,val in zip(pos, self._position):
24632468
val.set(num)
24642469

lib/matplotlib/backends/backend_agg.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ def draw(self):
307307
"""
308308
if __debug__: verbose.report('FigureCanvasAgg.draw', 'debug-annoying')
309309

310+
renderer = self.get_renderer()
311+
self.figure.draw(renderer)
312+
313+
def get_renderer(self):
310314
l,b,w,h = self.figure.bbox.get_bounds()
311315
key = w, h, self.figure.dpi.get()
312316
try: self._lastKey, self.renderer
@@ -316,8 +320,8 @@ def draw(self):
316320
if need_new_renderer:
317321
self.renderer = RendererAgg(w, h, self.figure.dpi)
318322
self._lastKey = key
319-
self.figure.draw(self.renderer)
320-
323+
return self.renderer
324+
321325
def tostring_rgb(self):
322326
if __debug__: verbose.report('FigureCanvasAgg.tostring_rgb', 'debug-annoying')
323327
return self.renderer.tostring_rgb()

lib/matplotlib/backends/backend_ps.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def set_color(self, r, g, b, store=1):
100100
self._pswriter.write("%1.3f setgray\n"%r)
101101
else:
102102
self._pswriter.write("%1.3f %1.3f %1.3f setrgbcolor\n"%(r,g,b))
103-
self.color = (r,g,b)
103+
if store: self.color = (r,g,b)
104104

105105
def set_linewidth(self, linewidth):
106106
if linewidth != self.linewidth:
@@ -315,8 +315,6 @@ def _draw_markers(self, gc, path, x, y, transform):
315315
# apply affine transform x and y to define marker center
316316
#draw_marker_here
317317

318-
print 'I did nothing!'
319-
320318
def _draw_lines(self, gc, points):
321319
"""
322320
Draw many lines. 'points' is a list of point coordinates.

lib/matplotlib/backends/backend_qt.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ class FigureCanvasQT( qt.QWidget, FigureCanvasBase ):
7272
qt.Qt.Key_Shift : 'shift',
7373
qt.Qt.Key_Alt : 'alt',
7474
}
75-
75+
# left 1, middle 2, right 3
76+
buttond = {1:1, 2:3, 4:2}
7677
def __init__( self, figure ):
7778
if DEBUG: print 'FigureCanvasQt: ', figure
7879
FigureCanvasBase.__init__( self, figure )
@@ -87,7 +88,9 @@ def mousePressEvent( self, event ):
8788
x = event.pos().x()
8889
# flipy so y=0 is bottom of canvas
8990
y = self.figure.bbox.height() - event.pos().y()
90-
FigureCanvasBase.button_press_event( self, x, y, event.button() )
91+
#print 'event.button()', event.button()
92+
button = self.buttond[event.button()]
93+
FigureCanvasBase.button_press_event( self, x, y, button )
9194
if DEBUG: print 'button pressed'
9295

9396
def mouseMoveEvent( self, event ):
@@ -101,7 +104,8 @@ def mouseReleaseEvent( self, event ):
101104
x = event.x()
102105
# flipy so y=0 is bottom of canvas
103106
y = self.figure.bbox.height() - event.y()
104-
FigureCanvasBase.button_release_event( self, x, y, event.button() )
107+
button = button = self.buttond[event.button()]
108+
FigureCanvasBase.button_release_event( self, x, y, button )
105109
if DEBUG: print 'button released'
106110
self.draw()
107111

@@ -189,7 +193,9 @@ def __init__( self, canvas, window ):
189193
self.canvas = canvas
190194
qt.QToolBar.__init__( self, "Navigator2", window, qt.Qt.DockBottom )
191195
NavigationToolbar2.__init__( self, canvas )
192-
196+
# If we don't do this, the status bar is hidden until needed.
197+
self.window.statusBar().message( " " )
198+
193199
def _init_toolbar( self ):
194200
self.window.setUsesTextLabel( False )
195201
basedir = matplotlib.rcParams[ 'datapath' ]

lib/matplotlib/cm.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
LUTSIZE = rcParams['image.lut']
1111

1212

13-
_cool_data = {'red': ((),()),
14-
'green': ((),()),
15-
'blue': ((),())}
1613

1714
_bone_data = {'red': ((0., 0., 0.),(1.0, 1.0, 1.0)),
1815
'green': ((0., 0., 0.),(1.0, 1.0, 1.0)),

lib/matplotlib/pylab.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -787,11 +787,6 @@ def figure(num=None, # autoincrement if None, else integer from 1-N
787787
if facecolor is None : facecolor = rcParams['figure.facecolor']
788788
if edgecolor is None : edgecolor = rcParams['figure.edgecolor']
789789

790-
791-
if num==0:
792-
raise ValueError('Figure number can not be 0.\n' + \
793-
'Hey, give me a break, this is matlab(TM) compatability')
794-
795790
if num is None:
796791
allnums = [f.num for f in _pylab_helpers.Gcf.get_all_fig_managers()]
797792
if allnums:

setupext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ def build_enthought(ext_modules, packages):
495495
packages.extend(['matplotlib/enthought',
496496
'matplotlib/enthought/traits',
497497
'matplotlib/enthought/traits/ui',
498-
'matplotlib/enthought/traits/ui/null',
498+
'matplotlib/enthought/traits/ui/null',
499499
'matplotlib/enthought/resource',
500500
'matplotlib/enthought/util',
501501
])

0 commit comments

Comments
 (0)