You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
(4) |
2
|
3
|
4
(2) |
5
(3) |
6
(1) |
7
(3) |
8
(7) |
9
(2) |
10
(1) |
11
(3) |
12
|
13
|
14
(3) |
15
|
16
(4) |
17
(4) |
18
(1) |
19
|
20
(1) |
21
(3) |
22
(2) |
23
(2) |
24
(1) |
25
|
26
|
27
(3) |
28
|
29
|
30
|
|
|
Revision: 8692 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8692&view=rev Author: jswhit Date: 2010年09月08日 15:53:27 +0000 (2010年9月08日) Log Message: ----------- add DeprecationWarning in NetCDFFile Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2010年09月08日 15:51:18 UTC (rev 8691) +++ trunk/toolkits/basemap/Changelog 2010年09月08日 15:53:27 UTC (rev 8692) @@ -1,4 +1,6 @@ version 1.0.1 (not yet released). + * NetCDFFile function deprecated, will be removed in 1.0.2. Issue + warning advising users to use netcdf4-python instead. * Deleting an item from the dicts returned by drawparallels and drawmeridians removes the corresponding parallel or meridian (and associated labels) from the plot. Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 15:51:18 UTC (rev 8691) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 15:53:27 UTC (rev 8692) @@ -4,7 +4,9 @@ Contains the :class:`Basemap` class (which does most of the heavy lifting), and the following functions: -:func:`NetCDFFile`: Read local and remote NetCDF datasets. +:func:`NetCDFFile`: Read local and remote NetCDF datasets. Deprecated +as of version 1.0.1 (will be removed in 1.0.2). Use netcdf4-python +(http://netcdf4-python.googlecode.com) module instead. :func:`interp`: bilinear interpolation between rectilinear grids. @@ -2015,9 +2017,11 @@ self.set_axes_limits(ax=ax) keys = linecolls.keys(); vals = linecolls.values() for k,v in zip(keys,vals): - if v == ([], []): del linecolls[k] + if v == ([], []): + del linecolls[k] # add a remove method to each tuple. - linecolls[k] = _tup(linecolls[k]) + else: + linecolls[k] = _tup(linecolls[k]) # override __delitem__ in dict to call remove() on values. return _dict(linecolls) @@ -2262,9 +2266,11 @@ # remove empty values from linecolls dictionary keys = linecolls.keys(); vals = linecolls.values() for k,v in zip(keys,vals): - if v == ([], []): del linecolls[k] + if v == ([], []): + del linecolls[k] + else: # add a remove method to each tuple. - linecolls[k] = _tup(linecolls[k]) + linecolls[k] = _tup(linecolls[k]) # override __delitem__ in dict to call remove() on values. return _dict(linecolls) @@ -3935,6 +3941,13 @@ This may be slow for very large netCDF variables. """ import netcdf + import warnings + msg=dedent(""" + + NetCDFFile will be removed in 1.0.2, please use netcdf4-python + (http://netcdf4-python.googlecode.com) instead + """) + warnings.warn(msg,DeprecationWarning) if file.startswith('http'): return netcdf._RemoteFile(file,maskandscale=maskandscale,\ cache=cache,username=username,password=password,verbose=verbose) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8691 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8691&view=rev Author: mdboom Date: 2010年09月08日 15:51:18 +0000 (2010年9月08日) Log Message: ----------- Another pass at fixing simplification. Modified Paths: -------------- branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.pdf branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.png branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.svg branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py branches/v1_0_maint/src/path_converters.h Modified: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.pdf =================================================================== (Binary files differ) Modified: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.png =================================================================== (Binary files differ) Modified: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.svg =================================================================== --- branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.svg 2010年09月08日 14:32:17 UTC (rev 8690) +++ branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/fft_peaks.svg 2010年09月08日 15:51:18 UTC (rev 8691) @@ -11,12 +11,12 @@ <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> @@ -25,9 +25,10 @@ </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 388.800000L76.132389 388.704243L76.151520 388.455734 L76.157897 388.474541L76.170651 262.490246L76.177029 70.552590 -L76.272686 388.786908L76.629806 388.799881L221.059337 388.800000 -L485.704389 388.713691L485.729897 388.401770L485.736274 386.681411 -L485.755406 70.552590L485.844686 388.786149L486.182674 388.799863 +L76.183406 112.959876L76.183406 112.959876L76.298194 388.793604 +L77.114469 388.799987L485.704389 388.713691L485.729897 388.401770 +L485.736274 386.681411L485.755406 70.552590L485.768160 379.474263 +L485.768160 379.474263L485.882949 388.795086L487.018080 388.799995 L489.926057 388.800000L489.926057 388.800000"/> </g> <g id="matplotlib.axis1"> Modified: branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py =================================================================== --- branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py 2010年09月08日 14:32:17 UTC (rev 8690) +++ branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py 2010年09月08日 15:51:18 UTC (rev 8691) @@ -141,7 +141,7 @@ print len(simplified) - assert len(simplified) == 17 + assert len(simplified) == 20 def test_start_with_moveto(): # Should be entirely clipped away to a single MOVETO @@ -212,8 +212,8 @@ @image_comparison(baseline_images=['para_equal_perp']) def test_para_equal_perp(): - x = np.array([0, 1, 2, 1, 0, -1, 0, 1]) - y = np.array([1, 1, 2, 1, 0, -1, 0, 0]) + x = np.array([0, 1, 2, 1, 0, -1, 0, 1] + [1] * 128) + y = np.array([1, 1, 2, 1, 0, -1, 0, 0] + [0] * 128) fig = plt.figure() ax = fig.add_subplot(111) Modified: branches/v1_0_maint/src/path_converters.h =================================================================== --- branches/v1_0_maint/src/path_converters.h 2010年09月08日 14:32:17 UTC (rev 8690) +++ branches/v1_0_maint/src/path_converters.h 2010年09月08日 15:51:18 UTC (rev 8691) @@ -520,7 +520,7 @@ m_moveto(true), m_after_moveto(false), m_lastx(0.0), m_lasty(0.0), m_clipped(false), m_origdx(0.0), m_origdy(0.0), - m_origdNorm2(0.0), m_dnorm2Max(0.0), m_dnorm2Min(0.0), + m_origdNorm2(0.0), m_dnorm2Max(0.0), m_lastMax(false), m_nextX(0.0), m_nextY(0.0), m_lastWrittenX(0.0), m_lastWrittenY(0.0) { @@ -637,7 +637,6 @@ //set all the variables to reflect this new orig vector m_dnorm2Max = m_origdNorm2; - m_dnorm2Min = 0.0; m_lastMax = true; m_nextX = m_lastWrittenX = m_lastx = *x; @@ -677,36 +676,25 @@ /* check if the current vector is parallel or anti-parallel to the orig vector. If it is parallel, test if it is the longest of the vectors - we are merging in that direction. If anti-p, test - if it is the longest in the opposite direction (the - min of our final line) */ + we are merging in that direction. */ double paradNorm2 = paradx * paradx + parady * parady; - if (perpdNorm2 == paradNorm2) { + m_lastMax = false; + if (totdot > 0.0) + { + if (paradNorm2 > m_dnorm2Max) + { + m_lastMax = true; + m_dnorm2Max = paradNorm2; + m_nextX = *x; + m_nextY = *y; + } + } + else + { _push(&m_lastx, &m_lasty); _push(x, y); break; - } else { - m_lastMax = false; - if (totdot >= 0.0) - { - if (paradNorm2 > m_dnorm2Max) - { - m_lastMax = true; - m_dnorm2Max = paradNorm2; - m_nextX = *x; - m_nextY = *y; - } - } - else - { - if (paradNorm2 < m_dnorm2Min) - { - m_dnorm2Min = paradNorm2; - m_nextX = *x; - m_nextY = *y; - } - } } m_lastx = *x; @@ -770,7 +758,6 @@ double m_origdy; double m_origdNorm2; double m_dnorm2Max; - double m_dnorm2Min; bool m_lastMax; double m_nextX; double m_nextY; @@ -805,7 +792,6 @@ m_origdNorm2 = m_origdx * m_origdx + m_origdy * m_origdy; m_dnorm2Max = m_origdNorm2; - m_dnorm2Min = 0.0; m_lastMax = true; m_lastWrittenX = m_queue[m_queue_write-1].x; m_lastWrittenY = m_queue[m_queue_write-1].y; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8690 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8690&view=rev Author: mdboom Date: 2010年09月08日 14:32:17 +0000 (2010年9月08日) Log Message: ----------- [3058804] part of a line is not drawn Modified Paths: -------------- branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py branches/v1_0_maint/src/path_converters.h Added Paths: ----------- branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.pdf branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.png branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.svg Added: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.pdf =================================================================== (Binary files differ) Property changes on: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.pdf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.png =================================================================== (Binary files differ) Property changes on: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.svg =================================================================== --- branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.svg (rev 0) +++ branches/v1_0_maint/lib/matplotlib/tests/baseline_images/test_simplification/para_equal_perp.svg 2010年09月08日 14:32:17 UTC (rev 8690) @@ -0,0 +1,296 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Created with matplotlib (http://matplotlib.sourceforge.net/) --> +<svg width="576pt" height="432pt" viewBox="0 0 576 432" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + id="svg1"> +<filter id="colorAdd"><feComposite in="SourceGraphic" in2="BackgroundImage" operator="arithmetic" k2="1" k3="1"/></filter> +<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.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.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="M220.800000 158.400000L369.600000 158.400000L518.400000 43.200000 +L369.600000 158.400000L220.800000 273.600000L72.000000 388.800000 +L220.800000 273.600000L369.600000 273.600000"/> +</g> +<g id="line2d2"> +<defs><path id="m87f81da4bcf58d853202912065521dc1" d="M0.000000 3.000000C0.795609 3.000000 1.558740 2.683901 2.121320 2.121320 +C2.683901 1.558740 3.000000 0.795609 3.000000 0.000000 +C3.000000 -0.795609 2.683901 -1.558740 2.121320 -2.121320 +C1.558740 -2.683901 0.795609 -3.000000 0.000000 -3.000000 +C-0.795609 -3.000000 -1.558740 -2.683901 -2.121320 -2.121320 +C-2.683901 -1.558740 -3.000000 -0.795609 -3.000000 0.000000 +C-3.000000 0.795609 -2.683901 1.558740 -2.121320 2.121320 +C-1.558740 2.683901 -0.795609 3.000000 0.000000 3.000000z"/></defs> +<g clip-path="url(#p50431ccdcb28178602d99d9270004dde)"><use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="220.800000" y="158.400000"/> +<use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="369.600000" y="158.400000"/> +<use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="518.400000" y="43.200000"/> +<use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="369.600000" y="158.400000"/> +<use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="220.800000" y="273.600000"/> +<use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="72.000000" y="388.800000"/> +<use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="220.800000" y="273.600000"/> +<use style="fill: #ff0000; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m87f81da4bcf58d853202912065521dc1" x="369.600000" y="273.600000"/> +</g></g> +<g id="matplotlib.axis1"> +<g id="xtick1"> +<g id="line2d3"> +<defs><path id="m30e32995789d870ad79a2e54c91cf9c6" d="M0.000000 0.000000L0.000000 -4.000000"/></defs> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="72.000000" y="388.800000"/> +</g></g> +<g id="line2d4"> +<defs><path id="m9281cae24120827b11d5ea8a7ad3e96b" d="M0.000000 0.000000L0.000000 4.000000"/></defs> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="72.000000" y="43.200000"/> +</g></g> +<g id="text1"> +<defs> +<path id="c_7a2040fe3b94fcd41d0a72c84e93b115" d="M31.781250 -66.406250q-7.609375 0.000000 -11.453125 7.500000q-3.828125 7.484375 -3.828125 22.531250q0.000000 14.984375 3.828125 22.484375q3.843750 7.500000 11.453125 7.500000q7.671875 0.000000 11.500000 -7.500000q3.843750 -7.500000 3.843750 -22.484375q0.000000 -15.046875 -3.843750 -22.531250q-3.828125 -7.500000 -11.500000 -7.500000M31.781250 -74.218750q12.265625 0.000000 18.734375 9.703125q6.468750 9.687500 6.468750 28.140625q0.000000 18.406250 -6.468750 28.109375q-6.468750 9.687500 -18.734375 9.687500q-12.250000 0.000000 -18.718750 -9.687500q-6.468750 -9.703125 -6.468750 -28.109375q0.000000 -18.453125 6.468750 -28.140625q6.468750 -9.703125 18.718750 -9.703125"/> +<path id="c_ed3e21196fb739f392806f09ca0594ef" d="M10.687500 -12.406250l10.312500 0.000000l0.000000 12.406250l-10.312500 0.000000z"/> +</defs> +<g style="fill: #000000; opacity: 1.000000" transform="translate(63.250000,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"/> +</g> +</g> +</g> +<g id="xtick2"> +<g id="line2d5"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="146.400000" y="388.800000"/> +</g></g> +<g id="line2d6"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="146.400000" y="43.200000"/> +</g></g> +<g id="text2"> +<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(137.775000,401.706250)scale(0.120000)"> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_1260a2df50f305f3db244e29828f968e" x="95.410156"/> +</g> +</g> +</g> +<g id="xtick3"> +<g id="line2d7"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="220.800000" y="388.800000"/> +</g></g> +<g id="line2d8"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="220.800000" y="43.200000"/> +</g></g> +<g id="text3"> +<defs> +<path id="c_42baa63129a918535c52adb20d687ea7" d="M12.406250 -8.296875l16.109375 0.000000l0.000000 -55.625000l-17.531250 3.515625l0.000000 -8.984375l17.437500 -3.515625l9.859375 0.000000l0.000000 64.609375l16.109375 0.000000l0.000000 8.296875l-41.984375 0.000000z"/> +</defs> +<g style="fill: #000000; opacity: 1.000000" transform="translate(212.307812,401.706250)scale(0.120000)"> +<use xlink:href="#c_42baa63129a918535c52adb20d687ea7"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> +</g> +</g> +</g> +<g id="xtick4"> +<g id="line2d9"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="295.200000" y="388.800000"/> +</g></g> +<g id="line2d10"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="295.200000" y="43.200000"/> +</g></g> +<g id="text4"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(286.832812,401.550000)scale(0.120000)"> +<use xlink:href="#c_42baa63129a918535c52adb20d687ea7"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_1260a2df50f305f3db244e29828f968e" x="95.410156"/> +</g> +</g> +</g> +<g id="xtick5"> +<g id="line2d11"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="369.600000" y="388.800000"/> +</g></g> +<g id="line2d12"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="369.600000" y="43.200000"/> +</g></g> +<g id="text5"> +<defs> +<path id="c_ed3f3ed3ebfbd18bcb9c012009a68ad1" d="M19.187500 -8.296875l34.421875 0.000000l0.000000 8.296875l-46.281250 0.000000l0.000000 -8.296875q5.609375 -5.812500 15.296875 -15.593750q9.703125 -9.796875 12.187500 -12.640625q4.734375 -5.312500 6.609375 -9.000000q1.890625 -3.687500 1.890625 -7.250000q0.000000 -5.812500 -4.078125 -9.468750q-4.078125 -3.671875 -10.625000 -3.671875q-4.640625 0.000000 -9.796875 1.609375q-5.140625 1.609375 -11.000000 4.890625l0.000000 -9.968750q5.953125 -2.390625 11.125000 -3.609375q5.187500 -1.218750 9.484375 -1.218750q11.328125 0.000000 18.062500 5.671875q6.734375 5.656250 6.734375 15.125000q0.000000 4.500000 -1.687500 8.531250q-1.671875 4.015625 -6.125000 9.484375q-1.218750 1.421875 -7.765625 8.187500q-6.531250 6.765625 -18.453125 18.921875"/> +</defs> +<g style="fill: #000000; opacity: 1.000000" transform="translate(360.889062,401.706250)scale(0.120000)"> +<use xlink:href="#c_ed3f3ed3ebfbd18bcb9c012009a68ad1"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> +</g> +</g> +</g> +<g id="xtick6"> +<g id="line2d13"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="444.000000" y="388.800000"/> +</g></g> +<g id="line2d14"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m9281cae24120827b11d5ea8a7ad3e96b" x="444.000000" y="43.200000"/> +</g></g> +<g id="text6"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(435.414062,401.706250)scale(0.120000)"> +<use xlink:href="#c_ed3f3ed3ebfbd18bcb9c012009a68ad1"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_1260a2df50f305f3db244e29828f968e" x="95.410156"/> +</g> +</g> +</g> +<g id="xtick7"> +<g id="line2d15"> +<g ><use style="fill: none; stroke: #000000; stroke-width: 0.500000; stroke-linejoin: round; stroke-linecap: butt; opacity: 1.000000" xlink:href="#m30e32995789d870ad79a2e54c91cf9c6" x="518.400000" y="388.800000"/> +</g></g> +<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="#m9281cae24120827b11d5ea8a7ad3e96b" x="518.400000" y="43.200000"/> +</g></g> +<g id="text7"> +<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 style="fill: #000000; opacity: 1.000000" transform="translate(509.712500,401.706250)scale(0.120000)"> +<use xlink:href="#c_3dcfa38a02242cb63ec6726c6e70be7a"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> +</g> +</g> +</g> +</g> +<g id="matplotlib.axis2"> +<g id="ytick1"> +<g id="line2d17"> +<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="388.800000"/> +</g></g> +<g id="line2d18"> +<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="388.800000"/> +</g></g> +<g id="text8"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(50.500000,393.167188)scale(0.120000)"> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> +</g> +</g> +</g> +<g id="ytick2"> +<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="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="331.200000"/> +</g></g> +<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="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="331.200000"/> +</g></g> +<g id="text9"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(50.750000,335.567188)scale(0.120000)"> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_1260a2df50f305f3db244e29828f968e" x="95.410156"/> +</g> +</g> +</g> +<g id="ytick3"> +<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="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="273.600000"/> +</g></g> +<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="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="273.600000"/> +</g></g> +<g id="text10"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(51.015625,277.967188)scale(0.120000)"> +<use xlink:href="#c_42baa63129a918535c52adb20d687ea7"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> +</g> +</g> +</g> +<g id="ytick4"> +<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="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="216.000000"/> +</g></g> +<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="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="216.000000"/> +</g></g> +<g id="text11"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(51.265625,220.289062)scale(0.120000)"> +<use xlink:href="#c_42baa63129a918535c52adb20d687ea7"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_1260a2df50f305f3db244e29828f968e" x="95.410156"/> +</g> +</g> +</g> +<g id="ytick5"> +<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="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="158.400000"/> +</g></g> +<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="#m20b58b2501143cb5e0a5e8f1ef6f1643" x="518.400000" y="158.400000"/> +</g></g> +<g id="text12"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(50.578125,162.767187)scale(0.120000)"> +<use xlink:href="#c_ed3f3ed3ebfbd18bcb9c012009a68ad1"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> +</g> +</g> +</g> +<g id="ytick6"> +<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="#m3400efa6b1638b3fea9e19e898273957" x="72.000000" y="100.800000"/> +</g></g> +<g id="line2d28"> +<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="100.800000"/> +</g></g> +<g id="text13"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(50.828125,105.167188)scale(0.120000)"> +<use xlink:href="#c_ed3f3ed3ebfbd18bcb9c012009a68ad1"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_1260a2df50f305f3db244e29828f968e" x="95.410156"/> +</g> +</g> +</g> +<g id="ytick7"> +<g id="line2d29"> +<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="43.200000"/> +</g></g> +<g id="line2d30"> +<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="43.200000"/> +</g></g> +<g id="text14"> +<g style="fill: #000000; opacity: 1.000000" transform="translate(50.625000,47.567187)scale(0.120000)"> +<use xlink:href="#c_3dcfa38a02242cb63ec6726c6e70be7a"/> +<use xlink:href="#c_ed3e21196fb739f392806f09ca0594ef" x="63.623047"/> +<use xlink:href="#c_7a2040fe3b94fcd41d0a72c84e93b115" x="95.410156"/> +</g> +</g> +</g> +</g> +<g id="patch3"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M72.000000 43.200000L518.400000 43.200000"/> +</g> +<g id="patch4"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M518.400000 388.800000L518.400000 43.200000"/> +</g> +<g id="patch5"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M72.000000 388.800000L518.400000 388.800000"/> +</g> +<g id="patch6"> +<path style="fill: none; stroke: #000000; stroke-width: 1.000000; stroke-linejoin: round; stroke-linecap: square; opacity: 1.000000" d="M72.000000 388.800000L72.000000 43.200000"/> +</g> +</g> +</g> +</svg> Modified: branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py =================================================================== --- branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py 2010年09月08日 13:48:29 UTC (rev 8689) +++ branches/v1_0_maint/lib/matplotlib/tests/test_simplification.py 2010年09月08日 14:32:17 UTC (rev 8690) @@ -73,6 +73,8 @@ path = transform.transform_path(path) simplified = list(path.iter_segments(simplify=(800, 600))) + print len(simplified) + assert len(simplified) == 3884 def test_sine_plus_noise(): @@ -90,6 +92,8 @@ path = transform.transform_path(path) simplified = list(path.iter_segments(simplify=(800, 600))) + print len(simplified) + assert len(simplified) == 876 @image_comparison(baseline_images=['simplify_curve']) @@ -135,6 +139,8 @@ path = transform.transform_path(path) simplified = list(path.iter_segments(simplify=(800, 600))) + print len(simplified) + assert len(simplified) == 17 def test_start_with_moveto(): @@ -204,6 +210,17 @@ ax.set_xlim(5, 9) fig.savefig('clipper_edge') +@image_comparison(baseline_images=['para_equal_perp']) +def test_para_equal_perp(): + x = np.array([0, 1, 2, 1, 0, -1, 0, 1]) + y = np.array([1, 1, 2, 1, 0, -1, 0, 0]) + + fig = plt.figure() + ax = fig.add_subplot(111) + ax.plot(x + 1, y + 1) + ax.plot(x + 1, y + 1, 'ro') + fig.savefig('para_equal_perp') + if __name__=='__main__': import nose nose.runmodule(argv=['-s','--with-doctest'], exit=False) Modified: branches/v1_0_maint/src/path_converters.h =================================================================== --- branches/v1_0_maint/src/path_converters.h 2010年09月08日 13:48:29 UTC (rev 8689) +++ branches/v1_0_maint/src/path_converters.h 2010年09月08日 14:32:17 UTC (rev 8690) @@ -682,24 +682,30 @@ min of our final line) */ double paradNorm2 = paradx * paradx + parady * parady; - m_lastMax = false; - if (totdot >= 0.0) - { - if (paradNorm2 > m_dnorm2Max) + if (perpdNorm2 == paradNorm2) { + _push(&m_lastx, &m_lasty); + _push(x, y); + break; + } else { + m_lastMax = false; + if (totdot >= 0.0) { - m_lastMax = true; - m_dnorm2Max = paradNorm2; - m_nextX = *x; - m_nextY = *y; + if (paradNorm2 > m_dnorm2Max) + { + m_lastMax = true; + m_dnorm2Max = paradNorm2; + m_nextX = *x; + m_nextY = *y; + } } - } - else - { - if (paradNorm2 < m_dnorm2Min) + else { - m_dnorm2Min = paradNorm2; - m_nextX = *x; - m_nextY = *y; + if (paradNorm2 < m_dnorm2Min) + { + m_dnorm2Min = paradNorm2; + m_nextX = *x; + m_nextY = *y; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8689 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8689&view=rev Author: jswhit Date: 2010年09月08日 13:48:29 +0000 (2010年9月08日) Log Message: ----------- cleanup previous commit. Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 13:47:13 UTC (rev 8688) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 13:48:29 UTC (rev 8689) @@ -2018,6 +2018,7 @@ if v == ([], []): del linecolls[k] # add a remove method to each tuple. linecolls[k] = _tup(linecolls[k]) + # override __delitem__ in dict to call remove() on values. return _dict(linecolls) def drawmeridians(self,meridians,color='k',linewidth=1., zorder=None,\ @@ -2264,6 +2265,7 @@ if v == ([], []): del linecolls[k] # add a remove method to each tuple. linecolls[k] = _tup(linecolls[k]) + # override __delitem__ in dict to call remove() on values. return _dict(linecolls) def tissot(self,lon_0,lat_0,radius_deg,npts,ax=None,**kwargs): @@ -4149,11 +4151,7 @@ def remove(self): for item in self: for x in item: - try: - x.remove() - except ValueError: - # don't raise an error if item already removed - pass + x.remove() class _dict(dict): # override __delitem__ to first call remove method on values. def __delitem__(self,key): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8688 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8688&view=rev Author: jswhit Date: 2010年09月08日 13:47:13 +0000 (2010年9月08日) Log Message: ----------- deleting an item from parallels/meridians dict removes it from plot. Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2010年09月08日 12:21:50 UTC (rev 8687) +++ trunk/toolkits/basemap/Changelog 2010年09月08日 13:47:13 UTC (rev 8688) @@ -1,4 +1,7 @@ version 1.0.1 (not yet released). + * Deleting an item from the dicts returned by drawparallels + and drawmeridians removes the corresponding parallel or meridian (and + associated labels) from the plot. * add a remove method to the tuples that are returned in the dicts returned by drawparallels and drawmeridians. * add removeparallels and removemeridians convenience methods. Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 12:21:50 UTC (rev 8687) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 13:47:13 UTC (rev 8688) @@ -1814,11 +1814,10 @@ ============== ==================================================== returns a dictionary whose keys are the parallel values, and - whose values are tuple-like objects containing lists of the + whose values are tuples containing lists of the matplotlib.lines.Line2D and matplotlib.text.Text instances - associated with each parallel. Each one of these tuple-like - objects has a ``remove`` method so it can be easily removed - from the plot. + associated with each parallel. Deleting an item from the + dictionary removes the corresponding parallel from the plot. """ # get current axes instance (if none specified). ax = ax or self._check_ax() @@ -2019,7 +2018,7 @@ if v == ([], []): del linecolls[k] # add a remove method to each tuple. linecolls[k] = _tup(linecolls[k]) - return linecolls + return _dict(linecolls) def drawmeridians(self,meridians,color='k',linewidth=1., zorder=None,\ dashes=[1,1],labels=[0,0,0,0],labelstyle=None,\ @@ -2070,11 +2069,10 @@ ============== ==================================================== returns a dictionary whose keys are the meridian values, and - whose values are tuple-like objects containing lists of the + whose values are tuples containing lists of the matplotlib.lines.Line2D and matplotlib.text.Text instances - associated with each meridian. Each one of these tuple-like - objects has a ``remove`` method so it can be easily removed - from the plot. + associated with each meridian. Deleting an item from the + dictionary removes the correpsonding meridian from the plot. """ # get current axes instance (if none specified). ax = ax or self._check_ax() @@ -2266,7 +2264,7 @@ if v == ([], []): del linecolls[k] # add a remove method to each tuple. linecolls[k] = _tup(linecolls[k]) - return linecolls + return _dict(linecolls) def tissot(self,lon_0,lat_0,radius_deg,npts,ax=None,**kwargs): """ @@ -4156,3 +4154,8 @@ except ValueError: # don't raise an error if item already removed pass +class _dict(dict): + # override __delitem__ to first call remove method on values. + def __delitem__(self,key): + self[key].remove() + super(_dict, self).__delitem__(key) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8687 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8687&view=rev Author: jswhit Date: 2010年09月08日 12:21:50 +0000 (2010年9月08日) Log Message: ----------- don't raise exception if parallel or meridian already removed. Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 12:00:32 UTC (rev 8686) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 12:21:50 UTC (rev 8687) @@ -4151,4 +4151,8 @@ def remove(self): for item in self: for x in item: - x.remove() + try: + x.remove() + except ValueError: + # don't raise an error if item already removed + pass This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 8686 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8686&view=rev Author: jswhit Date: 2010年09月08日 12:00:32 +0000 (2010年9月08日) Log Message: ----------- reconsider removeparallels and removemeridians. Add remove method to tuples contained in dicts returned by drawparallels and drawmeridians instead. Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2010年09月07日 23:15:27 UTC (rev 8685) +++ trunk/toolkits/basemap/Changelog 2010年09月08日 12:00:32 UTC (rev 8686) @@ -1,6 +1,6 @@ version 1.0.1 (not yet released). - * add datum grid shift files, so that pyproj.transform can do datum - shifts. + * add a remove method to the tuples that are returned in + the dicts returned by drawparallels and drawmeridians. * add removeparallels and removemeridians convenience methods. version 1.0 (svn revision 8531) * don't force adjustable='box' so Basemap is compatible Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月07日 23:15:27 UTC (rev 8685) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2010年09月08日 12:00:32 UTC (rev 8686) @@ -1814,9 +1814,11 @@ ============== ==================================================== returns a dictionary whose keys are the parallel values, and - whose values are tuples containing lists of the + whose values are tuple-like objects containing lists of the matplotlib.lines.Line2D and matplotlib.text.Text instances - associated with each parallel. + associated with each parallel. Each one of these tuple-like + objects has a ``remove`` method so it can be easily removed + from the plot. """ # get current axes instance (if none specified). ax = ax or self._check_ax() @@ -2015,41 +2017,10 @@ keys = linecolls.keys(); vals = linecolls.values() for k,v in zip(keys,vals): if v == ([], []): del linecolls[k] + # add a remove method to each tuple. + linecolls[k] = _tup(linecolls[k]) return linecolls - def removeparallels(self,pdict,lat=None,ax=None): - """ - Given a dictionary returned by :meth:`Basemap.drawparallels`, remove - parallels (latitude lines) and associated labels from the map. - - .. tabularcolumns:: |l|L| - - ============== ==================================================== - Keyword Description - ============== ==================================================== - lat latitude value to remove (Default None, removes all - of them) - ax axes instance (overrides default axes instance) - ============== ==================================================== - """ - if lat is not None and lat not in pdict.keys(): - raise ValueError('latitude %s not drawn' % lat) - for key in pdict.keys(): - if lat is None or key == lat: - tup = pdict[key] - for item in tup: - for x in item: - try: - x.remove() - # might already be removed, if so - # don't do anything (exit silently). - except ValueError: - pass - # get current axes instance (if none specified). - ax = ax or self._check_ax() - # set axes limits to fit map region. - self.set_axes_limits(ax=ax) - def drawmeridians(self,meridians,color='k',linewidth=1., zorder=None,\ dashes=[1,1],labels=[0,0,0,0],labelstyle=None,\ fmt='%g',xoffset=None,yoffset=None,ax=None,latmax=None, @@ -2099,9 +2070,11 @@ ============== ==================================================== returns a dictionary whose keys are the meridian values, and - whose values are tuples containing lists of the + whose values are tuple-like objects containing lists of the matplotlib.lines.Line2D and matplotlib.text.Text instances - associated with each meridian. + associated with each meridian. Each one of these tuple-like + objects has a ``remove`` method so it can be easily removed + from the plot. """ # get current axes instance (if none specified). ax = ax or self._check_ax() @@ -2291,27 +2264,10 @@ keys = linecolls.keys(); vals = linecolls.values() for k,v in zip(keys,vals): if v == ([], []): del linecolls[k] + # add a remove method to each tuple. + linecolls[k] = _tup(linecolls[k]) return linecolls - def removemeridians(self,mdict,lon=None): - """ - Given a dictionary returned by :meth:`Basemap.drawmeridians`, remove - meridians (longitude lines) and associated labels from the map. - - .. tabularcolumns:: |l|L| - - ============== ==================================================== - Keyword Description - ============== ==================================================== - lon longitude value to remove (Default None, removes all - of them) - ax axes instance (overrides default axes instance) - ============== ==================================================== - """ - if lon is not None and lon not in mdict.keys(): - raise ValueError('longitude %s not drawn' % lon) - self.removeparallels(mdict,lat=lon) - def tissot(self,lon_0,lat_0,radius_deg,npts,ax=None,**kwargs): """ Draw a polygon centered at ``lon_0,lat_0``. The polygon @@ -4188,3 +4144,11 @@ lsmask = tmparr lsmaskf.close() return lsmask_lons, lsmask_lats, lsmask + +class _tup(tuple): + # tuple with an added remove method. + # used for objects returned by drawparallels and drawmeridians. + def remove(self): + for item in self: + for x in item: + x.remove() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.