From: <ef...@us...> - 2010-06-04 19:20:53
|
Revision: 8378 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8378&view=rev Author: efiring Date: 2010-06-04 19:20:47 +0000 (Fri, 04 Jun 2010) Log Message: ----------- suppress spurious exceptions when killing a qt4 session. While investigating 2927619 I found that killing a python session with an active qt4 window generated Exceptions because callbacks were being executed after their modules had been deleted. There may be a cleaner solution than the one I implemented, which is merely to catch the useless exceptions. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-04 18:47:48 UTC (rev 8377) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-04 19:20:47 UTC (rev 8378) @@ -1447,8 +1447,14 @@ 'close_event' with a :class:`CloseEvent` """ s = 'close_event' - event = CloseEvent(s, self, guiEvent=guiEvent) - self.callbacks.process(s, event) + try: + event = CloseEvent(s, self, guiEvent=guiEvent) + self.callbacks.process(s, event) + except TypeError: + pass + # Suppress the TypeError when the python session is being killed. + # It may be that a better solution would be a mechanism to + # disconnect all callbacks upon shutdown. def key_press_event(self, key, guiEvent=None): """ Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2010-06-04 18:47:48 UTC (rev 8377) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2010-06-04 19:20:47 UTC (rev 8378) @@ -87,7 +87,7 @@ class TimerQT(TimerBase): ''' Subclass of :class:`backend_bases.TimerBase` that uses Qt4 timer events. - + Attributes: * interval: The time between timer events in milliseconds. Default is 1000 ms. @@ -99,7 +99,7 @@ ''' def __init__(self, *args, **kwargs): TimerBase.__init__(self, *args, **kwargs) - + # Create a new timer and connect the timeout() signal to the # _on_timer method. self._timer = QtCore.QTimer() @@ -237,9 +237,9 @@ Creates a new backend-specific subclass of :class:`backend_bases.Timer`. This is useful for getting periodic events through the backend's native event loop. Implemented only for backends with GUIs. - + optional arguments: - + *interval* Timer interval in milliseconds *callbacks* @@ -341,8 +341,15 @@ def _widgetclosed( self ): if self.window._destroying: return self.window._destroying = True - Gcf.destroy(self.num) + try: + Gcf.destroy(self.num) + except AttributeError: + pass + # It seems that when the python session is killed, + # Gcf can get destroyed before the Gcf.destroy + # line is run, leading to a useless AttributeError. + def _get_toolbar(self, canvas, parent): # must be inited after the window, drawingArea and figure # attrs are set This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-06 22:44:24
|
Revision: 8390 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8390&view=rev Author: efiring Date: 2010-06-06 22:44:18 +0000 (Sun, 06 Jun 2010) Log Message: ----------- [2841525] wx backend: fix classic toolbar; Figure.clf: add kwarg to keep axobservers Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py trunk/matplotlib/lib/matplotlib/figure.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2010-06-06 20:52:36 UTC (rev 8389) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2010-06-06 22:44:18 UTC (rev 8390) @@ -861,7 +861,7 @@ simply asks for image width and margin for printing. """ dmsg = """Width of output figure in inches. -The current aspect ration will be kept.""" +The current aspect ratio will be kept.""" dlg = wx.Dialog(self, -1, 'Page Setup for Printing' , (-1,-1)) df = dlg.GetFont() @@ -1546,8 +1546,11 @@ return self.toolbar def Destroy(self, *args, **kwargs): - self.canvas.mpl_disconnect(self.toolbar._idDrag) - # Rationale for line above: see issue 2941338. + try: + self.canvas.mpl_disconnect(self.toolbar._idDrag) + # Rationale for line above: see issue 2941338. + except AttributeError: + pass # classic toolbar lacks the attribute wx.Frame.Destroy(self, *args, **kwargs) if self.toolbar is not None: self.toolbar.Destroy() @@ -1707,6 +1710,8 @@ else: new = True self._menu.Check(evt.GetId(), new) + # Lines above would be deleted based on svn tracker ID 2841525; + # not clear whether this matters or not. self._toolbar.set_active(self.getActiveAxes()) evt.Skip() @@ -1720,7 +1725,11 @@ self._menu.Append(menuId, "Axis %d" % i, "Select axis %d" % i, True) self._menu.Check(menuId, True) bind(self, wx.EVT_MENU, self._onMenuItemSelected, id=menuId) - self._toolbar.set_active(range(len(self._axisId))) + elif maxAxis < len(self._axisId): + for menuId in self._axisId[maxAxis:]: + self._menu.Delete(menuId) + self._axisId = self._axisId[:maxAxis] + self._toolbar.set_active(range(maxAxis)) def getActiveAxes(self): """Return a list of the selected axes.""" @@ -2080,7 +2089,8 @@ def update(self): """ - Update the toolbar menu - called when (e.g.) a new subplot or axes are added + Update the toolbar menu - called when (e.g.) a new subplot + or axes are added """ DEBUG_MSG("update()", 1, self) self._axes = self.canvas.figure.get_axes() Modified: trunk/matplotlib/lib/matplotlib/figure.py =================================================================== --- trunk/matplotlib/lib/matplotlib/figure.py 2010-06-06 20:52:36 UTC (rev 8389) +++ trunk/matplotlib/lib/matplotlib/figure.py 2010-06-06 22:44:18 UTC (rev 8390) @@ -691,9 +691,12 @@ self.sca(a) return a - def clf(self): + def clf(self, keep_observers=False): """ - Clear the figure + Clear the figure. + + Set *keep_observers* to True if, for example, + a gui widget is tracking the axes in the figure. """ self.suppressComposite = None self.callbacks = cbook.CallbackRegistry(('dpi_changed', )) @@ -713,7 +716,8 @@ self.texts=[] self.images = [] self.legends = [] - self._axobservers = [] + if not keep_observers: + self._axobservers = [] def clear(self): """ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-06-07 14:24:05
|
Revision: 8393 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8393&view=rev Author: mdboom Date: 2010-06-07 14:23:58 +0000 (Mon, 07 Jun 2010) Log Message: ----------- Fix baseline-alignment on multi-line text. (Reported by Olle Engdeg?\195?\165rd) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg trunk/matplotlib/lib/matplotlib/tests/test_text.py trunk/matplotlib/lib/matplotlib/text.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.svg Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg 2010-06-07 13:04:24 UTC (rev 8392) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/formatter_ticker_005.svg 2010-06-07 14:23:58 UTC (rev 8393) @@ -143,7 +143,7 @@ <g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="518.400000" y="43.200000"/> </g></g> <g id="text6"> -<g style="fill: #000000; opacity: 1.000000" transform="translate(498.314062,401.706250)scale(0.120000)"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(498.314063,401.706250)scale(0.120000)"> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115"/> <use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> @@ -163,7 +163,7 @@ <path id="c_0bce5afba2dc6b9024b26277c38ad8e8" d="M56.203125 -29.593750l0.000000 4.390625l-41.312500 0.000000q0.593750 9.281250 5.593750 14.140625q5.000000 4.859375 13.937500 4.859375q5.171875 0.000000 10.031250 -1.265625q4.859375 -1.265625 9.656250 -3.812500l0.000000 8.500000q-4.843750 2.046875 -9.921875 3.125000q-5.078125 1.078125 -10.296875 1.078125q-13.093750 0.000000 -20.734375 -7.609375q-7.640625 -7.625000 -7.640625 -20.625000q0.000000 -13.421875 7.250000 -21.296875q7.250000 -7.890625 19.562500 -7.890625q11.031250 0.000000 17.453125 7.109375q6.421875 7.093750 6.421875 19.296875M47.218750 -32.234375q-0.093750 -7.359375 -4.125000 -11.750000q-4.031250 -4.406250 -10.671875 -4.406250q-7.515625 0.000000 -12.031250 4.250000q-4.515625 4.250000 -5.203125 11.968750z"/> <path id="c_d41d8cd98f00b204e9800998ecf8427e" d=""/> </defs> -<g style="fill: #000000; opacity: 1.000000" transform="translate(262.293750,416.003125)scale(0.120000)"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(262.121875,416.003125)scale(0.120000)"> <use xlink:href="#c_801fe2e877fad46da27c898b407b3b54"/> <use xlink:href="#c_7b26b13f539f13a4c64eef23b6952d29" x="59.179688"/> <use xlink:href="#c_5099edb83619131346ae654950954dea" x="95.263672"/> @@ -289,7 +289,7 @@ <g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="158.400000"/> </g></g> <g id="text14"> -<g style="fill: #000000; opacity: 1.000000" transform="translate(43.375000,162.767188)scale(0.120000)"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(43.375000,162.767187)scale(0.120000)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="63.623047"/> <use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="127.246094"/> Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_text/multiline.pdf 2010-06-07 14:23:58 UTC (rev 8393) @@ -0,0 +1,194 @@ +%PDF-1.4 +%\xAC\xDC \xAB\xBA +1 0 obj +<< /Type /Catalog /Pages 2 0 R >> +endobj +8 0 obj +<< /XObject 7 0 R /Pattern 5 0 R +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /ExtGState 4 0 R +/Shading 6 0 R /Font 3 0 R >> +endobj +10 0 obj +<< /Contents 9 0 R /Type /Page /Resources 8 0 R /Parent 2 0 R +/MediaBox [ 0 0 576 432 ] >> +endobj +9 0 obj +<< /Filter /FlateDecode /Length 11 0 R >> +stream +x\x9Cm\x8F=\xC20\x85w\x9F\xC2#,!\xCE_\xC3Z *\xB1\x92 \xD1VEI\xA7 8>.ڪ\x91\x9F\xFD\xDEg+\x847PxB_%&\xB4\x85\xE3\xDF\xD5h\xC5J\xFE*ϡ\xE4܃U\x85bC\xA8\x81!/\xCC\xD8\xC4O\xA3\xBD\x9E;\xCD\xE4\x81h\xDA1\xDAi\xC9\xC1fK\xD7\xE6\xFF\xDBc\xBA\xCCc\xC9\xFF\x94\xD8Bpw$$\xC3Lh@9#\xBC/,\x92BZ\xA7,\x86+l\xD2=\xE6.v}\xBD\xC5p\xC3CXaF \xEB +H\xBD\xD7|c\xA0r\xFD\xCCx\x89]ۧ\xBA\xCF_^]\x9FL +endstream +endobj +11 0 obj +185 +endobj +16 0 obj +<< /Filter /FlateDecode /Length 304 >> +stream +x\x9C=\x92;\x92\xC30C{\x9D\x82Ȍ\xF8\x93\xE4\xF3d'\x95\xF7\xFE\xED>2\xC9V\x80I\x89 |
From: <md...@us...> - 2010-06-07 20:15:18
|
Revision: 8395 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8395&view=rev Author: mdboom Date: 2010-06-07 20:15:11 +0000 (Mon, 07 Jun 2010) Log Message: ----------- [2860167] setting radial range of polar plot fails Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/projections/polar.py trunk/matplotlib/lib/matplotlib/tests/test_axes.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.svg Modified: trunk/matplotlib/lib/matplotlib/projections/polar.py =================================================================== --- trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-06-07 18:29:09 UTC (rev 8394) +++ trunk/matplotlib/lib/matplotlib/projections/polar.py 2010-06-07 20:15:11 UTC (rev 8395) @@ -35,14 +35,31 @@ output_dims = 2 is_separable = False + def __init__(self, axis=None): + Transform.__init__(self) + self._axis = axis + def transform(self, tr): xy = np.zeros(tr.shape, np.float_) + if self._axis is not None: + rmin = self._axis.viewLim.ymin + else: + rmin = 0 + t = tr[:, 0:1] r = tr[:, 1:2] x = xy[:, 0:1] y = xy[:, 1:2] - x[:] = r * np.cos(t) - y[:] = r * np.sin(t) + + if rmin != 0: + r = r - rmin + mask = r < 0 + x[:] = np.where(mask, np.nan, r * np.cos(t)) + y[:] = np.where(mask, np.nan, r * np.sin(t)) + else: + x[:] = r * np.cos(t) + y[:] = r * np.sin(t) + return xy transform.__doc__ = Transform.transform.__doc__ @@ -61,7 +78,7 @@ transform_path_non_affine.__doc__ = Transform.transform_path_non_affine.__doc__ def inverted(self): - return PolarAxes.InvertedPolarTransform() + return PolarAxes.InvertedPolarTransform(self._axis) inverted.__doc__ = Transform.inverted.__doc__ class PolarAffine(Affine2DBase): @@ -84,9 +101,9 @@ def get_matrix(self): if self._invalid: limits_scaled = self._limits.transformed(self._scale_transform) - ymax = limits_scaled.ymax + yscale = limits_scaled.ymax - limits_scaled.ymin affine = Affine2D() \ - .scale(0.5 / ymax) \ + .scale(0.5 / yscale) \ .translate(0.5, 0.5) self._mtx = affine.get_matrix() self._inverted = None @@ -103,10 +120,16 @@ output_dims = 2 is_separable = False + def __init__(self, axis=None): + Transform.__init__(self) + self._axis = axis + def transform(self, xy): x = xy[:, 0:1] y = xy[:, 1:] r = np.sqrt(x*x + y*y) + if self._axis is not None: + r += self._axis.viewLim.ymin theta = np.arccos(x / r) theta = np.where(y < 0, 2 * np.pi - theta, theta) return np.concatenate((theta, r), 1) @@ -221,9 +244,13 @@ # It is assumed that this part will have non-linear components self.transScale = TransformWrapper(IdentityTransform()) - # A (possibly non-linear) projection on the (already scaled) data - self.transProjection = self.PolarTransform() + # A (possibly non-linear) projection on the (already scaled) + # data. This one is aware of rmin + self.transProjection = self.PolarTransform(self) + # This one is not aware of rmin + self.transPureProjection = self.PolarTransform() + # An affine transformation on the data, generally to limit the # range of the axes self.transProjectionAffine = self.PolarAffine(self.transScale, self.viewLim) @@ -237,7 +264,7 @@ # equivalent to transData, except it always puts r == 1.0 at # the edge of the axis circle. self._xaxis_transform = ( - self.transProjection + + self.transPureProjection + self.PolarAffine(IdentityTransform(), Bbox.unit()) + self.transAxes) # The theta labels are moved from radius == 0.0 to radius == 1.1 @@ -298,13 +325,23 @@ (0.5, 0.5), 0.5)} def set_rmax(self, rmax): - self.viewLim.y0 = 0 self.viewLim.y1 = rmax - angle = self._r_label1_position.to_values()[4] def get_rmax(self): return self.viewLim.ymax + def set_rmin(self, rmin): + self.viewLim.y0 = rmin + + def get_rmin(self): + return self.viewLim.ymin + + def set_rlim(self, rmin=None, rmax=None): + self.viewLim.y0 = rmin + self.viewLim.y1 = rmax + + set_ylim = set_rlim + def set_yscale(self, *args, **kwargs): Axes.set_yscale(self, *args, **kwargs) self.yaxis.set_major_locator( Added: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf (rev 0) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/polar_rmin.pdf 2010-06-07 20:15:11 UTC (rev 8395) @@ -0,0 +1,321 @@ +%PDF-1.4 +%\xAC\xDC \xAB\xBA +1 0 obj +<< /Type /Catalog /Pages 2 0 R >> +endobj +8 0 obj +<< /XObject 7 0 R /Pattern 5 0 R +/ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ] /ExtGState 4 0 R +/Shading 6 0 R /Font 3 0 R >> +endobj +10 0 obj +<< /Contents 9 0 R /Type /Page /Resources 8 0 R /Parent 2 0 R +/MediaBox [ 0 0 576 432 ] >> +endobj +9 0 obj +<< /Filter /FlateDecode /Length 11 0 R >> +stream +x\x9C\xED\x9DϮ<?n\xDD\xF7\xF5\xB5L6\xFDWik 1\xE0]\xE2\xB2\xB2r\x90\xC6u\x80\xAC\xFCZyĜշKE];;?\xAF\xAE1\xE3\xF9ޮ\xAE\xAE\x92DR$Ͽ=\xD2\xF9Wg<\xFF\x87\xFE\xFB\x97G8\xC3\xF9wg\xEDM\xFF\xFBe\xFF[rҿ\xC2\xE7\xF5\xF9\xF1\xFA\xDE\xDF\xEB_y\xA4\xEBҕW\xD2M9\xE7וz\xB5\xBD?˽\xBF\xFA\x95K\x88\xAD\xC7v\xB6\xF8*\xA1\xA7q\x85\x91\xF5\xBB1\xBC\xE2u\x85\xFB5\x8E\xA1{c\xE5J1\x9Es\x96\x92^u\xE8\xC7\xE2\xAD\x9C1\xB5W\x8A\xAD\x8E+\xA7\xAB\x9C\xA5\x85\xD7uƮ\xD0\xCF\xDEl~\xA4\xEF\x9Cs\xBC\xFF\xAD\xC7ݯ\xF3\xFC\xBD\xEA\xFAb\xCFW\xC9\xF9\xBA\xFFһ\xB8Qd=v\xFD\xA9u\xD4\xF9\xBAx\xF2\xF5\xFE\xD7\xF17g҃?/9/\xC7q\xAD\x83q\xBF\xA7\xF7Ll\xEF\xF5\xB4e\xDD8b\xAC\x9A\xF5\xC7\xC0\xDFŦw\x99\xFF~L\x9B\xFB=7\xCF\xCFwqK\xE4\x86\xF1\\xDCǰM>\x82\xF27\xE7\xFF<\xFE\xFB\xF1\xBF\xCF_\xC9\xF9\x95\x9C?_r\xFE\xF3\xF9\xBF\x84So8\xCF\xFF4\x88\xC5\xFB;}\xAF\xBD\xAER\xCF)h\xC8I\xEF\xAC\xC9i\xADf\xFDSЕ. +9 +\xB8\xA7+\xD9\xF5c\xCA)\xA51jz\x97WU\x9Fk\xAA]\xCF5i\x85c\xD7tp~\xD5\xDC\xF4G\x99\xEBE\x8F+!\xB71\xDE\xF7KRR\xB1\x94֢]O)\x84\xA6A\xA7b\xF7\xC7W\xEDZ\x972\xD2\xE0~M`\xAD5\xE50\xE2e\xF7\x87W\xB9\xF4Ҋ\xBD\xBF~Nokɞ߇\x94\x87@Yo\xA1\xEB\xFA\xB9b\xBD\xA2>\xE3~]O\x92\xE0p\x85\xA6iM\xCDRJ-]\xD0\xED\xFE\xEBծ\xA0\x97I\xA9h҂\xBE\x9E\xAE\xF3żs\xBF\x96%kZ\xBC\xBA\xDE/t=.զ\xE9\x8C\xC3\xEE\xB7z\xEEm\xAE7\xA6\xE3\xD2d\x87>k\x8Du\x8F&Y\xD7\xEB+\i\xB4z\xE5\xDA\xDF\xF7\xF78Z\xAAz`\xD6\xF5\xCCtĦ\xF7 \xF5}\xFFUr\xE8\xE1*A\xEF\xD2+\xE8\xD1W˹\xA7\xF7\xFBk\xB9Z\x91L\xCDO\xD0\xF8r\xD7|iA\xE3\xFB\xFD\xABV[C(\xA8\x83\xA4\xEC\xD2d\x871\xFA\xF7\xF4\xC5C MK\xAA\xCB]\xA3\xEDU\xEB#%xO\xDF(\x9A\x99\xD1G@\xD7!y\x90\xD9\xF0\xB5<\xD2'}\xA1\x94!\x81E\xC3\xEB\xAD\xF6\xAB\xBE\x96W\xDD\xF8 +\xCDw,\xDF%\xA5'\xD5B-\xF3\xF8\xF8һ\xA9E\xEC\xF5[\xFA\xBA\xFE\x90*K\xBA\xE254YI+\xF5)<ү\x96c\x95pI\xB3\xA54\xAD\xD6\xBE\x85K\xAF|iH\xF6S\x837\xD5%\xCD\xD5\xD0\xC7M\x8F\xD2ȳ&7\xF2]=\xFB\xE2U5V]z!\xB5Hzn\x99\xFBZ)\x9A\xACvi\xA1\xA2\xDE,ǚ5\xAEL\x91F{e-m֛k\xA1\xA2F֊\xC4T\xB39o\xBFICk\xB3\xCB1\xC7r\xF1\xA1\x97\xD0\xF34i%\xA4\xCAHӫ\x8F*\xB9\x89&\x86z\x87W\xE0\xDA%\xB0\xCB +9\xAE5\xF7a\xB7\xEB\xE9\xB1غ\x97>\xAFKFR\xD5\xECV\xBB\xFF\xD2:t&+\xD4y]\xFA\x96[FO\xB8_z#\x95\xAD!J\xAC\xE6\xDBg\x9ET\xB4\x90\xA8\xA1~[r%\xC5\xEF=\xA4a\xA3\xA5&=K\xB0h\xF7wɑ~\xACJX\xA3]\xD7*i\xBAL\xAB\xB8_r\x8F\xA1\xE5b\x93rN҂\xEC\xF1I\xEF+D\xD1\x8Cl\xCD$"\x97$\xFA\xBAl\xF8IP\xABG\x85,Y\xB9l\xA1\x85(\x97\x86\xDFK\xB1\xFB\xA5%B\xE9U4 +\xF2\xBA\xA4Zܟ\xC3+\xE9iTM\x9B\xE49]\xE6\xFE\x9C\x84\xF1\xB1FTߤXW됰d\xBB[\xB2 \xA0\x8Cұ\xD6MId#\xAA\xAD\xE7jw냀Fhʸ\xAE\xB1\xCA\xC6\xD4b\x9CO/\xBD\xA1@Ib[M\x87\xF5\xB0"D\xC3h\xED\x80-\x8C |
From: <ef...@us...> - 2010-06-12 23:40:26
|
Revision: 8423 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8423&view=rev Author: efiring Date: 2010-06-12 23:40:19 +0000 (Sat, 12 Jun 2010) Log Message: ----------- backends: move windowing.py into backends--it is very backend-specific Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py Added Paths: ----------- trunk/matplotlib/lib/matplotlib/backends/windowing.py Removed Paths: ------------- trunk/matplotlib/lib/matplotlib/windowing.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2010-06-12 23:08:11 UTC (rev 8422) +++ trunk/matplotlib/lib/matplotlib/backends/backend_fltkagg.py 2010-06-12 23:40:19 UTC (rev 8423) @@ -26,7 +26,7 @@ NavigationToolbar2, cursors from matplotlib.figure import Figure from matplotlib._pylab_helpers import Gcf -import matplotlib.windowing as windowing +import matplotlib.backends.windowing as windowing from matplotlib.widgets import SubplotTool Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-06-12 23:08:11 UTC (rev 8422) +++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-06-12 23:40:19 UTC (rev 8423) @@ -11,6 +11,7 @@ import matplotlib.backends.tkagg as tkagg from matplotlib.backends.backend_agg import FigureCanvasAgg +import matplotlib.backends.windowing as windowing import matplotlib from matplotlib.cbook import is_string_like @@ -21,7 +22,6 @@ from matplotlib.figure import Figure from matplotlib._pylab_helpers import Gcf -import matplotlib.windowing as windowing from matplotlib.widgets import SubplotTool import matplotlib.cbook as cbook Copied: trunk/matplotlib/lib/matplotlib/backends/windowing.py (from rev 8419, trunk/matplotlib/lib/matplotlib/windowing.py) =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/windowing.py (rev 0) +++ trunk/matplotlib/lib/matplotlib/backends/windowing.py 2010-06-12 23:40:19 UTC (rev 8423) @@ -0,0 +1,26 @@ +""" +MS Windows-specific helper for TkAgg and FltkAgg backends. + +With rcParams['tk.window_focus'] default of False, it is +effectively disabled. + +It uses a tiny C++ extension module to access MS Win functions. +""" +from matplotlib import rcParams + +try: + if not rcParams['tk.window_focus']: + raise ImportError + from matplotlib._windowing import GetForegroundWindow, SetForegroundWindow +except ImportError: + def GetForegroundWindow(): + return 0 + def SetForegroundWindow(hwnd): + pass + +class FocusManager: + def __init__(self): + self._shellWindow = GetForegroundWindow() + + def __del__(self): + SetForegroundWindow(self._shellWindow) Deleted: trunk/matplotlib/lib/matplotlib/windowing.py =================================================================== --- trunk/matplotlib/lib/matplotlib/windowing.py 2010-06-12 23:08:11 UTC (rev 8422) +++ trunk/matplotlib/lib/matplotlib/windowing.py 2010-06-12 23:40:19 UTC (rev 8423) @@ -1,26 +0,0 @@ -""" -MS Windows-specific helper for TkAgg and FltkAgg backends. - -With rcParams['tk.window_focus'] default of False, it is -effectively disabled. - -It uses a tiny C++ extension module to access MS Win functions. -""" -from matplotlib import rcParams - -try: - if not rcParams['tk.window_focus']: - raise ImportError - from matplotlib._windowing import GetForegroundWindow, SetForegroundWindow -except ImportError: - def GetForegroundWindow(): - return 0 - def SetForegroundWindow(hwnd): - pass - -class FocusManager: - def __init__(self): - self._shellWindow = GetForegroundWindow() - - def __del__(self): - SetForegroundWindow(self._shellWindow) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-13 21:04:21
|
Revision: 8424 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8424&view=rev Author: efiring Date: 2010-06-13 21:04:14 +0000 (Sun, 13 Jun 2010) Log Message: ----------- [3015013] use atexit in _pylab_helpers to ensure orderly shutdown. It closes all windows; in the case of Tk, this calls the root.destroy() function, which should prevent the PyEval_RestoreThread error on Win. See http://mail.python.org/pipermail/python-bugs-list/2002-November/014207.html This changeset also refactors the close() functionality into three Gcf methods, fixing a bug (or inconsistency) in which calling close with a figure number failed to call mpl_disconnect. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/_pylab_helpers.py trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py trunk/matplotlib/lib/matplotlib/pyplot.py Modified: trunk/matplotlib/lib/matplotlib/_pylab_helpers.py =================================================================== --- trunk/matplotlib/lib/matplotlib/_pylab_helpers.py 2010-06-12 23:40:19 UTC (rev 8423) +++ trunk/matplotlib/lib/matplotlib/_pylab_helpers.py 2010-06-13 21:04:14 UTC (rev 8424) @@ -4,8 +4,12 @@ import sys, gc +import atexit +import traceback + + def error_msg(msg): - print >>sys.stderr, msgs + print >>sys.stderr, msg class Gcf(object): """ @@ -34,10 +38,10 @@ If figure manager *num* exists, make it the active figure and return the manager; otherwise return *None*. """ - figManager = Gcf.figs.get(num, None) - if figManager is not None: - Gcf.set_active(figManager) - return figManager + manager = Gcf.figs.get(num, None) + if manager is not None: + Gcf.set_active(manager) + return manager @staticmethod def destroy(num): @@ -48,22 +52,36 @@ window "destroy" and "delete" events. """ if not Gcf.has_fignum(num): return - figManager = Gcf.figs[num] + manager = Gcf.figs[num] + manager.canvas.mpl_disconnect(manager._cidgcf) # There must be a good reason for the following careful # rebuilding of the activeQue; what is it? oldQue = Gcf._activeQue[:] Gcf._activeQue = [] for f in oldQue: - if f != figManager: + if f != manager: Gcf._activeQue.append(f) del Gcf.figs[num] #print len(Gcf.figs.keys()), len(Gcf._activeQue) - figManager.destroy() + manager.destroy() gc.collect() @staticmethod + def destroy_fig(fig): + "*fig* is a Figure instance" + for manager in Gcf.figs.values(): + if manager.canvas.figure == fig: + Gcf.destroy(manager.num) + + @staticmethod + def destroy_all(): + for manager in Gcf.figs.values(): + Gcf.destroy(manager.num) + + + @staticmethod def has_fignum(num): """ Return *True* if figure *num* exists. @@ -105,3 +123,7 @@ Gcf._activeQue.append(manager) Gcf.figs[manager.num] = manager +atexit.register(Gcf.destroy_all) + + + Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-06-12 23:40:19 UTC (rev 8423) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2010-06-13 21:04:14 UTC (rev 8424) @@ -551,7 +551,7 @@ self.canvas.destroy() if self.toolbar: self.toolbar.destroy() - self.__dict__.clear() + self.__dict__.clear() #Is this needed? Other backends don't have it. if Gcf.get_num_fig_managers()==0 and \ not matplotlib.is_interactive() and \ Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-06-12 23:40:19 UTC (rev 8423) +++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2010-06-13 21:04:14 UTC (rev 8424) @@ -491,10 +491,8 @@ if self.window is not None: #self.toolbar.destroy() self.window.destroy() + self.window = None - pass - self.window = None - def set_window_title(self, title): self.window.wm_title(title) Modified: trunk/matplotlib/lib/matplotlib/pyplot.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-12 23:40:19 UTC (rev 8423) +++ trunk/matplotlib/lib/matplotlib/pyplot.py 2010-06-13 21:04:14 UTC (rev 8424) @@ -315,21 +315,15 @@ figManager = _pylab_helpers.Gcf.get_active() if figManager is None: return else: - figManager.canvas.mpl_disconnect(figManager._cidgcf) _pylab_helpers.Gcf.destroy(figManager.num) elif len(args)==1: arg = args[0] if arg=='all': - for manager in _pylab_helpers.Gcf.get_all_fig_managers(): - manager.canvas.mpl_disconnect(manager._cidgcf) - _pylab_helpers.Gcf.destroy(manager.num) + _pylab_helpers.Gcf.destroy_all() elif isinstance(arg, int): _pylab_helpers.Gcf.destroy(arg) elif isinstance(arg, Figure): - for manager in _pylab_helpers.Gcf.get_all_fig_managers(): - if manager.canvas.figure==arg: - manager.canvas.mpl_disconnect(manager._cidgcf) - _pylab_helpers.Gcf.destroy(manager.num) + _pylab_helpers.Gcf.destroy_fig(arg) else: raise TypeError('Unrecognized argument type %s to close'%type(arg)) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-14 05:31:26
|
Revision: 8434 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8434&view=rev Author: efiring Date: 2010-06-14 05:31:20 +0000 (Mon, 14 Jun 2010) Log Message: ----------- [2895114] _get_data_path: improve py2exe handling and readability. Also convert some imports to absolute. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/config/cutils.py Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2010-06-14 02:53:59 UTC (rev 8433) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2010-06-14 05:31:20 UTC (rev 8434) @@ -126,8 +126,10 @@ import sys, os, tempfile -from rcsetup import defaultParams, validate_backend, validate_toolbar -from rcsetup import validate_cairo_format +from matplotlib.rcsetup import (defaultParams, + validate_backend, + validate_toolbar, + validate_cairo_format) major, minor1, minor2, s, tmp = sys.version_info _python24 = major>=2 and minor1>=4 @@ -478,28 +480,33 @@ return path path = os.sep.join([os.path.dirname(__file__), 'mpl-data']) - if os.path.isdir(path): return path + if os.path.isdir(path): + return path # setuptools' namespace_packages may highjack this init file # so need to try something known to be in matplotlib, not basemap import matplotlib.afm path = os.sep.join([os.path.dirname(matplotlib.afm.__file__), 'mpl-data']) - if os.path.isdir(path): return path + if os.path.isdir(path): + return path # py2exe zips pure python, so still need special check if getattr(sys,'frozen',None): - path = os.path.join(os.path.split(sys.path[0])[0], 'mpl-data') - if os.path.isdir(path): return path - else: - # Try again assuming we need to step up one more directory - path = os.path.join(os.path.split(os.path.split(sys.path[0])[0])[0], - 'mpl-data') - if os.path.isdir(path): return path - else: - # Try again assuming sys.path[0] is a dir not a exe - path = os.path.join(sys.path[0], 'mpl-data') - if os.path.isdir(path): return path + exe_path = os.path.dirname(sys.executable) + path = os.path.join(exe_path, 'mpl-data') + if os.path.isdir(path): + return path + # Try again assuming we need to step up one more directory + path = os.path.join(os.path.split(exe_path)[0], 'mpl-data') + if os.path.isdir(path): + return path + + # Try again assuming sys.path[0] is a dir not a exe + path = os.path.join(sys.path[0], 'mpl-data') + if os.path.isdir(path): + return path + raise RuntimeError('Could not find the matplotlib data files') def _get_data_path_cached(): @@ -813,11 +820,12 @@ if NEWCONFIG: #print "importing from reorganized config system!" try: - from config import rcParams, rcdefaults, mplConfig, save_config + from matplotlib.config import (rcParams, rcdefaults, + mplConfig, save_config) verbose.set_level(rcParams['verbose.level']) verbose.set_fileo(rcParams['verbose.fileo']) except: - from config import rcParams, rcdefaults + from matplotlib.config import rcParams, rcdefaults _use_error_msg = """ This call to matplotlib.use() has no effect because the the backend has already been chosen; Modified: trunk/matplotlib/lib/matplotlib/config/cutils.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/cutils.py 2010-06-14 02:53:59 UTC (rev 8433) +++ trunk/matplotlib/lib/matplotlib/config/cutils.py 2010-06-14 05:31:20 UTC (rev 8434) @@ -9,8 +9,8 @@ import warnings # matplotlib imports -from verbose import verbose -from rcsetup import defaultParams +from matplotlib.verbose import verbose +from matplotlib.rcsetup import defaultParams def is_string_like(obj): try: obj + '' @@ -92,6 +92,10 @@ def _get_data_path(): 'get the path to matplotlib data' +## The following is duplicated in matplotlib.__init__ +def _get_data_path(): + 'get the path to matplotlib data' + if 'MATPLOTLIBDATA' in os.environ: path = os.environ['MATPLOTLIBDATA'] if not os.path.isdir(path): @@ -99,30 +103,36 @@ return path path = os.sep.join([os.path.dirname(__file__), 'mpl-data']) - if os.path.isdir(path): return path + if os.path.isdir(path): + return path # setuptools' namespace_packages may highjack this init file # so need to try something known to be in matplotlib, not basemap import matplotlib.afm path = os.sep.join([os.path.dirname(matplotlib.afm.__file__), 'mpl-data']) - if os.path.isdir(path): return path + if os.path.isdir(path): + return path # py2exe zips pure python, so still need special check if getattr(sys,'frozen',None): - path = os.path.join(os.path.split(sys.path[0])[0], 'mpl-data') - if os.path.isdir(path): return path - else: - # Try again assuming we need to step up one more directory - path = os.path.join(os.path.split(os.path.split(sys.path[0])[0])[0], - 'mpl-data') - if os.path.isdir(path): return path - else: - # Try again assuming sys.path[0] is a dir not a exe - path = os.path.join(sys.path[0], 'mpl-data') - if os.path.isdir(path): return path + exe_path = os.path.dirname(sys.executable) + path = os.path.join(exe_path, 'mpl-data') + if os.path.isdir(path): + return path + # Try again assuming we need to step up one more directory + path = os.path.join(os.path.split(exe_path)[0], 'mpl-data') + if os.path.isdir(path): + return path + + # Try again assuming sys.path[0] is a dir not a exe + path = os.path.join(sys.path[0], 'mpl-data') + if os.path.isdir(path): + return path + raise RuntimeError('Could not find the matplotlib data files') + def _get_data_path_cached(): if defaultParams['datapath'][0] is None: defaultParams['datapath'][0] = _get_data_path() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-06-19 23:46:53
|
Revision: 8441 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8441&view=rev Author: efiring Date: 2010-06-19 23:46:47 +0000 (Sat, 19 Jun 2010) Log Message: ----------- [1530104, 3017380] slider grabs mouse; patch by C. Gohlke and baxissimo Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backend_bases.py trunk/matplotlib/lib/matplotlib/widgets.py Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-17 17:45:38 UTC (rev 8440) +++ trunk/matplotlib/lib/matplotlib/backend_bases.py 2010-06-19 23:46:47 UTC (rev 8441) @@ -1122,7 +1122,10 @@ return # Find all axes containing the mouse - axes_list = [a for a in self.canvas.figure.get_axes() if a.in_axes(self)] + if self.canvas.mouse_grabber is None: + axes_list = [a for a in self.canvas.figure.get_axes() if a.in_axes(self)] + else: + axes_list = [self.canvas.mouse_grabber] if len(axes_list) == 0: # None found self.inaxes = None @@ -1332,6 +1335,7 @@ self._lastx, self._lasty = None, None self.button_pick_id = self.mpl_connect('button_press_event',self.pick) self.scroll_pick_id = self.mpl_connect('scroll_event',self.pick) + self.mouse_grabber = None # the axes currently grabbing mouse if False: ## highlight the artists that are hit @@ -1610,6 +1614,26 @@ event = IdleEvent(s, self, guiEvent=guiEvent) self.callbacks.process(s, event) + def grab_mouse(self, ax): + """ + Set the child axes which are currently grabbing the mouse events. + Usually called by the widgets themselves. + It is an error to call this if the mouse is already grabbed by + another axes. + """ + if self.mouse_grabber not in (None, ax): + raise RuntimeError('two different attempted to grab mouse input') + self.mouse_grabber = ax + + def release_mouse(self, ax): + """ + Release the mouse grab held by the axes, ax. + Usually called by the widgets. + It is ok to call this even if you ax doesn't have the mouse grab currently. + """ + if self.mouse_grabber is ax: + self.mouse_grabber = None + def draw(self, *args, **kwargs): """ Render the :class:`~matplotlib.figure.Figure` Modified: trunk/matplotlib/lib/matplotlib/widgets.py =================================================================== --- trunk/matplotlib/lib/matplotlib/widgets.py 2010-06-17 17:45:38 UTC (rev 8440) +++ trunk/matplotlib/lib/matplotlib/widgets.py 2010-06-19 23:46:47 UTC (rev 8441) @@ -106,6 +106,7 @@ ax.figure.canvas.mpl_connect('button_press_event', self._click) + ax.figure.canvas.mpl_connect('button_release_event', self._release) ax.figure.canvas.mpl_connect('motion_notify_event', self._motion) ax.set_navigate(False) ax.set_axis_bgcolor(color) @@ -117,8 +118,21 @@ self._lastcolor = color def _click(self, event): - if event.inaxes != self.ax: return - if not self.eventson: return + if event.inaxes != self.ax: + return + if not self.eventson: + return + if event.canvas.mouse_grabber != self.ax: + event.canvas.grab_mouse(self.ax) + + def _release(self, event): + if event.canvas.mouse_grabber != self.ax: + return + event.canvas.release_mouse(self.ax) + if not self.eventson: + return + if event.inaxes != self.ax: + return for cid, func in self.observers.items(): func(event) @@ -209,6 +223,7 @@ ax.set_navigate(False) ax.figure.canvas.mpl_connect('button_press_event', self._update) + ax.figure.canvas.mpl_connect('button_release_event', self._update) if dragging: ax.figure.canvas.mpl_connect('motion_notify_event', self._update) self.label = ax.text(-0.02, 0.5, label, transform=ax.transAxes, @@ -227,14 +242,35 @@ self.closedmax = closedmax self.slidermin = slidermin self.slidermax = slidermax + self.drag_active = False def _update(self, event): 'update the slider position' - if event.button !=1: return - if event.inaxes != self.ax: return + if event.button != 1: + return + + if event.name == 'button_press_event' and event.inaxes == self.ax: + self.drag_active = True + event.canvas.grab_mouse(self.ax) + + if not self.drag_active: + return + + elif ((event.name == 'button_release_event') + or (event.name == 'button_press_event' and event.inaxes != self.ax)): + self.drag_active = False + event.canvas.release_mouse(self.ax) + return + val = event.xdata - if not self.closedmin and val<=self.valmin: return - if not self.closedmax and val>=self.valmax: return + if val <= self.valmin: + if not self.closedmin: + return + val = self.valmin + elif val >= self.valmax: + if not self.closedmax: + return + val = self.valmax if self.slidermin is not None: if val<=self.slidermin.val: return This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-07-05 19:40:05
|
Revision: 8495 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8495&view=rev Author: efiring Date: 2010-07-05 19:39:59 +0000 (Mon, 05 Jul 2010) Log Message: ----------- Remove experimental config subpackage using traits Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/__init__.py Removed Paths: ------------- trunk/matplotlib/lib/matplotlib/config/ Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2010-07-05 19:03:09 UTC (rev 8494) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2010-07-05 19:39:59 UTC (rev 8495) @@ -107,10 +107,6 @@ import distutils.sysconfig import distutils.version - -NEWCONFIG = False - - # Needed for toolkit setuptools support if 0: try: @@ -827,16 +823,6 @@ """ rcParams.update(rcParamsDefault) -if NEWCONFIG: - #print "importing from reorganized config system!" - try: - from matplotlib.config import (rcParams, rcdefaults, - mplConfig, save_config) - verbose.set_level(rcParams['verbose.level']) - verbose.set_fileo(rcParams['verbose.fileo']) - except: - from matplotlib.config import rcParams, rcdefaults - _use_error_msg = """ This call to matplotlib.use() has no effect because the the backend has already been chosen; matplotlib.use() must be called *before* pylab, matplotlib.pyplot, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2010-09-05 19:33:49
|
Revision: 8681 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8681&view=rev Author: efiring Date: 2010-09-05 19:33:42 +0000 (Sun, 05 Sep 2010) Log Message: ----------- [3050996] Prevent an Axes from being added to a Figure twice. The changeset includes refactoring to consolidate all Axes tracking in a single data structure. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/figure.py Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2010-09-05 00:43:25 UTC (rev 8680) +++ trunk/matplotlib/lib/matplotlib/artist.py 2010-09-05 19:33:42 UTC (rev 8681) @@ -92,7 +92,11 @@ self.eventson = False # fire events only if eventson self._oid = 0 # an observer id self._propobservers = {} # a dict from oids to funcs - self.axes = None + try: + self.axes = None + except AttributeError: + # Handle self.axes as a read-only property, as in Figure. + pass self._remove_method = None self._url = None self._gid = None Modified: trunk/matplotlib/lib/matplotlib/figure.py =================================================================== --- trunk/matplotlib/lib/matplotlib/figure.py 2010-09-05 00:43:25 UTC (rev 8680) +++ trunk/matplotlib/lib/matplotlib/figure.py 2010-09-05 19:33:42 UTC (rev 8681) @@ -37,6 +37,64 @@ docstring.interpd.update(projection_names = get_projection_names()) +class AxesStack(Stack): + """ + Specialization of the Stack to handle all + tracking of Axes in a Figure. This requires storing + key, axes pairs. The key is based on the args and kwargs + used in generating the Axes. + """ + def as_list(self): + """ + Return a list of the Axes instances that have been added to the figure + """ + return [a for k, a in self._elements] + + def get(self, key): + """ + Return the Axes instance that was added with *key*. + If it is not present, return None. + """ + return dict(self._elements).get(key) + + def _entry_from_axes(self, e): + k = dict([(a, k) for (k, a) in self._elements])[e] + return k, e + + def remove(self, a): + Stack.remove(self, self._entry_from_axes(a)) + + def bubble(self, a): + return Stack.bubble(self, self._entry_from_axes(a)) + + def add(self, key, a): + """ + Add Axes *a*, with key *key*, to the stack, and return the stack. + + If *a* is already on the stack, don't add it again, but + return *None*. + """ + # All the error checking may be unnecessary; but this method + # is called so seldom that the overhead is negligible. + if not isinstance(a, Axes): + raise ValueError("second argument, %s, is not an Axes" % a) + try: + hash(key) + except TypeError: + raise ValueError("first argument, %s, is not a valid key" % key) + if a in self: + return None + return Stack.push(self, (key, a)) + + def __call__(self): + if not len(self._elements): + return self._default + else: + return self._elements[self._pos][1] + + def __contains__(self, a): + return a in self.as_list() + class SubplotParams: """ A class to hold the parameters for a subplot @@ -202,11 +260,15 @@ self.subplotpars = subplotpars - self._axstack = Stack() # maintain the current axes - self.axes = [] + self._axstack = AxesStack() # track all figure axes and current axes self.clf() self._cachedRenderer = None + def _get_axes(self): + return self._axstack.as_list() + + axes = property(fget=_get_axes, doc="Read-only: list of axes in Figure") + def _get_dpi(self): return self._dpi def _set_dpi(self, dpi): @@ -523,15 +585,9 @@ def delaxes(self, a): 'remove a from the figure and update the current axes' - self.axes.remove(a) self._axstack.remove(a) - keys = [] - for key, thisax in self._seen.items(): - if a==thisax: del self._seen[key] for func in self._axobservers: func(self) - - def _make_key(self, *args, **kwargs): 'make a hashable key out of args and kwargs' @@ -595,8 +651,8 @@ key = self._make_key(*args, **kwargs) - if key in self._seen: - ax = self._seen[key] + ax = self._axstack.get(key) + if ax is not None: self.sca(ax) return ax @@ -618,10 +674,9 @@ a = projection_factory(projection, self, rect, **kwargs) - self.axes.append(a) - self._axstack.push(a) + if a not in self._axstack: + self._axstack.add(key, a) self.sca(a) - self._seen[key] = a return a @docstring.dedent_interpd @@ -675,19 +730,16 @@ projection_class = get_projection_class(projection) key = self._make_key(*args, **kwargs) - if key in self._seen: - ax = self._seen[key] + ax = self._axstack.get(key) + if ax is not None: if isinstance(ax, projection_class): self.sca(ax) return ax else: - self.axes.remove(ax) self._axstack.remove(ax) a = subplot_class_factory(projection_class)(self, *args, **kwargs) - self._seen[key] = a - self.axes.append(a) - self._axstack.push(a) + self._axstack.add(key, a) self.sca(a) return a @@ -703,13 +755,12 @@ for ax in tuple(self.axes): # Iterate over the copy. ax.cla() - self.delaxes(ax) # removes ax from self.axes + self.delaxes(ax) # removes ax from self._axstack toolbar = getattr(self.canvas, 'toolbar', None) if toolbar is not None: toolbar.update() self._axstack.clear() - self._seen = {} self.artists = [] self.lines = [] self.patches = [] @@ -975,7 +1026,7 @@ helper for :func:`~matplotlib.pyplot.gci`; do not use elsewhere. """ - for ax in reversed(self._axstack): + for ax in reversed(self.axes): im = ax._gci() if im is not None: return im This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-10-06 16:57:22
|
Revision: 8731 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8731&view=rev Author: mdboom Date: 2010-10-06 16:57:16 +0000 (Wed, 06 Oct 2010) Log Message: ----------- [3081451] symlog doesn't handle values <1.0 correctly Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/scale.py trunk/matplotlib/lib/matplotlib/ticker.py Modified: trunk/matplotlib/lib/matplotlib/scale.py =================================================================== --- trunk/matplotlib/lib/matplotlib/scale.py 2010-10-06 16:03:48 UTC (rev 8730) +++ trunk/matplotlib/lib/matplotlib/scale.py 2010-10-06 16:57:16 UTC (rev 8731) @@ -6,6 +6,7 @@ from cbook import dedent from ticker import NullFormatter, ScalarFormatter, LogFormatterMathtext, Formatter from ticker import NullLocator, LogLocator, AutoLocator, SymmetricalLogLocator, FixedLocator +from ticker import is_decade from transforms import Transform, IdentityTransform from matplotlib import docstring @@ -318,19 +319,22 @@ def __init__(self, base, linthresh): Transform.__init__(self) self.base = base - self.linthresh = linthresh + self.linthresh = abs(linthresh) self._log_base = np.log(base) - self._linadjust = (np.log(linthresh) / self._log_base) / linthresh + self._logb_linthresh = np.log(linthresh) / self._log_base + self._logb_minlog = np.floor(self._logb_linthresh - 1e-10) + self._linadjust = np.abs((np.log(linthresh) - self._logb_minlog) / + linthresh) def transform(self, a): a = np.asarray(a) sign = np.sign(a) masked = ma.masked_inside(a, -self.linthresh, self.linthresh, copy=False) - log = sign * ma.log(np.abs(masked)) / self._log_base + log = sign * (ma.log(np.abs(masked)) / self._log_base - self._logb_minlog) if masked.mask.any(): return np.asarray(ma.where(masked.mask, - a * self._linadjust, - log)) + a * self._linadjust, + log)) else: return np.asarray(log) Modified: trunk/matplotlib/lib/matplotlib/ticker.py =================================================================== --- trunk/matplotlib/lib/matplotlib/ticker.py 2010-10-06 16:03:48 UTC (rev 8730) +++ trunk/matplotlib/lib/matplotlib/ticker.py 2010-10-06 16:57:16 UTC (rev 8731) @@ -1180,20 +1180,20 @@ 'floor x to the nearest lower decade' if x == 0.0: return -base - lx = math.floor(math.log(x)/math.log(base)) + lx = np.floor(np.log(x)/np.log(base)) return base**lx def decade_up(x, base=10): 'ceil x to the nearest higher decade' if x == 0.0: return base - lx = math.ceil(math.log(x)/math.log(base)) + lx = np.ceil(np.log(x)/np.log(base)) return base**lx def is_decade(x,base=10): if x == 0.0: return True - lx = math.log(x)/math.log(base) + lx = np.log(x)/np.log(base) return lx==int(lx) class LogLocator(Locator): @@ -1268,15 +1268,12 @@ stride += 1 decades = np.arange(math.floor(vmin), - math.ceil(vmax)+stride, stride) + math.ceil(vmax)+stride, stride) + ticklocs = self._transform.inverted().transform(decades) if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0): - ticklocs = [] - for decadeStart in b**decades: - ticklocs.extend( subs*decadeStart ) - else: - ticklocs = b**decades + ticklocs = np.ravel(np.outer(subs, ticklocs)) - return self.raise_if_exceeds(np.array(ticklocs)) + return self.raise_if_exceeds(np.asarray(ticklocs)) def view_limits(self, vmin, vmax): 'Try to choose the view limits intelligently' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2010-10-07 14:19:08
|
Revision: 8733 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8733&view=rev Author: mdboom Date: 2010-10-07 14:19:00 +0000 (Thu, 07 Oct 2010) Log Message: ----------- Fix r8732 and update regression tests. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/pcolormesh.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.pdf trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.png trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg trunk/matplotlib/lib/matplotlib/ticker.py Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/pcolormesh.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.pdf =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.png =================================================================== (Binary files differ) Modified: trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg =================================================================== --- trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg 2010-10-06 23:59:15 UTC (rev 8732) +++ trunk/matplotlib/lib/matplotlib/tests/baseline_images/test_axes/symlog.svg 2010-10-07 14:19:00 UTC (rev 8733) @@ -11,21 +11,21 @@ <g id="figure1"> <g id="patch1"> <path style="fill: #ffffff; stroke: #ffffff; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M0.000000 432.000000L576.000000 432.000000L576.000000 0.000000 -L0.000000 0.000000L0.000000 432.000000"/> +L0.000000 0.000000z"/> </g> <g id="axes1"> <g id="patch2"> <path style="fill: #ffffff; opacity: 1.000000" d="M72.000000 388.800000L518.400000 388.800000L518.400000 43.200000 -L72.000000 43.200000L72.000000 388.800000"/> +L72.000000 43.200000z"/> </g> <g id="line2d1"> <defs> <clipPath id="p50431ccdcb28178602d99d9270004dde"> <rect x="72.000000" y="43.200000" width="446.400000" height="345.600000"/> </clipPath> -</defs><path style="fill: none; stroke: #0000ff; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" clip-path="url(#p50431ccdcb28178602d99d9270004dde)" d="M72.000000 91.532183L89.856000 106.081620L107.712000 139.864366 -L143.424000 284.860915L179.136000 347.742535L232.704000 381.525282 -L286.272000 381.525282L500.544000 381.525282"/> +</defs><path style="fill: none; stroke: #0000ff; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" clip-path="url(#p50431ccdcb28178602d99d9270004dde)" d="M72.000000 90.242338L89.856000 104.403493L107.712000 137.284677 +L143.424000 278.411691L179.136000 339.615185L232.704000 372.496368 +L286.272000 372.496368L500.544000 372.496368"/> </g> <g id="matplotlib.axis1"> <g id="xtick1"> @@ -57,7 +57,7 @@ <defs> <path id="c_1260a2df50f305f3db244e29828f968e" d="M10.796875 -72.906250l38.718750 0.000000l0.000000 8.312500l-29.687500 0.000000l0.000000 17.859375q2.140625 -0.734375 4.281250 -1.093750q2.156250 -0.359375 4.312500 -0.359375q12.203125 0.000000 19.328125 6.687500q7.140625 6.687500 7.140625 18.109375q0.000000 11.765625 -7.328125 18.296875q-7.328125 6.515625 -20.656250 6.515625q-4.593750 0.000000 -9.359375 -0.781250q-4.750000 -0.781250 -9.828125 -2.343750l0.000000 -9.921875q4.390625 2.390625 9.078125 3.562500q4.687500 1.171875 9.906250 1.171875q8.453125 0.000000 13.375000 -4.437500q4.937500 -4.437500 4.937500 -12.062500q0.000000 -7.609375 -4.937500 -12.046875q-4.921875 -4.453125 -13.375000 -4.453125q-3.953125 0.000000 -7.890625 0.875000q-3.921875 0.875000 -8.015625 2.734375z"/> </defs> -<g style="fill: #000000; opacity: 1.000000" transform="translate(158.444062,401.550000)scale(0.120000)"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(158.444063,401.550000)scale(0.120000)"> <use xlink:href="#c_1260a2df50f305f3db244e29828f968e"/> </g> </g> @@ -129,18 +129,18 @@ <g id="ytick1"> <g id="line2d14"> <defs><path id="m3400efa6b1638b3fea9e19e898273957" d="M0.000000 0.000000L4.000000 0.000000"/></defs> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="372.496368"/> </g></g> <g id="line2d15"> <defs><path id="m20b58b2501143cb5e0a5e8f1ef6f1643" d="M0.000000 0.000000L-4.000000 0.000000"/></defs> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="372.496368"/> </g></g> <g id="text7"> <defs> <path id="c_f47f2818876b2f1a61c47f270461e46e" d="M25.000000 2.203125q-12.250000 0.000000 -16.671875 -10.078125q-4.421875 -10.093750 -4.421875 -24.015625q0.000000 -8.687500 1.578125 -16.343750q1.593750 -7.671875 6.296875 -13.015625q4.718750 -5.359375 13.218750 -5.359375q6.593750 0.000000 10.781250 3.234375q4.203125 3.218750 6.406250 8.328125q2.203125 5.093750 3.000000 10.937500q0.812500 5.828125 0.812500 12.218750q0.000000 8.593750 -1.593750 16.093750q-1.578125 7.500000 -6.218750 12.750000q-4.640625 5.250000 -13.187500 5.250000M25.000000 -0.390625q5.562500 0.000000 8.296875 -5.703125q2.734375 -5.718750 3.375000 -12.656250q0.640625 -6.937500 0.640625 -14.750000q0.000000 -7.515625 -0.640625 -13.859375q-0.640625 -6.359375 -3.359375 -11.500000q-2.703125 -5.156250 -8.312500 -5.156250q-5.656250 0.000000 -8.390625 5.187500q-2.734375 5.171875 -3.375000 11.500000q-0.640625 6.312500 -0.640625 13.828125q0.000000 5.562500 0.265625 10.500000q0.281250 4.937500 1.453125 10.187500q1.171875 5.250000 3.781250 8.843750q2.609375 3.578125 6.906250 3.578125"/> </defs> <g id="mathtext1"> -<g style="fill: #000000" transform="translate(62.000000,386.025282)"> +<g style="fill: #000000" transform="translate(62.000000,376.996368)"> <use xlink:href="#c_f47f2818876b2f1a61c47f270461e46e" transform="translate(0.000000,-1.000000)scale(0.120000)"/> </g> </g> @@ -148,14 +148,14 @@ </g> <g id="ytick2"> <g id="line2d16"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="333.193098"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="325.454030"/> </g></g> <g id="line2d17"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="333.193098"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="325.454030"/> </g></g> <g id="text8"> <g id="mathtext2"> -<g style="fill: #000000" transform="translate(44.000000,340.193098)"> +<g style="fill: #000000" transform="translate(44.000000,332.454030)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7" transform="translate(0.000000,-1.575000)scale(0.120000)"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" transform="translate(7.634766,-1.575000)scale(0.120000)"/> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7" transform="translate(15.269531,-7.875000)scale(0.084000)"/> @@ -165,14 +165,14 @@ </g> <g id="ytick3"> <g id="line2d18"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="284.860915"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="278.411691"/> </g></g> <g id="line2d19"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="284.860915"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="278.411691"/> </g></g> <g id="text9"> <g id="mathtext3"> -<g style="fill: #000000" transform="translate(44.000000,291.860915)"> +<g style="fill: #000000" transform="translate(44.000000,285.411691)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7" transform="translate(0.000000,-1.465625)scale(0.120000)"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" transform="translate(7.634766,-1.465625)scale(0.120000)"/> <use xlink:href="#c_ed3f3ed3ebfbd18bcb9c012009a68ad1" transform="translate(15.269531,-7.765625)scale(0.084000)"/> @@ -182,17 +182,17 @@ </g> <g id="ytick4"> <g id="line2d20"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="236.528732"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="231.369353"/> </g></g> <g id="line2d21"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="236.528732"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="231.369353"/> </g></g> <g id="text10"> <defs> <path id="c_3dcfa38a02242cb63ec6726c6e70be7a" d="M40.578125 -39.312500q7.078125 1.515625 11.046875 6.312500q3.984375 4.781250 3.984375 11.812500q0.000000 10.781250 -7.421875 16.703125q-7.421875 5.906250 -21.093750 5.906250q-4.578125 0.000000 -9.437500 -0.906250q-4.859375 -0.906250 -10.031250 -2.718750l0.000000 -9.515625q4.093750 2.390625 8.968750 3.609375q4.890625 1.218750 10.218750 1.218750q9.265625 0.000000 14.125000 -3.656250q4.859375 -3.656250 4.859375 -10.640625q0.000000 -6.453125 -4.515625 -10.078125q-4.515625 -3.640625 -12.562500 -3.640625l-8.500000 0.000000l0.000000 -8.109375l8.890625 0.000000q7.265625 0.000000 11.125000 -2.906250q3.859375 -2.906250 3.859375 -8.375000q0.000000 -5.609375 -3.984375 -8.609375q-3.968750 -3.015625 -11.390625 -3.015625q-4.062500 0.000000 -8.703125 0.890625q-4.640625 0.875000 -10.203125 2.718750l0.000000 -8.781250q5.625000 -1.562500 10.531250 -2.343750q4.906250 -0.781250 9.250000 -0.781250q11.234375 0.000000 17.765625 5.109375q6.546875 5.093750 6.546875 13.781250q0.000000 6.062500 -3.468750 10.234375q-3.468750 4.171875 -9.859375 5.781250"/> </defs> <g id="mathtext4"> -<g style="fill: #000000" transform="translate(44.000000,243.528732)"> +<g style="fill: #000000" transform="translate(44.000000,238.369353)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7" transform="translate(0.000000,-1.465625)scale(0.120000)"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" transform="translate(7.634766,-1.465625)scale(0.120000)"/> <use xlink:href="#c_3dcfa38a02242cb63ec6726c6e70be7a" transform="translate(15.269531,-7.765625)scale(0.084000)"/> @@ -202,17 +202,17 @@ </g> <g id="ytick5"> <g id="line2d22"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="188.196549"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="184.327015"/> </g></g> <g id="line2d23"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="188.196549"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="184.327015"/> </g></g> <g id="text11"> <defs> <path id="c_a0416418d96557a09b8c1332d34883ba" d="M37.796875 -64.312500l-24.906250 38.921875l24.906250 0.000000zM35.203125 -72.906250l12.406250 0.000000l0.000000 47.515625l10.406250 0.000000l0.000000 8.203125l-10.406250 0.000000l0.000000 17.187500l-9.812500 0.000000l0.000000 -17.187500l-32.906250 0.000000l0.000000 -9.515625z"/> </defs> <g id="mathtext5"> -<g style="fill: #000000" transform="translate(44.000000,195.196549)"> +<g style="fill: #000000" transform="translate(44.000000,191.327015)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7" transform="translate(0.000000,-1.575000)scale(0.120000)"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" transform="translate(7.634766,-1.575000)scale(0.120000)"/> <use xlink:href="#c_a0416418d96557a09b8c1332d34883ba" transform="translate(15.269531,-7.875000)scale(0.084000)"/> @@ -222,14 +222,14 @@ </g> <g id="ytick6"> <g id="line2d24"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="139.864366"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="137.284677"/> </g></g> <g id="line2d25"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="139.864366"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="137.284677"/> </g></g> <g id="text12"> <g id="mathtext6"> -<g style="fill: #000000" transform="translate(44.000000,146.864366)"> +<g style="fill: #000000" transform="translate(44.000000,144.284677)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7" transform="translate(0.000000,-1.575000)scale(0.120000)"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" transform="translate(7.634766,-1.575000)scale(0.120000)"/> <use xlink:href="#c_1260a2df50f305f3db244e29828f968e" transform="translate(15.269531,-7.875000)scale(0.084000)"/> @@ -239,17 +239,17 @@ </g> <g id="ytick7"> <g id="line2d26"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="91.532183"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="90.242338"/> </g></g> <g id="line2d27"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="91.532183"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="90.242338"/> </g></g> <g id="text13"> <defs> <path id="c_cc8d6d580d1b10c8632f7a42cd53db8a" d="M33.015625 -40.375000q-6.640625 0.000000 -10.531250 4.546875q-3.875000 4.531250 -3.875000 12.437500q0.000000 7.859375 3.875000 12.437500q3.890625 4.562500 10.531250 4.562500q6.640625 0.000000 10.515625 -4.562500q3.875000 -4.578125 3.875000 -12.437500q0.000000 -7.906250 -3.875000 -12.437500q-3.875000 -4.546875 -10.515625 -4.546875M52.593750 -71.296875l0.000000 8.984375q-3.718750 -1.750000 -7.500000 -2.671875q-3.781250 -0.937500 -7.500000 -0.937500q-9.765625 0.000000 -14.921875 6.593750q-5.140625 6.593750 -5.875000 19.921875q2.875000 -4.250000 7.218750 -6.515625q4.359375 -2.265625 9.578125 -2.265625q10.984375 0.000000 17.359375 6.671875q6.375000 6.656250 6.375000 18.125000q0.000000 11.234375 -6.640625 18.031250q-6.640625 6.781250 -17.671875 6.781250q-12.656250 0.000000 -19.343750 -9.687500q-6.687500 -9.703125 -6.687500 -28.109375q0.000000 -17.281250 8.203125 -27.562500q8.203125 -10.281250 22.015625 -10.281250q3.718750 0.000000 7.500000 0.734375q3.781250 0.734375 7.890625 2.187500"/> </defs> <g id="mathtext7"> -<g style="fill: #000000" transform="translate(44.000000,98.532183)"> +<g style="fill: #000000" transform="translate(44.000000,97.242338)"> <use xlink:href="#c_42baa63129a918535c52adb20d687ea7" transform="translate(0.000000,-1.465625)scale(0.120000)"/> <use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" transform="translate(7.634766,-1.465625)scale(0.120000)"/> <use xlink:href="#c_cc8d6d580d1b10c8632f7a42cd53db8a" transform="translate(15.269531,-7.765625)scale(0.084000)"/> @@ -280,227 +280,227 @@ <g id="ytick9"> <g id="line2d30"> <defs><path id="mb39cfcf7402899e54c4d755745537394" d="M0.000000 0.000000L2.000000 0.000000"/></defs> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="372.496368"/> </g></g> <g id="line2d31"> <defs><path id="m6046ccd8b6d57b9fb587e3fdd930e9c5" d="M0.000000 0.000000L-2.000000 0.000000"/></defs> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="372.496368"/> </g></g> </g> <g id="ytick10"> <g id="line2d32"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="372.496368"/> </g></g> <g id="line2d33"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="372.496368"/> </g></g> </g> <g id="ytick11"> <g id="line2d34"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="372.496368"/> </g></g> <g id="line2d35"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="372.496368"/> </g></g> </g> <g id="ytick12"> <g id="line2d36"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="372.496368"/> </g></g> <g id="line2d37"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="381.525282"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="372.496368"/> </g></g> </g> <g id="ytick13"> <g id="line2d38"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="318.643662"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="311.292875"/> </g></g> <g id="line2d39"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="318.643662"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="311.292875"/> </g></g> </g> <g id="ytick14"> <g id="line2d40"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="304.094225"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="297.131720"/> </g></g> <g id="line2d41"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="304.094225"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="297.131720"/> </g></g> </g> <g id="ytick15"> <g id="line2d42"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="295.583350"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="288.847975"/> </g></g> <g id="line2d43"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="295.583350"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="288.847975"/> </g></g> </g> <g id="ytick16"> <g id="line2d44"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="289.544788"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="282.970565"/> </g></g> <g id="line2d45"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="289.544788"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="282.970565"/> </g></g> </g> <g id="ytick17"> <g id="line2d46"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="270.311479"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="264.250536"/> </g></g> <g id="line2d47"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="270.311479"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="264.250536"/> </g></g> </g> <g id="ytick18"> <g id="line2d48"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="255.762042"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="250.089382"/> </g></g> <g id="line2d49"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="255.762042"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="250.089382"/> </g></g> </g> <g id="ytick19"> <g id="line2d50"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="247.251167"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="241.805637"/> </g></g> <g id="line2d51"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="247.251167"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="241.805637"/> </g></g> </g> <g id="ytick20"> <g id="line2d52"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="241.212605"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="235.928227"/> </g></g> <g id="line2d53"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="241.212605"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="235.928227"/> </g></g> </g> <g id="ytick21"> <g id="line2d54"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="221.979295"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="217.208198"/> </g></g> <g id="line2d55"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="221.979295"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="217.208198"/> </g></g> </g> <g id="ytick22"> <g id="line2d56"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="207.429859"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="203.047043"/> </g></g> <g id="line2d57"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="207.429859"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="203.047043"/> </g></g> </g> <g id="ytick23"> <g id="line2d58"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="198.918984"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="194.763299"/> </g></g> <g id="line2d59"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="198.918984"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="194.763299"/> </g></g> </g> <g id="ytick24"> <g id="line2d60"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="192.880422"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="188.885888"/> </g></g> <g id="line2d61"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="192.880422"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="188.885888"/> </g></g> </g> <g id="ytick25"> <g id="line2d62"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="173.647112"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="170.165860"/> </g></g> <g id="line2d63"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="173.647112"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="170.165860"/> </g></g> </g> <g id="ytick26"> <g id="line2d64"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="159.097676"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="156.004705"/> </g></g> <g id="line2d65"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="159.097676"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="156.004705"/> </g></g> </g> <g id="ytick27"> <g id="line2d66"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="150.586801"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="147.720960"/> </g></g> <g id="line2d67"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="150.586801"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="147.720960"/> </g></g> </g> <g id="ytick28"> <g id="line2d68"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="144.548239"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="141.843550"/> </g></g> <g id="line2d69"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="144.548239"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="141.843550"/> </g></g> </g> <g id="ytick29"> <g id="line2d70"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="125.314929"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="123.123522"/> </g></g> <g id="line2d71"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="125.314929"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="123.123522"/> </g></g> </g> <g id="ytick30"> <g id="line2d72"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="110.765492"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="108.962367"/> </g></g> <g id="line2d73"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="110.765492"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="108.962367"/> </g></g> </g> <g id="ytick31"> <g id="line2d74"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="102.254617"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="100.678622"/> </g></g> <g id="line2d75"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="102.254617"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="100.678622"/> </g></g> </g> <g id="ytick32"> <g id="line2d76"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="96.216056"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="94.801212"/> </g></g> <g id="line2d77"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="96.216056"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="94.801212"/> </g></g> </g> <g id="ytick33"> <g id="line2d78"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="76.982746"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="76.081183"/> </g></g> <g id="line2d79"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="76.982746"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="76.081183"/> </g></g> </g> <g id="ytick34"> <g id="line2d80"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="62.433309"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="61.920029"/> </g></g> <g id="line2d81"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="62.433309"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="61.920029"/> </g></g> </g> <g id="ytick35"> <g id="line2d82"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="53.922434"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="53.636284"/> </g></g> <g id="line2d83"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="53.922434"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="53.636284"/> </g></g> </g> <g id="ytick36"> <g id="line2d84"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="47.883872"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#mb39cfcf7402899e54c4d755745537394" x="72.000000" y="47.758874"/> </g></g> <g id="line2d85"> -<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="47.883872"/> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m6046ccd8b6d57b9fb587e3fdd930e9c5" x="518.400000" y="47.758874"/> </g></g> </g> </g> Modified: trunk/matplotlib/lib/matplotlib/ticker.py =================================================================== --- trunk/matplotlib/lib/matplotlib/ticker.py 2010-10-06 23:59:15 UTC (rev 8732) +++ trunk/matplotlib/lib/matplotlib/ticker.py 2010-10-07 14:19:00 UTC (rev 8733) @@ -127,7 +127,6 @@ - class TickHelper: axis = None class DummyAxis: @@ -1269,9 +1268,17 @@ decades = np.arange(math.floor(vmin), math.ceil(vmax)+stride, stride) - ticklocs = self._transform.inverted().transform(decades) - if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0): - ticklocs = np.ravel(np.outer(subs, ticklocs)) + if hasattr(self, '_transform'): + ticklocs = self._transform.inverted().transform(decades) + if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0): + ticklocs = np.ravel(np.outer(subs, ticklocs)) + else: + if len(subs) > 1 or (len(subs == 1) and subs[0] != 1.0): + ticklocs = [] + for decadeStart in b**decades: + ticklocs.extend( subs*decadeStart ) + else: + ticklocs = b**decades return self.raise_if_exceeds(np.asarray(ticklocs)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ef...@us...> - 2011-02-06 01:55:56
|
Revision: 8949 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8949&view=rev Author: efiring Date: 2011-02-06 01:55:50 +0000 (Sun, 06 Feb 2011) Log Message: ----------- PcolorImage: use local cache instead of the ScalarMappable.update_dict Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/cm.py trunk/matplotlib/lib/matplotlib/image.py Modified: trunk/matplotlib/lib/matplotlib/cm.py =================================================================== --- trunk/matplotlib/lib/matplotlib/cm.py 2011-02-06 00:43:54 UTC (rev 8948) +++ trunk/matplotlib/lib/matplotlib/cm.py 2011-02-06 01:55:50 UTC (rev 8949) @@ -43,7 +43,7 @@ def _reverse_cmap_spec(spec): """Reverses cmap specification *spec*, can handle both dict and tuple type specs.""" - + if 'red' in spec: return revcmap(spec) else: @@ -53,9 +53,9 @@ return revspec def _generate_cmap(name, lutsize): - """Generates the requested cmap from it's name *name*. The lut size is + """Generates the requested cmap from it's name *name*. The lut size is *lutsize*.""" - + spec = datad[name] # Generate the colormap object. Modified: trunk/matplotlib/lib/matplotlib/image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/image.py 2011-02-06 00:43:54 UTC (rev 8948) +++ trunk/matplotlib/lib/matplotlib/image.py 2011-02-06 01:55:50 UTC (rev 8949) @@ -97,7 +97,7 @@ self._imcache = None - # this is an expetimental attribute, if True, unsampled image + # this is an experimental attribute, if True, unsampled image # will be drawn using the affine transform that are # appropriately skewed so that the given postition # corresponds to the actual position in the coordinate. -JJL @@ -797,6 +797,9 @@ cm.ScalarMappable.__init__(self, norm, cmap) self.axes = ax self._rgbacache = None + # There is little point in caching the image itself because + # it needs to be remade if the bbox or viewlim change, + # so caching does help with zoom/pan/resize. self.update(kwargs) self.set_data(x, y, A) @@ -811,7 +814,7 @@ height = (round(t) + 0.5) - (round(b) - 0.5) width = width * magnification height = height * magnification - if self.check_update('array'): + if self._rgbacache is None: A = self.to_rgba(self._A, alpha=self._alpha, bytes=True) self._rgbacache = A if self._A.ndim == 2: @@ -827,9 +830,14 @@ im.is_grayscale = self.is_grayscale return im + def changed(self): + self._rgbacache = None + cm.ScalarMappable.changed(self) + @allow_rasterization def draw(self, renderer, *args, **kwargs): - if not self.get_visible(): return + if not self.get_visible(): + return im = self.make_image(renderer.get_image_magnification()) gc = renderer.new_gc() gc.set_clip_rectangle(self.axes.bbox.frozen()) @@ -871,7 +879,7 @@ self._A = A self._Ax = x self._Ay = y - self.update_dict['array'] = True + self._rgbacache = None def set_array(self, *args): raise NotImplementedError('Method not supported') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2011-02-17 15:51:23
|
Revision: 8986 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8986&view=rev Author: mdboom Date: 2011-02-17 15:51:17 +0000 (Thu, 17 Feb 2011) Log Message: ----------- Fix long Unicode characters in SVG backend (fixes mathtext_stixsans test on narrow Python builds.) Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2011-02-17 15:50:47 UTC (rev 8985) +++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2011-02-17 15:51:17 UTC (rev 8986) @@ -603,7 +603,7 @@ if rcParams['svg.embed_char_paths']: new_chars = [] for c in s: - path = self._add_char_def(prop, c) + path = self._add_char_def(prop, ord(c)) if path is not None: new_chars.append(path) if len(new_chars): @@ -628,7 +628,7 @@ lastgind = None currx = 0 for c in s: - charnum = self._get_char_def_id(prop, c) + charnum = self._get_char_def_id(prop, ord(c)) ccode = ord(c) gind = cmap.get(ccode) if gind is None: @@ -680,13 +680,13 @@ font = prop font.set_size(self.FONT_SCALE, 72) ps_name = font.get_sfnt()[(1,0,0,6)] - char_id = urllib.quote('%s-%d' % (ps_name, ord(char))) + char_id = urllib.quote('%s-%d' % (ps_name, char)) char_num = self._char_defs.get(char_id, None) if char_num is not None: return None path_data = [] - glyph = font.load_char(ord(char), flags=LOAD_NO_HINTING) + glyph = font.load_char(char, flags=LOAD_NO_HINTING) currx, curry = 0.0, 0.0 for step in glyph.path: if step[0] == 0: # MOVE_TO @@ -724,7 +724,7 @@ font = prop font.set_size(self.FONT_SCALE, 72) ps_name = font.get_sfnt()[(1,0,0,6)] - char_id = urllib.quote('%s-%d' % (ps_name, ord(char))) + char_id = urllib.quote('%s-%d' % (ps_name, char)) return self._char_defs[char_id] def _draw_mathtext(self, gc, x, y, s, prop, angle): @@ -742,8 +742,8 @@ if rcParams['svg.embed_char_paths']: new_chars = [] - for font, fontsize, thetext, new_x, new_y_mtc, metrics in svg_glyphs: - path = self._add_char_def(font, thetext) + for font, fontsize, char, new_x, new_y_mtc, metrics in svg_glyphs: + path = self._add_char_def(font, char) if path is not None: new_chars.append(path) if len(new_chars): @@ -760,8 +760,8 @@ svg.append('translate(%f,%f)' % (x, y)) svg.append('">\n') - for font, fontsize, thetext, new_x, new_y_mtc, metrics in svg_glyphs: - charid = self._get_char_def_id(font, thetext) + for font, fontsize, char, new_x, new_y_mtc, metrics in svg_glyphs: + charid = self._get_char_def_id(font, char) svg.append('<use xlink:href="#%s" transform="translate(%f,%f)scale(%f)"/>\n' % (charid, new_x, -new_y_mtc, fontsize / self.FONT_SCALE)) Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2011-02-17 15:50:47 UTC (rev 8985) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2011-02-17 15:51:17 UTC (rev 8986) @@ -329,10 +329,9 @@ def render_glyph(self, ox, oy, info): oy = self.height - oy + info.offset - thetext = unichr_safe(info.num) self.svg_glyphs.append( - (info.font, info.fontsize, thetext, ox, oy, info.metrics)) + (info.font, info.fontsize, info.num, ox, oy, info.metrics)) def render_rect_filled(self, x1, y1, x2, y2): self.svg_rects.append( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |