Skip to content

Commit ed37eff

Browse files
committed
Get Gtk backend working.
svn path=/branches/transforms/; revision=4521
1 parent b56cd10 commit ed37eff

File tree

4 files changed

+162
-119
lines changed

4 files changed

+162
-119
lines changed

lib/matplotlib/axis.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(self, axes, loc, label,
8787
self._size = size
8888

8989
self._padPixels = self.figure.dpi * self._pad * (1/72.0)
90-
90+
9191
self.tick1line = self._get_tick1line()
9292
self.tick2line = self._get_tick2line()
9393
self.gridline = self._get_gridline()
@@ -97,7 +97,7 @@ def __init__(self, axes, loc, label,
9797
self.label2 = self._get_text2()
9898

9999
self.update_position(loc)
100-
100+
101101
self.gridOn = gridOn
102102
self.tick1On = tick1On
103103
self.tick2On = tick2On
@@ -114,7 +114,7 @@ def set_clip_path(self, clippath, transform=None):
114114
#self.tick2line.set_clip_path(clippath, transform)
115115
self.gridline.set_clip_path(clippath, transform)
116116
set_clip_path.__doc__ = Artist.set_clip_path.__doc__
117-
117+
118118
def contains(self, mouseevent):
119119
"""Test whether the mouse event occured in the Tick marks.
120120
@@ -189,7 +189,7 @@ def set_label1(self, s):
189189
"""
190190
self.label1.set_text(s)
191191
set_label = set_label1
192-
192+
193193
def set_label2(self, s):
194194
"""
195195
Set the text of ticklabel2
@@ -209,7 +209,7 @@ def get_view_interval(self):
209209
def set_view_interval(self, vmin, vmax, ignore=False):
210210
raise NotImplementedError('Derived must override')
211211

212-
212+
213213
class XTick(Tick):
214214
"""
215215
Contains all the Artists needed to make an x tick - the tick line,
@@ -223,7 +223,7 @@ def _get_text1(self):
223223
# x in data coords, y in axes coords
224224
#t = Text(
225225
trans, vert, horiz = self.axes.get_xaxis_text1_transform(self._padPixels)
226-
226+
227227
t = TextWithDash(
228228
x=0, y=0,
229229
fontproperties=FontProperties(size=rcParams['xtick.labelsize']),
@@ -320,10 +320,10 @@ def set_view_interval(self, vmin, vmax, ignore = False):
320320
else:
321321
Vmin, Vmax = self.get_view_interval()
322322
self.axes.viewLim.intervalx = min(vmin, Vmin), max(vmax, Vmax)
323-
323+
324324
def get_minpos(self):
325325
return self.axes.dataLim.minposx
326-
326+
327327
def get_data_interval(self):
328328
'return the Interval instance for this axis data limits'
329329
return self.axes.dataLim.intervalx
@@ -428,7 +428,7 @@ def update_position(self, loc):
428428

429429
self._loc = loc
430430

431-
431+
432432
def get_view_interval(self):
433433
'return the Interval instance for this axis view limits'
434434
return self.axes.viewLim.intervaly
@@ -439,10 +439,10 @@ def set_view_interval(self, vmin, vmax):
439439
else:
440440
Vmin, Vmax = self.get_view_interval()
441441
self.axes.viewLim.intervaly = min(vmin, Vmin), max(vmax, Vmax)
442-
442+
443443
def get_minpos(self):
444444
return self.axes.dataLim.minposy
445-
445+
446446
def get_data_interval(self):
447447
'return the Interval instance for this axis data limits'
448448
return self.axes.dataLim.intervaly
@@ -465,7 +465,7 @@ class Axis(Artist):
465465
"""
466466
LABELPAD = 5
467467
OFFSETTEXTPAD = 3
468-
468+
469469
def __str__(self):
470470
return str(self.__class__).split('.')[-1] \
471471
+ "(%d,%d)"%self.axes.transAxes.xy_tup((0,0))
@@ -493,23 +493,23 @@ def __init__(self, axes, pickradius=15):
493493
self.majorTicks = []
494494
self.minorTicks = []
495495
self.pickradius = pickradius
496-
496+
497497
self.cla()
498498
self.set_scale('linear')
499-
499+
500500
def get_transform(self):
501501
return self._scale.get_transform()
502502

503503
def get_scale(self):
504504
return self._scale.name
505-
505+
506506
def set_scale(self, value, **kwargs):
507507
self._scale = scale_factory(value, self, **kwargs)
508508
self._scale.set_default_locators_and_formatters(self)
509509

510510
def limit_range_for_scale(self, vmin, vmax):
511511
return self._scale.limit_range_for_scale(vmin, vmax, self.get_minpos())
512-
512+
513513
def get_children(self):
514514
children = [self.label]
515515
majorticks = self.get_major_ticks()
@@ -547,33 +547,33 @@ def cla(self):
547547
self.minorTicks.extend([self._get_tick(major=False)])
548548
self._lastNumMajorTicks = 1
549549
self._lastNumMinorTicks = 1
550-
550+
551551
self.converter = None
552552
self.units = None
553553
self.set_units(None)
554554

555555
def set_clip_path(self, clippath, transform=None):
556556
Artist.set_clip_path(self, clippath, transform)
557557
majorticks = self.get_major_ticks()
558-
minorticks = self.get_minor_ticks()
558+
minorticks = self.get_minor_ticks()
559559
for child in self.majorTicks + self.minorTicks:
560560
child.set_clip_path(clippath, transform)
561-
561+
562562
def get_view_interval(self):
563563
'return the Interval instance for this axis view limits'
564564
raise NotImplementedError('Derived must override')
565565

566566
def set_view_interval(self, vmin, vmax, ignore=False):
567567
raise NotImplementedError('Derived must override')
568-
568+
569569
def get_data_interval(self):
570570
'return the Interval instance for this axis data limits'
571571
raise NotImplementedError('Derived must override')
572572

573573
def set_data_interval(self):
574574
'Set the axis data limits'
575575
raise NotImplementedError('Derived must override')
576-
576+
577577
def _set_artist_props(self, a):
578578
if a is None: return
579579
a.set_figure(self.figure)
@@ -774,7 +774,7 @@ def get_major_ticks(self, numticks=None):
774774
for i in range(numticks - len(self.majorTicks)):
775775
tick = self._get_tick(major=True)
776776
self.majorTicks.append(tick)
777-
777+
778778
if self._lastNumMajorTicks < numticks:
779779
protoTick = self.majorTicks[0]
780780
for i in range(self._lastNumMajorTicks, len(self.majorTicks)):
@@ -798,7 +798,7 @@ def get_minor_ticks(self, numticks=None):
798798
for i in range(numticks - len(self.minorTicks)):
799799
tick = self._get_tick(major=False)
800800
self.minorTicks.append(tick)
801-
801+
802802
if self._lastNumMinorTicks < numticks:
803803
protoTick = self.minorTicks[0]
804804
for i in range(self._lastNumMinorTicks, len(self.minorTicks)):
@@ -1039,7 +1039,7 @@ def zoom(self, direction):
10391039
class XAxis(Axis):
10401040
__name__ = 'xaxis'
10411041
axis_name = 'x'
1042-
1042+
10431043
def contains(self,mouseevent):
10441044
"""Test whether the mouse event occured in the x axis.
10451045
"""
@@ -1120,7 +1120,7 @@ def _update_label_position(self, bboxes, bboxes2):
11201120
bbox = Bbox.union(bboxes)
11211121
bottom = bbox.y0
11221122
self.label.set_position( (x, bottom - self.LABELPAD*self.figure.dpi / 72.0))
1123-
1123+
11241124
else:
11251125
if not len(bboxes2):
11261126
top = self.axes.bbox.ymax
@@ -1141,7 +1141,7 @@ def _update_offset_text_position(self, bboxes, bboxes2):
11411141
bbox = Bbox.union(bboxes)
11421142
bottom = bbox.y0
11431143
self.offsetText.set_position((x, bottom-self.OFFSETTEXTPAD*self.figure.dpi/72.0))
1144-
1144+
11451145
def set_ticks_position(self, position):
11461146
"""
11471147
Set the ticks position (top, bottom, both, default or none)
@@ -1224,10 +1224,10 @@ def set_view_interval(self, vmin, vmax, ignore=False):
12241224
else:
12251225
Vmin, Vmax = self.get_view_interval()
12261226
self.axes.viewLim.intervalx = min(vmin, Vmin), max(vmax, Vmax)
1227-
1227+
12281228
def get_minpos(self):
12291229
return self.axes.dataLim.minposx
1230-
1230+
12311231
def get_data_interval(self):
12321232
'return the Interval instance for this axis data limits'
12331233
return self.axes.dataLim.intervalx
@@ -1244,7 +1244,7 @@ def set_data_interval(self, vmin, vmax, ignore=False):
12441244
class YAxis(Axis):
12451245
__name__ = 'yaxis'
12461246
axis_name = 'y'
1247-
1247+
12481248
def contains(self,mouseevent):
12491249
"""Test whether the mouse event occurred in the y axis.
12501250
@@ -1331,7 +1331,7 @@ def _update_label_position(self, bboxes, bboxes2):
13311331
left = bbox.x0
13321332

13331333
self.label.set_position( (left-self.LABELPAD*self.figure.dpi/72.0, y))
1334-
1334+
13351335
else:
13361336
if not len(bboxes2):
13371337
right = self.axes.bbox.xmax
@@ -1349,7 +1349,7 @@ def _update_offset_text_position(self, bboxes, bboxes2):
13491349
x,y = self.offsetText.get_position()
13501350
top = self.axes.bbox.ymax
13511351
self.offsetText.set_position((x, top+self.OFFSETTEXTPAD*self.figure.dpi/72.0))
1352-
1352+
13531353
def set_offset_position(self, position):
13541354
assert position == 'left' or position == 'right'
13551355

@@ -1445,10 +1445,10 @@ def set_view_interval(self, vmin, vmax, ignore=False):
14451445
else:
14461446
Vmin, Vmax = self.get_view_interval()
14471447
self.axes.viewLim.intervaly = min(vmin, Vmin), max(vmax, Vmax)
1448-
1448+
14491449
def get_minpos(self):
14501450
return self.axes.dataLim.minposy
1451-
1451+
14521452
def get_data_interval(self):
14531453
'return the Interval instance for this axis data limits'
14541454
return self.axes.dataLim.intervaly

0 commit comments

Comments
 (0)