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

Skip to content

Commit 7e8b315

Browse files
committed
Added a Qt4Agg backend
svn path=/trunk/matplotlib/; revision=2529
1 parent c0d6110 commit 7e8b315

6 files changed

Lines changed: 488 additions & 14 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2006-06-29 Added a Qt4Agg backend. Thank you James Amundson - DSD
2+
13
2006-06-26 Fixed a usetex bug. On windows, usetex will prcess
24
postscript output in the current directory rather than
35
in a temp directory. This is due to the use of spaces

lib/matplotlib/__init__.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ def validate_int(s):
466466

467467
def validate_backend(s, fail_on_err = True):
468468
s=s.lower()
469-
backends = ['Agg2', 'Agg', 'Aqt', 'Cairo', 'CocoaAgg', 'EMF', 'GD', 'GDK', 'GTK',
470-
'GTKAgg', 'GTKCairo', 'FltkAgg', 'Paint', 'Pdf', 'PS', 'QtAgg', 'SVG',
471-
'Template', 'TkAgg', 'WX', 'WXAgg', ]
469+
backends = ['Agg2', 'Agg', 'Aqt', 'Cairo', 'CocoaAgg', 'EMF', 'GD', 'GDK',
470+
'GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'Paint', 'Pdf', 'PS',
471+
'QtAgg', 'Qt4Agg', 'SVG', 'Template', 'TkAgg', 'WX', 'WXAgg']
472472
for i in backends:
473473
if s == i.lower(): return i
474474
if fail_on_err: raise ValueError('Backend must be %s, or %s'% \
@@ -797,16 +797,19 @@ def __call__(self, s):
797797
'polaraxes.grid' : [True, validate_bool], # display polar grid or not
798798

799799
#legend properties
800-
'legend.isaxes' : [True,validate_bool],
801-
'legend.numpoints' : [ 4,validate_int], # the number of points in the legend line
800+
'legend.isaxes' : [True,validate_bool],
801+
'legend.numpoints' : [ 4,validate_int], # the number of points in the legend line
802802
'legend.fontsize' : ["small",validate_fontsize],
803-
'legend.pad' : [ 0.2, validate_float], # the fractional whitespace inside the legend border
804-
'legend.markerscale' : [ 0.6, validate_float], # the relative size of legend markers vs. original
803+
'legend.pad' : [ 0.2, validate_float], # the fractional whitespace inside the legend border
804+
'legend.markerscale' : [ 0.6, validate_float], # the relative size of legend markers vs. original
805+
806+
805807
# the following dimensions are in axes coords
806-
'legend.labelsep' : [ 0.005, validate_float], # the vertical space between the legend entries
807-
'legend.handlelen' : [ 0.05, validate_float], # the length of the legend lines
808-
'legend.handletextsep' : [ 0.02, validate_float], # the space between the legend line and legend text
809-
'legend.axespad' : [ 0.02, validate_float], # the border between the axes and legend edge
808+
'legend.labelsep' : [ 0.005, validate_float], # the vertical space between the legend entries
809+
'legend.handlelen' : [ 0.05, validate_float], # the length of the legend lines
810+
'legend.handletextsep' : [ 0.02, validate_float], # the space between the legend line and legend text
811+
'legend.axespad' : [ 0.02, validate_float], # the border between the axes and legend edge
812+
810813
'legend.shadow' : [ False, validate_bool ],
811814

812815

lib/matplotlib/backends/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
__all__ = ['backend','show','draw_if_interactive',
55
'new_figure_manager', 'backend_version']
66

7-
interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'TkAgg',
8-
'WX', 'WXAgg', 'CocoaAgg', 'Aqt']
7+
interactive_bk = ['GTK', 'GTKAgg', 'GTKCairo', 'FltkAgg', 'QtAgg', 'Qt4Agg',
8+
'TkAgg', 'WX', 'WXAgg', 'CocoaAgg', 'Aqt']
99
non_interactive_bk = ['Agg2', 'Agg', 'Cairo', 'EMF', 'GD', 'GDK', 'Paint',
10-
'Pdf', 'PS', 'SVG', 'Template']
10+
'Pdf', 'PS', 'SVG', 'Template']
1111
all_backends = interactive_bk + non_interactive_bk
1212

1313
backend = matplotlib.get_backend()

lib/matplotlib/backends/backend_qt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def set_history_buttons( self ):
324324

325325
# set icon used when windows are minimized
326326
try:
327+
# TODO: This is badly broken
327328
qt.window_set_default_icon_from_file (
328329
os.path.join( matplotlib.rcParams['datapath'], 'matplotlib.svg' ) )
329330
except:

0 commit comments

Comments
 (0)