You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(115) |
Aug
(120) |
Sep
(137) |
Oct
(170) |
Nov
(461) |
Dec
(263) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(120) |
Feb
(74) |
Mar
(35) |
Apr
(74) |
May
(245) |
Jun
(356) |
Jul
(240) |
Aug
(115) |
Sep
(78) |
Oct
(225) |
Nov
(98) |
Dec
(271) |
2009 |
Jan
(132) |
Feb
(84) |
Mar
(74) |
Apr
(56) |
May
(90) |
Jun
(79) |
Jul
(83) |
Aug
(296) |
Sep
(214) |
Oct
(76) |
Nov
(82) |
Dec
(66) |
2010 |
Jan
(46) |
Feb
(58) |
Mar
(51) |
Apr
(77) |
May
(58) |
Jun
(126) |
Jul
(128) |
Aug
(64) |
Sep
(50) |
Oct
(44) |
Nov
(48) |
Dec
(54) |
2011 |
Jan
(68) |
Feb
(52) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <js...@us...> - 2007-11-21 20:52:56
|
Revision: 4411 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4411&view=rev Author: jswhit Date: 2007-11-21 12:52:25 -0800 (Wed, 21 Nov 2007) Log Message: ----------- added examples for 'Plotting on Maps' workbook chapter Added Paths: ----------- trunk/py4science/examples/basemap1.py trunk/py4science/examples/basemap2.py trunk/py4science/examples/basemap3.py trunk/py4science/examples/basemap4.py trunk/py4science/examples/basemap5.py Added: trunk/py4science/examples/basemap1.py =================================================================== --- trunk/py4science/examples/basemap1.py (rev 0) +++ trunk/py4science/examples/basemap1.py 2007-11-21 20:52:25 UTC (rev 4411) @@ -0,0 +1,28 @@ +import pylab, numpy +from matplotlib.toolkits.basemap import Basemap + +# create figure. +# background color will be used for 'wet' areas. +fig = pylab.figure() +fig.add_axes([0.1,0.1,0.8,0.8],axisbg='aqua') +# create map by specifying lat/lon values at corners. +resolution = 'l' +lon_0 = -50 +lat_0 = 60 +projection = 'lcc' +llcrnrlat, llcrnrlon = 8, -92 +urcrnrlat, urcrnrlon = 39, 63 +m = Basemap(lon_0=lon_0,lat_0=lat_0,\ + llcrnrlat=llcrnrlat,llcrnrlon=llcrnrlon,\ + urcrnrlat=urcrnrlat,urcrnrlon=urcrnrlon,\ + resolution=resolution,projection=projection) +# draw coastlines. Make liness a little thinner than default. +m.drawcoastlines(linewidth=0.5) +# fill continents. +m.fillcontinents(color='coral') +# draw states and countries. +m.drawcountries() +m.drawstates() +pylab.title('map region specified using corner lat/lon values') +pylab.savefig('basemap1.eps') +pylab.savefig('basemap1.png') Added: trunk/py4science/examples/basemap2.py =================================================================== --- trunk/py4science/examples/basemap2.py (rev 0) +++ trunk/py4science/examples/basemap2.py 2007-11-21 20:52:25 UTC (rev 4411) @@ -0,0 +1,27 @@ +import pylab, numpy +from matplotlib.toolkits.basemap import Basemap + +# create figure. +# background color will be used for 'wet' areas. +fig = pylab.figure() +fig.add_axes([0.1,0.1,0.8,0.8],axisbg='aqua') +# create map by specifying width and height in km. +resolution = 'l' +lon_0 = -50 +lat_0 = 60 +projection = 'lcc' +width = 12000000 +height = 0.75*width +m = Basemap(lon_0=lon_0,lat_0=lat_0,\ + width=width,height=height,\ + resolution=resolution,projection=projection) +# draw coastlines. +m.drawcoastlines(linewidth=0.5) +# fill continents. +m.fillcontinents(color='coral') +# draw states and countries. +m.drawcountries() +m.drawstates() +pylab.title('map region specified using width and height') +pylab.savefig('basemap2.eps') +pylab.savefig('basemap2.png') Added: trunk/py4science/examples/basemap3.py =================================================================== --- trunk/py4science/examples/basemap3.py (rev 0) +++ trunk/py4science/examples/basemap3.py 2007-11-21 20:52:25 UTC (rev 4411) @@ -0,0 +1,45 @@ +import pylab, numpy +from matplotlib.toolkits.basemap import Basemap + +# create figure. +# background color will be used for 'wet' areas. +fig = pylab.figure() +fig.add_axes([0.1,0.1,0.8,0.8],axisbg='aqua') +# create map by specifying width and height in km. +resolution = 'l' +lon_0 = -50 +lat_0 = 60 +projection = 'lcc' +width = 12000000 +height = 0.75*width +m = Basemap(lon_0=lon_0,lat_0=lat_0,\ + width=width,height=height,\ + resolution=resolution,projection=projection) +# nylat, nylon are lat/lon of New York +nylat = 40.78 +nylon = -73.98 +# lonlat, lonlon are lat/lon of London. +lonlat = 51.53 +lonlon = 0.08 +# convert these points to map projection coordinates +# (using __call__ method of Basemap instance) +ny_x, ny_y = m(nylon, nylat) +lon_x, lon_y = m(lonlon, lonlat) +# plot black dots at the two points. +# make sure dots are drawn on top of other plot elements (zorder=10) +m.scatter([ny_x,lon_x],[ny_y,lon_y],25,color='k',marker='o',zorder=10) +# connect the dots along a great circle. +m.drawgreatcircle(nylon,nylat,lonlon,lonlat,linewidth=2,color='k') +# put the names of the cities to the left of each dot, offset +# by a little. Use a bold font. +pylab.text(ny_x-100000,ny_y+100000,'New York',fontsize=12,\ + color='k',horizontalalignment='right',fontweight='bold') +pylab.text(lon_x-100000,lon_y+100000,'London',fontsize=12,\ + color='k',horizontalalignment='right',fontweight='bold') +m.drawcoastlines(linewidth=0.5) +m.fillcontinents(color='coral') +m.drawcountries() +m.drawstates() +pylab.title('NY to London Great Circle') +pylab.savefig('basemap3.eps') +pylab.savefig('basemap3.png') Added: trunk/py4science/examples/basemap4.py =================================================================== --- trunk/py4science/examples/basemap4.py (rev 0) +++ trunk/py4science/examples/basemap4.py 2007-11-21 20:52:25 UTC (rev 4411) @@ -0,0 +1,29 @@ +import pylab, numpy +from matplotlib.toolkits.basemap import Basemap +# create figure. +# background color will be used for 'wet' areas. +fig = pylab.figure() +fig.add_axes([0.1,0.1,0.8,0.8],axisbg='aqua') +# create map by specifying width and height in km. +resolution = 'l' +lon_0 = -50 +lat_0 = 60 +projection = 'lcc' +width = 12000000 +height = 0.75*width +m = Basemap(lon_0=lon_0,lat_0=lat_0,\ + width=width,height=height,\ + resolution=resolution,projection=projection) +m.drawcoastlines(linewidth=0.5) +m.fillcontinents(color='coral') +m.drawcountries() +m.drawstates() +# label meridians where they intersect the left, right and bottom +# of the plot frame. +m.drawmeridians(numpy.arange(-180,181,20),labels=[1,1,0,1]) +# label parallels where they intersect the left, right and top +# of the plot frame. +m.drawparallels(numpy.arange(-80,81,20),labels=[1,1,1,0]) +pylab.title('labelled meridians and parallels',y=1.075) +pylab.savefig('basemap4.eps') +pylab.savefig('basemap4.png') Added: trunk/py4science/examples/basemap5.py =================================================================== --- trunk/py4science/examples/basemap5.py (rev 0) +++ trunk/py4science/examples/basemap5.py 2007-11-21 20:52:25 UTC (rev 4411) @@ -0,0 +1,38 @@ +from matplotlib.toolkits.basemap import Basemap, NetCDFFile +import pylab, numpy +from numpy import ma + +# read in netCDF sea-surface temperature data +ncfile = NetCDFFile('data/sst.nc') +sstv = ncfile.variables['analysed_sst'] +sst = ma.masked_values(numpy.squeeze(sstv[:]), sstv._FillValue) +sst = sstv.scale_factor*sst + sstv.add_offset +lats = ncfile.variables['lat'][:] +lons = ncfile.variables['lon'][:] +print sst.shape, sst.min(), sst.max() + +# make sure middle of map region is middle of data grid. +lon_0 = lons.mean() +lat_0 = lats.mean() +# set colormap +cmap = pylab.cm.gist_ncar +# create Basemap instance for mollweide projection. +m = Basemap(projection='moll',lon_0=lon_0,lat_0=lat_0,resolution='l') +# compute map projection coordinates of grid. +x, y = m(*numpy.meshgrid(lons, lats)) +# plot with contour +#CS = m.contour(x,y,sst,20,linewidths=0.5,colors='k') +#CS = m.contourf(x,y,sst,20,cmap=cmap) +# plot with pcolor +im = m.pcolormesh(x,y,sst,shading='flat',cmap=cmap) +# fill the continents (data is not defined there). +m.fillcontinents(color='k',lake_color='k') +# draw parallels and meridians. +m.drawparallels(numpy.arange(-90.,120.,30.)) +m.drawmeridians(numpy.arange(0.,420.,60.)) +# draw line around map projection limb. +m.drawmapboundary() +# draw horizontal colorbar. +pylab.colorbar(orientation='horizontal') +pylab.savefig('basemap5.pdf') # eps files are too huge when pcolor used. +pylab.savefig('basemap5.png') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-21 20:50:57
|
Revision: 4410 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4410&view=rev Author: jswhit Date: 2007-11-21 12:50:55 -0800 (Wed, 21 Nov 2007) Log Message: ----------- remove runtime_library_dirs (not needed, causes problems with mingw32) Modified Paths: -------------- trunk/toolkits/basemap-testing/setup.py Modified: trunk/toolkits/basemap-testing/setup.py =================================================================== --- trunk/toolkits/basemap-testing/setup.py 2007-11-21 20:50:10 UTC (rev 4409) +++ trunk/toolkits/basemap-testing/setup.py 2007-11-21 20:50:55 UTC (rev 4410) @@ -80,7 +80,7 @@ extensions.append(Extension("matplotlib.toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) # for some reason, pickling won't work if this extension is installed # as "matplotlib.toolkits.basemap._geos" -extensions.append(Extension("_geos",['src/_geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,runtime_library_dirs=geos_library_dirs,libraries=['geos_c','geos'])) +extensions.append(Extension("_geos",['src/_geos.c'],library_dirs=geos_library_dirs,include_dirs=geos_include_dirs,libraries=['geos_c','geos'])) # install shapelib and dbflib. packages = packages + ['shapelib','dbflib'] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-21 20:50:17
|
Revision: 4409 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4409&view=rev Author: jswhit Date: 2007-11-21 12:50:10 -0800 (Wed, 21 Nov 2007) Log Message: ----------- add 'Plotting on Maps' chapter Modified Paths: -------------- trunk/py4science/workbook/main.tex Added Paths: ----------- trunk/py4science/workbook/basemap.tex trunk/py4science/workbook/fig/basemap1.eps trunk/py4science/workbook/fig/basemap1.pdf trunk/py4science/workbook/fig/basemap1.png trunk/py4science/workbook/fig/basemap2.eps trunk/py4science/workbook/fig/basemap2.png trunk/py4science/workbook/fig/basemap3.eps trunk/py4science/workbook/fig/basemap3.pdf trunk/py4science/workbook/fig/basemap3.png trunk/py4science/workbook/fig/basemap4.eps trunk/py4science/workbook/fig/basemap4.pdf trunk/py4science/workbook/fig/basemap4.png trunk/py4science/workbook/fig/basemap5.pdf trunk/py4science/workbook/fig/basemap5.png Added: trunk/py4science/workbook/basemap.tex =================================================================== --- trunk/py4science/workbook/basemap.tex (rev 0) +++ trunk/py4science/workbook/basemap.tex 2007-11-21 20:50:10 UTC (rev 4409) @@ -0,0 +1,125 @@ +The matplotlib basemap toolkit is an add-on for matplotlib that provides +the capability to draw maps of the earth in various map projections, +and plot data on those maps. This section shows how to use basemap +to create simple maps, draw coastlines and political boundaries, draw +lines of constant latitude and longitude, and plot geophysical data +on the maps. + + +\section{Setting up the map.} + +In order to represent the curved surface of the earth in a two-dimensional +map, a map projection is needed. Since this cannot be done without +distortion, there are many map projections, each with it's own advantages +and disadvantages. Basemap provides 19 different map projections. +Some are global, some can only represent a portion of the globe. When +a Basemap class instance is created, the desired map projection must +be specified, along with information about the portion of the earth's +surface that the map projection will describe. There are two basic +ways of doing this. One is to provide the latitude and longitude values +of each of the four corners of the rectangular map projection region. +The other is to provide the lat/lon value of the center of the map +projection region along with the width and height of the region in +map projection coordinates. The first script illustrates how to use +both of these methods to create a simple map. It also shows how to +draw the continents and political boundaries on the map. + +Here is an example script that creates a map by specifying the latitudes +and longitudes of the four corners + +\lstinputlisting[label=code:basemap1_skel,caption={IGNORED}]{../examples/basemap1.py} + +After running this script, you should see a plot that looks similar +to Figure 1. + +\begin{figure}[h] +\includegraphics[scale=0.75]{fig/basemap1} + +\caption{A map created by specifying the latitudes and longitudes of the four +corners.} + +\end{figure} + +\medskip{} +Here is an example script that creates a map by specifying the center +of the map, plus the width and height in meters. + +\lstinputlisting[label=code:basemap2_skel,caption={IGNORED}]{../examples/basemap2.py} + +After running this script, you should see a plot that looks nearly +identical to Figure 1.\medskip{} + + +The Basemap class instance can be used to convert latitudes and longitudes +to coordinates on the map. To do this, simply call the instance as +if it were a function, passing it the longitude and latitudes values +to convert. The corresponding x and y values in map projection coordinates +will be returned. The following example script shows how to use this +to plot the locations of two cities (New York and London). The Basemap +method drawgreatcircle is then used to draw the great circle route +between these cities on the map. + +\lstinputlisting[label=code:basemap3_skel,caption={IGNORED}]{../examples/basemap3.py} + +This should produce something similar to Figure 2. + +\begin{figure}[h] +\includegraphics[scale=0.75]{fig/basemap3} + +\caption{Drawing the locations of two cities, and connecting them along a great +circle.} + +\end{figure} + +\medskip{} +Most maps include a graticule grid, a reference network of labelled +latitude and longitude lines. Basemap does this with the drawparallels +and drawmeridians instance methods. The longitude and latitude lines +can be labelled where the intersect the map projection boundary. Following +is an example script that draws a graticule on the map we've been +working with. + +\lstinputlisting[label=code:basemap4_skel,caption={IGNORED}]{../examples/basemap4.py} + +Running this script should produce a plot that looks like Figure 3. + +\begin{figure}[h] +\includegraphics[scale=0.75]{fig/basemap4} + +\caption{Drawing labelled meridians and parallels on the map (a graticule grid).} + +\end{figure} + + +\section{Plotting geophysical data on the map.} + +One of the most common uses of Basemap is to visualize earth science +data, such as output from climate models. These data often come on +latitude/longitude grids. One common data format for storing such +grids is NetCDF. Basemap includes a NetCDF file reader (written in +pure python by Roberto D'Almeida). There are python packages available +for reading just about every other scientific data format imaginable, +including HDF, GRIB, FITS and many others. Following is an example +of how to read sea-surface temperature data from a NetCDF file and +plot it on a global mollweide projection. + +\lstinputlisting[label=code:basemap5_skel,caption={IGNORED}]{../examples/basemap5.py} + +The resulting plot should look like Figure 4. + +\pagebreak + +\begin{figure}[h] +\includegraphics[scale=0.75]{fig/basemap5} + +\caption{Sea surface temperature on a global mollweide projection.} + +\end{figure} + +\medskip{} + +Basemap also is capable of reading ESRI shapefiles, a very common +GIS format. The script fillstates.py in the examples directory of +the basemap source distribution shows how to read and plot polygons +in a shapefile. There are many other useful examples in that directory +that illustrate various ways of using basemap.% Added: trunk/py4science/workbook/fig/basemap1.eps =================================================================== --- trunk/py4science/workbook/fig/basemap1.eps (rev 0) +++ trunk/py4science/workbook/fig/basemap1.eps 2007-11-21 20:50:10 UTC (rev 4409) @@ -0,0 +1,50377 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Title: basemap1.eps +%%Creator: matplotlib version 0.90.1, http://matplotlib.sourceforge.net/ +%%CreationDate: Wed Nov 21 12:50:18 2007 +%%Orientation: portrait +%%BoundingBox: 18 180 594 612 +%%EndComments +%%BeginProlog +/mpldict 8 dict def +mpldict begin +/m { moveto } bind def +/l { lineto } bind def +/r { rlineto } bind def +/box { +m +1 index 0 r +0 exch r +neg 0 r +closepath +} bind def +/clipbox { +box +clip +newpath +} bind def +/ellipse { +newpath +matrix currentmatrix 7 1 roll +translate +scale +0 0 1 5 3 roll arc +setmatrix +closepath +} bind def +/unitcircle { +newpath +-1. 0. moveto +-1.0 0.552284749831 -0.552284749831 1.0 0.0 1.0 curveto +0.552284749831 1.0 1.0 0.552284749831 1.0 0.0 curveto +1.0 -0.552284749831 0.552284749831 -1.0 0.0 -1.0 curveto +-0.552284749831 -1.0 -1.0 -0.552284749831 -1.0 0.0 curveto +closepath +} bind def +%!PS-Adobe-3.0 Resource-Font +%%Title: Bitstream Vera Sans +%%Copyright: Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. +%%Creator: Converted from TrueType by PPR +25 dict begin +/_d{bind def}bind def +/_m{moveto}_d +/_l{lineto}_d +/_cl{closepath eofill}_d +/_c{curveto}_d +/_sc{7 -1 roll{setcachedevice}{pop pop pop pop pop pop}ifelse}_d +/_e{exec}_d +/FontName /BitstreamVeraSans-Roman def +/PaintType 0 def +/FontMatrix[.001 0 0 .001 0 0]def +/FontBBox[-182 -235 1287 928]def +/FontType 3 def +/Encoding StandardEncoding def +/FontInfo 10 dict dup begin +/FamilyName (Bitstream Vera Sans) def +/FullName (Bitstream Vera Sans) def +/Notice (Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is a trademark of Bitstream, Inc.) def +/Weight (Roman) def +/Version (Release 1.10) def +/ItalicAngle 0.0 def +/isFixedPitch false def +/UnderlinePosition -213 def +/UnderlineThickness 143 def +end readonly def +/CharStrings 19 dict dup begin +/space{318 0 0 0 0 0 _sc +}_d +/slash{337 0 0 -92 337 729 _sc +254 729 _m +337 729 _l +83 -92 _l +0 -92 _l +254 729 _l +_cl}_d +/a{{613 0 60 -13 522 560 _sc +343 275 _m +270 275 220 266 192 250 _c +164 233 150 205 150 165 _c +150 133 160 107 181 89 _c +202 70 231 61 267 61 _c +317 61 357 78 387 114 _c +417 149 432 196 432 255 _c +432 275 _l +343 275 _l +522 312 _m +522 0 _l +432 0 _l +432 83 _l +411 49 385 25 355 10 _c +325 -5 287 -13 243 -13 _c +187 -13 142 2 109 33 _c +76 64 60 106 60 159 _c +60 220 80 266 122 298 _c +163 329 224 345 306 345 _c +432 345 _l +432 354 _l +432 395 418 427 391 450 _c +364 472 326 484 277 484 _c +245 484 215 480 185 472 _c +155 464 127 453 100 439 _c +100 522 _l +}_e{132 534 164 544 195 550 _c +226 556 256 560 286 560 _c +365 560 424 539 463 498 _c +502 457 522 395 522 312 _c +_cl}_e}_d +/c{{550 0 55 -13 488 560 _sc +488 526 _m +488 442 _l +462 456 437 466 411 473 _c +385 480 360 484 334 484 _c +276 484 230 465 198 428 _c +166 391 150 339 150 273 _c +150 206 166 154 198 117 _c +230 80 276 62 334 62 _c +360 62 385 65 411 72 _c +437 79 462 90 488 104 _c +488 21 _l +462 9 436 0 410 -5 _c +383 -10 354 -13 324 -13 _c +242 -13 176 12 128 64 _c +79 115 55 185 55 273 _c +55 362 79 432 128 483 _c +177 534 244 560 330 560 _c +358 560 385 557 411 551 _c +437 545 463 537 488 526 _c +_cl}_e}_d +/d{{635 0 55 -13 544 760 _sc +454 464 _m +454 760 _l +544 760 _l +544 0 _l +454 0 _l +454 82 _l +435 49 411 25 382 10 _c +353 -5 319 -13 279 -13 _c +213 -13 159 13 117 65 _c +75 117 55 187 55 273 _c +55 359 75 428 117 481 _c +159 533 213 560 279 560 _c +319 560 353 552 382 536 _c +411 520 435 496 454 464 _c +148 273 _m +148 207 161 155 188 117 _c +215 79 253 61 301 61 _c +348 61 385 79 413 117 _c +440 155 454 207 454 273 _c +454 339 440 390 413 428 _c +385 466 348 485 301 485 _c +253 485 215 466 188 428 _c +161 390 148 339 148 273 _c +_cl}_e}_d +/e{{615 0 55 -13 562 560 _sc +562 296 _m +562 252 _l +149 252 _l +153 190 171 142 205 110 _c +238 78 284 62 344 62 _c +378 62 412 66 444 74 _c +476 82 509 95 541 113 _c +541 28 _l +509 14 476 3 442 -3 _c +408 -9 373 -13 339 -13 _c +251 -13 182 12 131 62 _c +80 112 55 181 55 268 _c +55 357 79 428 127 481 _c +175 533 241 560 323 560 _c +397 560 455 536 498 489 _c +540 441 562 377 562 296 _c +472 322 _m +471 371 457 410 431 440 _c +404 469 368 484 324 484 _c +274 484 234 469 204 441 _c +174 413 156 373 152 322 _c +472 322 _l +_cl}_e}_d +/f{352 0 23 0 371 760 _sc +371 760 _m +371 685 _l +285 685 _l +253 685 230 678 218 665 _c +205 652 199 629 199 595 _c +199 547 _l +347 547 _l +347 477 _l +199 477 _l +199 0 _l +109 0 _l +109 477 _l +23 477 _l +23 547 _l +109 547 _l +109 585 _l +109 645 123 690 151 718 _c +179 746 224 760 286 760 _c +371 760 _l +_cl}_d +/g{{635 0 55 -207 544 560 _sc +454 280 _m +454 344 440 395 414 431 _c +387 467 349 485 301 485 _c +253 485 215 467 188 431 _c +161 395 148 344 148 280 _c +148 215 161 165 188 129 _c +215 93 253 75 301 75 _c +349 75 387 93 414 129 _c +440 165 454 215 454 280 _c +544 68 _m +544 -24 523 -93 482 -139 _c +440 -184 377 -207 292 -207 _c +260 -207 231 -204 203 -200 _c +175 -195 147 -188 121 -178 _c +121 -91 _l +147 -105 173 -115 199 -122 _c +225 -129 251 -133 278 -133 _c +336 -133 380 -117 410 -87 _c +439 -56 454 -10 454 52 _c +454 96 _l +435 64 411 40 382 24 _c +353 8 319 0 279 0 _c +211 0 157 25 116 76 _c +75 127 55 195 55 280 _c +55 364 75 432 116 483 _c +157 534 211 560 279 560 _c +}_e{319 560 353 552 382 536 _c +411 520 435 496 454 464 _c +454 547 _l +544 547 _l +544 68 _l +_cl}_e}_d +/i{278 0 94 0 184 760 _sc +94 547 _m +184 547 _l +184 0 _l +94 0 _l +94 547 _l +94 760 _m +184 760 _l +184 646 _l +94 646 _l +94 760 _l +_cl}_d +/l{278 0 94 0 184 760 _sc +94 760 _m +184 760 _l +184 0 _l +94 0 _l +94 760 _l +_cl}_d +/m{{974 0 91 0 889 560 _sc +520 442 _m +542 482 569 511 600 531 _c +631 550 668 560 711 560 _c +767 560 811 540 842 500 _c +873 460 889 403 889 330 _c +889 0 _l +799 0 _l +799 327 _l +799 379 789 418 771 444 _c +752 469 724 482 686 482 _c +639 482 602 466 575 435 _c +548 404 535 362 535 309 _c +535 0 _l +445 0 _l +445 327 _l +445 379 435 418 417 444 _c +398 469 369 482 331 482 _c +285 482 248 466 221 435 _c +194 404 181 362 181 309 _c +181 0 _l +91 0 _l +91 547 _l +181 547 _l +181 462 _l +201 495 226 520 255 536 _c +283 552 317 560 357 560 _c +397 560 430 550 458 530 _c +486 510 506 480 520 442 _c +}_e{_cl}_e}_d +/n{634 0 91 0 549 560 _sc +549 330 _m +549 0 _l +459 0 _l +459 327 _l +459 379 448 417 428 443 _c +408 469 378 482 338 482 _c +289 482 251 466 223 435 _c +195 404 181 362 181 309 _c +181 0 _l +91 0 _l +91 547 _l +181 547 _l +181 462 _l +202 494 227 519 257 535 _c +286 551 320 560 358 560 _c +420 560 468 540 500 501 _c +532 462 549 405 549 330 _c +_cl}_d +/o{612 0 55 -13 557 560 _sc +306 484 _m +258 484 220 465 192 427 _c +164 389 150 338 150 273 _c +150 207 163 156 191 118 _c +219 80 257 62 306 62 _c +354 62 392 80 420 118 _c +448 156 462 207 462 273 _c +462 337 448 389 420 427 _c +392 465 354 484 306 484 _c +306 560 _m +384 560 445 534 490 484 _c +534 433 557 363 557 273 _c +557 183 534 113 490 63 _c +445 12 384 -13 306 -13 _c +227 -13 165 12 121 63 _c +77 113 55 183 55 273 _c +55 363 77 433 121 484 _c +165 534 227 560 306 560 _c +_cl}_d +/p{{635 0 91 -207 580 560 _sc +181 82 _m +181 -207 _l +91 -207 _l +91 547 _l +181 547 _l +181 464 _l +199 496 223 520 252 536 _c +281 552 316 560 356 560 _c +422 560 476 533 518 481 _c +559 428 580 359 580 273 _c +580 187 559 117 518 65 _c +476 13 422 -13 356 -13 _c +316 -13 281 -5 252 10 _c +223 25 199 49 181 82 _c +487 273 _m +487 339 473 390 446 428 _c +418 466 381 485 334 485 _c +286 485 249 466 222 428 _c +194 390 181 339 181 273 _c +181 207 194 155 222 117 _c +249 79 286 61 334 61 _c +381 61 418 79 446 117 _c +473 155 487 207 487 273 _c +_cl}_e}_d +/r{411 0 91 0 411 560 _sc +411 463 _m +401 469 390 473 378 476 _c +366 478 353 480 339 480 _c +288 480 249 463 222 430 _c +194 397 181 350 181 288 _c +181 0 _l +91 0 _l +91 547 _l +181 547 _l +181 462 _l +199 495 224 520 254 536 _c +284 552 321 560 365 560 _c +371 560 378 559 386 559 _c +393 558 401 557 411 555 _c +411 463 _l +_cl}_d +/s{{521 0 54 -13 472 560 _sc +443 531 _m +443 446 _l +417 458 391 468 364 475 _c +336 481 308 485 279 485 _c +234 485 200 478 178 464 _c +156 450 145 430 145 403 _c +145 382 153 366 169 354 _c +185 342 217 330 265 320 _c +296 313 _l +360 299 405 279 432 255 _c +458 230 472 195 472 151 _c +472 100 452 60 412 31 _c +372 1 316 -13 246 -13 _c +216 -13 186 -10 154 -5 _c +122 0 89 8 54 20 _c +54 113 _l +87 95 120 82 152 74 _c +184 65 216 61 248 61 _c +290 61 323 68 346 82 _c +368 96 380 117 380 144 _c +380 168 371 187 355 200 _c +339 213 303 226 247 238 _c +216 245 _l +160 257 119 275 95 299 _c +70 323 58 356 58 399 _c +58 450 76 490 112 518 _c +148 546 200 560 268 560 _c +}_e{301 560 332 557 362 552 _c +391 547 418 540 443 531 _c +_cl}_e}_d +/t{392 0 27 0 368 702 _sc +183 702 _m +183 547 _l +368 547 _l +368 477 _l +183 477 _l +183 180 _l +183 135 189 106 201 94 _c +213 81 238 75 276 75 _c +368 75 _l +368 0 _l +276 0 _l +206 0 158 13 132 39 _c +106 65 93 112 93 180 _c +93 477 _l +27 477 _l +27 547 _l +93 547 _l +93 702 _l +183 702 _l +_cl}_d +/u{634 0 85 -13 543 547 _sc +85 216 _m +85 547 _l +175 547 _l +175 219 _l +175 167 185 129 205 103 _c +225 77 255 64 296 64 _c +344 64 383 79 411 110 _c +439 141 453 183 453 237 _c +453 547 _l +543 547 _l +543 0 _l +453 0 _l +453 84 _l +431 50 405 26 377 10 _c +348 -5 315 -13 277 -13 _c +214 -13 166 6 134 45 _c +101 83 85 140 85 216 _c +_cl}_d +/v{592 0 30 0 562 547 _sc +30 547 _m +125 547 _l +296 88 _l +467 547 _l +562 547 _l +357 0 _l +235 0 _l +30 547 _l +_cl}_d +end readonly def + +/BuildGlyph + {exch begin + CharStrings exch + 2 copy known not{pop /.notdef}if + true 3 1 roll get exec + end}_d + +/BuildChar { + 1 index /Encoding get exch get + 1 index /BuildGlyph get exec +}_d + +FontName currentdict end definefont pop +%%EOF +end +%%EndProlog +mpldict begin +18 180 translate +576 432 0 0 clipbox +1.000 setgray +1.000 setlinewidth +0 setlinejoin +2 setlinecap +[] 0 setdash +0 0 m +0 432 l +576 432 l +576 0 l +closepath +gsave +fill +grestore +stroke +0.000 setgray +57.6 43.214 m +57.6 388.786 l +518.4 388.786 l +518.4 43.214 l +closepath +gsave +0.000 1.000 1.000 setrgbcolor +fill +grestore +stroke +1.000 0.498 0.314 setrgbcolor +0.000 setlinewidth +gsave +460.8 345.6 57.6 43.21 clipbox +371.865 388.786 m +371.763 388.613 l +372.168 388.022 l +371.562 387.849 l +371.541 388.16 l +370.667 388.402 l +370.681 388.786 l +371.865 388.786 l +closepath +gsave +fill +grestore +newpath +grestore +gsave +460.8 345.6 57.6 43.21 clipbox +375.155 388.786 m +374.98 387.867 l +374.707 387.23 l +373.564 386.427 l +372.465 387.347 l +373.15 388.666 l +373.071 388.786 l +375.155 388.786 l +closepath +gsave +fill +grestore +newpath +grestore +gsave +460.8 345.6 57.6 43.21 clipbox +385.585 388.786 m +385.65 388.739 l +385.651 387.917 l +386.099 387.45 l +385.801 387.085 l +384.739 386.985 l +383.481 386.023 l +382.548 386.077 l +381.872 385.758 l +379.632 386.026 l +377.372 384.204 l +376.834 383.215 l +375.631 383.549 l +374.931 383.378 l +373.51 384.544 l +372.715 384.793 l +370.129 383.681 l +369.853 383.86 l +370.188 384.592 l +370.482 384.495 l +371.012 385.148 l +371.213 384.976 l +372.132 385.579 l +374.017 385.57 l +375.254 386.391 l +375.816 386.153 l +376.197 386.539 l +376.469 387.679 l +376.314 387.54 l +376.014 388.786 l +385.585 388.786 l +closepath +gsave +fill +grestore +newpath +grestore +gsave +460.8 345.6 57.6 43.21 clipbox +387.853 388.786 m +387.417 388.721 l +387.279 388.786 l +387.853 388.786 l +closepath +gsave +fill +grestore +newpath +grestore +gsave +460.8 345.6 57.6 43.21 clipbox +518.4 277.926 m +516.183 275.642 l +515.493 273.818 l +517.149 272.603 l +517.624 272.614 l +518.014 271.98 l +517.728 272.086 l +517.271 271.397 l +517.367 269.378 l +515.496 267.798 l +514.86 268.132 l +514.703 267.744 l +514.236 268.248 l +513.698 267.828 l +514.288 267.262 l +513.795 267.218 l +513.487 266.679 l +513.054 266.914 l +512.817 266.337 l +512.535 266.451 l +512.844 266.079 l +512.397 265.709 l +512.949 265.656 l +513.278 264.427 l +513.009 264.259 l +513.009 264.807 l +512.671 264.428 l +512.724 265.061 l +512.377 265.158 l +512.014 263.775 l +512.38 263.417 l +511.97 262.503 l +511.709 262.444 l +511.68 263.558 l +512.186 264.81 l +511.731 265.046 l +512.008 265.51 l +511.625 266.324 l +510.891 263.603 l +510.425 263.233 l +510.505 262.566 l +509.789 262.832 l +509.836 263.253 l +510.299 263.471 l +509.87 264.345 l +509.566 263.725 l +508.823 263.886 l +509.012 263.468 l +508.771 263.027 l +507.832 263.535 l +507.233 262.947 l +507.24 263.885 l +506.261 264.345 l +505.459 263.619 l +505.479 263.17 l +504.541 263.162 l +504.43 262.729 l +504.785 262.392 l +503.788 262.008 l +503.6 261.521 l +503.227 261.888 l +503.63 262.042 l +503.332 262.737 l +503.088 262.371 l +502.222 262.609 l +502.156 262.884 l +503.069 263.281 l +503.45 262.959 l +504.048 263.051 l +503.586 263.369 l +504.048 263.551 l +504.189 264.91 l +503.916 264.166 l +502.709 263.811 l +502.361 264.035 l +502.607 264.516 l +502.225 264.675 l +502.244 265.332 l +501.961 265.373 l +501.574 264.61 l +501.104 265.118 l +499.973 264.57 l +499.241 266.177 l +498.408 263.226 l +496.692 264.282 l +496.383 264.551 l +496.471 265.044 l +495.881 265.56 l +495.512 267.043 l +495.918 267.734 l +495.951 268.844 l +496.804 269.078 l +497.267 270.035 l +497.14 270.532 l +496.482 270.096 l +496.342 270.396 l +496.904 271.204 l +497.122 270.605 l +497.343 270.733 l +497.509 271.805 l +498.64 274.005 l +498.52 274.653 l +497.701 273.617 l +497.445 274.442 l +497.68 276.3 l +497.963 276.339 l +498.299 277.604 l +497.12 275.58 l +496.944 275.761 l +495.924 275.154 l +495.264 275.979 l +496.611 278.376 l +496.626 279.428 l +497.717 280.773 l +498.187 282.23 l +497.926 283.007 l +497.481 283.125 l +496.845 286.325 l +496.563 290.274 l +498.262 294.504 l +497.876 295.636 l +498.399 296.18 l +498.34 295.892 l +498.707 295.675 l +499.759 296.023 l +500.425 296.837 l +500.285 298.217 l +500.527 298.422 l +501.589 298.415 l +502.793 299.067 l +502.448 299.885 l +502.692 300.5 l +503.638 301.06 l +503.982 301.841 l +504.712 302.462 l +504.322 303.092 l +504.49 303.428 l +505.167 303.578 l +505.881 305.11 l +505.736 307.847 l +506.024 308.228 l +505.807 308.791 l +506.424 309.203 l +507.155 311.025 l +505.98 315.488 l +504.176 317.097 l +500.067 316.723 l +499.633 315.855 l +498.745 315.694 l +498.253 315.168 l +497.469 313.485 l +496.812 313.455 l +496.15 312.532 l +491.643 309.843 l +490.662 308.215 l +488.999 307.307 l +489.317 307.025 l +488.864 306.229 l +487.529 305.923 l +486.108 304.202 l +486.022 305.474 l +485.817 304.919 l +485.483 304.905 l +485.541 305.179 l +485.327 304.951 l +485.66 304.411 l +485.217 305.062 l +485.884 306.008 l +486.292 305.676 l +486.258 306.443 l +485.889 306.014 l +486.042 307.187 l +484.9 307.735 l +484.671 308.487 l +483.623 309.144 l +483.602 309.623 l +484.048 309.485 l +482.854 310.304 l +483.285 310.123 l +484.016 311.007 l +482.259 310.025 l +481.95 309.378 l +480.56 309.078 l +481.068 309.911 l +480.82 310.861 l +481.179 310.908 l +481.365 311.643 l +480.937 311.493 l +480.98 311.131 l +480.469 311.408 l +480.502 312.562 l +480.08 313.492 l +480.307 314.019 l +479.266 314.167 l +479.029 313.305 l +479.323 313.177 l +479.438 312.026 l +479.076 311.899 l +479.476 310.554 l +479.068 310.565 l +478.79 309.144 l +479.59 308.125 l +479.178 308.024 l +479.427 307.063 l +480.175 306.312 l +479.787 306.542 l +479.434 306.056 l +479.545 305.281 l +480.263 304.285 l +479.783 304.938 l +479.4 303.895 l +479.95 302.285 l +480.955 301.126 l +481.054 300.508 l +480.189 301.912 l +480.159 301.635 l +479.332 301.625 l +479.992 301.477 l +480.562 300.101 l +480.354 299.582 l +480.909 299.362 l +481.277 298.778 l +481.399 299.099 l +481.056 299.15 l +481.332 299.354 l +481.867 298.773 l +481.649 299.703 l +482.166 298.838 l +481.902 299.484 l +482.447 299.045 l +482.345 299.773 l +482.688 299.419 l +482.5 299.72 l +482.941 300.074 l +483.633 300.129 l +484.042 299.573 l +484.928 300.749 l +484.795 300.927 l +481.9 299.963 l +482.016 299.695 l +481.103 299.937 l +480.686 299.605 l +480.899 299.943 l +480.614 300.084 l +482.835 300.319 l +484.717 300.953 l +484.793 301.743 l +484.319 302.281 l +484.871 302.562 l +484.687 303.779 l +485.379 304.543 l +485.575 303.781 l +486.41 303.664 l +486.511 303.376 l +486.318 301.688 l +485.727 301.383 l +485.528 300.788 l +486.151 300.284 l +485.973 299.932 l +486.544 299.199 l +486.243 298.911 l +486.209 297.746 l +486.914 296.693 l +487.231 295.37 l +487.035 294.658 l +485.869 293.846 l +485.937 294.516 l +485.787 294.299 l +484.303 295.062 l +483.408 294.799 l +483.404 294.248 l +482.4 293.688 l +482.097 294.479 l +482.383 293.682 l +482.025 293.133 l +482.114 292.682 l +481.631 292.293 l +480.892 294.663 l +480.567 294.879 l +480.865 295.006 l +480.623 296.268 l +480.919 296.408 l +480.598 296.763 l +480.399 296.35 l +479.501 296.573 l +479.956 296.153 l +479.34 295.367 l +478.927 295.543 l +479.208 295.206 l +478.886 293.406 l +478.315 292.603 l +478.102 292.712 l +477.222 291.916 l +477.307 291.541 l +477.06 291.637 l +477.107 292.5 l +476.838 292.469 l +476.351 291.725 l +476.697 291.591 l +475.744 291.201 l +477.011 293.343 l +476.524 293.412 l +476.474 292.96 l +475.912 292.654 l +475.279 292.663 l +474.94 292.999 l +475.223 292.545 l +475.846 292.414 l +475.905 292.068 l +475.466 291.039 l +474.748 291.792 l +475.097 291.413 l +474.724 291.3 l +475.13 291.385 l +475.484 290.978 l +475.004 289.894 l +475.108 289.041 l +475.81 288.765 l +475.811 288.407 l +476.75 287.541 l +475.375 287.547 l +475.634 287.306 l +475.232 287.398 l +475.148 287.046 l +475.565 286.924 l +476.766 287.526 l +477.435 286.17 l +477.098 286.282 l +477.471 285.975 l +477.145 285.761 l +477.6 285.472 l +477.344 285.412 l +477.411 285.108 l +477.75 285.174 l +477.906 284.707 l +476.877 284.737 l +477.9 284.218 l +477.968 284.589 l +478.272 284.123 l +478.59 284.633 l +479.422 284.172 l +479.104 284.012 l +479.489 284.053 l +479.356 283.787 l +479.662 283.942 l +480.83 283.142 l +480.612 281.67 l +480.822 281.093 l +480.529 281.13 l +480.43 281.759 l +480.178 281.51 l +479.695 281.879 l +479.566 281.15 l +480.458 281.054 l +480.314 280.356 l +480.772 280.432 l +480.593 280.834 l +480.83 281.088 l +480.813 280.313 l +481.481 280.047 l +481.03 280.799 l +481.984 279.387 l +483.311 279.01 l +483.863 278.346 l +485.24 277.928 l +485.607 277.389 l +485.196 277.042 l +485.097 276.306 l +485.613 275.44 l +487.609 274.577 l +487.375 274.059 l +487.908 273.571 l +487.726 273.158 l +488.121 272.813 l +488.065 272.869 l +488.579 273.541 l +489.288 273.353 l +490.664 273.792 l +491.328 273.332 l +492.837 273.527 l +495.147 275.837 l +495.965 275.052 l +495.675 273.832 l +495.1 273.839 l +495.48 273.638 l +494.695 272.821 l +494.822 271.801 l +494.304 271.168 l +494.19 270.443 l +495.05 269.259 l +495.236 266.95 l +496.229 264.615 l +495.529 265.269 l +495.131 265.202 l +494.947 267.465 l +494.607 267.662 l +493.919 265.474 l +492.821 265.663 l +492.012 264.165 l +491.019 263.05 l +490.797 263.181 l +490.952 261.793 l +490.698 261.325 l +490.198 261.331 l +490.053 260.784 l +490.411 260.404 l +490.452 259.382 l +489.805 258.853 l +489.795 258.409 l +490.067 258.123 l +490.945 258.544 l +490.917 258.188 l +491.391 258.151 l +491.681 258.5 l +491.427 258.667 l +493.197 259.294 l +493.231 258.919 l +492.314 258.781 l +491.397 257.629 l +492.07 257.416 l +492.776 257.947 l +493.397 257.468 l +491.8 257.12 l +491.19 256.453 l +491.396 256.045 l +490.03 255.081 l +489.405 255.122 l +489.506 255.685 l +489.045 255.735 l +489.195 254.351 l +489.719 254.383 l +490.388 253.602 l +491.009 253.453 l +495.516 254.112 l +495.444 253.007 l +495.326 253.696 l +494.679 253.632 l +494.172 253.17 l +494.583 252.514 l +495.29 252.789 l +495.627 252.535 l +495.742 252.852 l +495.9 251.869 l +495.535 250.871 l +496.748 252.255 l +497.385 252.214 l +497.306 252.611 l +497.651 252.906 l +498.258 252.672 l +498.565 253.392 l +499.365 253.412 l +500.095 254.224 l +500.801 254.387 l +500.889 253.955 l +502.296 253.679 l +502.825 253.205 l +500.404 252.353 l +500.237 250.334 l +500.83 250.781 l +501.572 250.34 l +502.181 250.72 l +501.81 250.786 l +501.873 251.155 l +502.37 250.866 l +502.893 251.105 l +502.597 250.264 l +502.93 249.693 l +502.483 249.49 l +502.174 249.877 l +501.071 248.8 l +504.917 248.456 l +505.386 247.899 l +506.442 248.045 l +505.713 247.463 l +504.272 247.429 l +503.998 246.967 l +504.509 246.051 l +505.44 245.598 l +504.682 245.422 l +504.049 245.931 l +502.705 245.545 l +502.257 245.776 l +502.094 245.066 l +502.917 244.785 l +503.069 244.327 l +502.632 244.33 l +502.391 243.967 l +501.877 244.263 l +500.806 244.238 l +500.429 244.969 l +499.829 245.123 l +498.739 244.895 l +498.419 244.458 l +497.786 244.686 l +497.209 244.282 l +496.895 244.546 l +496.921 245.315 l +496.194 245.901 l +496.873 246.471 l +496.489 247.392 l +496.73 247.977 l +499.851 250.136 l +499.804 250.482 l +499.384 250.193 l +499.721 251.295 l +499.485 251.638 l +498.462 250.385 l +497.642 250.305 l +497.911 249.779 l +496.975 249.632 l +497.406 249.31 l +496.383 248.073 l +496.121 246.505 l +495.283 246.337 l +495.661 245.718 l +495.273 245.308 l +495.06 245.664 l +494.486 245.726 l +494.477 245.449 l +493.074 245.592 l +493.054 245.195 l +492.741 245.198 l +492.657 245.531 l +492.336 245.633 l +493.28 246.69 l +492.506 246.88 l +492.306 246.194 l +491.878 245.936 l +492.338 245.825 l +492.2 245.483 l +490.485 245.427 l +489.97 244.96 l +489.216 245.278 l +488.933 244.94 l +488.631 245.309 l +488.036 244.835 l +487.433 245.313 l +486.477 245.242 l +485.112 244.469 l +484.01 244.391 l +484.62 244.801 l +484.248 245.051 l +483.716 244.911 l +483.988 245.022 l +483.739 245.205 l +483.704 244.953 l +483.127 244.979 l +482.237 245.918 l +482.516 245.847 l +482.502 246.184 l +482.13 246.302 l +482.406 245.946 l +481.949 246.132 l +481.116 246.952 l +480.344 246.903 l +480.227 247.445 l +479.751 247.447 l +479.967 247.977 l +479.138 248.375 l +477.96 247.428 l +476.197 247.384 l +476.038 247.055 l +475.094 246.739 l +475.441 247.14 l +475.093 247.268 l +475.429 247.375 l +475.16 247.515 l +474.874 246.725 l +475.144 246.631 l +472.57 245.74 l +472.068 245.318 l +472.456 245.325 l +470.255 243.819 l +470.705 244.577 l +472.147 245.445 l +468.571 244.41 l +467.32 243.318 l +467.256 243.526 l +466.983 242.486 l +466.572 242.132 l +465.585 242.521 l +465.164 242.069 l +462.623 241.648 l +462.282 241.822 l +462.688 242.189 l +462.343 242.338 l +463.668 242.789 l +460.962 242.164 l +458.751 243.117 l +457.591 242.83 l +456.979 242.39 l +458.061 241.059 l +457.997 240.703 l +457.614 240.894 l +458.399 240.201 l +458.125 239.929 l +458.361 239.847 l +456.801 239.86 l +456.552 240.017 l +456.722 240.295 l +456.468 239.976 l +455.874 240.457 l +455.043 240.594 l +455.13 241.707 l +454.031 241.503 l +454.295 241.34 l +454.186 240.81 l +453.926 240.928 l +453.383 240.4 l +453.813 239.973 l +453.399 239.58 l +453.375 237.791 l +453.23 238.478 l +452.945 238.235 l +452.925 237.56 l +453.255 237.625 l +452.886 237.447 l +452.987 236.976 l +453.776 236.67 l +453.845 236.988 l +454.344 236.556 l +455.063 236.857 l +455.016 236.549 l +455.575 236.283 l +455.245 236.42 l +455.58 236.097 l +455.194 235.938 l +455.5 235.537 l +457.641 234.56 l +459.073 234.79 l +462.251 236.076 l +465.876 234.895 l +468.754 235.162 l +469.268 235.553 l +469.884 235.422 l +471.661 236.963 l +471.58 236.5 l +471.827 237.436 l +472.388 237.606 l +472.195 237.932 l +472.863 238.859 l +473.441 238.637 l +473.512 237.419 l +474.198 237.241 l +477.592 239.428 l +479.347 240.08 l +480.959 241.19 l +481.334 241.024 l +483.004 241.563 l +483.776 241.471 l +484.812 240.18 l +483.742 239.614 l +482.05 239.881 l +481.388 238.874 l +480.403 238.259 l +480.281 238.51 l +479.841 238.294 l +479.767 237.427 l +480.552 235.764 l +481.068 235.539 l +481.568 234.644 l +482.143 234.588 l +482.613 235.151 l +484.164 235.762 l +485.206 234.909 l +485.687 235.015 l +485.995 234.368 l +485.463 233.848 l +485.383 232.706 l +485.649 232.25 l +486.795 231.667 l +487.123 229.757 l +487.743 228.927 l +487.176 227.995 l +486.549 227.868 l +485.739 228.401 l +485.845 229.079 l +485.34 229.835 l +484.548 230.032 l +484.844 231.133 l +484.505 231.666 l +479.032 232.952 l +478.658 232.776 l +478.697 232.121 l +478.284 231.766 l +477.491 231.76 l +476.769 231.279 l +476.388 231.911 l +475.002 232.001 l +474.457 230.444 l +474.063 231.261 l +473.354 231.002 l +473.117 230.222 l +472.479 230.506 l +470.839 230.491 l +470.7 229.968 l +469.779 229.386 l +469.587 228.575 l +468.788 228.637 l +467.976 227.989 l +466.117 227.693 l +465.301 227.926 l +464.33 227.418 l +462.948 227.585 l +462.088 227.205 l +461.575 226.437 l +461.374 227.007 l +460.714 227.043 l +459.411 226.588 l +459.078 226.981 l +458.491 226.335 l +457.458 227.293 l +456.267 227.411 l +454.292 228.314 l +453.13 227.89 l +453.31 227.678 l +451.107 227.021 l +451.237 226.843 l +449.875 226.054 l +449.733 225.162 l +450.34 222.959 l +449.216 220.18 l +449.581 219.658 l +449.228 219.228 l +449.463 218.723 l +449.191 218.369 l +449.321 217.519 l +449.592 217.79 l +449.813 217.373 l +449.361 216.73 l +449.484 216.451 l +449.041 216.142 l +449.248 215.781 l +448.425 215.488 l +448.669 215.376 l +448.471 215.041 l +447.749 215.09 l +446.87 214.347 l +446.339 214.725 l +445.885 213.995 l +445.525 214.051 l +445.622 214.242 l +445.051 213.928 l +445.444 213.572 l +445.052 213.586 l +445.431 213.515 l +444.975 213.138 l +444.511 213.351 l +444.851 213.074 l +444.456 213.199 l +443.52 212.371 l +443.029 212.428 l +442.688 210.21 l +442.251 209.849 l +442.431 208.561 l +442.18 208.6 l +442.936 207.913 l +442.659 207.98 l +442.836 207.566 l +443.103 207.644 l +442.943 207.899 l +443.726 207.069 l +444.822 206.609 l +445.308 206.853 l +445.162 206.003 l +445.867 205.823 l +446.413 205.256 l +446.361 204.073 l +445.62 201.712 l +445.79 200.777 l +443.88 197.308 l +443.913 195.925 l +444.67 195.976 l +444.594 195.048 l +444.367 194.936 l +444.537 195.479 l +444.235 195.075 l +445.016 190.385 l +445.566 188.982 l +446.733 188.238 l +448.153 187.965 l +449.166 188.099 l +448.509 184.976 l +448.901 184.527 l +448.711 184.187 l +449.538 182.58 l +449.46 182.082 l +450.189 182.04 l +449.372 180.839 l +448.884 180.661 l +448.586 179.871 l +448.457 178.149 l +449.044 176.958 l +449.07 175.652 l +448.066 175.437 l +447.611 174.888 l +447.634 174.101 l +446.802 173.799 l +445.603 172.422 l +444.268 171.654 l +442.731 170.174 l +442.712 168.907 l +441.443 167.338 l +441.83 165.848 l +441.405 165.91 l +441.691 165.512 l +441.378 164.853 l +440.001 164.835 l +439.608 164.524 l +437.834 165.167 l +438.334 165.308 l +438.056 165.234 l +437.907 165.576 l +437.335 165.337 l +436.929 165.555 l +436.937 165.986 l +435.971 166.301 l +434.272 166.142 l +434.113 166.679 l +434.125 166.23 l +433.848 166.332 l +434.203 166.052 l +433.72 165.906 l +432.964 165.114 l +432.67 165.264 l +432.938 165.067 l +432.239 163.862 l +431.442 163.202 l +431.823 163.181 l +429.688 162.589 l +428.627 161.1 l +427.458 164.216 l +426.469 164.781 l +425.822 166.315 l +424.982 166.7 l +425.619 166.538 l +425.357 166.716 l +426.024 166.976 l +425.655 166.896 l +425.317 167.378 l +425.419 166.872 l +424.96 166.835 l +424.3 165.761 l +424.084 166.305 l +423.452 166.601 l +423.8 166.942 l +424.298 166.815 l +424.02 166.951 l +424.334 167.331 l +424.061 167.139 l +424.244 167.677 l +423.702 167.997 l +423.57 168.486 l +423.815 167.073 l +422.984 166.361 l +422.538 166.574 l +421.838 168.548 l +421.289 168.909 l +421.826 169.509 l +420.798 172.843 l +421.065 172.892 l +420.558 172.919 l +419.92 175.096 l +419.8 174.9 l +418.846 176.946 l +418.514 176.89 l +417.692 177.603 l +415.586 179.909 l +415.789 181.325 l +415.298 180.467 l +415.44 181.57 l +415.047 181.007 l +414.561 181.093 l +414.919 181.288 l +414.597 182.203 l +414.261 182.093 l +414.162 181.106 l +413.73 181.761 l +413.83 182.553 l +413.48 181.812 l +412.941 182.369 l +412.643 182.397 l +412.579 181.994 l +412.103 182.551 l +412.318 182.992 l +412.077 183.288 l +412.647 183.843 l +412.344 183.928 l +412.563 184.453 l +413.076 184.491 l +413.488 185.342 l +413.819 185.274 l +413.799 185.682 l +414.277 185.576 l +414.103 185.975 l +413.667 185.802 l +413.928 186.29 l +413.574 185.796 l +413.338 186.206 l +413.885 187.738 l +414.217 187.49 l +414.38 188.224 l +414.963 187.921 l +415.112 188.408 l +416.114 188.306 l +416.653 188.636 l +416.834 188.353 l +416.85 188.883 l +418.568 190.317 l +419.142 190.443 l +419.38 191.316 l +420.091 191.232 l +420.766 191.83 l +420.877 191.631 l +421.098 191.991 l +423.583 193.114 l +424.887 194.866 l +425.185 194.54 l +425.38 195.387 l +425.918 195.546 l +425.799 195.233 l +426.066 195.187 l +425.95 195.411 l +426.309 195.62 l +427.371 195.929 l +427.171 196.461 l +427.581 196.946 l +428.004 196.773 l +427.96 197.027 l +429.614 197.649 l +430.419 199.283 l +430.156 200.334 l +427.951 203.656 l +427.753 204.186 l +428.184 204.526 l +427.486 204.591 l +427.692 203.93 l +425.326 207.292 l +426.623 207.205 l +427.846 206.567 l +428.297 206.743 l +427.766 206.689 l +426.264 207.631 l +424.614 207.429 l +424.324 207.737 l +424.602 207.963 l +424.266 208.069 l +424.326 208.823 l +424.188 208.616 l +423.443 209.106 l +423.222 208.94 l +423.086 209.725 l +422.991 209.342 l +420.982 208.864 l +419.291 209.273 l +418.949 210.318 l +418.153 210.084 l +417.943 210.679 l +417.757 210.313 l +417.053 210.023 l +417.199 210.183 l +416.776 210.279 l +416.947 210.646 l +416.566 210.784 l +416.776 211.033 l +416.244 210.553 l +416.233 210.818 l +415.886 210.147 l +415.466 210.183 l +415.912 210.491 l +415.719 210.853 l +415.385 210.26 l +415.034 210.416 l +415.44 210.157 l +414.972 210.224 l +415.223 209.5 l +414.579 209.9 l +414.44 210.402 l +414.559 209.899 l +414.099 209.776 l +414.289 209.916 l +414.046 209.831 l +414.021 210.23 l +413.882 209.623 l +413.436 209.818 l +413.152 209.465 l +412.816 209.551 l +412.719 209.172 l +412.198 209.382 l +412.145 209.007 l +411.723 209.043 l +411.956 208.606 l +411.532 208.227 l +410.915 208.698 l +410.042 208.378 l +410.878 209.353 l +410.752 209.616 l +410.187 209.607 l +410.098 209.146 l +409.615 209.388 l +409.663 209.77 l +409.815 209.567 l +410.767 210.15 l +410.175 210.039 l +410.219 210.304 l +409.883 209.864 l +409.956 210.479 l +409.168 209.291 l +408.676 209.871 l +408.978 210.418 l +408.836 210.745 l +409.766 212.02 l +410.401 211.938 l +410.211 212.325 l +410.832 212.574 l +410.547 213.278 l +410.906 213.384 l +411.075 213.922 l +411.286 213.737 l +411.364 214.245 l +411.613 213.698 l +411.671 214.156 l +413.304 213.703 l +413.543 215.029 l +413.706 214.768 l +413.827 215.019 l +414.104 214.849 l +414.268 215.374 l +414.724 215.18 l +414.27 215.441 l +414.33 215.796 l +414.499 216 l +414.965 215.786 l +415.759 216.675 l +414.987 216.623 l +413.659 218.196 l +412.662 218.197 l +411.377 219.098 l +412.278 219.421 l +412.861 220.262 l +413.2 219.702 l +414.254 219.354 l +414.3 219.815 l +416.226 220.826 l +416.554 221.495 l +417.091 222.915 l +416.47 222.295 l +416.128 222.215 l +415.826 223.105 l +416.171 224.254 l +416.998 225.448 l +416.963 227.175 l +417.329 227.377 l +416.795 227.42 l +415.079 229.329 l +416.213 231.705 l +417.072 234.645 l +417.866 235.018 l +417.938 235.553 l +418.618 235.929 l +417.776 235.706 l +417.711 235.172 l +416.544 234.868 l +417.058 235.868 l +418.324 236.123 l +418.001 236.445 l +417.385 236.107 l +417.829 236.511 l +417.424 236.51 l +418.199 237.759 l +416.746 236.972 l +416.26 237.251 l +416.491 237.495 l +415.737 239.905 l +414.399 241.57 l +414.883 241.622 l +415.012 242.07 l +415.747 241.719 l +416.084 241.985 l +416.264 241.515 l +415.967 241.143 l +416.519 240.705 l +416.711 240.889 l +416.587 240.26 l +417.39 240.672 l +416.927 240.617 l +416.974 241.774 l +417.547 242.605 l +416.854 242.328 l +416.496 243.084 l +415.757 242.512 l +415.097 243.027 l +414.83 243.637 l +415.005 244.981 l +415.705 245.388 l +415.905 245.612 l +415.497 245.582 l +416.356 246.967 l +417.498 246.935 l +417.693 247.575 l +418.164 247.489 l +417.691 247.588 l +417.061 247.021 l +416.426 247.845 l +416.433 248.486 l +417.406 249.883 l +418.339 249.825 l +418.411 249.419 l +418.847 249.507 l +418.838 249.869 l +418.268 250.211 l +418.953 250.565 l +419.446 250.007 l +418.988 250.608 l +418.323 250.847 l +417.967 251.749 l +418.37 251.838 l +419.087 252.771 l +420.284 252.717 l +421.01 253.066 l +420.283 252.766 l +418.71 252.844 l +418.21 252.328 l +417.781 252.443 l +418.058 252.766 l +417.866 252.956 l +417.241 252.79 l +417.026 253.457 l +416.47 252.667 l +416.253 253.051 l +416.546 254.014 l +416.279 253.571 l +416.332 254.055 l +415.325 253.46 l +415.403 253.965 l +414.609 254.305 l +414.192 253.787 l +414.513 253.318 l +413.714 254.371 l +414.197 253.897 l +414.612 254.403 l +413.222 255.647 l +411.802 255.651 l +412.224 255.324 l +411.545 255.131 l +411.006 255.911 l +408.402 257.879 l +407.98 258.519 l +408.632 258.244 l +408.965 258.758 l +407.833 258.787 l +407.195 260.319 l +408.228 261.87 l +407.574 263.961 l +408.069 265.65 l +408.246 264.838 l +409.629 264.129 l +410.135 263.14 l +410 262.922 l +411.09 262.386 l +410.773 262.006 l +411.152 262.373 l +411.427 261.879 l +412.401 262.859 l +412.881 262.861 l +413.542 261.621 l +413.121 261.68 l +413.433 261.206 l +413.155 261.34 l +412.97 261.061 l +412.654 261.532 l +412.712 260.856 l +413.814 259.859 l +413.27 259.256 l +413.651 259.546 l +414.05 259.168 l +413.309 258.308 l +414.041 258.655 l +414.208 258.147 l +413.933 257.619 l +414.336 257.916 l +414.311 257.622 l +414.889 257.407 l +414.848 257.108 l +415.083 257.393 l +415.374 256.249 l +415.606 256.619 l +416.306 256.641 l +416.499 256.366 l +415.985 256.381 l +416.037 255.711 l +416.164 256.224 l +416.91 256.341 l +417.011 256.629 l +417.891 256.16 l +417.897 255.573 l +418.35 256.224 l +418.847 255.774 l +418.725 256.441 l +419.748 256.847 l +420.107 257.911 l +420.706 257.339 l +420.678 256.296 l +421.207 256.311 l +421.451 257.046 l +422.278 257.311 l +421.806 258.135 l +421.794 257.832 l +421.726 258.395 l +422.235 259.289 l +422.641 259.196 l +422.253 259.299 l +421.834 260.916 l +422.643 261.698 l +422.076 260.485 l +422.507 260.127 l +422.278 260.737 l +422.438 261.073 l +422.732 261.153 l +422.716 261.822 l +423.398 261.605 l +424.568 261.852 l +424.68 262.576 l +425.199 262.292 l +425.803 262.388 l +425.951 261.989 l +426.884 262.694 l +427.055 262.495 l +427.057 262.795 l +427.905 263.02 l +427.467 263.161 l +426.994 264.155 l +426.598 264.329 l +427.737 267.81 l +427.207 269.289 l +427.997 272.918 l +428.463 273.728 l +429.714 274.307 l +429.967 274.223 l +428.763 273.819 l +430.18 273.395 l +430.863 273.654 l +431.522 275.3 l +431.105 276.611 l +431.56 275.545 l +431.43 274.566 l +431.702 274.492 l +431.861 274.821 l +432.042 274.632 l +431.476 276.71 l +431.612 277.84 l +431.311 277.072 l +430.925 277.053 l +431.129 276.631 l +430.148 277.314 l +430.608 278.381 l +430.383 279.191 l +429.291 281.032 l +429.881 280.61 l +430.697 278.633 l +431.505 279.526 l +431.573 280.202 l +430.578 280.544 l +430.319 281.015 l +430.043 280.87 l +429.581 281.28 l +428.637 281.335 l +425.374 282.828 l +424.285 283.619 l +423.924 284.715 l +422.974 285.272 l +422.241 286.393 l +422.469 288.617 l +423.053 288.32 l +424.502 288.911 l +425.687 288.654 l +426.565 289.197 l +426.767 289.933 l +426.264 291.29 l +423.902 292.267 l +422.294 293.665 l +421.811 293.226 l +422.195 292.561 l +421.733 292.503 l +421.363 292.007 l +419.835 292.162 l +419.871 292.837 l +419.493 292.208 l +419.4 292.467 l +418.833 292.495 l +418.942 293.044 l +418.461 292.614 l +418.412 292.956 l +417.777 293.203 l +418.171 294.435 l +417.67 294.535 l +418.048 294.856 l +417.778 294.831 l +417.657 295.327 l +418.176 296.122 l +417.684 296.366 l +418.162 296.51 l +418.406 296.873 l +418.114 296.977 l +418.587 297.46 l +418.491 297.791 l +418.03 297.863 l +418.512 298.063 l +418.098 298.299 l +418.635 298.334 l +418.484 298.757 l +419.429 299.943 l +420.117 300.354 l +421.07 302.222 l +420.954 302.615 l +419.697 303.216 l +420.427 303.538 l +419.843 304.033 l +420.271 304.449 l +420.307 304.991 l +419.736 305.561 l +421.071 307.426 l +420.814 307.932 l +420.301 307.273 l +419.618 307.309 l +418.919 305.693 l +418.024 305.522 l +417.901 305.149 l +416.989 305.108 l +417.634 305.469 l +416.72 305.682 l +416.764 305.993 l +416.39 305.835 l +416.706 305.577 l +416.585 304.964 l +416.97 304.654 l +416.682 303.955 l +416.293 303.807 l +416.678 303.661 l +416.339 303.156 l +416.569 303.127 l +415.848 302.717 l +416.068 302.6 l +415.793 302.36 l +416.179 302.051 l +415.859 301.813 l +416.037 301.503 l +415.553 301.219 l +415.816 300.967 l +416.241 301.092 l +415.532 300.716 l +415.868 300.459 l +415.13 300.215 l +415.945 300.254 l +416.017 299.812 l +415.655 300.108 l +415.367 299.871 l +416.068 299.693 l +415.625 299.531 l +415.938 299.634 l +415.751 299.306 l +415.334 299.498 l +415.707 298.933 l +415.405 298.658 l +415.7 297.963 l +415.328 297.919 l +415.596 297.723 l +415.282 297.606 l +415.552 297.163 l +415.158 297.002 l +415.482 297.045 l +415.802 296.295 l +415.471 296.667 l +415.593 296.226 l +415.258 296.422 l +415.25 295.155 l +414.908 294.438 l +414.511 294.919 l +415.181 293.809 l +414.989 293.128 l +414.9 293.924 l +414.641 294.02 l +414.632 293.793 l +414.453 294.203 l +414.446 293.747 l +414.735 293.584 l +414.568 293.32 l +414.115 293.367 l +414.458 293.608 l +414.203 293.757 l +414.244 293.886 l +413.93 294.063 l +413.616 293.763 l +413.049 294.581 l +413.097 293.203 l +412.936 293.56 l +412.826 293.182 l +412.497 293.818 l +412.234 293.115 l +411.212 292.726 l +411.371 292.299 l +410.835 292.794 l +411.139 292.011 l +410.56 291.939 l +410.054 292.008 l +410.057 292.298 l +409.427 292.263 l +409.518 292.539 l +409.195 292.161 l +409.318 292.352 l +408.92 292.514 l +409.415 292.602 l +408.618 292.682 l +408.857 293.019 l +408.361 293.149 l +408.391 293.536 l +407.482 293.639 l +407.566 293.94 l +407.183 293.802 l +407.346 294.137 l +406.905 293.997 l +407.582 294.387 l +405.213 294.473 l +404.516 295.205 l +404.205 295.238 l +404.295 295.05 l +403.875 295.384 l +403.637 295.364 l +403.851 295.058 l +403.474 295.327 l +403.196 295.179 l +402.885 295.618 l +402.694 295.376 l +402.04 295.83 l +401.813 296.234 l +402.007 296.473 l +401.381 296.953 l +401.598 297.312 l +400.987 297.244 l +400.626 297.598 l +401.003 297.597 l +401.097 298.23 l +401.509 298.047 l +401.213 298.245 l +401.336 298.925 l +400.551 298.977 l +400.797 299.289 l +400.201 299.412 l +400.69 299.418 l +400.191 299.633 l +399.892 300.197 l +400.355 300.37 l +400.215 300.711 l +399.815 300.796 l +399.6 300.457 l +399.709 300.897 l +399.39 300.91 l +400.018 300.971 l +399.553 301.342 l +399.752 301.981 l +399.188 302.188 l +399.52 302.492 l +398.906 302.933 l +398.962 303.435 l +398.364 304.007 l +398.519 304.381 l +398.154 304.444 l +397.633 305.355 l +397.276 305.468 l +397.316 306.55 l +397.87 306.892 l +397.062 306.878 l +397.495 307.184 l +397.237 307.41 l +396.614 307.139 l +396.492 307.554 l +395.887 307.508 l +396.076 307.876 l +395.701 307.624 l +395.424 307.957 l +394.479 307.786 l +394.201 307.149 l +393.365 307.418 l +393.524 307.024 l +393.11 306.737 l +393.38 306.584 l +392.968 306.764 l +393.129 306.026 l +392.755 306.04 l +392.819 305.696 l +392.507 305.658 l +392.813 305.353 l +392.499 305.451 l +392.596 305.278 l +392.04 305.084 l +392.596 305.146 l +392.777 304.781 l +391.613 304.478 l +392.234 304.222 l +391.572 303.842 l +392.291 303.595 l +392.058 303.545 l +392.24 303.35 l +392.834 303.369 l +392.315 302.905 l +392.61 303.065 l +392.414 302.462 l +392.79 302.671 l +392.965 302.35 l +392.53 301.823 l +392.994 301.855 l +392.61 301.584 l +393.115 301.844 l +393.598 301.664 l +392.593 301.376 l +392.629 301.139 l +393.005 301.41 l +393.663 301.32 l +394.515 299.979 l +394.269 299.779 l +394.866 300.082 l +395.189 299.869 l +394.951 299.619 l +395.7 300.01 l +395.987 300.008 l +395.879 299.767 l +396.31 299.964 l +396.799 298.351 l +397.903 297.104 l +398.013 296.763 l +397.594 296.901 l +398.118 296.395 l +397.623 296.49 l +398.09 296.232 l +397.721 296.375 l +398.032 296.098 l +397.766 295.772 l +398.329 294.676 l +397.602 294.628 l +398.273 294.381 l +397.77 294.272 l +398.625 293.107 l +398.073 293.077 l +397.959 292.804 l +398.415 292.912 l +398.372 292.605 l +398.05 292.673 l +398.419 292.554 l +398.235 292.193 l +398.676 291.831 l +398.419 291.742 l +398.655 291.759 l +398.448 291.359 l +398.989 291.844 l +398.788 291.637 l +399.069 291.687 l +399.24 291.215 l +398.909 291.086 l +399.199 291.087 l +399.259 290.686 l +398.858 290.757 l +398.833 290.471 l +398.086 290.724 l +397.959 290.481 l +399.501 290.246 l +399.332 290.021 l +400.001 289.626 l +399.873 289.266 l +400.263 289.208 l +399.433 289.074 l +399.53 288.7 l +400.194 288.418 l +400.753 288.733 l +400.598 288.453 l +401.496 287.483 l +402.78 287.074 l +402.004 286.677 l +402.405 286.755 l +402.36 286.407 l +402.582 286.617 l +402.463 286.203 l +402.743 286.466 l +402.571 286.148 l +403.206 286.183 l +403.103 285.916 l +403.676 285.98 l +403.512 285.782 l +403.784 285.945 l +403.456 285.692 l +403.836 285.773 l +404.647 285.084 l +404.752 285.286 l +404.851 284.962 l +405.286 285.167 l +405.455 284.839 l +405.782 284.917 l +405.841 284.432 l +406.453 285.134 l +407.115 285.02 l +407.009 285.707 l +408.241 285.552 l +408.472 285.963 l +408.668 285.796 l +408.96 286.06 l +408.948 285.8 l +408.405 285.654 l +409.634 285.604 l +409.341 285.796 l +409.878 285.91 l +409.728 286.166 l +410.455 285.903 l +410.85 286.125 l +411.043 285.924 l +410.411 285.853 l +410.814 285.787 l +410.92 285.163 l +411.329 285.855 l +411.47 283.715 l +411.844 283.653 l +411.415 283.286 l +411.797 283.058 l +411.932 283.655 l +412.225 283.759 l +411.854 284.017 l +412.297 284.184 l +412.132 283.967 l +412.458 284.136 l +412.447 283.873 l +412.226 283.678 l +412.651 283.904 l +412.642 283.6 l +411.993 283.499 l +412.312 283.465 l +412.169 283.268 l +412.79 283.451 l +412.797 282.22 l +413.49 281.624 l +412.819 281.54 l +412.267 282.009 l +412.325 281.74 l +411.799 281.959 l +412.866 281.25 l +412.701 281.08 l +412.991 281.029 l +412.645 280.929 l +413.091 280.791 l +412.926 279.99 l +412.642 279.971 l +412.851 279.713 l +413.038 279.953 l +412.818 279.523 l +413.034 279.625 l +413.046 279.333 l +412.048 278.005 l +412.877 279.016 l +413.542 279.06 l +413.495 278.535 l +412.909 278.056 l +413.752 278.507 l +413.609 278.18 l +413.936 278.191 l +414.007 278.439 l +414.011 278.106 l +414.659 278.043 l +414.425 277.832 l +414.898 277.858 l +414.866 277.434 l +415.204 277.468 l +415.115 277.717 l +415.565 277.385 l +415.097 277.148 l +415.076 276.825 l +415.958 276.933 l +415.039 276.687 l +416.012 276.912 l +416.197 276.843 l +415.932 276.599 l +416.522 276.437 l +416.173 276.373 l +416.308 276.159 l +416.565 276.419 l +417.003 276.301 l +417.307 275.37 l +418.249 275.119 l +418.096 274.851 l +418.354 274.92 l +418.426 274.712 l +418.2 274.77 l +418.956 274.147 l +419.121 274.286 l +418.995 274.03 l +419.398 273.824 l +419.326 273.499 l +420.813 271.424 l +420.444 271.61 l +420.205 271.083 l +419.988 271.239 l +420.001 270.54 l +419.735 270.601 l +418.961 269.345 l +419.606 269.104 l +419.139 268.804 l +419.427 267.696 l +419.962 267.282 l +420.695 267.233 l +421.067 266.489 l +420.472 266.006 l +420.08 264.724 l +419.155 263.732 l +419.172 264.201 l +418.627 264.362 l +418.488 264.969 l +415.439 265.326 l +416.23 265.773 l +415.273 265.951 l +415.583 266.495 l +415.154 266.967 l +414.755 266.986 l +414.666 266.706 l +413.882 266.929 l +413.15 266.717 l +411.947 267.192 l +411.754 266.995 l +411.088 267.526 l +411.268 267.097 l +410.962 267.049 l +410.687 267.418 l +409.944 267.588 l +409.945 267.935 l +409.609 267.463 l +409.489 267.98 l +409.081 267.775 l +407.709 269.451 l +407.433 269.074 l +407.597 268.359 l +407.557 268.991 l +408.003 269.054 l +408.342 268.397 l +408.591 268.306 l +408.666 267.785 l +408.214 267.899 l +408.255 268.476 l +408.046 267.895 l +407.5 268.199 l +407.113 269.323 l +407.121 269.088 l +406.798 269.197 l +407.33 268.412 l +406.928 268.766 l +406.941 268.482 l +406.712 268.948 l +406.745 268.221 l +406.474 268.846 l +406.212 268.668 l +406.105 269.004 l +404.441 269.636 l +404.281 270.223 l +403.831 270.341 l +403.945 269.963 l +403.396 269.942 l +403.442 269.644 l +402.902 269.988 l +402.806 269.751 l +402.29 269.888 l +402.075 270.33 l +401.142 270.761 l +400.868 271.175 l +401.317 271.036 l +400.863 271.43 l +400.748 270.767 l +401.843 270.29 l +401.808 269.92 l +401.438 270.115 l +401.648 269.812 l +401.33 269.665 l +402.134 269.767 l +403.278 268.674 l +402.521 269.197 l +403.153 268.453 l +402.804 268.509 l +403.123 268.218 l +402.787 267.94 l +402.994 267.612 l +402.762 267.388 l +402.349 267.669 l +402.294 267.359 l +401.822 267.306 l +402.631 267.314 l +402.407 266.697 l +402.667 266.574 l +402.348 266.273 l +402.817 266.298 l +402.539 265.446 l +402.744 265.761 l +402.948 265.52 l +403.008 264.924 l +402.729 264.938 l +403.188 264.524 l +403.027 264.172 l +403.343 262.843 l +403.132 262.651 l +403.398 262.319 l +403.078 262.075 l +402.72 262.34 l +403.127 261.759 l +402.857 260.957 l +402.064 260.389 l +402.121 259.954 l +401.93 260.372 l +401.888 259.96 l +401.681 260.356 l +401.773 259.99 l +401.575 260.14 l +401.438 259.925 l +401.61 260.39 l +401.423 260.132 l +401.17 260.262 l +401.512 259.73 l +400.957 259.488 l +400.946 260.637 l +400.873 260.064 l +400.541 260.169 l +400.72 259.974 l +400.267 259.676 l +398.252 259.219 l +397.363 259.501 l +396.818 260.236 l +397.087 260.324 l +396.596 260.44 l +396.997 260.654 l +397.413 260.208 l +397.229 260.748 l +398.247 261.063 l +397.692 261.059 l +398.085 262.257 l +397.68 261.51 l +397.672 260.931 l +397.403 260.958 l +397.491 261.148 l +396.89 261.1 l +397.129 261.778 l +396.9 261.496 l +396.786 262.092 l +397.108 262.862 l +396.722 262.037 l +396.529 262.101 l +396.73 262.413 l +396.388 262.502 l +396.631 262.335 l +396.26 262.046 l +396.1 262.901 l +396.387 263.588 l +396.067 262.939 l +395.737 263.358 l +396.164 261.999 l +395.768 262.164 l +395.946 262.547 l +395.677 262.224 l +395.383 262.325 l +395.596 261.608 l +395.705 262.015 l +396.045 261.851 l +395.987 261.202 l +395.192 261.858 l +395.099 261.467 l +395.345 261.673 l +395.812 261.094 l +395.308 261.306 l +395.497 260.914 l +395.089 261.231 l +395.532 260.749 l +394.528 261.28 l +394.374 261.9 l +394.66 261.79 l +394.305 262.347 l +395.007 261.533 l +394.561 262.319 l +395.122 262.442 l +394.768 263.101 l +395.109 263.272 l +395.108 264.02 l +394.964 263.209 l +394.575 263.439 l +394.71 263.019 l +394.163 262.903 l +394.27 263.717 l +393.966 264.12 l +394.165 264.728 l +393.984 264.386 l +393.634 264.538 l +393.439 265.474 l +393.756 266.078 l +394.667 264.935 l +393.85 266.034 l +393.769 266.512 l +394.117 267.068 l +393.811 266.7 l +393.67 267.131 l +393.73 266.186 l +393.459 266.462 l +393.152 265.152 l +393.515 264.966 l +393.301 264.649 l +393.947 263.737 l +393.88 263.424 l +393.558 263.536 l +393.971 263.065 l +393.853 262.82 l +393.282 262.844 l +393.255 263.385 l +393.599 263.644 l +393.208 264.021 l +393.033 263.628 l +393.016 264.14 l +392.775 263.987 l +392.563 264.596 l +392.926 263.353 l +392.1 263.413 l +392.107 263.785 l +391.777 263.616 l +392.012 263.913 l +391.475 264.246 l +392.035 264.206 l +392.309 264.738 l +391.519 265.619 l +391.456 265.334 l +391.294 265.562 l +391.404 264.258 l +390.802 264.341 l +391.143 264.468 l +390.691 264.63 l +390.1 264.517 l +391.358 264.81 l +390.67 264.897 l +390.611 265.299 l +390.792 265.684 l +390.565 265.704 l +390.59 264.948 l +390.22 264.798 l +389.692 265.053 l +390.132 264.976 l +389.94 265.353 l +389.495 265.279 l +389.517 265.627 l +390.281 265.844 l +390.082 266.11 l +390.523 267.021 l +391.026 267.409 l +391.208 267.203 l +391.291 267.518 l +391.487 267.333 l +391.264 268.173 l +392.098 268.441 l +392.385 267.813 l +392.42 268.281 l +392.915 268.047 l +392.766 268.367 l +392.022 268.592 l +392.176 269.016 l +392.618 269.257 l +392.323 269.23 l +392.492 269.996 l +392.213 269.448 l +391.753 269.545 l +391.482 270.51 l +391.395 269.786 l +392.234 269.183 l +391.865 268.465 l +391.66 269.236 l +391.79 268.667 l +391.102 268.186 l +390.929 268.493 l +390.75 268.233 l +391.233 267.742 l +390.658 267.554 l +390.556 267.175 l +390.347 267.4 l +389.937 265.997 l +389.563 265.799 l +389.066 265.855 l +389.415 266.156 l +388.897 265.799 l +388.651 265.932 l +389.334 267.223 l +388.674 266.191 l +388.382 266.326 l +388.442 266.629 l +388.217 266.324 l +388.378 266.894 l +389.303 267.746 l +388.2 266.887 l +388.386 267.328 l +388.031 267.173 l +388.396 267.47 l +388.191 267.469 l +387.745 266.806 l +388.111 267.606 l +387.586 266.937 l +387.235 267.25 l +387.59 267.413 l +387.546 267.805 l +387.252 267.55 l +387.428 268.15 l +387.057 267.96 l +387.742 268.742 l +387.887 268.442 l +388.217 269.053 l +388.496 268.645 l +388.287 269.099 l +388.759 269.125 l +388.358 269.196 l +389.044 269.704 l +389.291 270.414 l +387.963 268.809 l +387.744 268.808 l +388.028 269.227 l +387.227 268.513 l +386.997 267.978 l +386.699 268.201 l +386.936 268.159 l +386.934 268.699 l +386.274 268.471 l +385.952 268.714 l +386.348 268.976 l +387.028 268.705 l +387.05 269.126 l +386.564 268.977 l +386.445 269.309 l +387.118 269.343 l +386.773 269.507 l +387.046 269.911 l +387.542 269.291 l +387.276 269.873 l +387.666 269.688 l +387.986 270.137 l +386.963 270.024 l +387.314 270.211 l +386.879 270.235 l +387.023 271.072 l +388.154 270.62 l +388 271.024 l +387.066 271.199 l +387.472 271.323 l +387.163 271.472 l +387.266 271.854 l +388.174 271.808 l +388.626 271.049 l +389.013 271.58 l +388.653 271.27 l +388.232 271.832 l +388.812 272.353 l +388.055 271.856 l +387.275 272.059 l +386.641 271.158 l +387.129 271.958 l +386.406 271.369 l +386.234 271.531 l +386.51 272.103 l +386.777 271.983 l +386.68 272.499 l +387.114 272.47 l +386.87 272.671 l +387.063 272.939 l +387.567 272.667 l +387.253 273.009 l +388.181 273.22 l +388.207 273.777 l +387.99 273.368 l +387.542 273.354 l +387.864 273.449 l +387.572 273.597 l +387.873 274.487 l +388.275 274.646 l +387.909 274.741 l +387.269 273.446 l +387.356 274.2 l +386.714 272.985 l +386.443 273.257 l +386.766 273.61 l +386.375 273.317 l +385.965 273.632 l +386.157 274.249 l +386.757 274.201 l +386.918 274.843 l +387.044 274.513 l +387.246 275.22 l +387.86 274.973 l +388.839 275.154 l +386.944 275.333 l +386.98 275.053 l +386.877 275.714 l +387.62 275.658 l +387.922 275.323 l +388.264 275.578 l +387.933 275.616 l +388.557 275.805 l +387.786 275.742 l +387.938 276.202 l +387.652 275.721 l +387.631 276.045 l +387.367 275.693 l +386.917 275.792 l +387.535 276.446 l +387.225 276.39 l +387.618 277.273 l +387.189 276.662 l +386.468 277.054 l +386.769 277.262 l +386.808 277.027 l +386.975 277.429 l +386.548 277.323 l +386.987 277.833 l +386.805 278.021 l +387.29 278.02 l +387.484 277.67 l +387.602 278.553 l +387.384 278.094 l +387.121 278.186 l +387.315 278.797 l +386.876 278.275 l +386.925 278.822 l +387.156 278.714 l +386.992 278.998 l +387.261 279.023 l +386.979 279.031 l +387.034 279.566 l +388.012 279.394 l +388.267 278.824 l +388.738 279.508 l +388.311 279.35 l +388.228 279.731 l +389.137 280.888 l +388.704 280.724 l +388.513 281.237 l +388.413 280.647 l +388.265 281.528 l +388.605 282.549 l +388.093 282.462 l +387.862 282.115 l +387.831 283.127 l +387.464 282.803 l +387.354 283.234 l +387.498 281.258 l +387.768 282.131 l +388.125 281.631 l +388.101 280.39 l +387.764 279.48 l +387.522 279.839 l +387.378 279.584 l +387.009 279.784 l +387.028 280.49 l +386.772 279.22 l +386.734 279.98 l +386.426 279.635 l +386.308 280.039 l +386.765 281.018 l +386.523 281.085 l +386.418 280.567 l +386.413 281.109 l +386.284 280.66 l +385.878 281.14 l +386.108 281.532 l +385.876 281.39 l +385.706 281.736 l +385.987 281.916 l +385.685 281.915 l +385.737 282.401 l +385.467 282.467 l +385.723 282.831 l +385.271 282.8 l +385.863 283.094 l +385.37 283.032 l +385.585 283.642 l +385.19 283.871 l +385.978 283.746 l +386.195 283.996 l +386.489 283.496 l +386.227 284.119 l +386.73 284.793 l +386.245 284.19 l +385.97 284.583 l +386.167 285.059 l +385.938 284.588 l +385.393 284.704 l +385.535 285.686 l +385.207 285.386 l +385.317 285.687 l +385.306 286.54 l +385.082 284.571 l +385.028 285.107 l +384.851 284.662 l +384.707 284.937 l +384.997 285.762 l +384.634 285.052 l +384.597 285.449 l +384.813 285.493 l +384.603 285.486 l +384.754 286.739 l +384.465 287.229 l +385.031 287.125 l +385.198 287.243 l +384.909 288.578 l +385.048 287.455 l +384.804 287.309 l +384.852 287.625 l +384.552 287.459 l +384.581 287.709 l +384.453 287.342 l +384.209 288.003 l +384.295 286.999 l +383.751 288.078 l +383.663 287.757 l +383.267 288.3 l +384.173 288.125 l +383.897 288.221 l +384.426 288.341 l +384.128 288.367 l +384.211 288.672 l +384.029 288.431 l +383.557 288.687 l +383.771 288.43 l +383.541 288.64 l +383.559 288.325 l +383.196 288.477 l +382.973 288.985 l +383.625 289.121 l +382.959 289.054 l +383.046 289.388 l +382.493 289.675 l +382.521 290.085 l +383.363 290.196 l +382.894 290.378 l +382.553 290.114 l +382.336 290.594 l +381.986 290.055 l +382.266 291.617 l +382.719 291.371 l +382.894 291.847 l +382.368 291.737 l +382.503 292.065 l +382.67 291.925 l +382.587 292.787 l +381.957 290.802 l +381.773 291.255 l +382.041 291.886 l +381.412 291.152 l +381.101 291.722 l +380.684 291.616 l +380.761 291.874 l +381.259 291.8 l +381.304 292.028 l +380.968 292.013 l +381.404 292.548 l +381.049 292.392 l +381.16 292.85 l +380.82 291.995 l +380.796 292.448 l +380.409 292.342 l +380.847 292.72 l +380.247 292.399 l +380.807 293.046 l +380.888 293.39 l +380.643 292.892 l +380.432 292.833 l +380.65 ... [truncated message content] |
From: <js...@us...> - 2007-11-21 18:59:16
|
Revision: 4408 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4408&view=rev Author: jswhit Date: 2007-11-21 10:59:15 -0800 (Wed, 21 Nov 2007) Log Message: ----------- fix for compiling with recent versions of mingw32 Modified Paths: -------------- trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h Added Paths: ----------- trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h.orig Modified: trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h =================================================================== --- trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h 2007-11-21 16:35:38 UTC (rev 4407) +++ trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h 2007-11-21 18:59:15 UTC (rev 4408) @@ -22,44 +22,6 @@ #define EPOCHFILETIME (116444736000000000LL) #endif -struct timezone { - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; - -__inline int gettimeofday(struct timeval *tv, struct timezone *tz) -{ - FILETIME ft; - LARGE_INTEGER li; - __int64 t; - static int tzflag; - - if (tv) - { - GetSystemTimeAsFileTime(&ft); - li.LowPart = ft.dwLowDateTime; - li.HighPart = ft.dwHighDateTime; - t = li.QuadPart; /* In 100-nanosecond intervals */ - t -= EPOCHFILETIME; /* Offset to the Epoch time */ - t /= 10; /* In microseconds */ - tv->tv_sec = (long)(t / 1000000); - tv->tv_usec = (long)(t % 1000000); - } - - if (tz) - { - if (!tzflag) - { - _tzset(); - tzflag++; - } - tz->tz_minuteswest = _timezone / 60; - tz->tz_dsttime = _daylight; - } - - return 0; -} - #else /* _WIN32 */ #include <sys/time.h> Added: trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h.orig =================================================================== --- trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h.orig (rev 0) +++ trunk/toolkits/basemap-testing/geos-2.2.3/source/headers/geos/timeval.h.orig 2007-11-21 18:59:15 UTC (rev 4408) @@ -0,0 +1,69 @@ +/* + * timeval.h 1.3 2003/01/14 + * + * Defines gettimeofday, timeval, etc. for Win32 + * + * By Wu Yongwei + * + */ + +#ifndef _TIMEVAL_H +#define _TIMEVAL_H + +#ifdef _WIN32 + +#define WIN32_LEAN_AND_MEAN +#include <winsock2.h> +#include <time.h> + +#if defined(_MSC_VER) || defined(__BORLANDC__) +#define EPOCHFILETIME (116444736000000000i64) +#else +#define EPOCHFILETIME (116444736000000000LL) +#endif + +struct timezone { + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + +__inline int gettimeofday(struct timeval *tv, struct timezone *tz) +{ + FILETIME ft; + LARGE_INTEGER li; + __int64 t; + static int tzflag; + + if (tv) + { + GetSystemTimeAsFileTime(&ft); + li.LowPart = ft.dwLowDateTime; + li.HighPart = ft.dwHighDateTime; + t = li.QuadPart; /* In 100-nanosecond intervals */ + t -= EPOCHFILETIME; /* Offset to the Epoch time */ + t /= 10; /* In microseconds */ + tv->tv_sec = (long)(t / 1000000); + tv->tv_usec = (long)(t % 1000000); + } + + if (tz) + { + if (!tzflag) + { + _tzset(); + tzflag++; + } + tz->tz_minuteswest = _timezone / 60; + tz->tz_dsttime = _daylight; + } + + return 0; +} + +#else /* _WIN32 */ + +#include <sys/time.h> + +#endif /* _WIN32 */ + +#endif /* _TIMEVAL_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-21 16:35:39
|
Revision: 4407 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4407&view=rev Author: mdboom Date: 2007-11-21 08:35:38 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Mathtext speed improvement. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-21 16:25:31 UTC (rev 4406) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-21 16:35:38 UTC (rev 4407) @@ -505,6 +505,7 @@ (through ft2font) """ basepath = os.path.join( get_data_path(), 'fonts' ) + _fonts = {} class CachedFont: def __init__(self, font): @@ -519,21 +520,17 @@ def __init__(self, default_font_prop, mathtext_backend): Fonts.__init__(self, default_font_prop, mathtext_backend) self.glyphd = {} - self.fonts = {} - filename = findfont(default_font_prop) - default_font = self.CachedFont(FT2Font(str(filename))) + if self._fonts == {}: + filename = findfont(default_font_prop) + default_font = self.CachedFont(FT2Font(str(filename))) - self.fonts['default'] = default_font + self._fonts['default'] = default_font def destroy(self): self.glyphd = None - for cached_font in self.fonts.values(): - cached_font.charmap = None - cached_font.glyphmap = None - cached_font.font = None Fonts.destroy(self) - + def _get_font(self, font): """Looks up a CachedFont with its charmap and inverse charmap. font may be a TeX font name (cal, rm, it etc.), or postscript name.""" @@ -542,16 +539,16 @@ else: basename = font - cached_font = self.fonts.get(basename) + cached_font = self._fonts.get(basename) if cached_font is None: try: font = FT2Font(basename) except RuntimeError: return None cached_font = self.CachedFont(font) - self.fonts[basename] = cached_font - self.fonts[font.postscript_name] = cached_font - self.fonts[font.postscript_name.lower()] = cached_font + self._fonts[basename] = cached_font + self._fonts[font.postscript_name] = cached_font + self._fonts[font.postscript_name.lower()] = cached_font return cached_font def _get_offset(self, cached_font, glyph, fontsize, dpi): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-21 16:25:39
|
Revision: 4406 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4406&view=rev Author: mdboom Date: 2007-11-21 08:25:31 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Merged revisions 4401-4405 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4402 | mdboom | 2007-11-21 10:24:22 -0500 (Wed, 21 Nov 2007) | 2 lines Fix to work on Python 2.3 ........ r4404 | mdboom | 2007-11-21 11:05:18 -0500 (Wed, 21 Nov 2007) | 5 lines Fix memory leak when using colorbar as discovered by Darren Dale. The (unit change) callbacks in the Axis objects were not cleared by cla(), so they would continue to grow long lists of callbacks that reference entire Axes objects. ........ r4405 | mdboom | 2007-11-21 11:18:52 -0500 (Wed, 21 Nov 2007) | 2 lines Fix mathtext bug. ........ Modified Paths: -------------- branches/transforms/lib/matplotlib/axis.py branches/transforms/lib/matplotlib/mathtext.py branches/transforms/lib/matplotlib/pyparsing.py Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4400 + /trunk/matplotlib:1-4405 Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-11-21 16:18:52 UTC (rev 4405) +++ branches/transforms/lib/matplotlib/axis.py 2007-11-21 16:25:31 UTC (rev 4406) @@ -526,6 +526,9 @@ self.set_minor_locator(NullLocator()) self.set_minor_formatter(NullFormatter()) + # Clear the callback registry for this axis, or it may "leak" + self.callbacks = CallbackRegistry(('units', 'units finalize')) + # whether the grids are on self._gridOnMajor = rcParams['axes.grid'] self._gridOnMinor = False Modified: branches/transforms/lib/matplotlib/mathtext.py =================================================================== --- branches/transforms/lib/matplotlib/mathtext.py 2007-11-21 16:18:52 UTC (rev 4405) +++ branches/transforms/lib/matplotlib/mathtext.py 2007-11-21 16:25:31 UTC (rev 4406) @@ -2077,9 +2077,9 @@ | placeable ) - ambiDelim = oneOf(self._ambiDelim) - leftDelim = oneOf(self._leftDelim) - rightDelim = oneOf(self._rightDelim) + ambiDelim = oneOf(list(self._ambiDelim)) + leftDelim = oneOf(list(self._leftDelim)) + rightDelim = oneOf(list(self._rightDelim)) autoDelim <<(Suppress(Literal(r"\left")) + ((leftDelim | ambiDelim) | Error("Expected a delimiter")) + Group( Modified: branches/transforms/lib/matplotlib/pyparsing.py =================================================================== --- branches/transforms/lib/matplotlib/pyparsing.py 2007-11-21 16:18:52 UTC (rev 4405) +++ branches/transforms/lib/matplotlib/pyparsing.py 2007-11-21 16:25:31 UTC (rev 4406) @@ -2846,7 +2846,11 @@ warnings.warn("Invalid argument to oneOf, expected string or list", SyntaxWarning, stacklevel=2) - symbols.sort(reverse=True) + try: + symbols.sort(reverse=True) + except TypeError: + symbols.sort() + symbols.reverse() i = 0 while i < len(symbols)-1: cur = symbols[i] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-21 16:18:56
|
Revision: 4405 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4405&view=rev Author: mdboom Date: 2007-11-21 08:18:52 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Fix mathtext bug. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-21 16:05:18 UTC (rev 4404) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-21 16:18:52 UTC (rev 4405) @@ -2079,9 +2079,9 @@ | placeable ) - ambiDelim = oneOf(self._ambiDelim) - leftDelim = oneOf(self._leftDelim) - rightDelim = oneOf(self._rightDelim) + ambiDelim = oneOf(list(self._ambiDelim)) + leftDelim = oneOf(list(self._leftDelim)) + rightDelim = oneOf(list(self._rightDelim)) autoDelim <<(Suppress(Literal(r"\left")) + ((leftDelim | ambiDelim) | Error("Expected a delimiter")) + Group( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-21 16:05:29
|
Revision: 4404 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4404&view=rev Author: mdboom Date: 2007-11-21 08:05:18 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Fix memory leak when using colorbar as discovered by Darren Dale. The (unit change) callbacks in the Axis objects were not cleared by cla(), so they would continue to grow long lists of callbacks that reference entire Axes objects. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axis.py Modified: trunk/matplotlib/lib/matplotlib/axis.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axis.py 2007-11-21 15:27:14 UTC (rev 4403) +++ trunk/matplotlib/lib/matplotlib/axis.py 2007-11-21 16:05:18 UTC (rev 4404) @@ -533,6 +533,9 @@ self.set_minor_locator(NullLocator()) self.set_minor_formatter(NullFormatter()) + # Clear the callback registry for this axis, or it may "leak" + self.callbacks = CallbackRegistry(('units', 'units finalize')) + # whether the grids are on self._gridOnMajor = rcParams['axes.grid'] self._gridOnMinor = False This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-21 15:27:17
|
Revision: 4403 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4403&view=rev Author: jswhit Date: 2007-11-21 07:27:14 -0800 (Wed, 21 Nov 2007) Log Message: ----------- fixed bug in drawlsmask Modified Paths: -------------- trunk/toolkits/basemap-testing/Changelog Modified: trunk/toolkits/basemap-testing/Changelog =================================================================== --- trunk/toolkits/basemap-testing/Changelog 2007-11-21 15:24:22 UTC (rev 4402) +++ trunk/toolkits/basemap-testing/Changelog 2007-11-21 15:27:14 UTC (rev 4403) @@ -1,4 +1,6 @@ version 0.9.7 (not yet released) + * fixed bug in drawlsmask for 'moll','robin' and 'sinu' + projections. * added lake_color keyword to fillcontinents. * fixed a bug in the 'tmerc' projection. * added pure python NetCDFFile reader from Roberto De Almeida This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-21 15:24:25
|
Revision: 4402 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4402&view=rev Author: mdboom Date: 2007-11-21 07:24:22 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Fix to work on Python 2.3 Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/pyparsing.py Modified: trunk/matplotlib/lib/matplotlib/pyparsing.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyparsing.py 2007-11-21 13:49:03 UTC (rev 4401) +++ trunk/matplotlib/lib/matplotlib/pyparsing.py 2007-11-21 15:24:22 UTC (rev 4402) @@ -2846,7 +2846,11 @@ warnings.warn("Invalid argument to oneOf, expected string or list", SyntaxWarning, stacklevel=2) - symbols.sort(reverse=True) + try: + symbols.sort(reverse=True) + except TypeError: + symbols.sort() + symbols.reverse() i = 0 while i < len(symbols)-1: cur = symbols[i] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-21 13:49:11
|
Revision: 4401 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4401&view=rev Author: mdboom Date: 2007-11-21 05:49:03 -0800 (Wed, 21 Nov 2007) Log Message: ----------- Merged revisions 4395-4400 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4396 | mdboom | 2007-11-20 13:25:33 -0500 (Tue, 20 Nov 2007) | 2 lines Slight speed improvement in draw_quad_mesh. ........ Modified Paths: -------------- branches/transforms/src/_backend_agg.cpp Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4394 + /trunk/matplotlib:1-4400 Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-11-21 13:23:54 UTC (rev 4400) +++ branches/transforms/src/_backend_agg.cpp 2007-11-21 13:49:03 UTC (rev 4401) @@ -469,7 +469,6 @@ typedef agg::renderer_base<pixfmt_amask_type> amask_ren_type; typedef agg::renderer_scanline_aa_solid<amask_ren_type> amask_aa_renderer_type; typedef agg::renderer_scanline_bin_solid<amask_ren_type> amask_bin_renderer_type; - args.verify_length(5, 6); Py::Object gc_obj = args[0]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-21 13:23:56
|
Revision: 4400 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4400&view=rev Author: jswhit Date: 2007-11-21 05:23:54 -0800 (Wed, 21 Nov 2007) Log Message: ----------- add disclaimer in drawlsmask docstring Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-20 22:00:51 UTC (rev 4399) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-21 13:23:54 UTC (rev 4400) @@ -167,7 +167,7 @@ The following parameters are map projection parameters which all default to None. Not all parameters are used by all projections, some are ignored. - The module variable 'projection_params' is a dictionary which + The module variable 'projection_params' is a dictionary which lists which parameters apply to which projections. lat_ts - latitude of true scale for mercator projection, optional @@ -2388,6 +2388,9 @@ """ draw land-sea mask image. + *Note* the land-sea mask image cannot be overlaid on top + of other images, due to limitations in matplotlib image handling. + land is colored with rgba integer tuple rgba_land. ocean is colored with rgba integer tuple rgba_ocean. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 22:00:54
|
Revision: 4399 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4399&view=rev Author: mdboom Date: 2007-11-20 14:00:51 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Reduce file sizes for mixed-mode PDFs by only outputting the part of the image with non-transparent pixels. Minor speed improvement in MixedModeRenderer. Modified Paths: -------------- branches/transforms/lib/matplotlib/backends/backend_agg.py branches/transforms/lib/matplotlib/backends/backend_mixed.py branches/transforms/src/_backend_agg.cpp branches/transforms/src/_backend_agg.h Modified: branches/transforms/lib/matplotlib/backends/backend_agg.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-11-20 21:00:20 UTC (rev 4398) +++ branches/transforms/lib/matplotlib/backends/backend_agg.py 2007-11-20 22:00:51 UTC (rev 4399) @@ -68,6 +68,7 @@ self.draw_image = self._renderer.draw_image self.copy_from_bbox = self._renderer.copy_from_bbox self.restore_region = self._renderer.restore_region + self.tostring_rgba_minimized = self._renderer.tostring_rgba_minimized self.mathtext_parser = MathTextParser('Agg') self._fontd = {} Modified: branches/transforms/lib/matplotlib/backends/backend_mixed.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_mixed.py 2007-11-20 21:00:20 UTC (rev 4398) +++ branches/transforms/lib/matplotlib/backends/backend_mixed.py 2007-11-20 22:00:51 UTC (rev 4399) @@ -34,14 +34,28 @@ assert not vector_renderer.option_image_nocomposite() self._vector_renderer = vector_renderer - vector_renderer.start_rasterizing = self.start_rasterizing - vector_renderer.stop_rasterizing = self.stop_rasterizing self._raster_renderer = None self._rasterizing = False - self._renderer = self._vector_renderer + self._set_current_renderer(vector_renderer) + _methods = """ + open_group close_group draw_path draw_markers + draw_path_collection draw_quad_mesh get_image_magnification + draw_image draw_tex draw_text flipy option_image_nocomposite + get_texmanager get_text_width_height_descent new_gc + points_to_pixels strip_math finalize + """.split() + def _set_current_renderer(self, renderer): + self._renderer = renderer + + for method in self._methods: + if hasattr(renderer, method): + setattr(self, method, getattr(renderer, method)) + renderer.start_rasterizing = self.start_rasterizing + renderer.stop_rasterizing = self.stop_rasterizing + def start_rasterizing(self): """ Enter "raster" mode. All subsequent drawing commands (until @@ -54,9 +68,7 @@ if not self._rasterizing: self._raster_renderer = self._raster_renderer_class( self._width*self._dpi, self._height*self._dpi, self._dpi) - self._raster_renderer.start_rasterizing = self.start_rasterizing - self._raster_renderer.stop_rasterizing = self.stop_rasterizing - self._renderer = self._raster_renderer + self._set_current_renderer(self._raster_renderer) self._rasterizing = True def stop_rasterizing(self): @@ -69,74 +81,19 @@ start_rasterizing is called, this method has no effect. """ if self._rasterizing: + self._set_current_renderer(self._vector_renderer) + width, height = self._width * self._dpi, self._height * self._dpi - buffer = self._raster_renderer.buffer_rgba(0, 0) - image = frombuffer(buffer, width, height, True) - image.is_grayscale = False + buffer, bounds = self._raster_renderer.tostring_rgba_minimized() + l, b, w, h = bounds + if w > 0 and h > 0: + image = frombuffer(buffer, w, h, True) + image.is_grayscale = False - self._renderer = self._vector_renderer - self._renderer.draw_image(0, 0, image, None) + self._renderer.draw_image(l, height - b - h, image, None) self._raster_renderer = None self._rasterizing = False def get_canvas_width_height(self): 'return the canvas width and height in display coords' return self._width, self._height - - # The rest of this methods simply delegate to the currently active - # rendering backend. - - def open_group(self, *args, **kwargs): - return self._renderer.open_group(*args, **kwargs) - - def close_group(self, *args, **kwargs): - return self._renderer.close_group(*args, **kwargs) - - def draw_path(self, *args, **kwargs): - return self._renderer.draw_path(*args, **kwargs) - - def draw_markers(self, *args, **kwargs): - return self._renderer.draw_markers(*args, **kwargs) - - def draw_path_collection(self, *args, **kwargs): - return self._renderer.draw_path_collection(*args, **kwargs) - - def draw_quad_mesh(self, *args, **kwargs): - return self._renderer.draw_quad_mesh(*args, **kwargs) - - def get_image_magnification(self, *args, **kwargs): - return self._renderer.get_image_magnification(*args, **kwargs) - - def draw_image(self, *args, **kwargs): - return self._renderer.draw_image(*args, **kwargs) - - def draw_tex(self, *args, **kwargs): - return self._renderer.draw_tex(*args, **kwargs) - - def draw_text(self, *args, **kwargs): - return self._renderer.draw_text(*args, **kwargs) - - def flipy(self, *args, **kwargs): - return self._renderer.flipy(*args, **kwargs) - - def option_image_nocomposite(self, *args, **kwargs): - return self._vector_renderer.option_image_nocomposite(*args, **kwargs) - - def get_texmanager(self, *args, **kwargs): - return self._renderer.get_texmanager(*args, **kwargs) - - def get_text_width_height_descent(self, *args, **kwargs): - return self._renderer.get_text_width_height_descent(*args, **kwargs) - - def new_gc(self, *args, **kwargs): - return self._renderer.new_gc(*args, **kwargs) - - def points_to_pixels(self, *args, **kwargs): - return self._renderer.points_to_pixels(*args, **kwargs) - - def strip_math(self, *args, **kwargs): - return self._renderer(*args, **kwargs) - - def finalize(self, *args, **kwargs): - return self._renderer.finalize(*args, **kwargs) - Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-11-20 21:00:20 UTC (rev 4398) +++ branches/transforms/src/_backend_agg.cpp 2007-11-20 22:00:51 UTC (rev 4399) @@ -1474,8 +1474,66 @@ return Py::asObject(PyBuffer_FromMemory( pixBuffer+start, row_len*height-start)); } +Py::Object +RendererAgg::tostring_rgba_minimized(const Py::Tuple& args) { + args.verify_length(0); + int xmin = width; + int ymin = height; + int xmax = 0; + int ymax = 0; + + // Looks at the alpha channel to find the minimum extents of the image + unsigned char* pixel = pixBuffer + 3; + for (int y = 0; y < (int)height; ++y) { + for (int x = 0; x < (int)width; ++x) { + if (*pixel) { + if (x < xmin) xmin = x; + if (y < ymin) ymin = y; + if (x > xmax) xmax = x; + if (y > ymax) ymax = y; + } + pixel += 4; + } + } + int newwidth = 0; + int newheight = 0; + Py::String data; + if (xmin < xmax and ymin < ymax) { + // Expand the bounds by 1 pixel on all sides + xmin = std::max(0, xmin - 1); + ymin = std::max(0, ymin - 1); + xmax = std::min(xmax, (int)width); + ymax = std::min(ymax, (int)height); + + newwidth = xmax - xmin; + newheight = ymax - ymin; + int newsize = newwidth * newheight * 4; + + unsigned char* buf = new unsigned char[newsize]; + unsigned int* dst = (unsigned int*)buf; + unsigned int* src = (unsigned int*)pixBuffer; + for (int y = ymin; y < ymax; ++y) + for (int x = xmin; x < xmax; ++x, ++dst) + *dst = src[y * width + x]; + + data = Py::String((const char *)buf, (int)newsize); + } + + Py::Tuple bounds(4); + bounds[0] = Py::Int(xmin); + bounds[1] = Py::Int(ymin); + bounds[2] = Py::Int(newwidth); + bounds[3] = Py::Int(newheight); + + Py::Tuple result(2); + result[0] = data; + result[1] = bounds; + + return result; +} + Py::Object RendererAgg::clear(const Py::Tuple& args) { //"clear the rendered buffer"; @@ -1605,6 +1663,8 @@ "s = tostring_argb()"); add_varargs_method("tostring_bgra", &RendererAgg::tostring_bgra, "s = tostring_bgra()"); + add_varargs_method("tostring_rgba_minimized", &RendererAgg::tostring_rgba_minimized, + "s = tostring_rgba_minimized()"); add_varargs_method("buffer_rgba", &RendererAgg::buffer_rgba, "buffer = buffer_rgba()"); add_varargs_method("clear", &RendererAgg::clear, Modified: branches/transforms/src/_backend_agg.h =================================================================== --- branches/transforms/src/_backend_agg.h 2007-11-20 21:00:20 UTC (rev 4398) +++ branches/transforms/src/_backend_agg.h 2007-11-20 22:00:51 UTC (rev 4399) @@ -179,6 +179,7 @@ Py::Object tostring_rgb(const Py::Tuple & args); Py::Object tostring_argb(const Py::Tuple & args); Py::Object tostring_bgra(const Py::Tuple & args); + Py::Object tostring_rgba_minimized(const Py::Tuple & args); Py::Object buffer_rgba(const Py::Tuple & args); Py::Object clear(const Py::Tuple & args); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 21:00:22
|
Revision: 4398 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4398&view=rev Author: mdboom Date: 2007-11-20 13:00:20 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Support mixed-mode rendering the PDF backend. This allows some things to be rendered as vectors and some as rasters. At the moment, mostly as a proof-of-concept, all quadmeshes are rendered as rasters with the PDF backend. Also make PDF backend resolution independent. Modified Paths: -------------- branches/transforms/lib/matplotlib/backend_bases.py branches/transforms/lib/matplotlib/backends/backend_pdf.py branches/transforms/lib/matplotlib/collections.py Added Paths: ----------- branches/transforms/lib/matplotlib/backends/backend_mixed.py Modified: branches/transforms/lib/matplotlib/backend_bases.py =================================================================== --- branches/transforms/lib/matplotlib/backend_bases.py 2007-11-20 20:21:53 UTC (rev 4397) +++ branches/transforms/lib/matplotlib/backend_bases.py 2007-11-20 21:00:20 UTC (rev 4398) @@ -9,6 +9,7 @@ import numpy as npy import matplotlib.cbook as cbook import matplotlib.colors as colors +import matplotlib._image as _image import matplotlib.path as path import matplotlib.transforms as transforms import matplotlib.widgets as widgets @@ -328,7 +329,13 @@ def strip_math(self, s): return cbook.strip_math(s) + def start_rasterizing(self): + pass + def stop_rasterizing(self): + pass + + class GraphicsContextBase: """An abstract base class that provides color, line styles, etc... """ Added: branches/transforms/lib/matplotlib/backends/backend_mixed.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_mixed.py (rev 0) +++ branches/transforms/lib/matplotlib/backends/backend_mixed.py 2007-11-20 21:00:20 UTC (rev 4398) @@ -0,0 +1,142 @@ +from matplotlib._image import frombuffer +from matplotlib.backends.backend_agg import RendererAgg + +class MixedModeRenderer(object): + """ + A helper class to implement a renderer that switches between + vector and raster drawing. An example may be a PDF writer, where + most things are drawn with PDF vector commands, but some very + complex objects, such as quad meshes, are rasterised and then + output as images. + """ + def __init__(self, width, height, dpi, vector_renderer, raster_renderer_class=None): + """ + width: The width of the canvas in logical units + + height: The height of the canvas in logical units + + dpi: The dpi of the canvas + + vector_renderer: An instance of a subclass of RendererBase + that will be used for the vector drawing. + + raster_renderer_class: The renderer class to use for the + raster drawing. If not provided, this will use the Agg + backend (which is currently the only viable option anyway.) + """ + if raster_renderer_class is None: + raster_renderer_class = RendererAgg + + self._raster_renderer_class = raster_renderer_class + self._width = width + self._height = height + self._dpi = dpi + + assert not vector_renderer.option_image_nocomposite() + self._vector_renderer = vector_renderer + vector_renderer.start_rasterizing = self.start_rasterizing + vector_renderer.stop_rasterizing = self.stop_rasterizing + + self._raster_renderer = None + self._rasterizing = False + + self._renderer = self._vector_renderer + + def start_rasterizing(self): + """ + Enter "raster" mode. All subsequent drawing commands (until + stop_rasterizing is called) will be drawn with the raster + backend. + + If start_rasterizing is called multiple times before + stop_rasterizing is called, this method has no effect. + """ + if not self._rasterizing: + self._raster_renderer = self._raster_renderer_class( + self._width*self._dpi, self._height*self._dpi, self._dpi) + self._raster_renderer.start_rasterizing = self.start_rasterizing + self._raster_renderer.stop_rasterizing = self.stop_rasterizing + self._renderer = self._raster_renderer + self._rasterizing = True + + def stop_rasterizing(self): + """ + Exit "raster" mode. All of the drawing that was done since + the last start_rasterizing command will be copied to the + vector backend by calling draw_image. + + If stop_rasterizing is called multiple times before + start_rasterizing is called, this method has no effect. + """ + if self._rasterizing: + width, height = self._width * self._dpi, self._height * self._dpi + buffer = self._raster_renderer.buffer_rgba(0, 0) + image = frombuffer(buffer, width, height, True) + image.is_grayscale = False + + self._renderer = self._vector_renderer + self._renderer.draw_image(0, 0, image, None) + self._raster_renderer = None + self._rasterizing = False + + def get_canvas_width_height(self): + 'return the canvas width and height in display coords' + return self._width, self._height + + # The rest of this methods simply delegate to the currently active + # rendering backend. + + def open_group(self, *args, **kwargs): + return self._renderer.open_group(*args, **kwargs) + + def close_group(self, *args, **kwargs): + return self._renderer.close_group(*args, **kwargs) + + def draw_path(self, *args, **kwargs): + return self._renderer.draw_path(*args, **kwargs) + + def draw_markers(self, *args, **kwargs): + return self._renderer.draw_markers(*args, **kwargs) + + def draw_path_collection(self, *args, **kwargs): + return self._renderer.draw_path_collection(*args, **kwargs) + + def draw_quad_mesh(self, *args, **kwargs): + return self._renderer.draw_quad_mesh(*args, **kwargs) + + def get_image_magnification(self, *args, **kwargs): + return self._renderer.get_image_magnification(*args, **kwargs) + + def draw_image(self, *args, **kwargs): + return self._renderer.draw_image(*args, **kwargs) + + def draw_tex(self, *args, **kwargs): + return self._renderer.draw_tex(*args, **kwargs) + + def draw_text(self, *args, **kwargs): + return self._renderer.draw_text(*args, **kwargs) + + def flipy(self, *args, **kwargs): + return self._renderer.flipy(*args, **kwargs) + + def option_image_nocomposite(self, *args, **kwargs): + return self._vector_renderer.option_image_nocomposite(*args, **kwargs) + + def get_texmanager(self, *args, **kwargs): + return self._renderer.get_texmanager(*args, **kwargs) + + def get_text_width_height_descent(self, *args, **kwargs): + return self._renderer.get_text_width_height_descent(*args, **kwargs) + + def new_gc(self, *args, **kwargs): + return self._renderer.new_gc(*args, **kwargs) + + def points_to_pixels(self, *args, **kwargs): + return self._renderer.points_to_pixels(*args, **kwargs) + + def strip_math(self, *args, **kwargs): + return self._renderer(*args, **kwargs) + + def finalize(self, *args, **kwargs): + return self._renderer.finalize(*args, **kwargs) + Modified: branches/transforms/lib/matplotlib/backends/backend_pdf.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-11-20 20:21:53 UTC (rev 4397) +++ branches/transforms/lib/matplotlib/backends/backend_pdf.py 2007-11-20 21:00:20 UTC (rev 4398) @@ -20,10 +20,11 @@ from sets import Set import matplotlib -from matplotlib import __version__, rcParams, agg, get_data_path +from matplotlib import __version__, rcParams, get_data_path from matplotlib._pylab_helpers import Gcf from matplotlib.backend_bases import RendererBase, GraphicsContextBase,\ FigureManagerBase, FigureCanvasBase +from matplotlib.backends.backend_mixed import MixedModeRenderer from matplotlib.cbook import Bunch, enumerate, is_string_like, reverse_dict, \ get_realpath_and_stat, is_writable_file_like from matplotlib.figure import Figure @@ -327,8 +328,9 @@ class PdfFile: """PDF file with one page.""" - def __init__(self, width, height, filename): + def __init__(self, width, height, dpi, filename): self.width, self.height = width, height + self.dpi = dpi self.nextObject = 1 # next free object id self.xrefTable = [ [0, 65535, 'the zero object'] ] self.passed_in_file_object = False @@ -379,7 +381,7 @@ thePage = { 'Type': Name('Page'), 'Parent': pagesObject, 'Resources': resourceObject, - 'MediaBox': [ 0, 0, 72*width, 72*height ], + 'MediaBox': [ 0, 0, dpi*width, dpi*height ], 'Contents': contentObject } self.writeObject(thePageObject, thePage) @@ -1003,8 +1005,9 @@ rgba = npy.fromstring(s, npy.uint8) rgba.shape = (h, w, 4) - rgb = rgba[:,:,:4] - return h, w, rgb.tostring() + rgb = rgba[:,:,:3] + a = rgba[:,:,3:] + return h, w, rgb.tostring(), a.tostring() def _gray(self, im, rc=0.3, gc=0.59, bc=0.11): rgbat = im.as_rgba_str() @@ -1022,20 +1025,36 @@ img.flipud_out() if img.is_grayscale: height, width, data = self._gray(img) - colorspace = Name('DeviceGray') + self.beginStream( + pair[1].id, + self.reserveObject('length of image stream'), + {'Type': Name('XObject'), 'Subtype': Name('Image'), + 'Width': width, 'Height': height, + 'ColorSpace': Name('DeviceGray'), 'BitsPerComponent': 8 }) + self.currentstream.write(data) # TODO: predictors (i.e., output png) + self.endStream() else: - height, width, data = self._rgb(img) - colorspace = Name('DeviceRGB') + height, width, data, adata = self._rgb(img) + smaskObject = self.reserveObject("smask") + stream = self.beginStream( + smaskObject.id, + self.reserveObject('length of smask stream'), + {'Type': Name('XObject'), 'Subtype': Name('Image'), + 'Width': width, 'Height': height, + 'ColorSpace': Name('DeviceGray'), 'BitsPerComponent': 8 }) + self.currentstream.write(adata) # TODO: predictors (i.e., output png) + self.endStream() - self.beginStream( - pair[1].id, - self.reserveObject('length of image stream'), - {'Type': Name('XObject'), 'Subtype': Name('Image'), - 'Width': width, 'Height': height, - 'ColorSpace': colorspace, 'BitsPerComponent': 8 }) - self.currentstream.write(data) # TODO: predictors (i.e., output png) - self.endStream() - + self.beginStream( + pair[1].id, + self.reserveObject('length of image stream'), + {'Type': Name('XObject'), 'Subtype': Name('Image'), + 'Width': width, 'Height': height, + 'ColorSpace': Name('DeviceRGB'), 'BitsPerComponent': 8, + 'SMask': smaskObject}) + self.currentstream.write(data) # TODO: predictors (i.e., output png) + self.endStream() + img.flipud_out() def markerObject(self, path, trans, fillp, lw): @@ -1152,7 +1171,7 @@ self.afm_font_cache = {} self.file.used_characters = self.used_characters = {} self.mathtext_parser = MathTextParser("Pdf") - self.image_magnification = dpi/72.0 + self.dpi = dpi self.tex_font_map = None def finalize(self): @@ -1194,19 +1213,16 @@ stat_key, (realpath, Set())) used_characters[1].update(set) - def get_image_magnification(self): - return self.image_magnification - def draw_image(self, x, y, im, bbox, clippath=None, clippath_trans=None): #print >>sys.stderr, "draw_image called" # MGDTODO: Support clippath here gc = self.new_gc() - gc.set_clip_rectangle(bbox.bounds) + if bbox is not None: + gc.set_clip_rectangle(bbox) self.check_gc(gc) h, w = im.get_size_out() - h, w = h/self.image_magnification, w/self.image_magnification imob = self.file.imageObject(im) self.file.output(Op.gsave, w, 0, 0, h, x, y, Op.concat_matrix, imob, Op.use_xobject, Op.grestore) @@ -1246,7 +1262,7 @@ def draw_mathtext(self, gc, x, y, s, prop, angle): # TODO: fix positioning and encoding width, height, descent, glyphs, rects, used_characters = \ - self.mathtext_parser.parse(s, 72, prop) + self.mathtext_parser.parse(s, self.dpi, prop) self.merge_used_characters(used_characters) # When using Type 3 fonts, we can't use character codes higher @@ -1311,7 +1327,7 @@ texmanager = self.get_texmanager() fontsize = prop.get_size_in_points() dvifile = texmanager.make_dvi(s, fontsize) - dvi = dviread.Dvi(dvifile, 72) + dvi = dviread.Dvi(dvifile, self.dpi) page = iter(dvi).next() dvi.close() @@ -1539,13 +1555,13 @@ texmanager = self.get_texmanager() fontsize = prop.get_size_in_points() dvifile = texmanager.make_dvi(s, fontsize) - dvi = dviread.Dvi(dvifile, 72) + dvi = dviread.Dvi(dvifile, self.dpi) page = iter(dvi).next() dvi.close() return page.width, page.height, page.descent if ismath: w, h, d, glyphs, rects, used_characters = \ - self.mathtext_parser.parse(s, 72, prop) + self.mathtext_parser.parse(s, self.dpi, prop) elif rcParams['pdf.use14corefonts']: font = self._get_font_afm(prop) @@ -1583,14 +1599,14 @@ font = FT2Font(str(filename)) self.truetype_font_cache[key] = font font.clear() - font.set_size(prop.get_size_in_points(), 72.0) + font.set_size(prop.get_size_in_points(), self.dpi) return font def flipy(self): return False def get_canvas_width_height(self): - return self.file.width / 72.0, self.file.height / 72.0 + return self.file.width / self.dpi, self.file.height / self.dpi def new_gc(self): return GraphicsContextPdf(self.file) @@ -1830,11 +1846,12 @@ return 'pdf' def print_pdf(self, filename, **kwargs): - dpi = kwargs.get('dpi', None) - self.figure.set_dpi(72) # Override the dpi kwarg + dpi = kwargs.get('dpi', 72) + self.figure.set_dpi(dpi) # Override the dpi kwarg width, height = self.figure.get_size_inches() - file = PdfFile(width, height, filename) - renderer = RendererPdf(file, dpi) + file = PdfFile(width, height, dpi, filename) + renderer = MixedModeRenderer( + width, height, dpi, RendererPdf(file, dpi)) self.figure.draw(renderer) renderer.finalize() file.close() Modified: branches/transforms/lib/matplotlib/collections.py =================================================================== --- branches/transforms/lib/matplotlib/collections.py 2007-11-20 20:21:53 UTC (rev 4397) +++ branches/transforms/lib/matplotlib/collections.py 2007-11-20 21:00:20 UTC (rev 4398) @@ -453,11 +453,13 @@ offsets = transOffset.transform_non_affine(offsets) transOffset = transOffset.get_affine() + renderer.start_rasterizing() renderer.draw_quad_mesh( transform.frozen(), self.clipbox, clippath, clippath_trans, self._meshWidth, self._meshHeight, self._coordinates, offsets, transOffset, self._facecolors, self._antialiased, self._showedges) + renderer.stop_rasterizing() renderer.close_group(self.__class__.__name__) class PolyCollection(Collection): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-20 20:21:57
|
Revision: 4397 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4397&view=rev Author: jswhit Date: 2007-11-20 12:21:53 -0800 (Tue, 20 Nov 2007) Log Message: ----------- fix drawlsmask for 'moll','robin' and 'sinu' projections. Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-20 18:25:33 UTC (rev 4396) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-20 20:21:53 UTC (rev 4397) @@ -2461,8 +2461,22 @@ nx = int((self.xmax-self.xmin)/dx)+1; ny = int((self.ymax-self.ymin)/dx)+1 # interpolate rgba values from proj='cyl' (geographic coords) # to a rectangular map projection grid. - mask = self.transform_scalar(lsmask,lsmask_lons,\ - lsmask_lats,nx,ny,order=0,masked=255) + mask,x,y = self.transform_scalar(lsmask,lsmask_lons,\ + lsmask_lats,nx,ny,returnxy=True,order=0,masked=255) + # for these projections, points outside the projection + # limb have to be set to transparent manually. + if self.projection in ['moll','robin','sinu']: + lons, lats = self(x, y, inverse=True) + lon_0 = self.projparams['lon_0'] + lats = lats[:,nx/2] + lons1 = (lon_0+180.)*npy.ones(lons.shape[0],npy.float64) + lons2 = (lon_0-180.)*npy.ones(lons.shape[0],npy.float64) + xmax,ytmp = self(lons1,lats) + xmin,ytmp = self(lons2,lats) + for j in range(lats.shape[0]): + xx = x[j,:] + mask[j,:]=npy.where(npy.logical_or(xx<xmin[j],xx>xmax[j]),\ + 255,mask[j,:]) self.lsmask = mask # optionally, set lakes to ocean color. if lakes: @@ -2479,6 +2493,7 @@ rgba[:,:,3] = npy.where(mask==255,0,rgba[:,:,3]) # plot mask as rgba image. im = self.imshow(rgba,interpolation='nearest',ax=ax,**kwargs) + return im ### End of Basemap class This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 18:25:38
|
Revision: 4396 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4396&view=rev Author: mdboom Date: 2007-11-20 10:25:33 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Slight speed improvement in draw_quad_mesh. Modified Paths: -------------- trunk/matplotlib/src/_backend_agg.cpp trunk/matplotlib/src/_backend_agg.h Modified: trunk/matplotlib/src/_backend_agg.cpp =================================================================== --- trunk/matplotlib/src/_backend_agg.cpp 2007-11-20 17:44:27 UTC (rev 4395) +++ trunk/matplotlib/src/_backend_agg.cpp 2007-11-20 18:25:33 UTC (rev 4396) @@ -956,8 +956,10 @@ return numIntersect; } -void RendererAgg::DrawQuadMesh(int meshWidth, int meshHeight, const agg::rgba8 colorArray[], const double xCoords[], const double yCoords[]) +void RendererAgg::DrawQuadMesh(int meshWidth, int meshHeight, void* colors_void, const double xCoords[], const double yCoords[]) { + PyArrayObject* colors = (PyArrayObject*)colors_void; + /* draw each quadrilateral */ // agg::renderer_primitives<agg::renderer_base<agg::pixfmt_rgba32> > lineRen(*rendererBase); int i = 0; @@ -992,18 +994,25 @@ //currTime = clock(); //timer2 += (clock() - currTime); //currTime = clock(); + size_t color_index = (i * meshWidth) + j; + agg::rgba color(*(double*)PyArray_GETPTR2(colors, color_index, 0), + *(double*)PyArray_GETPTR2(colors, color_index, 1), + *(double*)PyArray_GETPTR2(colors, color_index, 2), + *(double*)PyArray_GETPTR2(colors, color_index, 3)); + for(k = firstRow; k <= lastRow; k++) { numCol = inPolygon(k, xs, ys, col); - if (numCol >= 2) rendererBase->copy_hline(col[0], k, col[1] - 1, colorArray[(i * meshWidth) + j]); - if (numCol == 4) rendererBase->copy_hline(col[2], k, col[3] - 1, colorArray[(i * meshWidth) + j]); + + if (numCol >= 2) rendererBase->copy_hline(col[0], k, col[1] - 1, color); + if (numCol == 4) rendererBase->copy_hline(col[2], k, col[3] - 1, color); } } } return; } -void RendererAgg::DrawQuadMeshEdges(int meshWidth, int meshHeight, const agg::rgba8 colorArray[], const double xCoords[], const double yCoords[]) +void RendererAgg::DrawQuadMeshEdges(int meshWidth, int meshHeight, const double xCoords[], const double yCoords[]) { int i, j; agg::renderer_primitives<agg::renderer_base<agg::pixfmt_rgba32> > lineRen(*rendererBase); @@ -1027,7 +1036,6 @@ Py::Object RendererAgg::draw_quad_mesh(const Py::Tuple& args){ - //printf("#1: %d\n", clock()); Py::Object colorsi = args[2]; Py::Object xCoordsi = args[3]; @@ -1035,7 +1043,6 @@ int meshWidth = Py::Int(args[0]); int meshHeight = Py::Int(args[1]); int showedges = Py::Int(args[9]); - int numQuads = (meshWidth * meshHeight); PyArrayObject *colors = (PyArrayObject *) PyArray_ContiguousFromObject(colorsi.ptr(), PyArray_DOUBLE, 2, 2); PyArrayObject *xCoords = (PyArrayObject *) PyArray_ContiguousFromObject(xCoordsi.ptr(), PyArray_DOUBLE, 1, 1); PyArrayObject *yCoords = (PyArrayObject *) PyArray_ContiguousFromObject(yCoordsi.ptr(), PyArray_DOUBLE, 1, 1); @@ -1117,30 +1124,14 @@ /**** End of transformations ****/ - /* convert colors */ - double r; - double g; - double b; - double a; - int i; - agg::rgba8* colorArray = new agg::rgba8[numQuads]; - for(i=0; i < numQuads; i++) - { - r = *(double *)(colors -> data + i*(colors -> strides[0])); - g = *(double *)(colors -> data + i*(colors -> strides[0]) + (colors -> strides[1])); - b = *(double *)(colors -> data + i*(colors -> strides[0]) + 2*(colors -> strides[1])); - a = *(double *)(colors -> data + i*(colors -> strides[0]) + 3*(colors -> strides[1])); - colorArray[i] = agg::rgba8((int)(255.0 * r), (int)(255.0 * g), (int)(255.0 * b), (int)(255.0 * a)); - } - DrawQuadMesh(meshWidth, meshHeight, colorArray, &(newXCoords[0]), &(newYCoords[0])); + DrawQuadMesh(meshWidth, meshHeight, colors, &(newXCoords[0]), &(newYCoords[0])); if(showedges) - DrawQuadMeshEdges(meshWidth, meshHeight, colorArray, &(newXCoords[0]), &(newYCoords[0])); + DrawQuadMeshEdges(meshWidth, meshHeight, &(newXCoords[0]), &(newYCoords[0])); Py_XDECREF(xCoords); Py_XDECREF(yCoords); Py_XDECREF(colors); delete newXCoords; delete newYCoords; - delete colorArray; //printf("#2: %d\n", clock()); return Py::Object(); } Modified: trunk/matplotlib/src/_backend_agg.h =================================================================== --- trunk/matplotlib/src/_backend_agg.h 2007-11-20 17:44:27 UTC (rev 4395) +++ trunk/matplotlib/src/_backend_agg.h 2007-11-20 18:25:33 UTC (rev 4396) @@ -215,8 +215,8 @@ agg::rect bbox_to_rect( const Py::Object& o); double points_to_pixels( const Py::Object& points); double points_to_pixels_snapto( const Py::Object& points); - void DrawQuadMesh(int, int, const agg::rgba8[], const double[], const double[]); - void DrawQuadMeshEdges(int, int, const agg::rgba8[], const double[], const double[]); + void DrawQuadMesh(int, int, void* colors, const double[], const double[]); + void DrawQuadMeshEdges(int, int, const double[], const double[]); int intersectCheck(double, double, double, double, double, int*); int inPolygon(int, const double[4], const double[4], int[4]); void set_clip_from_bbox(const Py::Object& o); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 17:44:33
|
Revision: 4395 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4395&view=rev Author: mdboom Date: 2007-11-20 09:44:27 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Merged revisions 4393-4394 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4394 | mdboom | 2007-11-20 12:43:40 -0500 (Tue, 20 Nov 2007) | 3 lines Minor refactorings, comments, and one bugfix (to do with the alignment of wide accents with STIX fonts). ........ Modified Paths: -------------- branches/transforms/lib/matplotlib/mathtext.py Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4392 + /trunk/matplotlib:1-4394 Modified: branches/transforms/lib/matplotlib/mathtext.py =================================================================== --- branches/transforms/lib/matplotlib/mathtext.py 2007-11-20 17:43:40 UTC (rev 4394) +++ branches/transforms/lib/matplotlib/mathtext.py 2007-11-20 17:44:27 UTC (rev 4395) @@ -1707,6 +1707,7 @@ char = char_class(sym, state) Hlist.__init__(self, [char]) + self.width = char.width class Ship(object): """Once the boxes have been set up, this sends them to output. @@ -1742,11 +1743,14 @@ left_edge = self.cur_h self.cur_s += 1 self.max_push = max(self.cur_s, self.max_push) - + clamp = self.clamp + for p in box.children: if isinstance(p, Char): p.render(self.cur_h + self.off_h, self.cur_v + self.off_v) self.cur_h += p.width + elif isinstance(p, Kern): + self.cur_h += p.width elif isinstance(p, List): # @623 if len(p.children) == 0: @@ -1785,14 +1789,12 @@ if glue_sign == 1: # stretching if glue_spec.stretch_order == glue_order: cur_glue += glue_spec.stretch - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) elif glue_spec.shrink_order == glue_order: cur_glue += glue_spec.shrink - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) rule_width += cur_g self.cur_h += rule_width - elif isinstance(p, Kern): - self.cur_h += p.width self.cur_s -= 1 def vlist_out(self, box): @@ -1805,9 +1807,12 @@ left_edge = self.cur_h self.cur_v -= box.height top_edge = self.cur_v + clamp = self.clamp for p in box.children: - if isinstance(p, List): + if isinstance(p, Kern): + self.cur_v += p.width + elif isinstance(p, List): if len(p.children) == 0: self.cur_v += p.height + p.depth else: @@ -1840,14 +1845,12 @@ if glue_sign == 1: # stretching if glue_spec.stretch_order == glue_order: cur_glue += glue_spec.stretch - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) elif glue_spec.shrink_order == glue_order: # shrinking cur_glue += glue_spec.shrink - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) rule_height += cur_g self.cur_v += rule_height - elif isinstance(p, Kern): - self.cur_v += p.width elif isinstance(p, Char): raise RuntimeError("Internal mathtext error: Char node found in vlist") self.cur_s -= 1 @@ -1921,6 +1924,21 @@ _dropsub_symbols = Set(r'''\int \oint'''.split()) + _fontnames = Set("rm cal it tt sf bf default bb frak circled scr".split()) + + _function_names = Set(""" + arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim + liminf sin cos exp limsup sinh cosh gcd ln sup cot hom log tan + coth inf max tanh""".split()) + + _ambiDelim = Set(r""" + | \| / \backslash \uparrow \downarrow \updownarrow \Uparrow + \Downarrow \Updownarrow .""".split()) + + _leftDelim = Set(r"( [ { \lfloor \langle \lceil".split()) + + _rightDelim = Set(r") ] } \rfloor \rangle \rceil".split()) + def __init__(self): # All forward declarations are here font = Forward().setParseAction(self.font).setName("font") @@ -1944,15 +1962,10 @@ accent = oneOf(self._accent_map.keys() + list(self._wide_accents)) - function = oneOf("arccos csc ker min arcsin deg lg Pr arctan det " - "lim sec arg dim liminf sin cos exp limsup sinh " - "cosh gcd ln sup cot hom log tan coth inf max " - "tanh") + function = oneOf(list(self._function_names)) - fontname = oneOf("rm cal it tt sf bf") - latex2efont = oneOf("mathrm mathcal mathit mathtt mathsf mathbf " - "mathdefault mathbb mathfrak mathcircled " - "mathscr") + fontname = oneOf(list(self._fontnames)) + latex2efont = oneOf(['math' + x for x in self._fontnames]) space =(FollowedBy(bslash) + (Literal(r'\ ') @@ -1991,7 +2004,8 @@ ).setParseAction(self.accent).setName("accent") function =(Suppress(bslash) - + function).setParseAction(self.function).setName("function") + + function + ).setParseAction(self.function).setName("function") group = Group( start_group @@ -2063,11 +2077,9 @@ | placeable ) - ambiDelim = oneOf(r"""| \| / \backslash \uparrow \downarrow - \updownarrow \Uparrow \Downarrow - \Updownarrow .""") - leftDelim = oneOf(r"( [ { \lfloor \langle \lceil") - rightDelim = oneOf(r") ] } \rfloor \rangle \rceil") + ambiDelim = oneOf(self._ambiDelim) + leftDelim = oneOf(self._leftDelim) + rightDelim = oneOf(self._rightDelim) autoDelim <<(Suppress(Literal(r"\left")) + ((leftDelim | ambiDelim) | Error("Expected a delimiter")) + Group( @@ -2395,7 +2407,9 @@ super = next1 sub = next2 else: - raise ParseFatalException("Subscript/superscript sequence is too long. Use braces { } to remove ambiguity.") + raise ParseFatalException( + "Subscript/superscript sequence is too long. " + "Use braces { } to remove ambiguity.") state = self.get_state() rule_thickness = state.font_output.get_underline_thickness( @@ -2403,6 +2417,7 @@ xHeight = state.font_output.get_xheight( state.font, state.fontsize, state.dpi) + # Handle over/under symbols, such as sum or integral if self.is_overunder(nucleus): vlist = [] shift = 0. @@ -2431,6 +2446,7 @@ result = Hlist([vlist]) return [result] + # Handle regular sub/superscripts shift_up = nucleus.height - SUBDROP * xHeight if self.is_dropsub(nucleus): shift_down = nucleus.depth + SUBDROP * xHeight This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 17:43:48
|
Revision: 4394 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4394&view=rev Author: mdboom Date: 2007-11-20 09:43:40 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Minor refactorings, comments, and one bugfix (to do with the alignment of wide accents with STIX fonts). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/mathtext.py Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-20 14:52:24 UTC (rev 4393) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2007-11-20 17:43:40 UTC (rev 4394) @@ -1709,6 +1709,7 @@ char = char_class(sym, state) Hlist.__init__(self, [char]) + self.width = char.width class Ship(object): """Once the boxes have been set up, this sends them to output. @@ -1744,11 +1745,14 @@ left_edge = self.cur_h self.cur_s += 1 self.max_push = max(self.cur_s, self.max_push) - + clamp = self.clamp + for p in box.children: if isinstance(p, Char): p.render(self.cur_h + self.off_h, self.cur_v + self.off_v) self.cur_h += p.width + elif isinstance(p, Kern): + self.cur_h += p.width elif isinstance(p, List): # @623 if len(p.children) == 0: @@ -1787,14 +1791,12 @@ if glue_sign == 1: # stretching if glue_spec.stretch_order == glue_order: cur_glue += glue_spec.stretch - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) elif glue_spec.shrink_order == glue_order: cur_glue += glue_spec.shrink - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) rule_width += cur_g self.cur_h += rule_width - elif isinstance(p, Kern): - self.cur_h += p.width self.cur_s -= 1 def vlist_out(self, box): @@ -1807,9 +1809,12 @@ left_edge = self.cur_h self.cur_v -= box.height top_edge = self.cur_v + clamp = self.clamp for p in box.children: - if isinstance(p, List): + if isinstance(p, Kern): + self.cur_v += p.width + elif isinstance(p, List): if len(p.children) == 0: self.cur_v += p.height + p.depth else: @@ -1842,14 +1847,12 @@ if glue_sign == 1: # stretching if glue_spec.stretch_order == glue_order: cur_glue += glue_spec.stretch - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) elif glue_spec.shrink_order == glue_order: # shrinking cur_glue += glue_spec.shrink - cur_g = round(self.clamp(float(box.glue_set) * cur_glue)) + cur_g = round(clamp(float(box.glue_set) * cur_glue)) rule_height += cur_g self.cur_v += rule_height - elif isinstance(p, Kern): - self.cur_v += p.width elif isinstance(p, Char): raise RuntimeError("Internal mathtext error: Char node found in vlist") self.cur_s -= 1 @@ -1923,6 +1926,21 @@ _dropsub_symbols = Set(r'''\int \oint'''.split()) + _fontnames = Set("rm cal it tt sf bf default bb frak circled scr".split()) + + _function_names = Set(""" + arccos csc ker min arcsin deg lg Pr arctan det lim sec arg dim + liminf sin cos exp limsup sinh cosh gcd ln sup cot hom log tan + coth inf max tanh""".split()) + + _ambiDelim = Set(r""" + | \| / \backslash \uparrow \downarrow \updownarrow \Uparrow + \Downarrow \Updownarrow .""".split()) + + _leftDelim = Set(r"( [ { \lfloor \langle \lceil".split()) + + _rightDelim = Set(r") ] } \rfloor \rangle \rceil".split()) + def __init__(self): # All forward declarations are here font = Forward().setParseAction(self.font).setName("font") @@ -1946,15 +1964,10 @@ accent = oneOf(self._accent_map.keys() + list(self._wide_accents)) - function = oneOf("arccos csc ker min arcsin deg lg Pr arctan det " - "lim sec arg dim liminf sin cos exp limsup sinh " - "cosh gcd ln sup cot hom log tan coth inf max " - "tanh") + function = oneOf(list(self._function_names)) - fontname = oneOf("rm cal it tt sf bf") - latex2efont = oneOf("mathrm mathcal mathit mathtt mathsf mathbf " - "mathdefault mathbb mathfrak mathcircled " - "mathscr") + fontname = oneOf(list(self._fontnames)) + latex2efont = oneOf(['math' + x for x in self._fontnames]) space =(FollowedBy(bslash) + (Literal(r'\ ') @@ -1993,7 +2006,8 @@ ).setParseAction(self.accent).setName("accent") function =(Suppress(bslash) - + function).setParseAction(self.function).setName("function") + + function + ).setParseAction(self.function).setName("function") group = Group( start_group @@ -2065,11 +2079,9 @@ | placeable ) - ambiDelim = oneOf(r"""| \| / \backslash \uparrow \downarrow - \updownarrow \Uparrow \Downarrow - \Updownarrow .""") - leftDelim = oneOf(r"( [ { \lfloor \langle \lceil") - rightDelim = oneOf(r") ] } \rfloor \rangle \rceil") + ambiDelim = oneOf(self._ambiDelim) + leftDelim = oneOf(self._leftDelim) + rightDelim = oneOf(self._rightDelim) autoDelim <<(Suppress(Literal(r"\left")) + ((leftDelim | ambiDelim) | Error("Expected a delimiter")) + Group( @@ -2397,7 +2409,9 @@ super = next1 sub = next2 else: - raise ParseFatalException("Subscript/superscript sequence is too long. Use braces { } to remove ambiguity.") + raise ParseFatalException( + "Subscript/superscript sequence is too long. " + "Use braces { } to remove ambiguity.") state = self.get_state() rule_thickness = state.font_output.get_underline_thickness( @@ -2405,6 +2419,7 @@ xHeight = state.font_output.get_xheight( state.font, state.fontsize, state.dpi) + # Handle over/under symbols, such as sum or integral if self.is_overunder(nucleus): vlist = [] shift = 0. @@ -2433,6 +2448,7 @@ result = Hlist([vlist]) return [result] + # Handle regular sub/superscripts shift_up = nucleus.height - SUBDROP * xHeight if self.is_dropsub(nucleus): shift_down = nucleus.depth + SUBDROP * xHeight This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 14:52:26
|
Revision: 4393 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4393&view=rev Author: mdboom Date: 2007-11-20 06:52:24 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Merged revisions 4340-4392 via svnmerge from http://matplotlib.svn.sf.net/svnroot/matplotlib/trunk/matplotlib ........ r4341 | jdh2358 | 2007-11-16 13:15:32 -0500 (Fri, 16 Nov 2007) | 2 lines removed a couple of pyc files ........ r4346 | dsdale | 2007-11-16 16:47:17 -0500 (Fri, 16 Nov 2007) | 2 lines fixed version checking for traits-3 ........ r4347 | mdboom | 2007-11-17 07:44:52 -0500 (Sat, 17 Nov 2007) | 1 line Bugfix: [1655313] axis label disappears when minor tick labels are hidden ........ r4374 | efiring | 2007-11-18 13:59:56 -0500 (Sun, 18 Nov 2007) | 11 lines Let to_rgba return uint8; track changes to cmap Images require rgba as 4 uint8s, so it is more efficient to generate these directly in to_rgba than to generate 4 doubles and convert them later. The tracking of changes in ScalarMappable was handling communication between objects, but was not keeping track of when to_rgba needs to be rerun. A dictionary was added to do this. ........ r4375 | efiring | 2007-11-18 14:01:39 -0500 (Sun, 18 Nov 2007) | 2 lines Remove trailing whitespace. ........ r4376 | efiring | 2007-11-18 14:02:55 -0500 (Sun, 18 Nov 2007) | 2 lines Use new update_dict from ScalarMappable in QuadMesh ........ r4377 | efiring | 2007-11-18 14:06:49 -0500 (Sun, 18 Nov 2007) | 7 lines Add experimental "pcolorfast" for fast interactive pcolor plots This will need more discussion and work, but it illustrates the potential for very fast pcolor-type plotting with all three grid types: uniform, irregular but rectilinear, and general quadrilateral. ........ r4379 | efiring | 2007-11-18 15:54:22 -0500 (Sun, 18 Nov 2007) | 2 lines Remove unnecessary data copying from draw_quad_mesh ........ r4383 | jdh2358 | 2007-11-19 16:43:24 -0500 (Mon, 19 Nov 2007) | 2 lines fixed a minor bug in csv2rec ........ r4387 | mdboom | 2007-11-20 08:13:22 -0500 (Tue, 20 Nov 2007) | 2 lines Speed improvement initializing mathtext parser. ........ r4391 | mdboom | 2007-11-20 08:29:20 -0500 (Tue, 20 Nov 2007) | 2 lines Fix problem with 0-line width drawing in Postscript. (Thanks Ben North). ........ Modified Paths: -------------- branches/transforms/lib/matplotlib/axes.py branches/transforms/lib/matplotlib/axis.py branches/transforms/lib/matplotlib/backends/backend_ps.py branches/transforms/lib/matplotlib/cm.py branches/transforms/lib/matplotlib/collections.py branches/transforms/lib/matplotlib/image.py branches/transforms/lib/matplotlib/mlab.py branches/transforms/lib/matplotlib/pyparsing.py branches/transforms/setupext.py Property Changed: ---------------- branches/transforms/ Property changes on: branches/transforms ___________________________________________________________________ Name: svnmerge-integrated - /trunk/matplotlib:1-4339 + /trunk/matplotlib:1-4392 Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/axes.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -3774,8 +3774,8 @@ xs = [thisx for thisx, b in zip(xs, mask) if b] ys = [thisy for thisy, b in zip(ys, mask) if b] return xs, ys - + if capsize > 0: plot_kw = { 'ms':2*capsize, @@ -3801,16 +3801,16 @@ # can't use numpy logical indexing since left and # y are lists leftlo, ylo = xywhere(left, y, xlolims) - + caplines.extend( self.plot(leftlo, ylo, ls='None', marker=mlines.CARETLEFT, **plot_kw) ) xlolims = ~xlolims - leftlo, ylo = xywhere(left, y, xlolims) + leftlo, ylo = xywhere(left, y, xlolims) caplines.extend( self.plot(leftlo, ylo, 'k|', **plot_kw) ) else: caplines.extend( self.plot(left, y, 'k|', **plot_kw) ) if xuplims.any(): - + rightup, yup = xywhere(right, y, xuplims) caplines.extend( self.plot(rightup, yup, ls='None', marker=mlines.CARETRIGHT, **plot_kw) ) xuplims = ~xuplims @@ -3843,7 +3843,7 @@ if uplims.any(): xup, upperup = xywhere(x, upper, uplims) - + caplines.extend( self.plot(xup, upperup, ls='None', marker=mlines.CARETUP, **plot_kw) ) uplims = ~uplims xup, upperup = xywhere(x, upper, uplims) @@ -4835,6 +4835,177 @@ return collection pcolormesh.__doc__ = cbook.dedent(pcolormesh.__doc__) % martist.kwdocd + def pcolorfast(self, *args, **kwargs): + """ + Experimental; this is a version of pcolor that + does not draw lines, that provides the fastest + possible rendering with the Agg backend, and that + can handle any quadrilateral grid. + + pcolor(*args, **kwargs): pseudocolor plot of a 2-D array + + Function signatures + + pcolor(C, **kwargs) + pcolor(xr, yr, C, **kwargs) + pcolor(x, y, C, **kwargs) + pcolor(X, Y, C, **kwargs) + + C is the 2D array of color values corresponding to quadrilateral + cells. Let (nr, nc) be its shape. C may be a masked array. + + pcolor(C, **kwargs) is equivalent to + pcolor([0,nc], [0,nr], C, **kwargs) + + xr, yr specify the ranges of x and y corresponding to the rectangular + region bounding C. If xr = [x0, x1] and yr = [y0,y1] then + x goes from x0 to x1 as the second index of C goes from 0 to nc, + etc. (x0, y0) is the outermost corner of cell (0,0), and (x1, y1) + is the outermost corner of cell (nr-1, nc-1). All cells are + rectangles of the same size. This is the fastest version. + + x, y are 1D arrays of length nc+1 and nr+1, respectively, giving + the x and y boundaries of the cells. Hence the cells are + rectangular but the grid may be nonuniform. The speed is + intermediate. (The grid is checked, and if found to be + uniform the fast version is used.) + + X and Y are 2D arrays with shape (nr+1, nc+1) that specify + the (x,y) coordinates of the corners of the colored + quadrilaterals; the quadrilateral for C[i,j] has corners at + (X[i,j],Y[i,j]), (X[i,j+1],Y[i,j+1]), (X[i+1,j],Y[i+1,j]), + (X[i+1,j+1],Y[i+1,j+1]). The cells need not be rectangular. + This is the most general, but the slowest to render. It may + produce faster and more compact output using ps, pdf, and + svg backends, however. + + Note that the the column index corresponds to the x-coordinate, + and the row index corresponds to y; for details, see + the "Grid Orientation" section below. + + Optional keyword args are shown with their defaults below (you must + use kwargs for these): + + * cmap = cm.jet : a cm Colormap instance from cm + + * norm = Normalize() : mcolors.Normalize instance + is used to scale luminance data to 0,1. + + * vmin=None and vmax=None : vmin and vmax are used in conjunction + with norm to normalize luminance data. If either are None, the + min and max of the color array C is used. If you pass a norm + instance, vmin and vmax will be None + + * alpha=1.0 : the alpha blending value + + Return value is an image if a regular or rectangular grid + is specified, and a QuadMesh collection in the general + quadrilateral case. + + """ + + if not self._hold: self.cla() + + alpha = kwargs.pop('alpha', 1.0) + norm = kwargs.pop('norm', None) + cmap = kwargs.pop('cmap', None) + vmin = kwargs.pop('vmin', None) + vmax = kwargs.pop('vmax', None) + if norm is not None: assert(isinstance(norm, mcolors.Normalize)) + if cmap is not None: assert(isinstance(cmap, mcolors.Colormap)) + + C = args[-1] + nr, nc = C.shape + if len(args) == 1: + style = "image" + x = [0, nc+1] + y = [0, nr+1] + elif len(args) == 3: + x, y = args[:2] + x = npy.asarray(x) + y = npy.asarray(y) + if x.ndim == 1 and y.ndim == 1: + if x.size == 2 and y.size == 2: + style = "image" + else: + dx = npy.diff(x) + dy = npy.diff(y) + if (npy.ptp(dx) < 0.01*npy.abs(dx.mean()) and + npy.ptp(dy) < 0.01*npy.abs(dy.mean())): + style = "image" + style = "pcolorimage" + elif x.ndim == 2 and y.ndim == 2: + style = "quadmesh" + else: + raise TypeError("arguments do not match valid signatures") + else: + raise TypeError("need 1 argument or 3 arguments") + + if style == "quadmesh": + + # convert to one dimensional arrays + # This should also be moved to the QuadMesh class + C = ma.ravel(C) # data point in each cell is value at lower left corner + X = x.ravel() + Y = y.ravel() + Nx = nc+1 + Ny = nr+1 + + # The following needs to be cleaned up; the renderer + # requires separate contiguous arrays for X and Y, + # but the QuadMesh class requires the 2D array. + coords = npy.empty(((Nx * Ny), 2), npy.float64) + coords[:, 0] = X + coords[:, 1] = Y + + # The QuadMesh class can also be changed to + # handle relevant superclass kwargs; the initializer + # should do much more than it does now. + collection = mcoll.QuadMesh(nc, nr, coords, 0) + collection.set_alpha(alpha) + collection.set_array(C) + collection.set_cmap(cmap) + collection.set_norm(norm) + self.add_collection(collection) + xl, xr, yb, yt = X.min(), X.max(), Y.min(), Y.max() + ret = collection + + else: + # One of the image styles: + xl, xr, yb, yt = x[0], x[-1], y[0], y[-1] + if style == "image": + + im = mimage.AxesImage(self, cmap, norm, + interpolation='nearest', + origin='lower', + extent=(xl, xr, yb, yt), + **kwargs) + im.set_data(C) + im.set_alpha(alpha) + self.images.append(im) + ret = im + + if style == "pcolorimage": + im = mimage.PcolorImage(self, x, y, C, + cmap=cmap, + norm=norm, + alpha=alpha, + **kwargs) + self.images.append(im) + ret = im + + self._set_artist_props(ret) + if vmin is not None or vmax is not None: + ret.set_clim(vmin, vmax) + else: + ret.autoscale_None() + self.update_datalim(npy.array([[xl, yb], [xr, yt]])) + self.autoscale_view(tight=True) + return ret + + + + def contour(self, *args, **kwargs): kwargs['filled'] = False return mcontour.ContourSet(self, *args, **kwargs) @@ -4895,14 +5066,14 @@ ticks on bottom and the returned axes will have ticks on the top """ - + ax2 = self.figure.add_axes(self.get_position(), sharey=self, frameon=False) ax2.xaxis.tick_top() ax2.xaxis.set_label_position('top') self.xaxis.tick_bottom() return ax2 - + #### Data analysis Modified: branches/transforms/lib/matplotlib/axis.py =================================================================== --- branches/transforms/lib/matplotlib/axis.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/axis.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -620,10 +620,10 @@ tick.set_label2(label) tick.draw(renderer) - if tick.label1On: + if tick.label1On and tick.label1.get_visible(): extent = tick.label1.get_window_extent(renderer) ticklabelBoxes.append(extent) - if tick.label2On: + if tick.label2On and tick.label2.get_visible(): extent = tick.label2.get_window_extent(renderer) ticklabelBoxes2.append(extent) Modified: branches/transforms/lib/matplotlib/backends/backend_ps.py =================================================================== --- branches/transforms/lib/matplotlib/backends/backend_ps.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/backends/backend_ps.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -787,6 +787,9 @@ if self.linewidth > 0 and stroke: self.set_color(*gc.get_rgb()[:3]) write("stroke\n") + else: + write("newpath\n") + if clippath: write("grestore\n") if cliprect: Modified: branches/transforms/lib/matplotlib/cm.py =================================================================== --- branches/transforms/lib/matplotlib/cm.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/cm.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -40,6 +40,7 @@ self.cmap = cmap self.observers = [] self.colorbar = None + self.update_dict = {'array':False} def set_colorbar(self, im, ax): 'set the colorbar image and axes associated with mappable' @@ -47,11 +48,26 @@ def to_rgba(self, x, alpha=1.0, bytes=False): '''Return a normalized rgba array corresponding to x. - If x is already an rgb or rgba array, return it unchanged. + If x is already an rgb array, insert alpha; if it is + already rgba, return it unchanged. + If bytes is True, return rgba as 4 uint8s instead of 4 floats. ''' try: - if x.ndim == 3 and (x.shape[2] == 3 or x.shape[2] == 4): - return x + if x.ndim == 3: + if x.shape[2] == 3: + if x.dtype == npy.uint8: + alpha = npy.array(alpha*255, npy.uint8) + m, n = npy.shape[:2] + xx = npy.empty(shape=(m,n,4), dtype = x.dtype) + xx[:,:,:3] = x + xx[:,:,3] = alpha + elif x.shape[2] == 4: + xx = x + else: + raise ValueError("third dimension must be 3 or 4") + if bytes and xx.dtype != npy.uint8: + xx = (xx * 255).astype(npy.uint8) + return xx except AttributeError: pass x = ma.asarray(x) @@ -62,6 +78,7 @@ def set_array(self, A): 'Set the image array from numpy array A' self._A = A + self.update_dict['array'] = True def get_array(self): 'Return the array' @@ -124,7 +141,23 @@ self.changed() + def add_checker(self, checker): + """ + Add an entry to a dictionary of boolean flags + that are set to True when the mappable is changed. + """ + self.update_dict[checker] = False + def check_update(self, checker): + """ + If mappable has changed since the last check, + return True; else return False + """ + if self.update_dict[checker]: + self.update_dict[checker] = False + return True + return False + def add_observer(self, mappable): """ whenever the norm, clim or cmap is set, call the notify @@ -158,3 +191,6 @@ """ for observer in self.observers: observer.notify(self) + for key in self.update_dict: + self.update_dict[key] = True + Modified: branches/transforms/lib/matplotlib/collections.py =================================================================== --- branches/transforms/lib/matplotlib/collections.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/collections.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -441,7 +441,8 @@ else: offsets = npy.asarray(offsets, npy.float_) - self.update_scalarmappable() + if self.check_update('array'): + self.update_scalarmappable() clippath, clippath_trans = self.get_transformed_clip_path_and_affine() if clippath_trans is not None: Modified: branches/transforms/lib/matplotlib/image.py =================================================================== --- branches/transforms/lib/matplotlib/image.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/image.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -404,9 +404,107 @@ raise RuntimeError('Cannot change colors after loading data') cm.ScalarMappable.set_cmap(self, norm) +class PcolorImage(martist.Artist, cm.ScalarMappable): + def __init__(self, ax, + x=None, + y=None, + A=None, + cmap = None, + norm = None, + **kwargs + ): + """ + cmap defaults to its rc setting + cmap is a colors.Colormap instance + norm is a colors.Normalize instance to map luminance to 0-1 + Additional kwargs are matplotlib.artist properties + """ + martist.Artist.__init__(self) + cm.ScalarMappable.__init__(self, norm, cmap) + self.axes = ax + self._rgbacache = None + self.update(kwargs) + self.set_data(x, y, A) + + def make_image(self, magnification=1.0): + if self._A is None: + raise RuntimeError('You must first set the image array') + fc = self.axes.get_frame().get_facecolor() + bg = mcolors.colorConverter.to_rgba(fc, 0) + bg = (npy.array(bg)*255).astype(npy.uint8) + x0, y0, v_width, v_height = self.axes.viewLim.get_bounds() + l, b, width, height = self.axes.bbox.get_bounds() + width *= magnification + height *= magnification + if self.check_update('array'): + A = self.to_rgba(self._A, alpha=self._alpha, bytes=True) + self._rgbacache = A + if self._A.ndim == 2: + self.is_grayscale = self.cmap.is_gray() + else: + A = self._rgbacache + im = _image.pcolor2(self._Ax, self._Ay, A, + height, width, + (x0, x0+v_width, y0, y0+v_height), + bg) + im.is_grayscale = self.is_grayscale + return im + + def draw(self, renderer, *args, **kwargs): + if not self.get_visible(): return + im = self.make_image(renderer.get_image_magnification()) + l, b, widthDisplay, heightDisplay = self.axes.bbox.get_bounds() + renderer.draw_image(l, b, im, self.axes.bbox) + + + def set_data(self, x, y, A): + A = ma.asarray(A) + if x is None: + x = npy.arange(0, A.shape[1]+1, dtype=npy.float64) + else: + x = npy.asarray(x, npy.float64).ravel() + if y is None: + y = npy.arange(0, A.shape[0]+1, dtype=npy.float64) + else: + y = npy.asarray(y, npy.float64).ravel() + + if A.shape[:2] != (y.size-1, x.size-1): + print A.shape + print y.size + print x.size + raise ValueError("Axes don't match array shape") + if A.ndim not in [2, 3]: + raise ValueError("A must be 2D or 3D") + if A.ndim == 3 and A.shape[2] == 1: + A.shape = A.shape[:2] + self.is_grayscale = False + if A.ndim == 3: + if A.shape[2] in [3, 4]: + if (A[:,:,0] == A[:,:,1]).all() and (A[:,:,0] == A[:,:,2]).all(): + self.is_grayscale = True + else: + raise ValueError("3D arrays must have RGB or RGBA as last dim") + self._A = A + self._Ax = x + self._Ay = y + self.update_dict['array'] = True + + def set_array(self, *args): + raise NotImplementedError('Method not supported') + + def set_alpha(self, alpha): + """ + Set the alpha value used for blending - not supported on + all backends + + ACCEPTS: float + """ + martist.Artist.set_alpha(self, alpha) + self.update_dict['array'] = True + class FigureImage(martist.Artist, cm.ScalarMappable): def __init__(self, fig, cmap = None, Modified: branches/transforms/lib/matplotlib/mlab.py =================================================================== --- branches/transforms/lib/matplotlib/mlab.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/mlab.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -44,7 +44,7 @@ compute it for a lot of pairs. This function is optimized to do this efficiently by caching the direct FFTs. -= record array helper functions = += record array helper functions = rec2csv : store record array in CSV file rec2excel : store record array in excel worksheet - required pyExcelerator @@ -1261,8 +1261,6 @@ def splitfunc(x): return x.split(delimiter) - - converterseq = None for i,line in enumerate(fh): if i<skiprows: continue @@ -1958,13 +1956,13 @@ newrec[name] = arr return newrec.view(npy.recarray) - + def rec_drop_fields(rec, names): - 'return a new numpy record array with fields in names dropped' + 'return a new numpy record array with fields in names dropped' names = set(names) Nr = len(rec) - + newdtype = npy.dtype([(name, rec.dtype[name]) for name in rec.dtype.names if name not in names]) @@ -1974,7 +1972,7 @@ return newrec.view(npy.recarray) - + def rec_join(key, r1, r2): """ join record arrays r1 and r2 on key; key is a tuple of field @@ -1992,15 +1990,15 @@ def makekey(row): return tuple([row[name] for name in key]) - + names = list(r1.dtype.names) + [name for name in r2.dtype.names if name not in set(r1.dtype.names)] - - - r1d = dict([(makekey(row),i) for i,row in enumerate(r1)]) + + + r1d = dict([(makekey(row),i) for i,row in enumerate(r1)]) r2d = dict([(makekey(row),i) for i,row in enumerate(r2)]) - r1keys = set(r1d.keys()) + r1keys = set(r1d.keys()) r2keys = set(r2d.keys()) keys = r1keys & r2keys @@ -2008,7 +2006,7 @@ r1ind = [r1d[k] for k in keys] r2ind = [r2d[k] for k in keys] - + r1 = r1[r1ind] r2 = r2[r2ind] @@ -2028,15 +2026,15 @@ else: return (name, dt2.descr[0][1]) - - + + keydesc = [key_desc(name) for name in key] newdtype = npy.dtype(keydesc + [desc for desc in r1.dtype.descr if desc[0] not in key ] + [desc for desc in r2.dtype.descr if desc[0] not in key ] ) - - + + newrec = npy.empty(len(r1), dtype=newdtype) for field in r1.dtype.names: newrec[field] = r1[field] @@ -2089,7 +2087,7 @@ fh = cbook.to_filehandle(fname) - + class FH: """ for space delimited files, we want different behavior than @@ -2115,13 +2113,13 @@ return self.fix(self.fh.next()) def __iter__(self): - for line in self.fh: + for line in self.fh: yield self.fix(line) if delimiter==' ': fh = FH(fh) - reader = csv.reader(fh, delimiter=delimiter) + reader = csv.reader(fh, delimiter=delimiter) def process_skiprows(reader): if skiprows: for i, row in enumerate(reader): @@ -2155,7 +2153,7 @@ 'file' : 'file_', 'print' : 'print_', } - + def get_converters(reader): converters = None @@ -2209,6 +2207,7 @@ # reset the reader and start over fh.seek(0) + reader = csv.reader(fh, delimiter=delimiter) process_skiprows(reader) if needheader: skipheader = reader.next() @@ -2232,7 +2231,7 @@ class FormatObj: def tostr(self, x): return self.toval(x) - + def toval(self, x): return str(x) @@ -2255,12 +2254,12 @@ FormatFormatStr.__init__(self, '%%1.%df'%precision) self.precision = precision self.scale = scale - + def toval(self, x): if x is not None: x = x * self.scale return x - + class FormatInt(FormatObj): def toval(self, x): return x @@ -2292,20 +2291,20 @@ defaultformatd = { - npy.int16 : FormatInt(), + npy.int16 : FormatInt(), npy.int32 : FormatInt(), - npy.int64 : FormatInt(), + npy.int64 : FormatInt(), npy.float32 : FormatFloat(), - npy.float64 : FormatFloat(), + npy.float64 : FormatFloat(), npy.object_ : FormatObj(), - npy.string_ : FormatObj(), + npy.string_ : FormatObj(), } def get_formatd(r, formatd=None): 'build a formatd guaranteed to have a key for every dtype name' if formatd is None: formatd = dict() - + for i, name in enumerate(r.dtype.names): dt = r.dtype[name] format = formatd.get(name) @@ -2316,7 +2315,7 @@ def csvformat_factory(format): format = copy.deepcopy(format) - if isinstance(format, FormatFloat): + if isinstance(format, FormatFloat): format.scale = 1. # override scaling for storage format.fmt = '%g' # maximal precision return format @@ -2358,14 +2357,14 @@ """ format = copy.deepcopy(format) - - + + xlstyle = excel.XFStyle() - if isinstance(format, FormatFloat): + if isinstance(format, FormatFloat): zeros = ''.join(['0']*format.precision) xlstyle.num_format_str = '#,##0.%s;[RED]-#,##0.%s'%(zeros, zeros) elif isinstance(format, FormatInt): - xlstyle.num_format_str = '#,##;[RED]-#,##' + xlstyle.num_format_str = '#,##;[RED]-#,##' elif isinstance(format, FormatPercent): zeros = ''.join(['0']*format.precision) xlstyle.num_format_str = '0.%s%;[RED]-0.%s%'%(zeros, zeros) @@ -2374,7 +2373,7 @@ xlstyle = None format.xlstyle = xlstyle - + return format def rec2excel(r, ws, formatd=None, rownum=0): @@ -2412,7 +2411,7 @@ rownum+=1 - + ind = npy.arange(len(r.dtype.names)) for row in r: for i in ind: @@ -2470,7 +2469,7 @@ cell.set_property('foreground', 'black') - if isinstance(format, FormatFloat) or isinstance(format, FormatInt): + if isinstance(format, FormatFloat) or isinstance(format, FormatInt): format.cell = negative_red_cell format.xalign = 1. elif isinstance(format, FormatDate): @@ -2573,7 +2572,7 @@ self.clear() def clear(self): - self.iterd = dict() + self.iterd = dict() self.iters = [] # an ordered list of iters self.rownumd = dict() # a map from rownum -> symbol self.model.clear() @@ -2596,7 +2595,7 @@ thisiter = self.iterd[key] self.model.remove(thisiter) del self.datad[key] - del self.iterd[key] + del self.iterd[key] self.iters.remove(thisiter) for i, thisiter in enumerate(self.iters): @@ -2611,7 +2610,7 @@ del self.datad[key] - del self.iterd[key] + del self.iterd[key] self.rownumd[len(self.iters)] = key self.iters.remove(thisiter) @@ -2619,7 +2618,7 @@ if thiskey==key: del self.rownumd[rownum] def add_row(self, row): - thisiter = self.model.append() + thisiter = self.model.append() self.model.set(thisiter, *self.flat(row)) key = tuple(row) self.datad[key] = row @@ -2702,7 +2701,7 @@ win.add(scroll) win.show_all() scroll.win = win - + return scroll Modified: branches/transforms/lib/matplotlib/pyparsing.py =================================================================== --- branches/transforms/lib/matplotlib/pyparsing.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/lib/matplotlib/pyparsing.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -2845,22 +2845,18 @@ else: warnings.warn("Invalid argument to oneOf, expected string or list", SyntaxWarning, stacklevel=2) - + + symbols.sort(reverse=True) i = 0 while i < len(symbols)-1: cur = symbols[i] - for j,other in enumerate(symbols[i+1:]): + for j, other in enumerate(symbols[i+1:]): if ( isequal(other, cur) ): del symbols[i+j+1] + else: break - elif ( masks(cur, other) ): - del symbols[i+j+1] - symbols.insert(i,other) - cur = other - break - else: - i += 1 - + i += 1 + if not caseless and useRegex: #~ print strs,"->", "|".join( [ _escapeRegexChars(sym) for sym in symbols] ) try: Modified: branches/transforms/setupext.py =================================================================== --- branches/transforms/setupext.py 2007-11-20 13:50:04 UTC (rev 4392) +++ branches/transforms/setupext.py 2007-11-20 14:52:24 UTC (rev 4393) @@ -466,11 +466,16 @@ print_status("enthought.traits", "unknown and incompatible version: < 2.0") return False else: - if version.version.endswith('mpl'): + # traits 2 and 3 store their version strings in different places: + try: + version = version.version + except AttributeError: + version = version.__version__ + if version.endswith('mpl'): print_status("enthought.traits", "matplotlib will provide") return True else: - print_status("enthought.traits", version.version) + print_status("enthought.traits", version) return False except ImportError: if options['provide_traits']: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 13:50:12
|
Revision: 4392 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4392&view=rev Author: mdboom Date: 2007-11-20 05:50:04 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Removing trailing whitespace so a merge from trunk will be possible. Modified Paths: -------------- branches/transforms/src/_backend_agg.cpp Modified: branches/transforms/src/_backend_agg.cpp =================================================================== --- branches/transforms/src/_backend_agg.cpp 2007-11-20 13:29:20 UTC (rev 4391) +++ branches/transforms/src/_backend_agg.cpp 2007-11-20 13:50:04 UTC (rev 4392) @@ -50,7 +50,7 @@ the C++ representation as a std::vector<std::pair<double, double> > (GCAgg::dash_t) */ -void convert_dashes(const Py::Tuple& dashes, double dpi, GCAgg::dash_t& dashes_out, +void convert_dashes(const Py::Tuple& dashes, double dpi, GCAgg::dash_t& dashes_out, double& dashOffset_out) { if (dashes.length()!=2) throw Py::ValueError(Printf("Dash descriptor must be a length 2 tuple; found %d", dashes.length()).str()); @@ -59,11 +59,11 @@ dashOffset_out = 0.0; if (dashes[0].ptr() == Py_None) return; - + dashOffset_out = double(Py::Float(dashes[0])) * dpi/72.0; Py::SeqBase<Py::Object> dashSeq = dashes[1]; - + size_t Ndash = dashSeq.length(); if (Ndash % 2 != 0) throw Py::ValueError(Printf("Dash sequence must be an even length sequence; found %d", Ndash).str()); @@ -89,9 +89,9 @@ public: conv_quantize(VertexSource& source, bool quantize) : m_source(&source), m_quantize(quantize) {} - - void rewind(unsigned path_id) { - m_source->rewind(path_id); + + void rewind(unsigned path_id) { + m_source->rewind(path_id); } unsigned vertex(double* x, double* y) { @@ -142,9 +142,9 @@ GCAgg::get_color(const Py::Object& gc) { _VERBOSE("GCAgg::get_color"); Py::Tuple rgb = Py::Tuple( gc.getAttr("_rgb") ); - + double alpha = Py::Float( gc.getAttr("_alpha") ); - + double r = Py::Float(rgb[0]); double g = Py::Float(rgb[1]); double b = Py::Float(rgb[2]); @@ -161,7 +161,7 @@ void GCAgg::_set_linecap(const Py::Object& gc) { _VERBOSE("GCAgg::_set_linecap"); - + std::string capstyle = Py::String( gc.getAttr( "_capstyle" ) ); if (capstyle=="butt") @@ -177,9 +177,9 @@ void GCAgg::_set_joinstyle(const Py::Object& gc) { _VERBOSE("GCAgg::_set_joinstyle"); - + std::string joinstyle = Py::String( gc.getAttr("_joinstyle") ); - + if (joinstyle=="miter") join = agg::miter_join; else if (joinstyle=="round") @@ -194,7 +194,7 @@ GCAgg::_set_dashes(const Py::Object& gc) { //return the dashOffset, dashes sequence tuple. _VERBOSE("GCAgg::_set_dashes"); - + Py::Object dash_obj( gc.getAttr( "_dashes" ) ); if (dash_obj.ptr() == Py_None) { dashes.clear(); @@ -207,7 +207,7 @@ void GCAgg::_set_clip_rectangle( const Py::Object& gc) { //set the clip rectangle from the gc - + _VERBOSE("GCAgg::_set_clip_rectangle"); Py::Object o ( gc.getAttr( "_cliprect" ) ); @@ -217,9 +217,9 @@ void GCAgg::_set_clip_path( const Py::Object& gc) { //set the clip path from the gc - + _VERBOSE("GCAgg::_set_clip_path"); - + Py::Object method_obj = gc.getAttr("get_clip_path"); Py::Callable method(method_obj); Py::Tuple path_and_transform = method.apply(Py::Tuple()); @@ -243,12 +243,12 @@ { _VERBOSE("RendererAgg::RendererAgg"); unsigned stride(width*4); - - + + pixBuffer = new agg::int8u[NUMBYTES]; renderingBuffer = new agg::rendering_buffer; renderingBuffer->attach(pixBuffer, width, height, stride); - + alphaBuffer = new agg::int8u[NUMBYTES]; alphaMaskRenderingBuffer = new agg::rendering_buffer; alphaMaskRenderingBuffer->attach(alphaBuffer, width, height, stride); @@ -258,33 +258,33 @@ rendererBaseAlphaMask = new renderer_base_alpha_mask_type(*pixfmtAlphaMask); rendererAlphaMask = new renderer_alpha_mask_type(*rendererBaseAlphaMask); scanlineAlphaMask = new agg::scanline_p8(); - - + + slineP8 = new scanline_p8; slineBin = new scanline_bin; - + pixFmt = new pixfmt(*renderingBuffer); rendererBase = new renderer_base(*pixFmt); rendererBase->clear(agg::rgba(1, 1, 1, 0)); - + rendererAA = new renderer_aa(*rendererBase); rendererBin = new renderer_bin(*rendererBase); theRasterizer = new rasterizer(); //theRasterizer->filling_rule(agg::fill_even_odd); //theRasterizer->filling_rule(agg::fill_non_zero); - + }; template<class R> void RendererAgg::set_clipbox(const Py::Object& cliprect, R rasterizer) { //set the clip rectangle from the gc - + _VERBOSE("RendererAgg::set_clipbox"); double l, b, r, t; if (py_convert_bbox(cliprect.ptr(), l, b, r, t)) { - rasterizer->clip_box(int(round(l)) + 1, height - int(round(b)), + rasterizer->clip_box(int(round(l)) + 1, height - int(round(b)), int(round(r)), height - int(round(t))); } @@ -295,7 +295,7 @@ RendererAgg::_get_rgba_face(const Py::Object& rgbFace, double alpha) { _VERBOSE("RendererAgg::_get_rgba_face"); std::pair<bool, agg::rgba> face; - + if (rgbFace.ptr() == Py_None) { face.first = false; } @@ -311,7 +311,7 @@ SafeSnap::snap (const float& x, const float& y) { xsnap = (int)x + 0.5; ysnap = (int)y + 0.5; - + if ( first || ( (xsnap!=lastxsnap) || (ysnap!=lastysnap) ) ) { lastxsnap = xsnap; lastysnap = ysnap; @@ -328,7 +328,7 @@ lastysnap = ysnap; lastx = x; lasty = y; - return SnapData(false, xsnap, ysnap); + return SnapData(false, xsnap, ysnap); } // ok the real points are not identical but the rounded ones, so do @@ -343,12 +343,12 @@ lastysnap = ysnap; lastx = x; lasty = y; - return SnapData(true, xsnap, ysnap); -} + return SnapData(true, xsnap, ysnap); +} template<class Path> bool should_snap(Path& path, const agg::trans_affine& trans) { - // If this is a straight horizontal or vertical line, quantize to nearest + // If this is a straight horizontal or vertical line, quantize to nearest // pixels double x0, y0, x1, y1; unsigned code; @@ -385,11 +385,11 @@ Py::Object box_obj = args[0]; double l, b, r, t; - if (!py_convert_bbox(box_obj.ptr(), l, b, r, t)) + if (!py_convert_bbox(box_obj.ptr(), l, b, r, t)) throw Py::TypeError("Invalid bbox provided to copy_from_bbox"); - + agg::rect_i rect((int)l, height - (int)t, (int)r, height - (int)b); - + BufferRegion* reg = NULL; try { reg = new BufferRegion(rect, true); @@ -403,7 +403,7 @@ agg::rendering_buffer rbuf; rbuf.attach(reg->data, reg->width, reg->height, reg->stride); - + pixfmt pf(rbuf); renderer_base rb(pf); rb.copy_from(*renderingBuffer, &rect, -rect.x1, -rect.y1); @@ -415,20 +415,20 @@ //copy BufferRegion to buffer args.verify_length(1); BufferRegion* region = static_cast<BufferRegion*>(args[0].ptr()); - + if (region->data==NULL) return Py::Object(); //throw Py::ValueError("Cannot restore_region from NULL data"); - - + + agg::rendering_buffer rbuf; rbuf.attach(region->data, region->width, region->height, region->stride); - + rendererBase->copy_from(rbuf, 0, region->rect.x1, region->rect.y1); - + return Py::Object(); } @@ -438,8 +438,8 @@ bool has_clippath = (clippath.ptr() != Py_None); - if (has_clippath && - (clippath.ptr() != lastclippath.ptr() || + if (has_clippath && + (clippath.ptr() != lastclippath.ptr() || clippath_trans != lastclippath_transform)) { agg::trans_affine trans(clippath_trans); trans *= agg::trans_affine_scaling(1.0, -1.0); @@ -471,7 +471,7 @@ typedef agg::renderer_scanline_bin_solid<amask_ren_type> amask_bin_renderer_type; args.verify_length(5, 6); - + Py::Object gc_obj = args[0]; Py::Object marker_path_obj = args[1]; agg::trans_affine marker_trans = py_to_agg_transformation_matrix(args[2]); @@ -485,7 +485,7 @@ marker_trans *= agg::trans_affine_scaling(1.0, -1.0); trans *= agg::trans_affine_scaling(1.0, -1.0); trans *= agg::trans_affine_translation(0.0, (double)height); - + PathIterator marker_path(marker_path_obj); transformed_path_t marker_path_transformed(marker_path, marker_trans); curve_t marker_path_curve(marker_path_transformed); @@ -498,11 +498,11 @@ path_quantized.rewind(0); facepair_t face = _get_rgba_face(face_obj, gc.alpha); - + //maxim's suggestions for cached scanlines agg::scanline_storage_aa8 scanlines; theRasterizer->reset(); - + agg::int8u* fillCache = NULL; agg::int8u* strokeCache = NULL; @@ -515,7 +515,7 @@ fillCache = new agg::int8u[fillSize]; // or any container scanlines.serialize(fillCache); } - + stroke_t stroke(marker_path_curve); stroke.width(gc.linewidth); stroke.line_cap(gc.cap); @@ -531,7 +531,7 @@ rendererBase->reset_clipping(true); set_clipbox(gc.cliprect, rendererBase); bool has_clippath = render_clippath(gc.clippath, gc.clippath_trans); - + double x, y; agg::serialized_scanlines_adaptor_aa8 sa; @@ -580,16 +580,16 @@ delete[] strokeCache; throw; } - + delete [] fillCache; delete [] strokeCache; return Py::Object(); - + } /** - * This is a custom span generator that converts spans in the + * This is a custom span generator that converts spans in the * 8-bit inverted greyscale font buffer to rgba that agg can use. */ template<class ChildGenerator> @@ -605,9 +605,9 @@ child_type* _gen; color_type _color; span_alloc_type _allocator; - + public: - font_to_rgba(child_type* gen, color_type color) : + font_to_rgba(child_type* gen, color_type color) : _gen(gen), _color(color) { } @@ -626,7 +626,7 @@ } while (--len); } - void prepare() + void prepare() { _gen->prepare(); } @@ -642,18 +642,18 @@ typedef agg::span_allocator<agg::rgba8> color_span_alloc_type; typedef agg::span_interpolator_linear<> interpolator_type; typedef agg::image_accessor_clip<agg::pixfmt_gray8> image_accessor_type; - typedef agg::span_image_filter_gray_2x2<image_accessor_type, interpolator_type> + typedef agg::span_image_filter_gray_2x2<image_accessor_type, interpolator_type> image_span_gen_type; typedef font_to_rgba<image_span_gen_type> span_gen_type; - typedef agg::renderer_scanline_aa<renderer_base, color_span_alloc_type, span_gen_type> + typedef agg::renderer_scanline_aa<renderer_base, color_span_alloc_type, span_gen_type> renderer_type; - + args.verify_length(5); - + FT2Image *image = static_cast<FT2Image*>(args[0].ptr()); if (!image->get_buffer()) return Py::Object(); - + int x(0),y(0); try { x = Py::Int( args[1] ); @@ -663,21 +663,21 @@ //x,y out of range; todo issue warning? return Py::Object(); } - + double angle = Py::Float( args[3] ); GCAgg gc = GCAgg(args[4], dpi); - + theRasterizer->reset_clipping(); rendererBase->reset_clipping(true); set_clipbox(gc.cliprect, theRasterizer); const unsigned char* const buffer = image->get_buffer(); agg::rendering_buffer srcbuf - ((agg::int8u*)buffer, image->get_width(), + ((agg::int8u*)buffer, image->get_width(), image->get_height(), image->get_width()); agg::pixfmt_gray8 pixf_img(srcbuf); - + agg::trans_affine mtx; mtx *= agg::trans_affine_translation(0, -(int)image->get_height()); mtx *= agg::trans_affine_rotation(-angle * agg::pi / 180.0); @@ -702,10 +702,10 @@ image_span_gen_type image_span_generator(ia, interpolator, filter); span_gen_type output_span_generator(&image_span_generator, gc.color); renderer_type ri(*rendererBase, sa, output_span_generator); - + theRasterizer->add_path(rect2); agg::render_scanlines(*theRasterizer, *slineP8, ri); - + return Py::Object(); } @@ -716,7 +716,7 @@ _VERBOSE("RendererAgg::draw_image"); args.verify_length(4, 6); - + float x = Py::Float(args[0]); float y = Py::Float(args[1]); Image *image = static_cast<Image*>(args[2].ptr()); @@ -727,7 +727,7 @@ clippath = args[4]; clippath_trans = py_to_agg_transformation_matrix(args[5], false); } - + theRasterizer->reset_clipping(); rendererBase->reset_clipping(true); set_clipbox(box_obj, rendererBase); @@ -739,13 +739,13 @@ rendererBase->blend_from(pixf, 0, (int)x, (int)(height-(y+image->rowsOut))); image->flipud_out(empty); - + return Py::Object(); } template<class PathIteratorType> -void RendererAgg::_draw_path(PathIteratorType& path, agg::trans_affine trans, - bool has_clippath, const facepair_t& face, +void RendererAgg::_draw_path(PathIteratorType& path, agg::trans_affine trans, + bool has_clippath, const facepair_t& face, const GCAgg& gc, bool check_snap) { typedef agg::conv_transform<PathIteratorType> transformed_path_t; typedef conv_quantize<transformed_path_t> quantize_t; @@ -768,7 +768,7 @@ transformed_path_t tpath(path, trans); quantize_t quantized(tpath, snap); // Benchmarking shows that there is no noticable slowdown to always - // treating paths as having curved segments. Doing so greatly + // treating paths as having curved segments. Doing so greatly // simplifies the code curve_t curve(quantized); @@ -824,14 +824,14 @@ val1 = (int)val1 + 0.5; } dash.add_dash(val0, val1); - } + } stroke_dash_t stroke(dash); stroke.line_cap(gc.cap); stroke.line_join(gc.join); stroke.width(linewidth); theRasterizer->add_path(stroke); } - + if (gc.isaa && !(snap)) { if (has_clippath) { pixfmt_amask_type pfa(*pixFmt, *alphaMask); @@ -856,7 +856,7 @@ } } } -} +} Py::Object RendererAgg::draw_path(const Py::Tuple& args) { @@ -873,14 +873,14 @@ PathIterator path(path_obj); GCAgg gc = GCAgg(gc_obj, dpi); facepair_t face = _get_rgba_face(face_obj, gc.alpha); - + theRasterizer->reset_clipping(); rendererBase->reset_clipping(true); set_clipbox(gc.cliprect, theRasterizer); bool has_clippath = render_clippath(gc.clippath, gc.clippath_trans); _draw_path(path, trans, has_clippath, face, gc, true); - + return Py::Object(); } @@ -909,26 +909,26 @@ try { offsets = (PyArrayObject*)PyArray_FromObject(offsets_obj.ptr(), PyArray_DOUBLE, 0, 2); - if (!offsets || - (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || + if (!offsets || + (PyArray_NDIM(offsets) == 2 && PyArray_DIM(offsets, 1) != 2) || (PyArray_NDIM(offsets) == 1 && PyArray_DIM(offsets, 0) != 0)) { throw Py::ValueError("Offsets array must be Nx2"); } PyArrayObject* facecolors = (PyArrayObject*)PyArray_FromObject (facecolors_obj.ptr(), PyArray_DOUBLE, 1, 2); - if (!facecolors || - (PyArray_NDIM(facecolors) == 1 && PyArray_DIM(facecolors, 0) != 0) || + if (!facecolors || + (PyArray_NDIM(facecolors) == 1 && PyArray_DIM(facecolors, 0) != 0) || (PyArray_NDIM(facecolors) == 2 && PyArray_DIM(facecolors, 1) != 4)) throw Py::ValueError("Facecolors must be a Nx4 numpy array or empty"); PyArrayObject* edgecolors = (PyArrayObject*)PyArray_FromObject (edgecolors_obj.ptr(), PyArray_DOUBLE, 1, 2); - if (!edgecolors || - (PyArray_NDIM(edgecolors) == 1 && PyArray_DIM(edgecolors, 0) != 0) || + if (!edgecolors || + (PyArray_NDIM(edgecolors) == 1 && PyArray_DIM(edgecolors, 0) != 0) || (PyArray_NDIM(edgecolors) == 2 && PyArray_DIM(edgecolors, 1) != 4)) throw Py::ValueError("Edgecolors must be a Nx4 numpy array"); - + size_t Npaths = path_generator.num_paths(); size_t Noffsets = offsets->dimensions[0]; size_t N = std::max(Npaths, Noffsets); @@ -941,9 +941,9 @@ if ((Nfacecolors == 0 && Nedgecolors == 0) || Npaths == 0) return Py::Object(); - + size_t i = 0; - + // Convert all of the transforms up front typedef std::vector<agg::trans_affine> transforms_t; transforms_t transforms; @@ -954,23 +954,23 @@ trans *= master_transform; transforms.push_back(trans); } - + // Convert all the dashes up front typedef std::vector<std::pair<double, GCAgg::dash_t> > dashes_t; dashes_t dashes; dashes.resize(Nlinestyles); i = 0; - for (dashes_t::iterator d = dashes.begin(); + for (dashes_t::iterator d = dashes.begin(); d != dashes.end(); ++d, ++i) { convert_dashes(Py::Tuple(linestyles_obj[i]), dpi, d->second, d->first); } - + // Handle any clipping globally theRasterizer->reset_clipping(); rendererBase->reset_clipping(true); set_clipbox(cliprect, theRasterizer); bool has_clippath = render_clippath(clippath, clippath_trans); - + // Set some defaults, assuming no face or edge gc.linewidth = 0.0; facepair_t face; @@ -991,7 +991,7 @@ offset_trans.transform(&xo, &yo); trans *= agg::trans_affine_translation(xo, yo); } - + if (Nfacecolors) { size_t fi = i % Nfacecolors; face.second = agg::rgba(*(double*)PyArray_GETPTR2(facecolors, fi, 0), @@ -999,7 +999,7 @@ *(double*)PyArray_GETPTR2(facecolors, fi, 2), *(double*)PyArray_GETPTR2(facecolors, fi, 3)); } - + if (Nedgecolors) { size_t ei = i % Nedgecolors; gc.color = agg::rgba(*(double*)PyArray_GETPTR2(edgecolors, ei, 0), @@ -1016,7 +1016,7 @@ gc.dashOffset = dashes[i % Nlinestyles].first; } } - + gc.isaa = bool(Py::Int(antialiaseds[i % Naa])); _draw_path(path, trans, has_clippath, face, gc, check_snap); @@ -1044,7 +1044,7 @@ m_paths(paths), m_npaths(paths.size()) { } - + inline size_t num_paths() const { return m_npaths; } @@ -1058,7 +1058,7 @@ RendererAgg::draw_path_collection(const Py::Tuple& args) { _VERBOSE("RendererAgg::draw_path_collection"); args.verify_length(13); - + //segments, trans, clipbox, colors, linewidths, antialiaseds agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[0]); Py::Object cliprect = args[1]; @@ -1108,7 +1108,7 @@ QuadMeshPathIterator(size_t m, size_t n, PyArrayObject* coordinates) : m_iterator(0), m_m(m), m_n(n), m_coordinates(coordinates) { } - + static const size_t offsets[5][2]; inline unsigned vertex(unsigned idx, double* x, double* y) { @@ -1127,7 +1127,7 @@ inline void rewind(unsigned path_id) { m_iterator = path_id; } - + inline unsigned total_vertices() { return 5; } @@ -1146,14 +1146,14 @@ if (!coordinates_array) { throw Py::ValueError("Invalid coordinates array."); } - + PyArray_Dims shape; npy_intp dims[] = { meshHeight + 1, meshWidth + 1, 2 }; shape.ptr = dims; shape.len = 3; m_coordinates = (PyArrayObject*)PyArray_Newshape(coordinates_array, &shape, PyArray_CORDER); } - + inline ~QuadMeshGenerator() { Py_XDECREF(m_coordinates); } @@ -1178,7 +1178,7 @@ RendererAgg::draw_quad_mesh(const Py::Tuple& args) { _VERBOSE("RendererAgg::draw_quad_mesh"); args.verify_length(12); - + //segments, trans, clipbox, colors, linewidths, antialiaseds agg::trans_affine master_transform = py_to_agg_transformation_matrix(args[0]); Py::Object cliprect = args[1]; @@ -1192,7 +1192,7 @@ Py::Object facecolors_obj = args[9]; bool antialiased = (bool)Py::Int(args[10]); bool showedges = (bool)Py::Int(args[11]); - + QuadMeshGenerator path_generator(mesh_width, mesh_height, coordinates); Py::SeqBase<Py::Object> transforms_obj; @@ -1238,10 +1238,10 @@ Py::Object RendererAgg::write_rgba(const Py::Tuple& args) { _VERBOSE("RendererAgg::write_rgba"); - + args.verify_length(1); std::string fname = Py::String(args[0]); - + std::ofstream of2( fname.c_str(), std::ios::binary|std::ios::out); for (size_t i=0; i<NUMBYTES; i++) { of2.write((char*)&(pixBuffer[i]), sizeof(char)); @@ -1253,7 +1253,7 @@ PyObject* py_file_obj = (PyObject*)png_get_io_ptr(png_ptr); PyObject* write_method = PyObject_GetAttrString(py_file_obj, "write"); PyObject_CallFunction(write_method, "s#", data, length); - + // MGDTODO: Check NULL on failure } @@ -1272,9 +1272,9 @@ RendererAgg::write_png(const Py::Tuple& args) { _VERBOSE("RendererAgg::write_png"); - + args.verify_length(1, 2); - + FILE *fp = NULL; Py::Object py_fileobj = Py::Object(args[0]); if (py_fileobj.isString()) { @@ -1294,34 +1294,34 @@ png_bytep *row_pointers = NULL; png_structp png_ptr = NULL; png_infop info_ptr = NULL; - + try { struct png_color_8_struct sig_bit; png_uint_32 row; - + row_pointers = new png_bytep[height]; for (row = 0; row < height; ++row) { row_pointers[row] = pixBuffer + row * width * 4; } - + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if (png_ptr == NULL) { throw Py::RuntimeError("Could not create write struct"); } - + info_ptr = png_create_info_struct(png_ptr); if (info_ptr == NULL) { throw Py::RuntimeError("Could not create info struct"); } - + if (setjmp(png_ptr->jmpbuf)) { throw Py::RuntimeError("Error building image"); } - + if (fp) { png_init_io(png_ptr, fp); } else { - png_set_write_fn(png_ptr, (void*)py_fileobj.ptr(), + png_set_write_fn(png_ptr, (void*)py_fileobj.ptr(), &write_png_data, &flush_png_data); } png_set_IHDR(png_ptr, info_ptr, @@ -1335,7 +1335,7 @@ size_t dots_per_meter = (size_t)(dpi / (2.54 / 100.0)); png_set_pHYs(png_ptr, info_ptr, dots_per_meter, dots_per_meter, PNG_RESOLUTION_METER); } - + // this a a color image! sig_bit.gray = 0; sig_bit.red = 8; @@ -1344,23 +1344,23 @@ /* if the image has an alpha channel then */ sig_bit.alpha = 8; png_set_sBIT(png_ptr, info_ptr, &sig_bit); - + png_write_info(png_ptr, info_ptr); png_write_image(png_ptr, row_pointers); png_write_end(png_ptr, info_ptr); - + /* Changed calls to png_destroy_write_struct to follow http://www.libpng.org/pub/png/libpng-manual.txt. This ensures the info_ptr memory is released. */ - + } catch (...) { if (fp) fclose(fp); delete [] row_pointers; if (png_ptr && info_ptr) png_destroy_write_struct(&png_ptr, &info_ptr); throw; } - + png_destroy_write_struct(&png_ptr, &info_ptr); delete [] row_pointers; if (fp) fclose(fp); @@ -1372,9 +1372,9 @@ Py::Object RendererAgg::tostring_rgb(const Py::Tuple& args) { //"Return the rendered buffer as an RGB string"; - + _VERBOSE("RendererAgg::tostring_rgb"); - + args.verify_length(0); int row_len = width*3; unsigned char* buf_tmp = new unsigned char[row_len * height]; @@ -1387,10 +1387,10 @@ width, height, row_len); - + agg::color_conv(&renderingBufferTmp, renderingBuffer, agg::color_conv_rgba32_to_rgb24()); - - + + //todo: how to do this with native CXX PyObject* o = Py_BuildValue("s#", buf_tmp, @@ -1403,9 +1403,9 @@ Py::Object RendererAgg::tostring_argb(const Py::Tuple& args) { //"Return the rendered buffer as an RGB string"; - + _VERBOSE("RendererAgg::tostring_argb"); - + args.verify_length(0); int row_len = width*4; unsigned char* buf_tmp = new unsigned char[row_len * height]; @@ -1418,10 +1418,10 @@ width, height, row_len); - + agg::color_conv(&renderingBufferTmp, renderingBuffer, agg::color_conv_rgba32_to_argb32()); - - + + //todo: how to do this with native CXX PyObject* o = Py_BuildValue("s#", buf_tmp, @@ -1433,9 +1433,9 @@ Py::Object RendererAgg::tostring_bgra(const Py::Tuple& args) { //"Return the rendered buffer as an RGB string"; - + _VERBOSE("RendererAgg::tostring_bgra"); - + args.verify_length(0); int row_len = width*4; unsigned char* buf_tmp = new unsigned char[row_len * height]; @@ -1448,10 +1448,10 @@ width, height, row_len); - + agg::color_conv(&renderingBufferTmp, renderingBuffer, agg::color_conv_rgba32_to_bgra32()); - - + + //todo: how to do this with native CXX PyObject* o = Py_BuildValue("s#", buf_tmp, @@ -1463,9 +1463,9 @@ Py::Object RendererAgg::buffer_rgba(const Py::Tuple& args) { //"expose the rendered buffer as Python buffer object, starting from postion x,y"; - + _VERBOSE("RendererAgg::buffer_rgba"); - + args.verify_length(2); int startw = Py::Int(args[0]); int starth = Py::Int(args[1]); @@ -1479,12 +1479,12 @@ Py::Object RendererAgg::clear(const Py::Tuple& args) { //"clear the rendered buffer"; - + _VERBOSE("RendererAgg::clear"); - + args.verify_length(0); rendererBase->clear(agg::rgba(1, 1, 1, 0)); - + return Py::Object(); } @@ -1492,12 +1492,12 @@ agg::rgba RendererAgg::rgb_to_color(const Py::SeqBase<Py::Object>& rgb, double alpha) { _VERBOSE("RendererAgg::rgb_to_color"); - + double r = Py::Float(rgb[0]); double g = Py::Float(rgb[1]); double b = Py::Float(rgb[2]); return agg::rgba(r, g, b, alpha); - + } @@ -1510,8 +1510,8 @@ double p = Py::Float( points ) ; //return (int)(p*PIXELS_PER_INCH/72.0*dpi/72.0)+0.5; return (int)(p*dpi/72.0)+0.5; - - + + } double @@ -1524,10 +1524,10 @@ RendererAgg::~RendererAgg() { - + _VERBOSE("RendererAgg::~RendererAgg"); - - + + delete slineP8; delete slineBin; delete theRasterizer; @@ -1536,7 +1536,7 @@ delete rendererBase; delete pixFmt; delete renderingBuffer; - + delete alphaMask; delete alphaMaskRenderingBuffer; delete [] alphaBuffer; @@ -1545,23 +1545,23 @@ delete rendererBaseAlphaMask; delete rendererAlphaMask; delete scanlineAlphaMask; - + } /* ------------ module methods ------------- */ Py::Object _backend_agg_module::new_renderer (const Py::Tuple &args, const Py::Dict &kws) { - + if (args.length() != 3 ) { throw Py::RuntimeError("Incorrect # of args to RendererAgg(width, height, dpi)."); } - + int debug; if ( kws.hasKey("debug") ) debug = Py::Int( kws["debug"] ); else debug=0; - + int width = Py::Int(args[0]); int height = Py::Int(args[1]); double dpi = Py::Float(args[2]); @@ -1572,7 +1572,7 @@ void BufferRegion::init_type() { behaviors().name("BufferRegion"); behaviors().doc("A wrapper to pass agg buffer objects to and from the python level"); - + add_varargs_method("to_string", &BufferRegion::to_string, "to_string()"); } @@ -1582,7 +1582,7 @@ { behaviors().name("RendererAgg"); behaviors().doc("The agg backend extension module"); - + add_varargs_method("draw_path", &RendererAgg::draw_path, "draw_path(gc, path, transform, rgbFace)\n"); add_varargs_method("draw_path_collection", &RendererAgg::draw_path_collection, @@ -1620,12 +1620,12 @@ init_backend_agg(void) { //static _backend_agg_module* _backend_agg = new _backend_agg_module; - + _VERBOSE("init_backend_agg"); - + import_array(); - + static _backend_agg_module* _backend_agg = NULL; _backend_agg = new _backend_agg_module; - + }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 13:29:27
|
Revision: 4391 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4391&view=rev Author: mdboom Date: 2007-11-20 05:29:20 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Fix problem with 0-line width drawing in Postscript. (Thanks Ben North). Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_ps.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2007-11-20 13:20:54 UTC (rev 4390) +++ trunk/matplotlib/lib/matplotlib/backends/backend_ps.py 2007-11-20 13:29:20 UTC (rev 4391) @@ -947,6 +947,9 @@ if self.linewidth > 0: write("stroke\n") + else: + write("newpath\n") + if cliprect: write("grestore\n") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-20 13:20:57
|
Revision: 4390 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4390&view=rev Author: jswhit Date: 2007-11-20 05:20:54 -0800 (Tue, 20 Nov 2007) Log Message: ----------- docstring tweak. Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-20 13:18:22 UTC (rev 4389) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-20 13:20:54 UTC (rev 4390) @@ -167,8 +167,8 @@ The following parameters are map projection parameters which all default to None. Not all parameters are used by all projections, some are ignored. - The module variable 'projection_params' lists which parameters apply - to which projections. + The module variable 'projection_params' is a dictionary which + lists which parameters apply to which projections. lat_ts - latitude of true scale for mercator projection, optional for stereographic projection. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <js...@us...> - 2007-11-20 13:18:23
|
Revision: 4389 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4389&view=rev Author: jswhit Date: 2007-11-20 05:18:22 -0800 (Tue, 20 Nov 2007) Log Message: ----------- added module variable 'projection_params' - a dict containing the relevant projection parameters for each projection. Modified Paths: -------------- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py Modified: trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-20 13:14:34 UTC (rev 4388) +++ trunk/toolkits/basemap-testing/lib/matplotlib/toolkits/basemap/basemap.py 2007-11-20 13:18:22 UTC (rev 4389) @@ -53,6 +53,34 @@ supported_projections.append("'%s' = %s\n" % (_items)) supported_projections = ''.join(supported_projections) +# projection specific parameters. +projection_params = {'cyl' : 'corners only (no width/height)', + 'merc' : 'corners plus lat_ts (no width/height)', + 'tmerc' : 'lon_0,lat_0', + 'omerc' : 'lon_0,lat_0,lat_1,lat_2,lon_1,lon_2,no width/height', + 'mill' : 'corners only (no width/height)', + 'lcc' : 'lon_0,lat_0,lat_1,lat_2', + 'laea' : 'lon_0,lat_0', + 'nplaea' : 'bounding_lat,lon_0,lat_0,no corners or width/height', + 'splaea' : 'bounding_lat,lon_0,lat_0,no corners or width/height', + 'eqdc' : 'lon_0,lat_0,lat_1,lat_2', + 'aeqd' : 'lon_0,lat_0', + 'npaeqd' : 'bounding_lat,lon_0,lat_0,no corners or width/height', + 'spaeqd' : 'bounding_lat,lon_0,lat_0,no corners or width/height', + 'aea' : 'lon_0,lat_0,lat_1', + 'stere' : 'lon_0,lat_0,lat_ts', + 'npstere' : 'bounding_lat,lon_0,lat_0,no corners or width/height', + 'spstere' : 'bounding_lat,lon_0,lat_0,no corners or width/height', + 'cass' : 'lon_0,lat_0', + 'poly' : 'lon_0,lat_0', + 'ortho' : 'lon_0,lat_0', + 'geos' : 'lon_0,lat_0,satellite_height', + 'sinu' : 'lon_0,lat_0,no corners or width/height', + 'moll' : 'lon_0,lat_0,no corners or width/height', + 'robin' : 'lon_0,lat_0,no corners or width/height', + 'gnom' : 'lon_0,lat_0', + } + # The __init__ docstring is pulled out here because it is so long; # Having it in the usual place makes it hard to get from the # __init__ argument list to the code that uses the arguments. @@ -65,7 +93,8 @@ %(supported_projections)s Default is 'cyl'. - The map projection region can either be specified by setting these keywords: + For most map projections, the map projection region can either be + specified by setting these keywords: llcrnrlon - longitude of lower left hand corner of the desired map domain (degrees). llcrnrlat - latitude of lower left hand corner of the desired map domain (degrees). @@ -81,9 +110,10 @@ For 'sinu', 'moll', 'npstere', 'spstere', 'nplaea', 'splaea', 'nplaea', 'splaea', 'npaeqd', 'spaeqd' or 'robin', the values of - llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat,width and height are ignored (because - either they are computed internally, or entire globe is always plotted). For the - cylindrical projections ('cyl','merc' and 'mill'), the default is to use + llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat,width and height are ignored + (because either they are computed internally, or entire globe is + always plotted). For the cylindrical projections + ('cyl','merc' and 'mill'), the default is to use llcrnrlon=-180,llcrnrlat=-90, urcrnrlon=180 and urcrnrlat=90). For all other projections except 'ortho' and 'geos', either the lat/lon values of the corners or width and height must be specified by the user. @@ -117,9 +147,10 @@ in map projection coordinates. Default False, so parallels and meridians can be labelled instead. If parallel or meridian labelling is requested (using drawparallels and drawmeridians methods), automatic tick labelling - will be supressed even is suppress_ticks=False. Typically, you will - only want to override the default if you want to label the axes in meters - using native map projection coordinates. + will be supressed even is suppress_ticks=False. suppress_ticks=False + is useful if you want to use your own custom tick formatter, or + if you want to let matplotlib label the axes in meters + using native map projection coordinates anchor - determines how map is placed in axes rectangle (passed to axes.set_aspect). Default is 'C', which means map is centered. @@ -136,9 +167,11 @@ The following parameters are map projection parameters which all default to None. Not all parameters are used by all projections, some are ignored. + The module variable 'projection_params' lists which parameters apply + to which projections. - lat_ts - latitude of natural origin (used for mercator, and - optionally for stereographic projection). + lat_ts - latitude of true scale for mercator projection, optional + for stereographic projection. lat_1 - first standard parallel for lambert conformal, albers equal area projection and equidistant conic projections. Latitude of one of the two points on the projection centerline for oblique mercator. @@ -154,6 +187,7 @@ lon_2 - longitude of one of the two points on the projection centerline for oblique mercator. lat_0 - central latitude (y-axis origin) - used by all projections, + Must be equator for mercator projection. lon_0 - central meridian (x-axis origin) - used by all projections, boundinglat - bounding latitude for pole-centered projections (npstere,spstere, nplaea,splaea,npaeqd,spaeqd). These projections are square regions centered This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 13:18:00
|
Revision: 4387 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4387&view=rev Author: mdboom Date: 2007-11-20 05:13:22 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Speed improvement initializing mathtext parser. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/pyparsing.py Modified: trunk/matplotlib/lib/matplotlib/pyparsing.py =================================================================== --- trunk/matplotlib/lib/matplotlib/pyparsing.py 2007-11-20 04:09:55 UTC (rev 4386) +++ trunk/matplotlib/lib/matplotlib/pyparsing.py 2007-11-20 13:13:22 UTC (rev 4387) @@ -2845,22 +2845,18 @@ else: warnings.warn("Invalid argument to oneOf, expected string or list", SyntaxWarning, stacklevel=2) - + + symbols.sort(reverse=True) i = 0 while i < len(symbols)-1: cur = symbols[i] - for j,other in enumerate(symbols[i+1:]): + for j, other in enumerate(symbols[i+1:]): if ( isequal(other, cur) ): del symbols[i+j+1] + else: break - elif ( masks(cur, other) ): - del symbols[i+j+1] - symbols.insert(i,other) - cur = other - break - else: - i += 1 - + i += 1 + if not caseless and useRegex: #~ print strs,"->", "|".join( [ _escapeRegexChars(sym) for sym in symbols] ) try: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <md...@us...> - 2007-11-20 13:17:55
|
Revision: 4388 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4388&view=rev Author: mdboom Date: 2007-11-20 05:14:34 -0800 (Tue, 20 Nov 2007) Log Message: ----------- Reverting imshow -- these issues are being dealt with by Eric Firing on the trunk. Modified Paths: -------------- branches/transforms/lib/matplotlib/axes.py Modified: branches/transforms/lib/matplotlib/axes.py =================================================================== --- branches/transforms/lib/matplotlib/axes.py 2007-11-20 13:13:22 UTC (rev 4387) +++ branches/transforms/lib/matplotlib/axes.py 2007-11-20 13:14:34 UTC (rev 4388) @@ -4386,9 +4386,7 @@ #### plotting z(x,y): imshow, pcolor and relatives, contour - def imshow(self, I, - X = None, - Y = None, + def imshow(self, X, cmap = None, norm = None, aspect=None, @@ -4405,24 +4403,18 @@ **kwargs): """ - IMSHOW(I, X=None, Y=None, cmap=None, norm=None, aspect=None, - interpolation=None, alpha=1.0, vmin=None, vmax=None, - origin=None, extent=None) + IMSHOW(X, cmap=None, norm=None, aspect=None, interpolation=None, + alpha=1.0, vmin=None, vmax=None, origin=None, extent=None) - IMSHOW(I) - plot image I to current axes, resampling to scale to axes - size (I may be numpy array or PIL image) + IMSHOW(X) - plot image X to current axes, resampling to scale to axes + size (X may be numarray/Numeric array or PIL image) - IMSHOW(I, X, Y) - plot image I to current axes, with - nonuniform X and Y axes. (I, X and Y may be - numarray/Numeric array or PIL image) - - IMSHOW(I, X, Y, **kwargs) - Use keyword args to control image - scaling, colormapping etc. See - below for details + IMSHOW(X, **kwargs) - Use keyword args to control image scaling, + colormapping etc. See below for details - Display the image in I to current axes. I may be a float array, a - uint8 array or a PIL image. If I is an array, I can have the following + Display the image in X to current axes. X may be a float array, a + uint8 array or a PIL image. If X is an array, X can have the following shapes: MxN : luminance (grayscale, float array only) @@ -4434,10 +4426,6 @@ The value for each component of MxNx3 and MxNx4 float arrays should be in the range 0.0 to 1.0; MxN float arrays may be normalised. - X and/or Y may be provided to specify a non-uniform image - grid. Each element of the X or Y arrays is the width or height - of the corresponding pixel in the given image. - A image.AxesImage instance is returned The following kwargs are allowed: @@ -4502,24 +4490,11 @@ if cmap is not None: assert(isinstance(cmap, mcolors.Colormap)) if aspect is None: aspect = rcParams['image.aspect'] self.set_aspect(aspect) - - if X is None and Y is None: - im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent, - filternorm=filternorm, - filterrad=filterrad, **kwargs) - - im.set_data(I) - else: - if X is None: - X = npy.arange(I.shape[1]) - if Y is None: - Y = npy.arange(I.shape[0]) - im = mimage.NonUniformImage(self, cmap=cmap, norm=norm, - interpolation=interpolation, - origin=origin, extent=extent, - filternorm=filternorm, - filterrad=filterrad, **kwargs) - im.set_data(X, Y, I) + im = mimage.AxesImage(self, cmap, norm, interpolation, origin, extent, + filternorm=filternorm, + filterrad=filterrad, **kwargs) + + im.set_data(X) im.set_alpha(alpha) self._set_artist_props(im) im.set_clip_path(self.axesPatch) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |