You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
| 2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
| 2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
| 2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ef...@us...> - 2009-05-06 20:53:02
|
Revision: 7087
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7087&view=rev
Author: efiring
Date: 2009-05-06 20:52:55 +0000 (Wed, 06 May 2009)
Log Message:
-----------
Give a more descriptive name (multiprocess.py) to new example
Added Paths:
-----------
trunk/matplotlib/examples/misc/multiprocess.py
Removed Paths:
-------------
trunk/matplotlib/examples/misc/log.py
Deleted: trunk/matplotlib/examples/misc/log.py
===================================================================
--- trunk/matplotlib/examples/misc/log.py 2009-05-06 18:13:41 UTC (rev 7086)
+++ trunk/matplotlib/examples/misc/log.py 2009-05-06 20:52:55 UTC (rev 7087)
@@ -1,87 +0,0 @@
-#Demo of using multiprocessing for generating data in one process and plotting
-#in another.
-#Written by Robert Cimrman
-#Requires >= Python 2.6 for the multiprocessing module or having the
-#standalone processing module installed
-import time
-try:
- from multiprocessing import Process, Pipe
-except ImportError:
- from processing import Process, Pipe
-from Queue import Empty
-import numpy as np
-import pylab
-import gobject
-
-class ProcessPlotter(object):
-
- def __init__(self):
- self.x = []
- self.y = []
-
- def terminate(self):
- pylab.close('all')
-
- def poll_draw(self):
-
- def call_back():
- while 1:
- if not self.pipe.poll():
- break
-
- command = self.pipe.recv()
-
- if command is None:
- self.terminate()
- return False
-
- else:
- self.x.append(command[0])
- self.y.append(command[1])
- self.ax.plot(self.x, self.y, 'ro')
-
- self.fig.canvas.draw()
- return True
-
- return call_back
-
- def __call__(self, pipe):
- print 'starting plotter...'
-
- self.pipe = pipe
- self.fig = pylab.figure()
-
- self.ax = self.fig.add_subplot(111)
- self.gid = gobject.timeout_add(1000, self.poll_draw())
-
- print '...done'
- pylab.show()
-
-
-class NBPlot(object):
- def __init__(self):
- self.plot_pipe, plotter_pipe = Pipe()
- self.plotter = ProcessPlotter()
- self.plot_process = Process(target = self.plotter,
- args = (plotter_pipe,))
- self.plot_process.daemon = True
- self.plot_process.start()
-
- def plot(self, finished=False):
- send = self.plot_pipe.send
- if finished:
- send(None)
- else:
- data = np.random.random(2)
- send(data)
-
-def main():
- pl = NBPlot()
- for ii in xrange(10):
- pl.plot()
- time.sleep(0.5)
- raw_input('press Enter...')
- pl.plot(finished=True)
-
-if __name__ == '__main__':
- main()
Copied: trunk/matplotlib/examples/misc/multiprocess.py (from rev 7086, trunk/matplotlib/examples/misc/log.py)
===================================================================
--- trunk/matplotlib/examples/misc/multiprocess.py (rev 0)
+++ trunk/matplotlib/examples/misc/multiprocess.py 2009-05-06 20:52:55 UTC (rev 7087)
@@ -0,0 +1,87 @@
+#Demo of using multiprocessing for generating data in one process and plotting
+#in another.
+#Written by Robert Cimrman
+#Requires >= Python 2.6 for the multiprocessing module or having the
+#standalone processing module installed
+import time
+try:
+ from multiprocessing import Process, Pipe
+except ImportError:
+ from processing import Process, Pipe
+from Queue import Empty
+import numpy as np
+import pylab
+import gobject
+
+class ProcessPlotter(object):
+
+ def __init__(self):
+ self.x = []
+ self.y = []
+
+ def terminate(self):
+ pylab.close('all')
+
+ def poll_draw(self):
+
+ def call_back():
+ while 1:
+ if not self.pipe.poll():
+ break
+
+ command = self.pipe.recv()
+
+ if command is None:
+ self.terminate()
+ return False
+
+ else:
+ self.x.append(command[0])
+ self.y.append(command[1])
+ self.ax.plot(self.x, self.y, 'ro')
+
+ self.fig.canvas.draw()
+ return True
+
+ return call_back
+
+ def __call__(self, pipe):
+ print 'starting plotter...'
+
+ self.pipe = pipe
+ self.fig = pylab.figure()
+
+ self.ax = self.fig.add_subplot(111)
+ self.gid = gobject.timeout_add(1000, self.poll_draw())
+
+ print '...done'
+ pylab.show()
+
+
+class NBPlot(object):
+ def __init__(self):
+ self.plot_pipe, plotter_pipe = Pipe()
+ self.plotter = ProcessPlotter()
+ self.plot_process = Process(target = self.plotter,
+ args = (plotter_pipe,))
+ self.plot_process.daemon = True
+ self.plot_process.start()
+
+ def plot(self, finished=False):
+ send = self.plot_pipe.send
+ if finished:
+ send(None)
+ else:
+ data = np.random.random(2)
+ send(data)
+
+def main():
+ pl = NBPlot()
+ for ii in xrange(10):
+ pl.plot()
+ time.sleep(0.5)
+ raw_input('press Enter...')
+ pl.plot(finished=True)
+
+if __name__ == '__main__':
+ main()
Property changes on: trunk/matplotlib/examples/misc/multiprocess.py
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/v0_91_maint/examples/misc/log.py:5753-5771
/branches/v0_98_5_maint/examples/misc/log.py:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2009-05-06 18:13:50
|
Revision: 7086
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7086&view=rev
Author: ryanmay
Date: 2009-05-06 18:13:41 +0000 (Wed, 06 May 2009)
Log Message:
-----------
Add an example of an updating plot using (multi)processing. Credit goes to Robert Cimrman.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Added Paths:
-----------
trunk/matplotlib/examples/misc/log.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-05-05 17:27:23 UTC (rev 7085)
+++ trunk/matplotlib/CHANGELOG 2009-05-06 18:13:41 UTC (rev 7086)
@@ -1,9 +1,13 @@
======================================================================
-2009-05-05 Add Axes.get_legend_handles_labels method -JJL
+2009-05-05 Add an example that shows how to make a plot that updates
+ using data from another process. Thanks to Robert
+ Cimrman - RMM
-2009-05-04 Fix bug that Text.Annotation is still drawn while set to
- not visible.-JJL
+2009-05-05 Add Axes.get_legend_handles_labels method. - JJL
+2009-05-04 Fix bug that Text.Annotation is still drawn while set to
+ not visible. - JJL
+
2009-05-04 Added TJ's fill_betweenx patch - JDH
2009-05-02 Added options to plotfile based on question from
Added: trunk/matplotlib/examples/misc/log.py
===================================================================
--- trunk/matplotlib/examples/misc/log.py (rev 0)
+++ trunk/matplotlib/examples/misc/log.py 2009-05-06 18:13:41 UTC (rev 7086)
@@ -0,0 +1,87 @@
+#Demo of using multiprocessing for generating data in one process and plotting
+#in another.
+#Written by Robert Cimrman
+#Requires >= Python 2.6 for the multiprocessing module or having the
+#standalone processing module installed
+import time
+try:
+ from multiprocessing import Process, Pipe
+except ImportError:
+ from processing import Process, Pipe
+from Queue import Empty
+import numpy as np
+import pylab
+import gobject
+
+class ProcessPlotter(object):
+
+ def __init__(self):
+ self.x = []
+ self.y = []
+
+ def terminate(self):
+ pylab.close('all')
+
+ def poll_draw(self):
+
+ def call_back():
+ while 1:
+ if not self.pipe.poll():
+ break
+
+ command = self.pipe.recv()
+
+ if command is None:
+ self.terminate()
+ return False
+
+ else:
+ self.x.append(command[0])
+ self.y.append(command[1])
+ self.ax.plot(self.x, self.y, 'ro')
+
+ self.fig.canvas.draw()
+ return True
+
+ return call_back
+
+ def __call__(self, pipe):
+ print 'starting plotter...'
+
+ self.pipe = pipe
+ self.fig = pylab.figure()
+
+ self.ax = self.fig.add_subplot(111)
+ self.gid = gobject.timeout_add(1000, self.poll_draw())
+
+ print '...done'
+ pylab.show()
+
+
+class NBPlot(object):
+ def __init__(self):
+ self.plot_pipe, plotter_pipe = Pipe()
+ self.plotter = ProcessPlotter()
+ self.plot_process = Process(target = self.plotter,
+ args = (plotter_pipe,))
+ self.plot_process.daemon = True
+ self.plot_process.start()
+
+ def plot(self, finished=False):
+ send = self.plot_pipe.send
+ if finished:
+ send(None)
+ else:
+ data = np.random.random(2)
+ send(data)
+
+def main():
+ pl = NBPlot()
+ for ii in xrange(10):
+ pl.plot()
+ time.sleep(0.5)
+ raw_input('press Enter...')
+ pl.plot(finished=True)
+
+if __name__ == '__main__':
+ main()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-05-05 17:27:28
|
Revision: 7085
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7085&view=rev
Author: leejjoon
Date: 2009-05-05 17:27:23 +0000 (Tue, 05 May 2009)
Log Message:
-----------
Add Axes.get_legend_handles_labels method
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-05-05 03:27:48 UTC (rev 7084)
+++ trunk/matplotlib/CHANGELOG 2009-05-05 17:27:23 UTC (rev 7085)
@@ -1,4 +1,6 @@
======================================================================
+2009-05-05 Add Axes.get_legend_handles_labels method -JJL
+
2009-05-04 Fix bug that Text.Annotation is still drawn while set to
not visible.-JJL
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-05-05 03:27:48 UTC (rev 7084)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-05-05 17:27:23 UTC (rev 7085)
@@ -3761,6 +3761,41 @@
return lags, c, a, b
xcorr.__doc__ = cbook.dedent(xcorr.__doc__) % martist.kwdocd
+
+ def _get_legend_handles(self):
+ "return artists that will be used as handles for legend"
+ handles = self.lines[:]
+ handles.extend(self.patches)
+ handles.extend([c for c in self.collections
+ if isinstance(c, mcoll.LineCollection)])
+ handles.extend([c for c in self.collections
+ if isinstance(c, mcoll.RegularPolyCollection)])
+ return handles
+
+
+ def get_legend_handles_labels(self):
+ """
+ return handles and labels for legend
+
+ ax.legend() is equibalent to ::
+
+ h, l = ax.get_legend_handles_labels()
+ ax.legend(h, l)
+
+ """
+
+ handles = []
+ labels = []
+ for handle in self._get_legend_handles():
+ label = handle.get_label()
+ if (label is not None and
+ label != '' and not label.startswith('_')):
+ handles.append(handle)
+ labels.append(label)
+
+ return handles, labels
+
+
def legend(self, *args, **kwargs):
"""
call signature::
@@ -3867,24 +3902,8 @@
.. plot:: mpl_examples/api/legend_demo.py
"""
- def get_handles():
- handles = self.lines[:]
- handles.extend(self.patches)
- handles.extend([c for c in self.collections
- if isinstance(c, mcoll.LineCollection)])
- handles.extend([c for c in self.collections
- if isinstance(c, mcoll.RegularPolyCollection)])
- return handles
-
if len(args)==0:
- handles = []
- labels = []
- for handle in get_handles():
- label = handle.get_label()
- if (label is not None and
- label != '' and not label.startswith('_')):
- handles.append(handle)
- labels.append(label)
+ handles, labels = self.get_legend_handles_labels()
if len(handles) == 0:
warnings.warn("No labeled objects found. "
"Use label='...' kwarg on individual plots.")
@@ -3893,13 +3912,15 @@
elif len(args)==1:
# LABELS
labels = args[0]
- handles = [h for h, label in zip(get_handles(), labels)]
+ handles = [h for h, label in zip(self._get_legend_handles(),
+ labels)]
elif len(args)==2:
if is_string_like(args[1]) or isinstance(args[1], int):
# LABELS, LOC
labels, loc = args
- handles = [h for h, label in zip(get_handles(), labels)]
+ handles = [h for h, label in zip(self._get_legend_handles(),
+ labels)]
kwargs['loc'] = loc
else:
# LINES, LABELS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-05-05 03:28:01
|
Revision: 7084
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7084&view=rev
Author: leejjoon
Date: 2009-05-05 03:27:48 +0000 (Tue, 05 May 2009)
Log Message:
-----------
Better support for tick (tick label) color handling in axes_grid.axisline
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/text.py
trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py
trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py
trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py
Added Paths:
-----------
trunk/matplotlib/lib/mpl_toolkits/axes_grid/ChangeLog
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2009-05-04 20:14:40 UTC (rev 7083)
+++ trunk/matplotlib/lib/matplotlib/text.py 2009-05-05 03:27:48 UTC (rev 7084)
@@ -235,7 +235,7 @@
thisx, thisy = 0.0, 0.0
xmin, ymin = 0.0, 0.0
width, height = 0.0, 0.0
- lines = self._text.split('\n')
+ lines = self.get_text().split('\n')
whs = np.zeros((len(lines), 2))
horizLayout = np.zeros((len(lines), 4))
@@ -406,10 +406,10 @@
props = props.copy() # don't want to alter the pad externally
pad = props.pop('pad', 4)
pad = renderer.points_to_pixels(pad)
- if self._text == "":
+ if self.get_text() == "":
self.arrow_patch.set_patchA(None)
return
-
+
bbox = self.get_window_extent(renderer)
l,b,w,h = bbox.bounds
l-=pad/2.
@@ -451,7 +451,7 @@
if renderer is not None:
self._renderer = renderer
if not self.get_visible(): return
- if self._text=='': return
+ if self.get_text()=='': return
renderer.open_group('text', self.get_gid())
@@ -472,8 +472,8 @@
self._draw_bbox(renderer, posx, posy)
gc = renderer.new_gc()
- gc.set_foreground(self._color)
- gc.set_alpha(self._alpha)
+ gc.set_foreground(self.get_color())
+ gc.set_alpha(self.get_alpha())
gc.set_url(self._url)
if self.get_clip_on():
gc.set_clip_rectangle(self.clipbox)
@@ -604,7 +604,7 @@
need to know if the text has changed.
"""
x, y = self.get_position()
- return (x, y, self._text, self._color,
+ return (x, y, self.get_text(), self._color,
self._verticalalignment, self._horizontalalignment,
hash(self._fontproperties), self._rotation,
self.figure.dpi, id(self._renderer),
@@ -650,7 +650,7 @@
if dpi is not None:
dpi_orig = self.figure.dpi
self.figure.dpi = dpi
- if self._text == '':
+ if self.get_text() == '':
tx, ty = self._get_xy_display()
return Bbox.from_bounds(tx,ty,0,0)
Added: trunk/matplotlib/lib/mpl_toolkits/axes_grid/ChangeLog
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/ChangeLog (rev 0)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/ChangeLog 2009-05-05 03:27:48 UTC (rev 7084)
@@ -0,0 +1,8 @@
+2009-05-04 Jae-Joon Lee <lee...@gm...>
+
+ * inset_locator.py (inset_axes, zoomed_inset_axes): axes_class support
+
+ * axislines.py : Better support for tick (tick label) color
+ handling
+ (Axes.get_children): fix typo
+
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py 2009-05-04 20:14:40 UTC (rev 7083)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axislines.py 2009-05-05 03:27:48 UTC (rev 7084)
@@ -200,16 +200,18 @@
nth_coord = 1
elif loc in ["bottom", "top"]:
nth_coord = 0
+
+ self.nth_coord = nth_coord
+ self.axis = [self.axes.xaxis, self.axes.yaxis][self.nth_coord]
+
+ super(AxisLineHelper.Fixed, self).__init__(loc)
+
if passingthrough_point is None:
passingthrough_point = self._default_passthru_pt[loc]
if label_direction is None:
label_direction = loc
- super(AxisLineHelper.Fixed, self).__init__(loc)
- self.nth_coord = nth_coord
- self.axis = [self.axes.xaxis, self.axes.yaxis][self.nth_coord]
-
self.passthru_pt = passingthrough_point
_verts = np.array([[0., 0.],
@@ -456,11 +458,48 @@
def __init__(self, ticksize, **kwargs):
self.ticksize = ticksize
self.locs_angles = []
+
+ self._axis = kwargs.pop("axis", None)
+ if self._axis is not None:
+ if "color" not in kwargs:
+ kwargs["color"] = "auto"
+ if ("mew" not in kwargs) and ("markeredgewidth" not in kwargs):
+ kwargs["markeredgewidth"] = "auto"
+
super(Ticks, self).__init__([0.], [0.], **kwargs)
- #self.set_color("k")
- self.set_mec("k")
- self.set_mew(0.5)
+
+ def get_color(self):
+ if self._color == 'auto':
+ if self._axis is not None:
+ ticklines = self._axis.get_ticklines()
+ if ticklines:
+ color_from_axis = ticklines[0].get_color()
+ return color_from_axis
+ return "k"
+
+ return super(Ticks, self).get_color()
+
+
+ def get_markeredgecolor(self):
+ if self._markeredgecolor == 'auto':
+ return self.get_color()
+ else:
+ return self._markeredgecolor
+
+ def get_markeredgewidth(self):
+ if self._markeredgewidth == 'auto':
+ if self._axis is not None:
+ ticklines = self._axis.get_ticklines()
+ if ticklines:
+ width_from_axis = ticklines[0].get_markeredgewidth()
+ return width_from_axis
+ return .5
+
+ else:
+ return self._markeredgewidth
+
+
def update_locs_angles(self, locs_angles, renderer):
self.locs_angles = locs_angles
@@ -494,7 +533,7 @@
gc = renderer.new_gc()
self._set_gc_clip(gc)
gc.set_foreground(self.get_markeredgecolor())
- gc.set_linewidth(self._markeredgewidth)
+ gc.set_linewidth(self.get_markeredgewidth())
gc.set_alpha(self._alpha)
offset = renderer.points_to_pixels(size)
@@ -515,16 +554,33 @@
class TickLabels(mtext.Text):
- def __init__(self, size, color):
+ def __init__(self, size, **kwargs):
self._locs_labels = []
+ self._axis = kwargs.pop("axis", None)
+ if self._axis is not None:
+ if "color" not in kwargs:
+ kwargs["color"] = "auto"
+
super(TickLabels, self).__init__(x=0., y=0., text="",
- color=color,
+ **kwargs
)
def update_locs_labels(self, locs_labels, renderer):
self._locs_labels = locs_labels
+ def get_color(self):
+ if self._color == 'auto':
+ if self._axis is not None:
+ ticklabels = self._axis.get_ticklabels()
+ if ticklabels:
+ color_from_axis = ticklabels[0].get_color()
+ return color_from_axis
+ return "k"
+
+ return super(TickLabels, self).get_color()
+
+
def draw(self, renderer):
if not self.get_visible(): return
@@ -549,6 +605,34 @@
#else:
# return Bbox.from_bounds(0, 0, 0, 0)
+
+class AxisLabel(mtext.Text):
+ def __init__(self, *kl, **kwargs):
+ self._axis = kwargs.pop("axis", None)
+ if self._axis is not None:
+ if "color" not in kwargs:
+ kwargs["color"] = "auto"
+
+ super(AxisLabel, self).__init__(*kl, **kwargs)
+
+ def get_color(self):
+ if self._color == 'auto':
+ if self._axis is not None:
+ label = self._axis.get_label()
+ if label:
+ color_from_axis = label.get_color()
+ return color_from_axis
+ return "k"
+
+ return super(AxisLabel, self).get_color()
+
+ def get_text(self):
+ t = super(AxisLabel, self).get_text()
+ if t == "__from_axes__":
+ return self._axis.get_label().get_text()
+ return self._text
+
+
class AxisGridLineBase(martist.Artist):
def __init__(self, *kl, **kw):
super(AxisGridLineBase, self).__init__(*kl, **kw)
@@ -599,9 +683,9 @@
if self._helper.label_direction in ["left", "right"]:
+ axis_name = "ytick"
+ else:
axis_name = "xtick"
- else:
- axis_name = "ytick"
if major_tick_size is None:
@@ -638,12 +722,13 @@
transform=self._helper.get_tick_transform()+self.offset_transform
- self.major_ticks = Ticks(self.major_tick_size, transform=transform)
- self.minor_ticks = Ticks(self.minor_tick_size, transform=transform)
+ self.major_ticks = Ticks(self.major_tick_size,
+ transform=transform)
+ self.minor_ticks = Ticks(self.minor_tick_size,
+ transform=transform)
size = rcParams['xtick.labelsize']
- color = rcParams['xtick.color']
fontprops = font_manager.FontProperties(size=size)
tvhl = self._helper.get_ticklabel_transform(self.major_tick_pad,
@@ -652,10 +737,14 @@
trans=transform)
trans, vert, horiz, label_a = tvhl
- self.major_ticklabels = TickLabels(size, color)
- self.minor_ticklabels = TickLabels(size, color)
+ color = rcParams['xtick.color']
+ self.major_ticklabels = TickLabels(size, color=color)
+ self.minor_ticklabels = TickLabels(size, color=color)
+ #self.major_ticklabels = TickLabels(size, axis=self.axis)
+ #self.minor_ticklabels = TickLabels(size, axis=self.axis)
+
self.major_ticklabels.set(figure = self.axes.figure,
rotation = label_a,
transform=trans,
@@ -724,10 +813,10 @@
color = rcParams['axes.labelcolor'],
)
- self.label = mtext.Text(0, 0, "__from_axes__",
- fontproperties=fontprops,
- color = rcParams['axes.labelcolor'],
- )
+ self.label = AxisLabel(0, 0, "",
+ fontproperties=fontprops,
+ color = rcParams['axes.labelcolor'],
+ )
self.label.set_figure(self.axes.figure)
#self._set_artist_props(label)
@@ -752,15 +841,16 @@
transform=tr2,
va=va, ha=ha, rotation=a)
- if self.label.get_text() == "__from_axes__":
- label_text = self._helper.axis.get_label().get_text()
- self.label.set_text(label_text)
- self.label.draw(renderer)
- self.label.set_text("__from_axes__")
- else:
- self.label.draw(renderer)
+# if self.label.get_text() == "__from_axes__":
+# label_text = self.axis.get_label().get_text()
+# self.label.set_text(label_text)
+# self.label.draw(renderer)
+# self.label.set_text("__from_axes__")
+# else:
+ self.label.draw(renderer)
+
def set_label(self, s):
self.label.set_text(s)
@@ -857,9 +947,11 @@
if self._helper.label_direction in ["left", "right"]:
+ axis_name = "ytick"
+ self.axis = axes.yaxis
+ else:
axis_name = "xtick"
- else:
- axis_name = "ytick"
+ self.axis = axes.xaxis
if major_tick_size is None:
@@ -897,12 +989,15 @@
transform=self._helper.get_tick_transform()+self.offset_transform
- self.major_ticks = Ticks(self.major_tick_size, transform=transform)
- self.minor_ticks = Ticks(self.minor_tick_size, transform=transform)
+ self.major_ticks = Ticks(self.major_tick_size,
+ axis=self.axis,
+ transform=transform)
+ self.minor_ticks = Ticks(self.minor_tick_size,
+ axis=self.axis,
+ transform=transform)
size = rcParams['xtick.labelsize']
- color = rcParams['xtick.color']
fontprops = font_manager.FontProperties(size=size)
tvhl = self._helper.get_ticklabel_transform(self.major_tick_pad,
@@ -911,10 +1006,14 @@
trans=transform)
trans, vert, horiz, label_a = tvhl
- self.major_ticklabels = TickLabels(size, color)
- self.minor_ticklabels = TickLabels(size, color)
+ #color = rcParams['xtick.color']
+ #self.major_ticklabels = TickLabels(size, color=color)
+ #self.minor_ticklabels = TickLabels(size, color=color)
+ self.major_ticklabels = TickLabels(size, axis=self.axis)
+ self.minor_ticklabels = TickLabels(size, axis=self.axis)
+
self.major_ticklabels.set(figure = self.axes.figure,
rotation = label_a,
transform=trans,
@@ -1022,10 +1121,12 @@
color = rcParams['axes.labelcolor'],
)
- self.label = mtext.Text(0, 0, "__from_axes__",
- fontproperties=fontprops,
- color = rcParams['axes.labelcolor'],
- )
+ self.label = AxisLabel(0, 0, "__from_axes__",
+ color = "auto", #rcParams['axes.labelcolor'],
+ fontproperties=fontprops,
+ axis=self.axis,
+ )
+
self.label.set_figure(self.axes.figure)
#self._set_artist_props(label)
@@ -1050,15 +1151,16 @@
transform=tr2,
va=va, ha=ha, rotation=a)
- if self.label.get_text() == "__from_axes__":
- label_text = self._helper.axis.get_label().get_text()
- self.label.set_text(label_text)
- self.label.draw(renderer)
- self.label.set_text("__from_axes__")
- else:
- self.label.draw(renderer)
+# if self.label.get_text() == "__from_axes__":
+# label_text = self._helper.axis.get_label().get_text()
+# self.label.set_text(label_text)
+# self.label.draw(renderer)
+# self.label.set_text("__from_axes__")
+# else:
+ self.label.draw(renderer)
+
def set_label(self, s):
self.label.set_text(s)
@@ -1208,7 +1310,7 @@
if self._axisline_on:
children = self._axislines.values()+[self.gridlines]
else:
- cildren = []
+ children = []
children.extend(super(Axes, self).get_children())
return children
@@ -1253,15 +1355,16 @@
continue
if axisline.label.get_visible():
- if axisline.label.get_text() == "__from_axes__":
- label_text = axisline._helper.axis.get_label().get_text()
- axisline.label.set_text(label_text)
- bb.append(axisline.label.get_window_extent(renderer))
- axisline.label.set_text("__from_axes__")
- else:
- bb.append(axisline.label.get_window_extent(renderer))
+# if axisline.label.get_text() == "__from_axes__":
+# label_text = axisline._helper.axis.get_label().get_text()
+# axisline.label.set_text(label_text)
+# bb.append(axisline.label.get_window_extent(renderer))
+# axisline.label.set_text("__from_axes__")
+# else:
+ bb.append(axisline.label.get_window_extent(renderer))
+
if axisline.major_ticklabels.get_visible():
bb.extend(axisline.major_ticklabels.get_window_extents(renderer))
if axisline.minor_ticklabels.get_visible():
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py 2009-05-04 20:14:40 UTC (rev 7083)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/inset_locator.py 2009-05-05 03:27:48 UTC (rev 7084)
@@ -246,9 +246,13 @@
def inset_axes(parent_axes, width, height, loc=1,
bbox_to_anchor=None, bbox_transform=None,
+ axes_class=None,
axes_kwargs=None,
**kwargs):
+ if axes_class is None:
+ axes_class = Axes
+
if axes_kwargs is None:
inset_axes = Axes(parent_axes.figure, parent_axes.get_position())
else:
@@ -268,24 +272,24 @@
def zoomed_inset_axes(parent_axes, zoom, loc=1,
bbox_to_anchor=None, bbox_transform=None,
+ axes_class=None,
axes_kwargs=None,
- connects=None,
**kwargs):
+ if axes_class is None:
+ axes_class = Axes
+
if axes_kwargs is None:
- inset_axes = Axes(parent_axes.figure, parent_axes.get_position())
+ inset_axes = axes_class(parent_axes.figure, parent_axes.get_position())
else:
- inset_axes = Axes(parent_axes.figure, parent_axes.get_position(),
- **axes_kwargs)
+ inset_axes = axes_class(parent_axes.figure, parent_axes.get_position(),
+ **axes_kwargs)
axes_locator = AnchoredZoomLocator(parent_axes, zoom=zoom, loc=loc)
inset_axes.set_axes_locator(axes_locator)
_add_inset_axes(parent_axes, inset_axes)
- if connects is not None:
- pass
-
return inset_axes
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py 2009-05-04 20:14:40 UTC (rev 7083)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/parasite_axes.py 2009-05-05 03:27:48 UTC (rev 7084)
@@ -287,13 +287,21 @@
ax2 = ParasiteAxes(self, sharex=self, frameon=False)
self.parasites.append(ax2)
+
+ # for normal axes
+ self.yaxis.tick_left()
+ ax2.xaxis.set_visible(False)
+ ax2.yaxis.tick_right()
+ ax2.yaxis.set_label_position('right')
+
+ # for axisline axes
self._axislines["right"].set_visible(False)
- ax2.xaxis.set_visible(False)
ax2._axislines["left"].set_visible(False)
ax2._axislines["right"].set_visible(True)
ax2._axislines["right"].major_ticklabels.set_visible(True)
ax2._axislines["right"].label.set_visible(True)
- self.yaxis.tick_left()
+
+
return ax2
def twiny(self):
@@ -310,11 +318,20 @@
ax2 = ParasiteAxes(self, sharey=self, frameon=False)
self.parasites.append(ax2)
- ax2.xaxis.set_visible(True)
+
+ # for normal axes
+ self.xaxis.tick_bottom()
ax2.yaxis.set_visible(False)
ax2.xaxis.tick_top()
ax2.xaxis.set_label_position('top')
- self.xaxis.tick_bottom()
+
+ # for axisline axes
+ self._axislines["top"].set_visible(False)
+ ax2._axislines["bottom"].set_visible(False)
+ ax2._axislines["top"].set_visible(True)
+ ax2._axislines["top"].major_ticklabels.set_visible(True)
+ ax2._axislines["top"].label.set_visible(True)
+
return ax2
def twin(self, aux_trans=None):
@@ -339,6 +356,16 @@
)
self.parasites.append(ax2)
+
+ # for normal axes
+ self.yaxis.tick_left()
+ self.xaxis.tick_bottom()
+ ax2.yaxis.tick_right()
+ ax2.yaxis.set_label_position('right')
+ ax2.xaxis.tick_top()
+ ax2.xaxis.set_label_position('top')
+
+ # for axisline axes
self._axislines["right"].set_visible(False)
self._axislines["top"].set_visible(False)
ax2._axislines["left"].set_visible(False)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-05-04 20:14:41
|
Revision: 7083
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7083&view=rev
Author: leejjoon
Date: 2009-05-04 20:14:40 +0000 (Mon, 04 May 2009)
Log Message:
-----------
Merged revisions 7082 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r7082 | leejjoon | 2009-05-04 16:05:57 -0400 (Mon, 04 May 2009) | 2 lines
Fix bug that Text.Annotation is still drawn while set to not visible
........
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/text.py
Property Changed:
----------------
trunk/matplotlib/
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7080
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7082
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-05-04 20:05:57 UTC (rev 7082)
+++ trunk/matplotlib/CHANGELOG 2009-05-04 20:14:40 UTC (rev 7083)
@@ -1,4 +1,7 @@
======================================================================
+2009-05-04 Fix bug that Text.Annotation is still drawn while set to
+ not visible.-JJL
+
2009-05-04 Added TJ's fill_betweenx patch - JDH
2009-05-02 Added options to plotfile based on question from
Modified: trunk/matplotlib/lib/matplotlib/text.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/text.py 2009-05-04 20:05:57 UTC (rev 7082)
+++ trunk/matplotlib/lib/matplotlib/text.py 2009-05-04 20:14:40 UTC (rev 7083)
@@ -1612,6 +1612,11 @@
"""
Draw the :class:`Annotation` object to the given *renderer*.
"""
+
+ if renderer is not None:
+ self._renderer = renderer
+ if not self.get_visible(): return
+
self.update_positions(renderer)
self.update_bbox_position_size(renderer)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-05-04 20:05:59
|
Revision: 7082
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7082&view=rev
Author: leejjoon
Date: 2009-05-04 20:05:57 +0000 (Mon, 04 May 2009)
Log Message:
-----------
Fix bug that Text.Annotation is still drawn while set to not visible
Modified Paths:
--------------
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/lib/matplotlib/text.py
Modified: branches/v0_98_5_maint/CHANGELOG
===================================================================
--- branches/v0_98_5_maint/CHANGELOG 2009-05-04 19:07:43 UTC (rev 7081)
+++ branches/v0_98_5_maint/CHANGELOG 2009-05-04 20:05:57 UTC (rev 7082)
@@ -1,4 +1,7 @@
======================================================================
+2009-05-04 Fix bug that Text.Annotation is still drawn while set to
+ not visible.-JJL
+
2008-04-12 Release 0.98.5.3 at r7038
2009-04-06 The pdf backend now escapes newlines and linefeeds in strings.
Modified: branches/v0_98_5_maint/lib/matplotlib/text.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/text.py 2009-05-04 19:07:43 UTC (rev 7081)
+++ branches/v0_98_5_maint/lib/matplotlib/text.py 2009-05-04 20:05:57 UTC (rev 7082)
@@ -1602,6 +1602,11 @@
"""
Draw the :class:`Annotation` object to the given *renderer*.
"""
+
+ if renderer is not None:
+ self._renderer = renderer
+ if not self.get_visible(): return
+
self.update_positions(renderer)
self.update_bbox_position_size(renderer)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-05-04 19:07:48
|
Revision: 7081
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7081&view=rev
Author: mdboom
Date: 2009-05-04 19:07:43 +0000 (Mon, 04 May 2009)
Log Message:
-----------
Merged revisions 7080 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r7080 | mdboom | 2009-05-04 15:05:38 -0400 (Mon, 04 May 2009) | 2 lines
[2723470] UnboundLocalError in ticker.py
........
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/ticker.py
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7072
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7080
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
Property changes on: trunk/matplotlib/doc/pyplots/README
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
+ /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
+ /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
+ /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
+ /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072,7080
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2009-05-04 19:05:38 UTC (rev 7080)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2009-05-04 19:07:43 UTC (rev 7081)
@@ -953,6 +953,8 @@
vmax -= offset
raw_step = (vmax-vmin)/nbins
scaled_raw_step = raw_step/scale
+ best_vmax = vmax
+ best_vmin = vmin
for step in self._steps:
if step < scaled_raw_step:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-05-04 19:05:50
|
Revision: 7080
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7080&view=rev
Author: mdboom
Date: 2009-05-04 19:05:38 +0000 (Mon, 04 May 2009)
Log Message:
-----------
[2723470] UnboundLocalError in ticker.py
Modified Paths:
--------------
branches/v0_98_5_maint/lib/matplotlib/ticker.py
Modified: branches/v0_98_5_maint/lib/matplotlib/ticker.py
===================================================================
--- branches/v0_98_5_maint/lib/matplotlib/ticker.py 2009-05-04 18:19:18 UTC (rev 7079)
+++ branches/v0_98_5_maint/lib/matplotlib/ticker.py 2009-05-04 19:05:38 UTC (rev 7080)
@@ -930,6 +930,8 @@
vmax -= offset
raw_step = (vmax-vmin)/nbins
scaled_raw_step = raw_step/scale
+ best_vmax = vmax
+ best_vmin = vmin
for step in self._steps:
if step < scaled_raw_step:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-05-04 18:19:24
|
Revision: 7079
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7079&view=rev
Author: jdh2358
Date: 2009-05-04 18:19:18 +0000 (Mon, 04 May 2009)
Log Message:
-----------
added sf patch 2786759 for fill_betweenx
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/boilerplate.py
trunk/matplotlib/lib/matplotlib/axes.py
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-05-03 00:09:06 UTC (rev 7078)
+++ trunk/matplotlib/CHANGELOG 2009-05-04 18:19:18 UTC (rev 7079)
@@ -1,7 +1,10 @@
======================================================================
+2009-05-04 Added TJ's fill_betweenx patch - JDH
+
2009-05-02 Added options to plotfile based on question from
Joseph Smidt and patch by Matthias Michler. - EF
+
2009-05-01 Changed add_artist and similar Axes methods to
return their argument. - EF
Modified: trunk/matplotlib/boilerplate.py
===================================================================
--- trunk/matplotlib/boilerplate.py 2009-05-03 00:09:06 UTC (rev 7078)
+++ trunk/matplotlib/boilerplate.py 2009-05-04 18:19:18 UTC (rev 7079)
@@ -65,6 +65,7 @@
'errorbar',
'fill',
'fill_between',
+ 'fill_betweenx',
'hexbin',
'hist',
'hlines',
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-05-03 00:09:06 UTC (rev 7078)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-05-04 18:19:18 UTC (rev 7079)
@@ -5826,10 +5826,10 @@
an N length np array of the x data
*y1*
- an N length scalar or np array of the x data
+ an N length scalar or np array of the y data
*y2*
- an N length scalar or np array of the x data
+ an N length scalar or np array of the y data
*where*
if None, default to fill between everywhere. If not None,
@@ -5844,6 +5844,12 @@
%(PolyCollection)s
.. plot:: mpl_examples/pylab_examples/fill_between.py
+
+ .. seealso::
+
+ :meth:`fill_betweenx`
+ for filling between two sets of x-values
+
"""
# Handle united data, such as dates
self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs)
@@ -5913,6 +5919,113 @@
return collection
fill_between.__doc__ = cbook.dedent(fill_between.__doc__) % martist.kwdocd
+ def fill_betweenx(self, y, x1, x2=0, where=None, **kwargs):
+ """
+ call signature::
+
+ fill_between(y, x1, x2=0, where=None, **kwargs)
+
+ Create a :class:`~matplotlib.collections.PolyCollection`
+ filling the regions between *x1* and *x2* where
+ ``where==True``
+
+ *y*
+ an N length np array of the y data
+
+ *x1*
+ an N length scalar or np array of the x data
+
+ *x2*
+ an N length scalar or np array of the x data
+
+ *where*
+ if None, default to fill between everywhere. If not None,
+ it is a a N length numpy boolean array and the fill will
+ only happen over the regions where ``where==True``
+
+ *kwargs*
+ keyword args passed on to the :class:`PolyCollection`
+
+ kwargs control the Polygon properties:
+
+ %(PolyCollection)s
+
+ .. plot:: mpl_examples/pylab_examples/fill_betweenx.py
+
+ .. seealso::
+
+ :meth:`fill_between`
+ for filling between two sets of y-values
+
+ """
+ # Handle united data, such as dates
+ self._process_unit_info(ydata=y, xdata=x1, kwargs=kwargs)
+ self._process_unit_info(xdata=x2)
+
+ # Convert the arrays so we can work with them
+ y = np.asanyarray(self.convert_yunits(y))
+ x1 = np.asanyarray(self.convert_xunits(x1))
+ x2 = np.asanyarray(self.convert_xunits(x2))
+
+ if x1.ndim == 0:
+ x1 = np.ones_like(y)*x1
+ if x2.ndim == 0:
+ x2 = np.ones_like(y)*x2
+
+ if where is None:
+ where = np.ones(len(y), np.bool)
+ else:
+ where = np.asarray(where, np.bool)
+
+ if not (y.shape == x1.shape == x2.shape == where.shape):
+ raise ValueError("Argument dimensions are incompatible")
+
+ mask = reduce(ma.mask_or,
+ [ma.getmask(y), ma.getmask(x1), ma.getmask(x2)])
+ if mask is not ma.nomask:
+ where &= ~mask
+
+ polys = []
+ for ind0, ind1 in mlab.contiguous_regions(where):
+ theseverts = []
+ yslice = y[ind0:ind1]
+ x1slice = x1[ind0:ind1]
+ x2slice = x2[ind0:ind1]
+
+ if not len(yslice):
+ continue
+
+ N = len(yslice)
+ Y = np.zeros((2*N+2, 2), np.float)
+
+ # the purpose of the next two lines is for when x2 is a
+ # scalar like 0 and we want the fill to go all the way
+ # down to 0 even if none of the x1 sample points do
+ Y[0] = x2slice[0], yslice[0]
+ Y[N+1] = x2slice[-1], yslice[-1]
+
+ Y[1:N+1,0] = x1slice
+ Y[1:N+1,1] = yslice
+ Y[N+2:,0] = x2slice[::-1]
+ Y[N+2:,1] = yslice[::-1]
+
+ polys.append(Y)
+
+ collection = mcoll.PolyCollection(polys, **kwargs)
+
+ # now update the datalim and autoscale
+ X1Y = np.array([x1[where], y[where]]).T
+ X2Y = np.array([x2[where], y[where]]).T
+ self.dataLim.update_from_data_xy(X1Y, self.ignore_existing_data_limits,
+ updatex=True, updatey=True)
+
+ self.dataLim.update_from_data_xy(X2Y, self.ignore_existing_data_limits,
+ updatex=False, updatey=True)
+ self.add_collection(collection)
+ self.autoscale_view()
+ return collection
+ fill_between.__doc__ = cbook.dedent(fill_between.__doc__) % martist.kwdocd
+
#### plotting z(x,y): imshow, pcolor and relatives, contour
def imshow(self, X, cmap=None, norm=None, aspect=None,
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2009-05-03 00:09:06 UTC (rev 7078)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2009-05-04 18:19:18 UTC (rev 7079)
@@ -1185,7 +1185,8 @@
figtext add text in figure coords
figure create or change active figure
fill make filled polygons
- fill_between make filled polygons
+ fill_between make filled polygons between two sets of y-values
+ fill_betweenx make filled polygons between two sets of x-values
gca return the current axes
gcf return the current figure
gci get the current image, or None
@@ -1973,6 +1974,28 @@
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
+def fill_betweenx(*args, **kwargs):
+ # allow callers to override the hold state by passing hold=True|False
+ b = ishold()
+ h = kwargs.pop('hold', None)
+ if h is not None:
+ hold(h)
+ try:
+ ret = gca().fill_betweenx(*args, **kwargs)
+ draw_if_interactive()
+ except:
+ hold(b)
+ raise
+
+ hold(b)
+ return ret
+if Axes.fill_betweenx.__doc__ is not None:
+ fill_betweenx.__doc__ = dedent(Axes.fill_betweenx.__doc__) + """
+
+Additional kwargs: hold = [True|False] overrides default hold state"""
+
+# This function was autogenerated by boilerplate.py. Do not edit as
+# changes will be lost
def hexbin(*args, **kwargs):
# allow callers to override the hold state by passing hold=True|False
b = ishold()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-05-03 00:09:14
|
Revision: 7078
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7078&view=rev
Author: efiring
Date: 2009-05-03 00:09:06 +0000 (Sun, 03 May 2009)
Log Message:
-----------
Added options to plotfile
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/pylab_examples/plotfile_demo.py
trunk/matplotlib/lib/matplotlib/pyplot.py
Added Paths:
-----------
trunk/matplotlib/examples/data/data_x_x2_x3.csv
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-05-01 19:04:06 UTC (rev 7077)
+++ trunk/matplotlib/CHANGELOG 2009-05-03 00:09:06 UTC (rev 7078)
@@ -1,4 +1,7 @@
======================================================================
+2009-05-02 Added options to plotfile based on question from
+ Joseph Smidt and patch by Matthias Michler. - EF
+
2009-05-01 Changed add_artist and similar Axes methods to
return their argument. - EF
Added: trunk/matplotlib/examples/data/data_x_x2_x3.csv
===================================================================
--- trunk/matplotlib/examples/data/data_x_x2_x3.csv (rev 0)
+++ trunk/matplotlib/examples/data/data_x_x2_x3.csv 2009-05-03 00:09:06 UTC (rev 7078)
@@ -0,0 +1,11 @@
+ 0 0 0
+ 1 1 1
+ 2 4 8
+ 3 9 27
+ 4 16 64
+ 5 25 125
+ 6 36 216
+ 7 49 343
+ 8 64 512
+ 9 81 729
+10 100 1000
Modified: trunk/matplotlib/examples/pylab_examples/plotfile_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/plotfile_demo.py 2009-05-01 19:04:06 UTC (rev 7077)
+++ trunk/matplotlib/examples/pylab_examples/plotfile_demo.py 2009-05-03 00:09:06 UTC (rev 7078)
@@ -1,6 +1,7 @@
-from pylab import plotfile, show
+from pylab import plotfile, show, gca
fname = '../data/msft.csv'
+fname2 = '../data/data_x_x2_x3.csv'
# test 1; use ints
plotfile(fname, (0,5,6))
@@ -14,7 +15,20 @@
# test 4; use semilogy for volume
plotfile(fname, (0,5,6), plotfuncs={5:'semilogy'})
-# test 5; use bar for volume
+#test 5; single subplot
+plotfile(fname, ('date', 'open', 'high', 'low', 'close'), subplots=False)
+
+# test 6; labeling, if no names in csv-file
+plotfile(fname2, cols=(0,1,2), delimiter=' ',
+ names=['$x$', '$f(x)=x^2$', '$f(x)=x^3$'])
+
+# test 7; more than one file per figure--illustrated here with a single file
+plotfile(fname2, cols=(0, 1), delimiter=' ')
+plotfile(fname2, cols=(0, 2), newfig=False, delimiter=' ') # use current figure
+gca().set_xlabel(r'$x$')
+gca().set_ylabel(r'$f(x) = x^2, x^3$')
+
+# test 8; use bar for volume
plotfile(fname, (0,5,6), plotfuncs={5:'bar'})
show()
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2009-05-01 19:04:06 UTC (rev 7077)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2009-05-03 00:09:06 UTC (rev 7078)
@@ -1448,7 +1448,8 @@
return ret
def plotfile(fname, cols=(0,), plotfuncs=None,
- comments='#', skiprows=0, checkrows=5, delimiter=',',
+ comments='#', skiprows=0, checkrows=5, delimiter=',', names=None,
+ subplots=True, newfig=True,
**kwargs):
"""
Plot the data in *fname*
@@ -1464,18 +1465,28 @@
- If len(*cols*) > 1, the first element will be an identifier for
data for the *x* axis and the remaining elements will be the
- column indexes for multiple subplots
+ column indexes for multiple subplots if *subplots* is *True*
+ (the default), or for lines in a single subplot if *subplots*
+ is *False*.
*plotfuncs*, if not *None*, is a dictionary mapping identifier to
an :class:`~matplotlib.axes.Axes` plotting function as a string.
Default is 'plot', other choices are 'semilogy', 'fill', 'bar',
etc. You must use the same type of identifier in the *cols*
vector as you use in the *plotfuncs* dictionary, eg., integer
- column numbers in both or column names in both.
+ column numbers in both or column names in both. If *subplots*
+ is *False*, then including any function such as 'semilogy'
+ that changes the axis scaling will set the scaling for all
+ columns.
- *comments*, *skiprows*, *checkrows*, and *delimiter* are all passed on to
- :func:`matplotlib.pylab.csv2rec` to load the data into a record array.
+ *comments*, *skiprows*, *checkrows*, *delimiter*, and *names*
+ are all passed on to :func:`matplotlib.pylab.csv2rec` to
+ load the data into a record array.
+ If *newfig* is *True*, the plot always will be made in a new figure;
+ if *False*, it will be made in the current figure if one exists,
+ else in a new figure.
+
kwargs are passed on to plotting functions.
Example usage::
@@ -1484,17 +1495,26 @@
plotfile(fname, (0,1,3))
# plot using column names; specify an alternate plot type for volume
- plotfile(fname, ('date', 'volume', 'adj_close'), plotfuncs={'volume': 'semilogy'})
+ plotfile(fname, ('date', 'volume', 'adj_close'),
+ plotfuncs={'volume': 'semilogy'})
+
+ Note: plotfile is intended as a convenience for quickly plotting
+ data from flat files; it is not intended as an alternative
+ interface to general plotting with pyplot or matplotlib.
"""
- fig = figure()
+ if newfig:
+ fig = figure()
+ else:
+ fig = gcf()
+
if len(cols)<1:
raise ValueError('must have at least one column of data')
if plotfuncs is None:
plotfuncs = dict()
- r = mlab.csv2rec(fname, comments=comments,
- skiprows=skiprows, checkrows=checkrows, delimiter=delimiter)
+ r = mlab.csv2rec(fname, comments=comments, skiprows=skiprows,
+ checkrows=checkrows, delimiter=delimiter, names=names)
def getname_val(identifier):
'return the name and column data for identifier'
@@ -1507,36 +1527,44 @@
raise TypeError('identifier must be a string or integer')
xname, x = getname_val(cols[0])
+ ynamelist = []
if len(cols)==1:
ax1 = fig.add_subplot(1,1,1)
funcname = plotfuncs.get(cols[0], 'plot')
func = getattr(ax1, funcname)
func(x, **kwargs)
- ax1.set_xlabel(xname)
+ ax1.set_ylabel(xname)
else:
N = len(cols)
for i in range(1,N):
- if i==1:
- ax = ax1 = fig.add_subplot(N-1,1,i)
- ax.grid(True)
- else:
- ax = fig.add_subplot(N-1,1,i, sharex=ax1)
- ax.grid(True)
+ if subplots:
+ if i==1:
+ ax = ax1 = fig.add_subplot(N-1,1,i)
+ else:
+ ax = fig.add_subplot(N-1,1,i, sharex=ax1)
+ elif i==1:
+ ax = fig.add_subplot(1,1,1)
+ ax.grid(True)
+
yname, y = getname_val(cols[i])
+ ynamelist.append(yname)
funcname = plotfuncs.get(cols[i], 'plot')
func = getattr(ax, funcname)
func(x, y, **kwargs)
- ax.set_ylabel(yname)
+ if subplots:
+ ax.set_ylabel(yname)
if ax.is_last_row():
ax.set_xlabel(xname)
else:
ax.set_xlabel('')
+ if not subplots:
+ ax.legend(ynamelist, loc='best')
if xname=='date':
fig.autofmt_xdate()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-05-01 19:04:09
|
Revision: 7077
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7077&view=rev
Author: efiring
Date: 2009-05-01 19:04:06 +0000 (Fri, 01 May 2009)
Log Message:
-----------
Make Axes.add_artist etc. return their argument.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-05-01 18:05:12 UTC (rev 7076)
+++ trunk/matplotlib/CHANGELOG 2009-05-01 19:04:06 UTC (rev 7077)
@@ -1,4 +1,6 @@
======================================================================
+2009-05-01 Changed add_artist and similar Axes methods to
+ return their argument. - EF
2009-04-30 Incorrect eps bbox for landscape mode fixed - JJL
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-05-01 18:05:12 UTC (rev 7076)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-05-01 19:04:06 UTC (rev 7077)
@@ -1323,17 +1323,24 @@
len(self.patches))>0
def add_artist(self, a):
- 'Add any :class:`~matplotlib.artist.Artist` to the axes'
+ '''
+ Add any :class:`~matplotlib.artist.Artist` to the axes
+
+ Returns the artist.
+ '''
a.set_axes(self)
self.artists.append(a)
self._set_artist_props(a)
a.set_clip_path(self.patch)
a._remove_method = lambda h: self.artists.remove(h)
+ return a
def add_collection(self, collection, autolim=True):
'''
add a :class:`~matplotlib.collections.Collection` instance
to the axes
+
+ Returns the collection.
'''
label = collection.get_label()
if not label:
@@ -1348,11 +1355,14 @@
self.update_datalim(collection.get_datalim(self.transData))
collection._remove_method = lambda h: self.collections.remove(h)
+ return collection
def add_line(self, line):
'''
Add a :class:`~matplotlib.lines.Line2D` to the list of plot
lines
+
+ Returns the line.
'''
self._set_artist_props(line)
if line.get_clip_path() is None:
@@ -1363,6 +1373,7 @@
line.set_label('_line%d'%len(self.lines))
self.lines.append(line)
line._remove_method = lambda h: self.lines.remove(h)
+ return line
def _update_line_limits(self, line):
p = line.get_path()
@@ -1378,6 +1389,8 @@
axes patches; the clipbox will be set to the Axes clipping
box. If the transform is not set, it will be set to
:attr:`transData`.
+
+ Returns the patch.
"""
self._set_artist_props(p)
@@ -1386,6 +1399,7 @@
self._update_patch_limits(p)
self.patches.append(p)
p._remove_method = lambda h: self.patches.remove(h)
+ return p
def _update_patch_limits(self, patch):
'update the data limits for patch *p*'
@@ -1412,11 +1426,14 @@
'''
Add a :class:`~matplotlib.tables.Table` instance to the
list of axes tables
+
+ Returns the table.
'''
self._set_artist_props(tab)
self.tables.append(tab)
tab.set_clip_path(self.patch)
tab._remove_method = lambda h: self.tables.remove(h)
+ return tab
def relim(self):
'recompute the data limits based on current artists'
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-05-01 18:05:14
|
Revision: 7076
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7076&view=rev
Author: mdboom
Date: 2009-05-01 18:05:12 +0000 (Fri, 01 May 2009)
Log Message:
-----------
Scale fonts correctly for Mac OS-X backend. (Patch contributed by Michiel de Hoon).
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2009-04-30 17:31:23 UTC (rev 7075)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_macosx.py 2009-05-01 18:05:12 UTC (rev 7076)
@@ -107,7 +107,6 @@
n = self.gc.level() - gc.level()
for i in range(n): self.gc.restore()
self.gc = gc
- size = prop.get_size_in_points()
ox, oy, width, height, descent, image, used_characters = \
self.mathtext_parser.parse(s, self.dpi, prop)
gc.draw_mathtext(x, y, angle, 255 - image.as_array())
@@ -121,15 +120,15 @@
self._draw_mathtext(gc, x, y, s, prop, angle)
else:
family = prop.get_family()
- size = prop.get_size_in_points()
weight = prop.get_weight()
style = prop.get_style()
+ points = prop.get_size_in_points()
+ size = self.points_to_pixels(points)
gc.draw_text(x, y, unicode(s), family, size, weight, style, angle)
def get_text_width_height_descent(self, s, prop, ismath):
if ismath=='TeX':
# todo: handle props
- size = prop.get_size_in_points()
texmanager = self.get_texmanager()
fontsize = prop.get_size_in_points()
w, h, d = texmanager.get_text_width_height_descent(s, fontsize,
@@ -140,9 +139,10 @@
self.mathtext_parser.parse(s, self.dpi, prop)
return width, height, descent
family = prop.get_family()
- size = prop.get_size_in_points()
weight = prop.get_weight()
style = prop.get_style()
+ points = prop.get_size_in_points()
+ size = self.points_to_pixels(points)
width, height, descent = self.gc.get_text_width_height_descent(unicode(s), family, size, weight, style)
return width, height, 0.0*descent
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-04-30 17:31:30
|
Revision: 7075
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7075&view=rev
Author: leejjoon
Date: 2009-04-30 17:31:23 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
add kwarg bbox_transform for legend. bbox_to_anchor now can be a BboxBase instance
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2009-04-30 17:05:27 UTC (rev 7074)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2009-04-30 17:31:23 UTC (rev 7075)
@@ -32,7 +32,7 @@
from matplotlib.lines import Line2D
from matplotlib.patches import Patch, Rectangle, Shadow, FancyBboxPatch
from matplotlib.collections import LineCollection, RegularPolyCollection
-from matplotlib.transforms import Bbox, TransformedBbox, BboxTransformTo
+from matplotlib.transforms import Bbox, BboxBase, TransformedBbox, BboxTransformTo
from matplotlib.offsetbox import HPacker, VPacker, TextArea, DrawingArea
@@ -112,7 +112,8 @@
fancybox=None, # True use a fancy box, false use a rounded box, none use rc
shadow = None,
title = None, # set a title for the legend
- bbox_to_anchor = None, # bbox thaw the legend will be anchored.
+ bbox_to_anchor = None, # bbox that the legend will be anchored.
+ bbox_transform = None, # transform for the bbox
):
"""
- *parent* : the artist that contains the legend
@@ -138,11 +139,16 @@
borderaxespad the pad between the axes and legend border
columnspacing the spacing between columns
title the legend title
- bbox_to_anchor the bbox that the legend will be anchored.
+ bbox_to_anchor the bbox that the legend will be anchored.
+ bbox_transform the transform for the bbox. transAxes if None.
================ ==================================================================
The dimensions of pad and spacing are given as a fraction of the
_fontsize. Values from rcParams will be used if None.
+
+bbox_to_anchor can be an instance of BboxBase(or its derivatives) or a
+tuple of 2 or 4 floats. See :meth:`set_bbox_to_anchor` for more
+detail.
"""
from matplotlib.axes import Axes # local import only to avoid circularity
from matplotlib.figure import Figure # local import only to avoid circularity
@@ -251,7 +257,7 @@
self._loc = loc
self._mode = mode
- self.set_bbox_to_anchor(bbox_to_anchor)
+ self.set_bbox_to_anchor(bbox_to_anchor, bbox_transform)
# We use FancyBboxPatch to draw a legend frame. The location
# and size of the box will be updated during the drawing time.
@@ -689,14 +695,15 @@
"""
set the bbox that the legend will be anchored.
- *bbox* can be a Bbox instance, a list of [left, bottom, width,
- height] in normalized axes coordinate, or a list of [left,
- bottom] where the width and height will be assumed to be zero.
+ *bbox* can be a BboxBase instance, a tuple of [left, bottom,
+ width, height] in the given transform (normalized axes
+ coordinate if None), or a tuple of [left, bottom] where the
+ width and height will be assumed to be zero.
"""
if bbox is None:
self._bbox_to_anchor = None
return
- elif isinstance(bbox, Bbox):
+ elif isinstance(bbox, BboxBase):
self._bbox_to_anchor = bbox
else:
try:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-04-30 17:05:28
|
Revision: 7074
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7074&view=rev
Author: leejjoon
Date: 2009-04-30 17:05:27 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
Incorrect eps bbox for landscape mode fixed
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-04-30 13:28:54 UTC (rev 7073)
+++ trunk/matplotlib/CHANGELOG 2009-04-30 17:05:27 UTC (rev 7074)
@@ -1,5 +1,7 @@
======================================================================
+2009-04-30 Incorrect eps bbox for landscape mode fixed - JJL
+
2009-04-28 Fixed incorrect bbox of eps output when usetex=True. - JJL
2009-04-24 Changed use of os.open* to instead use subprocess.Popen.
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-04-30 13:28:54 UTC (rev 7073)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-04-30 17:05:27 UTC (rev 7074)
@@ -1100,8 +1100,10 @@
# set the paper size to the figure size if isEPSF. The
# resulting ps file has the given size with correct bounding
# box so that there is no need to call 'pstoeps'
- if isEPSF:
+ if isEPSF:
paperWidth, paperHeight = self.figure.get_size_inches()
+ if isLandscape:
+ paperWidth, paperHeight = paperHeight, paperWidth
else:
temp_papertype = _get_papertype(width, height)
if papertype=='auto':
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-04-30 13:29:03
|
Revision: 7073
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7073&view=rev
Author: mdboom
Date: 2009-04-30 13:28:54 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
Merged revisions 7072 via svnmerge from
https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint
........
r7072 | mdboom | 2009-04-30 09:27:04 -0400 (Thu, 30 Apr 2009) | 2 lines
Fix solaris builds where "putchar" is a macro.
........
Modified Paths:
--------------
trunk/matplotlib/ttconv/pprdrv.h
trunk/matplotlib/ttconv/pprdrv_tt.cpp
trunk/matplotlib/ttconv/pprdrv_tt2.cpp
trunk/matplotlib/ttconv/ttutil.cpp
Property Changed:
----------------
trunk/matplotlib/
trunk/matplotlib/doc/pyplots/README
trunk/matplotlib/doc/sphinxext/gen_gallery.py
trunk/matplotlib/doc/sphinxext/gen_rst.py
trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
Property changes on: trunk/matplotlib
___________________________________________________________________
Modified: svnmerge-integrated
- /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7054
+ /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-7072
Modified: svn:mergeinfo
- /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042
+ /branches/v0_91_maint:5753-5771
/branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
Property changes on: trunk/matplotlib/doc/pyplots/README
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042
+ /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042
+ /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042
+ /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771
/branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918,6920-6925,6927-6928,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042
+ /branches/v0_91_maint/doc/sphinxext/mathmpl.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042
+ /branches/v0_91_maint/doc/sphinxext/only_directives.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py:6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
Property changes on: trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042
+ /branches/v0_91_maint/doc/sphinxext/plot_directive.py:5753-5771
/branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py:6920-6925,6934,6941,6946,6948,6950,6952,6960,6972,6984-6985,6990,6995,6997-7001,7014,7016,7018,7024-7025,7033,7035,7042,7072
Modified: trunk/matplotlib/ttconv/pprdrv.h
===================================================================
--- trunk/matplotlib/ttconv/pprdrv.h 2009-04-30 13:27:04 UTC (rev 7072)
+++ trunk/matplotlib/ttconv/pprdrv.h 2009-04-30 13:28:54 UTC (rev 7073)
@@ -40,7 +40,7 @@
virtual void write(const char*) = 0;
virtual void printf(const char* format, ...);
- virtual void putchar(int val);
+ virtual void put_char(int val);
virtual void puts(const char* a);
virtual void putline(const char* a);
};
Modified: trunk/matplotlib/ttconv/pprdrv_tt.cpp
===================================================================
--- trunk/matplotlib/ttconv/pprdrv_tt.cpp 2009-04-30 13:27:04 UTC (rev 7072)
+++ trunk/matplotlib/ttconv/pprdrv_tt.cpp 2009-04-30 13:28:54 UTC (rev 7073)
@@ -495,20 +495,20 @@
if(!in_string)
{
- stream.putchar('<');
+ stream.put_char('<');
string_len=0;
line_len++;
in_string=TRUE;
}
- stream.putchar( hexdigits[ n / 16 ] );
- stream.putchar( hexdigits[ n % 16 ] );
+ stream.put_char( hexdigits[ n / 16 ] );
+ stream.put_char( hexdigits[ n % 16 ] );
string_len++;
line_len+=2;
if(line_len > 70)
{
- stream.putchar('\n');
+ stream.put_char('\n');
line_len=0;
}
@@ -561,7 +561,7 @@
#endif
sfnts_pputBYTE(stream, 0); /* extra byte for pre-2013 compatibility */
- stream.putchar('>');
+ stream.put_char('>');
line_len++;
}
in_string=FALSE;
@@ -968,7 +968,7 @@
/* a BuildGlyph and BuildChar proceedures. */
if( font->target_type == PS_TYPE_3 )
{
- stream.putchar('\n');
+ stream.put_char('\n');
stream.putline("/BuildGlyph");
stream.putline(" {exch begin"); /* start font dictionary */
@@ -977,7 +977,7 @@
stream.putline(" true 3 1 roll get exec");
stream.putline(" end}_d");
- stream.putchar('\n');
+ stream.put_char('\n');
/* This proceedure is for compatiblity with */
/* level 1 interpreters. */
@@ -986,7 +986,7 @@
stream.putline(" 1 index /BuildGlyph get exec");
stream.putline("}_d");
- stream.putchar('\n');
+ stream.put_char('\n');
}
/* If we are generating a type 42 font, we need to check to see */
@@ -998,7 +998,7 @@
/* setup instructions and part of BuildGlyph came from. */
else if( font->target_type == PS_TYPE_42 )
{
- stream.putchar('\n');
+ stream.put_char('\n');
/* If we have no "resourcestatus" command, or FontType 42 */
/* is unknown, leave "true" on the stack. */
@@ -1079,7 +1079,7 @@
/* if the printer has no built-in TrueType */
/* rasterizer. */
stream.putline("}if");
- stream.putchar('\n');
+ stream.put_char('\n');
} /* end of if Type 42 not understood. */
stream.putline("FontName currentdict end definefont pop");
Modified: trunk/matplotlib/ttconv/pprdrv_tt2.cpp
===================================================================
--- trunk/matplotlib/ttconv/pprdrv_tt2.cpp 2009-04-30 13:27:04 UTC (rev 7072)
+++ trunk/matplotlib/ttconv/pprdrv_tt2.cpp 2009-04-30 13:28:54 UTC (rev 7073)
@@ -104,7 +104,7 @@
{ /* have a log of points. */
if(stack_depth == 0)
{
- stream.putchar('{');
+ stream.put_char('{');
stack_depth=1;
}
Modified: trunk/matplotlib/ttconv/ttutil.cpp
===================================================================
--- trunk/matplotlib/ttconv/ttutil.cpp 2009-04-30 13:27:04 UTC (rev 7072)
+++ trunk/matplotlib/ttconv/ttutil.cpp 2009-04-30 13:28:54 UTC (rev 7073)
@@ -52,7 +52,7 @@
va_end(arg_list);
}
-void TTStreamWriter::putchar(int val)
+void TTStreamWriter::put_char(int val)
{
char c[2];
c[0] = (char)val;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-04-30 13:27:11
|
Revision: 7072
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7072&view=rev
Author: mdboom
Date: 2009-04-30 13:27:04 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
Fix solaris builds where "putchar" is a macro.
Modified Paths:
--------------
branches/v0_98_5_maint/ttconv/pprdrv.h
branches/v0_98_5_maint/ttconv/pprdrv_tt.cpp
branches/v0_98_5_maint/ttconv/pprdrv_tt2.cpp
branches/v0_98_5_maint/ttconv/ttutil.cpp
Modified: branches/v0_98_5_maint/ttconv/pprdrv.h
===================================================================
--- branches/v0_98_5_maint/ttconv/pprdrv.h 2009-04-29 19:38:35 UTC (rev 7071)
+++ branches/v0_98_5_maint/ttconv/pprdrv.h 2009-04-30 13:27:04 UTC (rev 7072)
@@ -40,7 +40,7 @@
virtual void write(const char*) = 0;
virtual void printf(const char* format, ...);
- virtual void putchar(int val);
+ virtual void put_char(int val);
virtual void puts(const char* a);
virtual void putline(const char* a);
};
Modified: branches/v0_98_5_maint/ttconv/pprdrv_tt.cpp
===================================================================
--- branches/v0_98_5_maint/ttconv/pprdrv_tt.cpp 2009-04-29 19:38:35 UTC (rev 7071)
+++ branches/v0_98_5_maint/ttconv/pprdrv_tt.cpp 2009-04-30 13:27:04 UTC (rev 7072)
@@ -482,20 +482,20 @@
if(!in_string)
{
- stream.putchar('<');
+ stream.put_char('<');
string_len=0;
line_len++;
in_string=TRUE;
}
- stream.putchar( hexdigits[ n / 16 ] );
- stream.putchar( hexdigits[ n % 16 ] );
+ stream.put_char( hexdigits[ n / 16 ] );
+ stream.put_char( hexdigits[ n % 16 ] );
string_len++;
line_len+=2;
if(line_len > 70)
{
- stream.putchar('\n');
+ stream.put_char('\n');
line_len=0;
}
@@ -548,7 +548,7 @@
#endif
sfnts_pputBYTE(stream, 0); /* extra byte for pre-2013 compatibility */
- stream.putchar('>');
+ stream.put_char('>');
line_len++;
}
in_string=FALSE;
@@ -955,7 +955,7 @@
/* a BuildGlyph and BuildChar proceedures. */
if( font->target_type == PS_TYPE_3 )
{
- stream.putchar('\n');
+ stream.put_char('\n');
stream.putline("/BuildGlyph");
stream.putline(" {exch begin"); /* start font dictionary */
@@ -964,7 +964,7 @@
stream.putline(" true 3 1 roll get exec");
stream.putline(" end}_d");
- stream.putchar('\n');
+ stream.put_char('\n');
/* This proceedure is for compatiblity with */
/* level 1 interpreters. */
@@ -973,7 +973,7 @@
stream.putline(" 1 index /BuildGlyph get exec");
stream.putline("}_d");
- stream.putchar('\n');
+ stream.put_char('\n');
}
/* If we are generating a type 42 font, we need to check to see */
@@ -985,7 +985,7 @@
/* setup instructions and part of BuildGlyph came from. */
else if( font->target_type == PS_TYPE_42 )
{
- stream.putchar('\n');
+ stream.put_char('\n');
/* If we have no "resourcestatus" command, or FontType 42 */
/* is unknown, leave "true" on the stack. */
@@ -1066,7 +1066,7 @@
/* if the printer has no built-in TrueType */
/* rasterizer. */
stream.putline("}if");
- stream.putchar('\n');
+ stream.put_char('\n');
} /* end of if Type 42 not understood. */
stream.putline("FontName currentdict end definefont pop");
Modified: branches/v0_98_5_maint/ttconv/pprdrv_tt2.cpp
===================================================================
--- branches/v0_98_5_maint/ttconv/pprdrv_tt2.cpp 2009-04-29 19:38:35 UTC (rev 7071)
+++ branches/v0_98_5_maint/ttconv/pprdrv_tt2.cpp 2009-04-30 13:27:04 UTC (rev 7072)
@@ -104,7 +104,7 @@
{ /* have a log of points. */
if(stack_depth == 0)
{
- stream.putchar('{');
+ stream.put_char('{');
stack_depth=1;
}
Modified: branches/v0_98_5_maint/ttconv/ttutil.cpp
===================================================================
--- branches/v0_98_5_maint/ttconv/ttutil.cpp 2009-04-29 19:38:35 UTC (rev 7071)
+++ branches/v0_98_5_maint/ttconv/ttutil.cpp 2009-04-30 13:27:04 UTC (rev 7072)
@@ -52,7 +52,7 @@
va_end(arg_list);
}
-void TTStreamWriter::putchar(int val)
+void TTStreamWriter::put_char(int val)
{
char c[2];
c[0] = (char)val;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-04-29 19:38:47
|
Revision: 7071
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7071&view=rev
Author: efiring
Date: 2009-04-29 19:38:35 +0000 (Wed, 29 Apr 2009)
Log Message:
-----------
Condense argument handling in fill_between, and add masked example
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/fill_between.py
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/examples/pylab_examples/fill_between.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/fill_between.py 2009-04-29 16:07:27 UTC (rev 7070)
+++ trunk/matplotlib/examples/pylab_examples/fill_between.py 2009-04-29 19:38:35 UTC (rev 7071)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import matplotlib.mlab as mlab
-from pylab import figure, show
+from matplotlib.pyplot import figure, show
import numpy as np
x = np.arange(0.0, 2, 0.01)
@@ -27,11 +27,24 @@
# fill_between(x[where], y1[where],y2[where]
# because of edge effects over multiple contiguous regions.
fig = figure()
-ax = fig.add_subplot(111)
+ax = fig.add_subplot(211)
ax.plot(x, y1, x, y2, color='black')
-ax.fill_between(x, y1, y2, where=y2>y1, facecolor='green')
+ax.fill_between(x, y1, y2, where=y2>=y1, facecolor='green')
ax.fill_between(x, y1, y2, where=y2<=y1, facecolor='red')
ax.set_title('fill between where')
+# Test support for masked arrays.
+y2 = np.ma.masked_greater(y2, 1.0)
+ax1 = fig.add_subplot(212, sharex=ax)
+ax1.plot(x, y1, x, y2, color='black')
+ax1.fill_between(x, y1, y2, where=y2>=y1, facecolor='green')
+ax1.fill_between(x, y1, y2, where=y2<=y1, facecolor='red')
+ax1.set_title('Now regions with y2>1 are masked')
+
+# This example illustrates a problem; because of the data
+# gridding, there are undesired unfilled triangles at the crossover
+# points. A brute-force solution would be to interpolate all
+# arrays to a very fine grid before plotting.
+
show()
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-04-29 16:07:27 UTC (rev 7070)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-04-29 19:38:35 UTC (rev 7071)
@@ -5832,40 +5832,29 @@
self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs)
self._process_unit_info(ydata=y2)
- if where is None:
- where = np.ones(len(x), np.bool)
- else:
- where = np.asarray(where)
-
- maskedx = isinstance(x, np.ma.MaskedArray)
- maskedy1 = isinstance(y1, np.ma.MaskedArray)
- maskedy2 = isinstance(y2, np.ma.MaskedArray)
-
- if (maskedx or maskedy1 or maskedy2):
- if maskedx:
- where = where & (~x.mask)
-
- if maskedy1:
- where = where & (~y1.mask)
-
- if maskedy2:
- where = where & (~y2.mask)
-
-
# Convert the arrays so we can work with them
- x = np.asarray(self.convert_xunits(x))
- y1 = np.asarray(self.convert_yunits(y1))
- y2 = np.asarray(self.convert_yunits(y2))
+ x = np.asanyarray(self.convert_xunits(x))
+ y1 = np.asanyarray(self.convert_yunits(y1))
+ y2 = np.asanyarray(self.convert_yunits(y2))
- if not cbook.iterable(y1):
+ if y1.ndim == 0:
y1 = np.ones_like(x)*y1
-
- if not cbook.iterable(y2):
+ if y2.ndim == 0:
y2 = np.ones_like(x)*y2
+ if where is None:
+ where = np.ones(len(x), np.bool)
+ else:
+ where = np.asarray(where, np.bool)
- assert( (len(x)==len(y1)) and (len(x)==len(y2)) and len(x)==len(where))
+ if not (x.shape == y1.shape == y2.shape == where.shape):
+ raise ValueError("Argument dimensions are incompatible")
+ mask = reduce(ma.mask_or,
+ [ma.getmask(x), ma.getmask(y1), ma.getmask(y2)])
+ if mask is not ma.nomask:
+ where &= ~mask
+
polys = []
for ind0, ind1 in mlab.contiguous_regions(where):
theseverts = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2009-04-29 16:07:31
|
Revision: 7070
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7070&view=rev
Author: jdh2358
Date: 2009-04-29 16:07:27 +0000 (Wed, 29 Apr 2009)
Log Message:
-----------
add masked array support to fill_between
Modified Paths:
--------------
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk.py
trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/examples/user_interfaces/embedding_in_gtk.py
===================================================================
--- trunk/matplotlib/examples/user_interfaces/embedding_in_gtk.py 2009-04-29 15:28:33 UTC (rev 7069)
+++ trunk/matplotlib/examples/user_interfaces/embedding_in_gtk.py 2009-04-29 16:07:27 UTC (rev 7070)
@@ -10,8 +10,8 @@
from numpy import arange, sin, pi
# uncomment to select /GTK/GTKAgg/GTKCairo
-from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
-#from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
+#from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
+from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
#from matplotlib.backends.backend_gtkcairo import FigureCanvasGTKCairo as FigureCanvas
Modified: trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py
===================================================================
--- trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py 2009-04-29 15:28:33 UTC (rev 7069)
+++ trunk/matplotlib/examples/user_interfaces/embedding_in_gtk2.py 2009-04-29 16:07:27 UTC (rev 7070)
@@ -9,8 +9,8 @@
from numpy import arange, sin, pi
# uncomment to select /GTK/GTKAgg/GTKCairo
-from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
-#from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
+#from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
+from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
#from matplotlib.backends.backend_gtkcairo import FigureCanvasGTKCairo as FigureCanvas
# or NavigationToolbar for classic
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-04-29 15:28:33 UTC (rev 7069)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-04-29 16:07:27 UTC (rev 7070)
@@ -5832,6 +5832,26 @@
self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs)
self._process_unit_info(ydata=y2)
+ if where is None:
+ where = np.ones(len(x), np.bool)
+ else:
+ where = np.asarray(where)
+
+ maskedx = isinstance(x, np.ma.MaskedArray)
+ maskedy1 = isinstance(y1, np.ma.MaskedArray)
+ maskedy2 = isinstance(y2, np.ma.MaskedArray)
+
+ if (maskedx or maskedy1 or maskedy2):
+ if maskedx:
+ where = where & (~x.mask)
+
+ if maskedy1:
+ where = where & (~y1.mask)
+
+ if maskedy2:
+ where = where & (~y2.mask)
+
+
# Convert the arrays so we can work with them
x = np.asarray(self.convert_xunits(x))
y1 = np.asarray(self.convert_yunits(y1))
@@ -5843,10 +5863,7 @@
if not cbook.iterable(y2):
y2 = np.ones_like(x)*y2
- if where is None:
- where = np.ones(len(x), np.bool)
- where = np.asarray(where)
assert( (len(x)==len(y1)) and (len(x)==len(y2)) and len(x)==len(where))
polys = []
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2009-04-29 15:28:41
|
Revision: 7069
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7069&view=rev
Author: mdboom
Date: 2009-04-29 15:28:33 +0000 (Wed, 29 Apr 2009)
Log Message:
-----------
Fix bug in Cairo backend due to changes in convert_path, reported by Michiel de Hoon
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py 2009-04-28 19:48:18 UTC (rev 7068)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_cairo.py 2009-04-29 15:28:33 UTC (rev 7069)
@@ -122,8 +122,7 @@
tpath, affine = clippath.get_transformed_path_and_affine()
ctx.new_path()
affine = affine + Affine2D().scale(1.0, -1.0).translate(0.0, self.height)
- tpath = affine.transform_path(tpath)
- RendererCairo.convert_path(ctx, tpath)
+ RendererCairo.convert_path(ctx, tpath, affine)
ctx.clip()
def _fill_and_stroke (self, ctx, fill_c, alpha):
@@ -184,9 +183,8 @@
ctx = self.ctx
ctx.save()
if clippath is not None:
- tpath = clippath_trans.transform_path(clippath)
ctx.new_path()
- RendererCairo.convert_path(ctx, tpath)
+ RendererCairo.convert_path(ctx, clippath, clippath_trans)
ctx.clip()
y = self.height - y - rows
ctx.set_source_surface (surface, x, y)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2009-04-28 19:48:22
|
Revision: 7068
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7068&view=rev
Author: leejjoon
Date: 2009-04-28 19:48:18 +0000 (Tue, 28 Apr 2009)
Log Message:
-----------
Fixed incorrect bbox of eps output when usetex=True
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-04-27 23:30:20 UTC (rev 7067)
+++ trunk/matplotlib/CHANGELOG 2009-04-28 19:48:18 UTC (rev 7068)
@@ -1,5 +1,7 @@
======================================================================
+2009-04-28 Fixed incorrect bbox of eps output when usetex=True. - JJL
+
2009-04-24 Changed use of os.open* to instead use subprocess.Popen.
os.popen* are deprecated in 2.6 and are removed in 3.0. - RMM
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-04-27 23:30:20 UTC (rev 7067)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2009-04-28 19:48:18 UTC (rev 7068)
@@ -1096,17 +1096,25 @@
isLandscape = True
width, height = height, width
bbox = (lly, llx, ury, urx)
- temp_papertype = _get_papertype(width, height)
- if papertype=='auto':
- papertype = temp_papertype
- paperWidth, paperHeight = papersize[temp_papertype]
+
+ # set the paper size to the figure size if isEPSF. The
+ # resulting ps file has the given size with correct bounding
+ # box so that there is no need to call 'pstoeps'
+ if isEPSF:
+ paperWidth, paperHeight = self.figure.get_size_inches()
else:
- paperWidth, paperHeight = papersize[papertype]
- if (width>paperWidth or height>paperHeight) and isEPSF:
+ temp_papertype = _get_papertype(width, height)
+ if papertype=='auto':
+ papertype = temp_papertype
paperWidth, paperHeight = papersize[temp_papertype]
- verbose.report('Your figure is too big to fit on %s paper. %s \
-paper will be used to prevent clipping.'%(papertype, temp_papertype), 'helpful')
+ else:
+ paperWidth, paperHeight = papersize[papertype]
+ if (width>paperWidth or height>paperHeight) and isEPSF:
+ paperWidth, paperHeight = papersize[temp_papertype]
+ verbose.report('Your figure is too big to fit on %s paper. %s \
+ paper will be used to prevent clipping.'%(papertype, temp_papertype), 'helpful')
+
texmanager = renderer.get_texmanager()
font_preamble = texmanager.get_font_preamble()
custom_preamble = texmanager.get_custom_preamble()
@@ -1247,10 +1255,16 @@
os.remove(outfile)
os.remove(tmpfile)
shutil.move(psfile, tmpfile)
- if eps:
- pstoeps(tmpfile, bbox)
+
+ # Since the the paper size is set to the figure size for eps
+ # output (in '_print_figure_tex'), pstoeps call is not required.
+
+ #if eps:
+ # pstoeps(tmpfile, bbox)
+
+
def xpdf_distill(tmpfile, eps=False, ptype='letter', bbox=None):
"""
Use ghostscript's ps2pdf and xpdf's/poppler's pdftops to distill a file.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2009-04-27 23:30:23
|
Revision: 7067
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7067&view=rev
Author: astraw
Date: 2009-04-27 23:30:20 +0000 (Mon, 27 Apr 2009)
Log Message:
-----------
Don't raise error in boxplot() when a location has no observations.
Fixes "IndexError: index out of range for array".
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2009-04-26 10:29:30 UTC (rev 7066)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2009-04-27 23:30:20 UTC (rev 7067)
@@ -4856,6 +4856,9 @@
for i,pos in enumerate(positions):
d = np.ravel(x[i])
row = len(d)
+ if row==0:
+ # no data, skip this position
+ continue
# get median and quartiles
q1, med, q3 = mlab.prctile(d,[25,50,75])
# get high extreme
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2009-04-26 10:29:37
|
Revision: 7066
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7066&view=rev
Author: jouni
Date: 2009-04-26 10:29:30 +0000 (Sun, 26 Apr 2009)
Log Message:
-----------
Mention rotate kwarg in xticks and yticks docstrings
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/pyplot.py
Modified: trunk/matplotlib/lib/matplotlib/pyplot.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/pyplot.py 2009-04-24 22:44:34 UTC (rev 7065)
+++ trunk/matplotlib/lib/matplotlib/pyplot.py 2009-04-26 10:29:30 UTC (rev 7066)
@@ -983,7 +983,9 @@
xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )
The keyword args, if any, are :class:`~matplotlib.text.Text`
- properties.
+ properties. For example, to rotate long labels::
+
+ xticks( arange(12), calendar.month_name[1:13], rotation=17 )
"""
ax = gca()
@@ -1019,7 +1021,9 @@
yticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )
The keyword args, if any, are :class:`~matplotlib.text.Text`
- properties.
+ properties. For example, to rotate long labels::
+
+ yticks( arange(12), calendar.month_name[1:13], rotation=45 )
"""
ax = gca()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ef...@us...> - 2009-04-24 22:44:43
|
Revision: 7065
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7065&view=rev
Author: efiring
Date: 2009-04-24 22:44:34 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
Fix for python 2.6: "as" is now reserved, don't use as a variable name.
Modified Paths:
--------------
trunk/matplotlib/lib/mpl_toolkits/axes_grid/axes_divider.py
Modified: trunk/matplotlib/lib/mpl_toolkits/axes_grid/axes_divider.py
===================================================================
--- trunk/matplotlib/lib/mpl_toolkits/axes_grid/axes_divider.py 2009-04-24 17:08:50 UTC (rev 7064)
+++ trunk/matplotlib/lib/mpl_toolkits/axes_grid/axes_divider.py 2009-04-24 22:44:34 UTC (rev 7065)
@@ -32,7 +32,7 @@
axes.
"""
-
+
def __init__(self, fig, pos, horizontal, vertical, aspect=None, anchor="C"):
"""
:param fig: matplotlib figure
@@ -48,9 +48,9 @@
so that the relative part of the horizontal and
vertical scales have same scale.
:param anchor: Detrmine how the reduced rectangle is placed
- when aspect is True,
+ when aspect is True,
"""
-
+
self._fig = fig
self._pos = pos
self._horizontal = horizontal
@@ -67,9 +67,9 @@
rs_sum, as_sum = 0., 0.
for s in l:
- rs, as = s.get_size(renderer)
- rs_sum += rs
- as_sum += as
+ _rs, _as = s.get_size(renderer)
+ rs_sum += _rs
+ as_sum += _as
if rs_sum != 0.:
k = (total_size - as_sum) / rs_sum
@@ -84,8 +84,8 @@
offsets = [0.]
for s in l:
- rs, as = s.get_size(renderer)
- offsets.append(offsets[-1] + rs*k + as)
+ _rs, _as = s.get_size(renderer)
+ offsets.append(offsets[-1] + _rs*k + _as)
return offsets
@@ -93,7 +93,7 @@
def set_position(self, pos):
"""
set the position of the rectangle.
-
+
:param pos: position (tuple of 4 floats) of the rectangle that
will be divided.
"""
@@ -220,7 +220,7 @@
"""
returns a new locator
(:class:`mpl_toolkits.axes_grid.axes_divider.AxesLocator`) for
- specified cell.
+ specified cell.
:param nx, nx1: Integers specifying the column-position of the
cell. When nx1 is None, a single nx-th column is
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2009-04-24 17:09:02
|
Revision: 7064
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7064&view=rev
Author: ryanmay
Date: 2009-04-24 17:08:50 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
Use subprocess.Popen instead of os.popen to retrieve memory usage. os.popen* are deprecated in Python 2.6.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/cbook.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2009-04-24 16:53:44 UTC (rev 7063)
+++ trunk/matplotlib/CHANGELOG 2009-04-24 17:08:50 UTC (rev 7064)
@@ -1,6 +1,9 @@
======================================================================
-2009-04-20 Worked on axes_grid documentation. Added
+2009-04-24 Changed use of os.open* to instead use subprocess.Popen.
+ os.popen* are deprecated in 2.6 and are removed in 3.0. - RMM
+
+2009-04-20 Worked on axes_grid documentation. Added
axes_grid.inset_locator. - JJL
2009-04-17 Initial check-in of the axes_grid toolkit. - JJL
@@ -16,12 +19,11 @@
an rasterizing backend are placed with incorrect size.
- JJL
-2008-04-14 Added Jonathan Taylor's Reinier Heeres' port of John
+2009-04-14 Added Jonathan Taylor's Reinier Heeres' port of John
Porters' mplot3d to svn trunk. Package in
mpl_toolkits.mplot3d and demo is examples/mplot3d/demo.py.
Thanks Reiner
-
2009-04-06 The pdf backend now escapes newlines and linefeeds in strings.
Fixes sf bug #2708559; thanks to Tiago Pereira for the report.
Modified: trunk/matplotlib/lib/matplotlib/cbook.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/cbook.py 2009-04-24 16:53:44 UTC (rev 7063)
+++ trunk/matplotlib/lib/matplotlib/cbook.py 2009-04-24 17:08:50 UTC (rev 7064)
@@ -903,15 +903,19 @@
def report_memory(i=0): # argument may go away
'return the memory consumed by process'
+ from subprocess import Popen, PIPE
pid = os.getpid()
if sys.platform=='sunos5':
- a2 = os.popen('ps -p %d -o osz' % pid).readlines()
+ a2 = Popen('ps -p %d -o osz' % pid, shell=True,
+ stdout=PIPE).stdout.readlines()
mem = int(a2[-1].strip())
elif sys.platform.startswith('linux'):
- a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines()
+ a2 = Popen('ps -p %d -o rss,sz' % pid, shell=True,
+ stdout=PIPE).stdout.readlines()
mem = int(a2[1].split()[1])
elif sys.platform.startswith('darwin'):
- a2 = os.popen('ps -p %d -o rss,vsz' % pid).readlines()
+ a2 = Popen('ps -p %d -o rss,vsz' % pid, shell=True,
+ stdout=PIPE).stdout.readlines()
mem = int(a2[1].split()[0])
return mem
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2009-04-24 16:53:54
|
Revision: 7063
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7063&view=rev
Author: ryanmay
Date: 2009-04-24 16:53:44 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
Use subprocess.Popen instead of os.popen4 to retrieve dvipng version. os.popen* are deprecated in Python 2.6.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/texmanager.py
Modified: trunk/matplotlib/lib/matplotlib/texmanager.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/texmanager.py 2009-04-24 15:23:57 UTC (rev 7062)
+++ trunk/matplotlib/lib/matplotlib/texmanager.py 2009-04-24 16:53:44 UTC (rev 7063)
@@ -34,6 +34,7 @@
"""
import copy, glob, os, shutil, sys, warnings
+from subprocess import Popen, PIPE, STDOUT
try:
from hashlib import md5
@@ -54,7 +55,9 @@
else: cmd_split = ';'
def dvipng_hack_alpha():
- stdin, stdout = os.popen4('dvipng -version')
+ p = Popen('dvipng -version', shell=True, stdin=PIPE, stdout=PIPE,
+ stderr=STDOUT, close_fds=True)
+ stdin, stdout = p.stdin, p.stdout
for line in stdout:
if line.startswith('dvipng '):
version = line.split()[-1]
@@ -601,4 +604,3 @@
dvi.close()
# A total height (including the descent) needs to be returned.
return page.width, page.height+page.descent, page.descent
-
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|