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: <md...@us...> - 2008-12-08 16:10:52
|
Revision: 6512
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6512&view=rev
Author: mdboom
Date: 2008-12-08 16:10:50 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Fix tick alignment in colorbars.
Modified Paths:
--------------
trunk/matplotlib/src/_backend_agg.cpp
Modified: trunk/matplotlib/src/_backend_agg.cpp
===================================================================
--- trunk/matplotlib/src/_backend_agg.cpp 2008-12-08 15:30:56 UTC (rev 6511)
+++ trunk/matplotlib/src/_backend_agg.cpp 2008-12-08 16:10:50 UTC (rev 6512)
@@ -555,6 +555,8 @@
if (has_clippath) {
while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
+ x = mpl_round(x); y = mpl_round(y);
+
pixfmt_amask_type pfa(pixFmt, alphaMask);
amask_ren_type r(pfa);
amask_aa_renderer_type ren(r);
@@ -570,6 +572,8 @@
}
} else {
while (path_transformed.vertex(&x, &y) != agg::path_cmd_stop) {
+ x = mpl_round(x); y = mpl_round(y);
+
if (face.first) {
rendererAA.color(face.second);
sa.init(fillCache, fillSize, x, y);
@@ -1179,7 +1183,7 @@
PathListGenerator path_generator(paths);
try {
- _draw_path_collection_generic<PathListGenerator, 1, 1>
+ _draw_path_collection_generic<PathListGenerator, 0, 1>
(master_transform,
cliprect,
clippath,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jd...@us...> - 2008-12-08 15:30:58
|
Revision: 6511
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6511&view=rev
Author: jdh2358
Date: 2008-12-08 15:30:56 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
added rc param to control legend fancybox
Modified Paths:
--------------
trunk/matplotlib/examples/pylab_examples/legend_demo.py
trunk/matplotlib/examples/pylab_examples/legend_demo3.py
trunk/matplotlib/lib/matplotlib/legend.py
trunk/matplotlib/lib/matplotlib/rcsetup.py
trunk/matplotlib/matplotlibrc.template
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo.py 2008-12-08 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo.py 2008-12-08 15:30:56 UTC (rev 6511)
@@ -15,7 +15,7 @@
ax = plt.subplot(111)
plt.plot(a,c,'k--',a,d,'k:',a,c+d,'k')
plt.legend(('Model length', 'Data length', 'Total message length'),
- 'upper center', shadow=True)
+ 'upper center', shadow=True, fancybox=True)
plt.ylim([-1,20])
plt.grid(False)
plt.xlabel('Model complexity --->')
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo3.py 2008-12-08 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo3.py 2008-12-08 15:30:56 UTC (rev 6511)
@@ -1,5 +1,6 @@
#!/usr/bin/env python
-
+import matplotlib
+matplotlib.rcParams['legend.fancybox'] = True
import matplotlib.pyplot as plt
import numpy as np
import pylab
@@ -22,7 +23,7 @@
ax3 = plt.subplot(3,1,3)
myplot(ax3)
-ax3.legend(loc=1, ncol=4, mode="expand", fancybox=False, shadow=True)
+ax3.legend(loc=1, ncol=4, mode="expand", shadow=True)
#title('Damped oscillation')
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-08 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-08 15:30:56 UTC (rev 6511)
@@ -63,7 +63,7 @@
loc can be a tuple of the noramilzed coordinate values with
respect its parent.
-
+
Return value is a sequence of text, line instances that make
up the legend
"""
@@ -94,15 +94,15 @@
scatterpoints = 3, # TODO: may be an rcParam
scatteryoffsets=None,
prop = None, # properties for the legend texts
-
+
# the following dimensions are in axes coords
pad = None, # deprecated; use borderpad
- labelsep = None, # deprecated; use labelspacing
- handlelen = None, # deprecated; use handlelength
- handletextsep = None, # deprecated; use handletextpad
+ labelsep = None, # deprecated; use labelspacing
+ handlelen = None, # deprecated; use handlelength
+ handletextsep = None, # deprecated; use handletextpad
axespad = None, # deprecated; use borderaxespad
- # spacing & pad defined as a fractionof the font-size
+ # spacing & pad defined as a fractionof the font-size
borderpad = None, # the whitespace inside the legend border
labelspacing=None, #the vertical space between the legend entries
handlelength=None, # the length of the legend handles
@@ -113,7 +113,7 @@
ncol=1, # number of columns
mode=None, # mode for horizontal distribution of columns. None, "expand"
- fancybox=True,
+ fancybox=None, # True use a fancy box, false use a rounded box, none use rc
shadow = None,
):
"""
@@ -131,7 +131,7 @@
numpoints the number of points in the legend line
prop the font property
markerscale the relative size of legend markers vs. original
- fancybox if True, draw a frame with a round fancybox.
+ fancybox if True, draw a frame with a round fancybox. If None, use rc
shadow if True, draw a shadow behind legend
scatteryoffsets a list of yoffsets for scatter symbols in legend
@@ -144,7 +144,7 @@
The dimensions of pad and spacing are given as a fraction of the
fontsize. Values from rcParams will be used if None.
-
+
"""
from matplotlib.axes import Axes # local import only to avoid circularity
from matplotlib.figure import Figure # local import only to avoid circularity
@@ -172,7 +172,7 @@
# Take care the deprecated keywords
deprecated_kwds = {"pad":"borderpad",
"labelsep":"labelspacing",
- "handlelen":"handlelength",
+ "handlelen":"handlelength",
"handletextsep":"handletextpad",
"axespad":"borderaxespad"}
@@ -182,7 +182,7 @@
# conversion factor
bbox = parent.bbox
axessize_fontsize = min(bbox.width, bbox.height)/self.fontsize
-
+
for k, v in deprecated_kwds.items():
# use deprecated value if not None and if their newer
# counter part is None.
@@ -199,7 +199,7 @@
setattr(self, v, localdict[v])
del localdict
-
+
self._ncol = ncol
if self.numpoints <= 0:
@@ -265,6 +265,9 @@
# The width and height of the legendPatch will be set (in the
# draw()) to the length that includes the padding. Thus we set
# pad=0 here.
+ if fancybox is None:
+ fancybox = rcParams["legend.fancybox"]
+
if fancybox == True:
self.legendPatch.set_boxstyle("round",pad=0,
rounding_size=0.2)
@@ -318,7 +321,7 @@
# find_offset function will be provided to _legend_box and
# _legend_box will draw itself at the location of the return
- # value of the find_offset.
+ # value of the find_offset.
if self._loc == 0:
self._legend_box.set_offset(self._findoffset_best)
else:
@@ -339,7 +342,7 @@
if self.shadow:
shadow = Shadow(self.legendPatch, 2, -2)
shadow.draw(renderer)
-
+
self.legendPatch.draw(renderer)
self._legend_box.draw(renderer)
@@ -360,7 +363,7 @@
Initiallize the legend_box. The legend_box is an instance of
the OffsetBox, which is packed with legend handles and
texts. Once packed, their location is calculated during the
- drawing time.
+ drawing time.
"""
# legend_box is a HPacker, horizontally packed with
@@ -371,7 +374,7 @@
# is an instance of offsetbox.TextArea which contains legend
# text.
-
+
text_list = [] # the list of text instances
handle_list = [] # the list of text instances
@@ -394,12 +397,12 @@
# The approximate height and descent of text. These values are
# only used for plotting the legend handle.
height = self._approx_text_height() * 0.7
- descent = 0.
+ descent = 0.
# each handle needs to be drawn inside a box of
# (x, y, w, h) = (0, -descent, width, height).
# And their corrdinates should be given in the display coordinates.
-
+
# The transformation of each handle will be automatically set
# to self.get_trasnform(). If the artist does not uses its
# default trasnform (eg, Collections), you need to
@@ -413,7 +416,7 @@
if npoints > 1:
# we put some pad here to compensate the size of the
# marker
- xdata = np.linspace(0.3*self.fontsize,
+ xdata = np.linspace(0.3*self.fontsize,
(self.handlelength-0.3)*self.fontsize,
npoints)
xdata_marker = xdata
@@ -484,14 +487,14 @@
size_min]
else:
sizes = (size_max-size_min)*np.linspace(0,1,self.scatterpoints)+size_min
-
+
p = type(handle)(handle.get_numsides(),
rotation=handle.get_rotation(),
sizes=sizes,
offsets=zip(xdata_marker,ydata),
transOffset=self.get_transform(),
)
-
+
p.update_from(handle)
p.set_figure(self.figure)
p.set_clip_box(None)
@@ -534,7 +537,7 @@
for h, t in handle_label[i0:i0+di]]
# minimumdescent=False for the text of the last row of the column
itemBoxes[-1].get_children()[1].set_minimumdescent(False)
-
+
# pack columnBox
columnbox.append(VPacker(pad=0,
sep=self.labelspacing*self.fontsize,
@@ -547,7 +550,7 @@
mode = "fixed"
sep = self.columnspacing*self.fontsize
-
+
self._legend_box = HPacker(pad=self.borderpad*self.fontsize,
sep=sep, align="baseline",
mode=mode,
@@ -555,8 +558,8 @@
self.texts = text_list
self.legendHandles = handle_list
-
+
def _auto_legend_data(self):
"""
Returns list of vertices and extents covered by the plot.
@@ -655,12 +658,12 @@
LC:"S",
UC:"N",
C:"C"}
-
+
c = anchor_coefs[loc]
container = parentbbox.padded(-(self.borderaxespad) * self.fontsize)
anchored_box = bbox.anchored(c, container=container)
- return anchored_box.x0, anchored_box.y0
+ return anchored_box.x0, anchored_box.y0
def _find_best_position(self, width, height, consider=None):
Modified: trunk/matplotlib/lib/matplotlib/rcsetup.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-08 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/lib/matplotlib/rcsetup.py 2008-12-08 15:30:56 UTC (rev 6511)
@@ -417,6 +417,7 @@
'polaraxes.grid' : [True, validate_bool], # display polar grid or not
#legend properties
+ 'legend.fancybox' : [False,validate_bool],
'legend.loc' : ['upper right',validate_legend_loc], # at some point, this should be changed to 'best'
'legend.isaxes' : [True,validate_bool], # this option is internally ignored - it never served any useful purpose
'legend.numpoints' : [2, validate_int], # the number of points in the legend line
Modified: trunk/matplotlib/matplotlibrc.template
===================================================================
--- trunk/matplotlib/matplotlibrc.template 2008-12-08 15:10:20 UTC (rev 6510)
+++ trunk/matplotlib/matplotlibrc.template 2008-12-08 15:30:56 UTC (rev 6511)
@@ -235,6 +235,8 @@
#grid.linewidth : 0.5 # in points
### Legend
+#legend.fancybox : False # if True, use a rounded box for the
+ # legend, else a rectangle
#legend.isaxes : True
#legend.numpoints : 2 # the number of points in the legend line
#legend.fontsize : large
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-08 15:10:22
|
Revision: 6510
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6510&view=rev
Author: jswhit
Date: 2008-12-08 15:10:20 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
use low resolution blue marble background
Modified Paths:
--------------
trunk/toolkits/basemap/examples/warpimage.py
Modified: trunk/toolkits/basemap/examples/warpimage.py
===================================================================
--- trunk/toolkits/basemap/examples/warpimage.py 2008-12-08 14:53:55 UTC (rev 6509)
+++ trunk/toolkits/basemap/examples/warpimage.py 2008-12-08 15:10:20 UTC (rev 6510)
@@ -24,7 +24,7 @@
fig=plt.figure()
# define projection centered on North America.
m = Basemap(projection='mbtfpq',lon_0=-100,resolution='l')
-m.bluemarble()
+m.bluemarble(resolution='low')
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines every 30 degrees.
@@ -38,7 +38,7 @@
# define cylindrical equidistant projection.
m = Basemap(projection='cyl',llcrnrlon=-180,llcrnrlat=-90,urcrnrlon=180,urcrnrlat=90,resolution='l')
# plot (unwarped) rgba image.
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines.
@@ -52,7 +52,7 @@
# define cylindrical equidistant projection.
m = Basemap(projection='cyl',llcrnrlon=0,llcrnrlat=-60,urcrnrlon=360,urcrnrlat=60,resolution='l')
# plot (unwarped) rgba image.
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines.
@@ -81,7 +81,7 @@
m = Basemap(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
rsphere=(6378137.00,6356752.3142),lat_1=50.,lon_0=-107.,\
resolution='i',area_thresh=1000.,projection='lcc')
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw parallels and meridians.
@@ -100,7 +100,7 @@
resolution=None,projection='omerc',\
lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55)
# plot warped rgba image.
-im = m.bluemarble()
+im = m.bluemarble(resolution='low')
# draw lat/lon grid lines every 20 degrees.
m.drawmeridians(np.arange(0,360,20),color='0.5')
m.drawparallels(np.arange(-80,81,20),color='0.5')
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-08 14:53:59
|
Revision: 6509
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6509&view=rev
Author: jswhit
Date: 2008-12-08 14:53:55 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
added low resolution option for blue marble background.
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Added Paths:
-----------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-12-08 12:52:29 UTC (rev 6508)
+++ trunk/toolkits/basemap/Changelog 2008-12-08 14:53:55 UTC (rev 6509)
@@ -1,4 +1,5 @@
version 0.99.2 (not yet released)
+ * added half resolution blue marble image (resolution='low')
* Made lat_ts default to 0 for mercator.
* Now can specify just lon_0 for all cylindrical projections
(to produce global map centered on lon_0).
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 12:52:29 UTC (rev 6508)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 14:53:55 UTC (rev 6509)
@@ -3135,17 +3135,17 @@
im = self.imshow(rgba,interpolation='nearest',ax=ax,**kwargs)
return im
- def bluemarble(self,ax=None):
+ def bluemarble(self,ax=None,resolution='high'):
"""
display blue marble image (from http://visibleearth.nasa.gov)
as map background.
"""
if ax is not None:
- self.warpimage(image='bluemarble',ax=ax)
+ self.warpimage(image='bluemarble',ax=ax,resolution=resolution)
else:
- self.warpimage(image='bluemarble')
+ self.warpimage(image='bluemarble',resolution=resolution)
- def warpimage(self,image="bluemarble",**kwargs):
+ def warpimage(self,image="bluemarble",resolution='high',**kwargs):
"""
Display an image (filename given by ``image`` keyword) as a map background.
If image is a URL (starts with 'http'), it is downloaded to a temp
@@ -3181,7 +3181,10 @@
# default image file is blue marble next generation
# from NASA (http://visibleearth.nasa.gov).
if image == "bluemarble":
- file = os.path.join(basemap_datadir,'bmng.jpg')
+ if resolution == 'low':
+ file = os.path.join(basemap_datadir,'bmng_low.jpg')
+ else:
+ file = os.path.join(basemap_datadir,'bmng.jpg')
else:
file = image
# if image is same as previous invocation, used cached data.
Added: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/data/bmng_low.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-08 12:52:33
|
Revision: 6508
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6508&view=rev
Author: jswhit
Date: 2008-12-08 12:52:29 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
lat_ts now defaults to 0 for mercator.
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-12-08 12:44:41 UTC (rev 6507)
+++ trunk/toolkits/basemap/Changelog 2008-12-08 12:52:29 UTC (rev 6508)
@@ -1,4 +1,5 @@
version 0.99.2 (not yet released)
+ * Made lat_ts default to 0 for mercator.
* Now can specify just lon_0 for all cylindrical projections
(to produce global map centered on lon_0).
* Added save_background.py example, showing how to re-use
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 12:44:41 UTC (rev 6507)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 12:52:29 UTC (rev 6508)
@@ -261,9 +261,10 @@
================ ====================================================
Keyword Description
================ ====================================================
- lat_ts latitude of true scale.
- optional for stereographic projection.
- mandatory for mercator projection.
+ lat_ts latitude of true scale. Optional for stereographic
+ and mercator projections.
+ default is lat_0 for stereographic projection.
+ default is 0 for mercator projection.
lat_1 first standard parallel for lambert conformal,
albers equal area and equidistant conic.
Latitude of one of the two points on the projection
@@ -285,7 +286,7 @@
not be rotated to true North. Default is False
(projection coordinates are automatically rotated).
lat_0 central latitude (y-axis origin) - used by all
- projections, Must be equator for mercator projection.
+ projections.
lon_0 central meridian (x-axis origin) - used by all
projections.
boundinglat bounding latitude for pole-centered projections
@@ -624,6 +625,10 @@
self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
elif projection in _cylproj:
+ if projection == 'merc':
+ if lat_ts is None:
+ lat_ts = 0.
+ projparams['lat_ts']=lat_ts
if not using_corners:
llcrnrlat = -90.
urcrnrlat = 90.
@@ -634,8 +639,7 @@
llcrnrlon = -180.
urcrnrlon = 180
if projection == 'merc':
- if lat_ts is None:
- raise ValueError, 'must specify lat_ts for Mercator basemap'
+ if lat_ts is None: lat_ts = 0.
# clip plot region to be within -89.99S to 89.99N
# (mercator is singular at poles)
if llcrnrlat < -89.99: llcrnrlat = -89.99
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-08 12:44:46
|
Revision: 6507
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6507&view=rev
Author: jswhit
Date: 2008-12-08 12:44:41 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
now can specify just lon_0 to define global cylindrical projection
centered on lon_0.
Modified Paths:
--------------
trunk/toolkits/basemap/Changelog
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/Changelog
===================================================================
--- trunk/toolkits/basemap/Changelog 2008-12-08 12:31:06 UTC (rev 6506)
+++ trunk/toolkits/basemap/Changelog 2008-12-08 12:44:41 UTC (rev 6507)
@@ -1,4 +1,6 @@
version 0.99.2 (not yet released)
+ * Now can specify just lon_0 for all cylindrical projections
+ (to produce global map centered on lon_0).
* Added save_background.py example, showing how to re-use
a map background without redrawing coastlines.
* Added embedding_map_in_wx.py example (courtesy of
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 12:31:06 UTC (rev 6506)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-08 12:44:41 UTC (rev 6507)
@@ -261,8 +261,9 @@
================ ====================================================
Keyword Description
================ ====================================================
- lat_ts latitude of true scale for mercator projection,
+ lat_ts latitude of true scale.
optional for stereographic projection.
+ mandatory for mercator projection.
lat_1 first standard parallel for lambert conformal,
albers equal area and equidistant conic.
Latitude of one of the two points on the projection
@@ -532,24 +533,6 @@
llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat = _choosecorners(width,height,**projparams)
self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- elif projection == 'merc':
- if lat_ts is None:
- raise ValueError, 'must specify lat_ts for Mercator basemap'
- # clip plot region to be within -89.99S to 89.99N
- # (mercator is singular at poles)
- if not using_corners:
- llcrnrlon = -180.
- llcrnrlat = -90.
- urcrnrlon = 180
- urcrnrlat = 90.
- if llcrnrlat < -89.99: llcrnrlat = -89.99
- if llcrnrlat > 89.99: llcrnrlat = 89.99
- if urcrnrlat < -89.99: urcrnrlat = -89.99
- if urcrnrlat > 89.99: urcrnrlat = 89.99
- self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
- self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- if width is not None or height is not None:
- print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection]
elif projection in ['tmerc','gnom','cass','poly'] :
if projection == 'gnom' and not projparams.has_key('R'):
raise ValueError, 'gnomonic projection only works for perfect spheres - not ellipsoids'
@@ -640,26 +623,29 @@
llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat = _choosecorners(width,height,**projparams)
self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- elif projection in ['mill','gall']:
+ elif projection in _cylproj:
if not using_corners:
- llcrnrlon = -180.
llcrnrlat = -90.
- urcrnrlon = 180
urcrnrlat = 90.
+ if lon_0 is not None:
+ llcrnrlon = lon_0-180.
+ urcrnrlon = lon_0+180.
+ else:
+ llcrnrlon = -180.
+ urcrnrlon = 180
+ if projection == 'merc':
+ if lat_ts is None:
+ raise ValueError, 'must specify lat_ts for Mercator basemap'
+ # clip plot region to be within -89.99S to 89.99N
+ # (mercator is singular at poles)
+ if llcrnrlat < -89.99: llcrnrlat = -89.99
+ if llcrnrlat > 89.99: llcrnrlat = 89.99
+ if urcrnrlat < -89.99: urcrnrlat = -89.99
+ if urcrnrlat > 89.99: urcrnrlat = 89.99
self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
if width is not None or height is not None:
print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection]
- elif projection == 'cyl':
- if not using_corners:
- llcrnrlon = -180.
- llcrnrlat = -90.
- urcrnrlon = 180
- urcrnrlat = 90.
- self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat
- self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat
- if width is not None or height is not None:
- print 'warning: width and height keywords ignored for %s projection' % _projnames[self.projection]
else:
raise ValueError(_unsupported_projection % projection)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2008-12-08 12:31:08
|
Revision: 6506
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6506&view=rev
Author: jouni
Date: 2008-12-08 12:31:06 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Other part of symlog bugfix (and deactivating an experimental type1font that slipped in by accident)
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/scale.py
trunk/matplotlib/lib/matplotlib/type1font.py
Modified: trunk/matplotlib/lib/matplotlib/scale.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/scale.py 2008-12-08 12:26:53 UTC (rev 6505)
+++ trunk/matplotlib/lib/matplotlib/scale.py 2008-12-08 12:31:06 UTC (rev 6506)
@@ -329,6 +329,7 @@
self._linadjust = linthresh / (np.log(linthresh) / self._log_base)
def transform(self, a):
+ a = np.asarray(a)
return np.where(a <= self._log_linthresh,
np.where(a >= -self._log_linthresh,
a * self._linadjust,
Modified: trunk/matplotlib/lib/matplotlib/type1font.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/type1font.py 2008-12-08 12:26:53 UTC (rev 6505)
+++ trunk/matplotlib/lib/matplotlib/type1font.py 2008-12-08 12:31:06 UTC (rev 6506)
@@ -29,7 +29,7 @@
finally:
file.close()
self.parts = self._split(data)
- self._parse()
+ #self._parse()
def _read(self, file):
rawdata = file.read()
@@ -180,5 +180,5 @@
font = Type1Font(sys.argv[1])
parts = font.parts
print len(parts[0]), len(parts[1]), len(parts[2])
- print parts[0][font.enc_starts:font.enc_ends]
+ #print parts[0][font.enc_starts:font.enc_ends]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jo...@us...> - 2008-12-08 12:26:58
|
Revision: 6505
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6505&view=rev
Author: jouni
Date: 2008-12-08 12:26:53 +0000 (Mon, 08 Dec 2008)
Log Message:
-----------
Fix SymmetricalLogLocator bug that caused platform-specific behavior
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/scale.py
trunk/matplotlib/lib/matplotlib/type1font.py
Modified: trunk/matplotlib/lib/matplotlib/scale.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/scale.py 2008-12-07 20:52:13 UTC (rev 6504)
+++ trunk/matplotlib/lib/matplotlib/scale.py 2008-12-08 12:26:53 UTC (rev 6505)
@@ -301,7 +301,8 @@
self._linadjust = (np.log(linthresh) / self._log_base) / linthresh
def transform(self, a):
- sign = np.sign(np.asarray(a))
+ a = np.asarray(a)
+ sign = np.sign(a)
masked = ma.masked_inside(a, -self.linthresh, self.linthresh, copy=False)
log = sign * ma.log(np.abs(masked)) / self._log_base
if masked.mask.any():
Modified: trunk/matplotlib/lib/matplotlib/type1font.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/type1font.py 2008-12-07 20:52:13 UTC (rev 6504)
+++ trunk/matplotlib/lib/matplotlib/type1font.py 2008-12-08 12:26:53 UTC (rev 6505)
@@ -17,6 +17,7 @@
Systems Incorporated, third printing, v1.1, 1993. ISBN 0-201-57044-0.
"""
+import re
import struct
class Type1Font(object):
@@ -28,6 +29,7 @@
finally:
file.close()
self.parts = self._split(data)
+ self._parse()
def _read(self, file):
rawdata = file.read()
@@ -97,8 +99,86 @@
return data[:len1], binary, data[idx:]
+ _whitespace = re.compile(r'[\0\t\r\014\n ]+')
+ _delim = re.compile(r'[()<>[]{}/%]')
+ _token = re.compile(r'/{0,2}[^]\0\t\r\v\n ()<>{}/%[]+')
+ _comment = re.compile(r'%[^\r\n\v]*')
+ _instring = re.compile(r'[()\\]')
+ def _parse(self):
+ """
+ A very limited kind of parsing to find the Encoding of the
+ font.
+ """
+ def tokens(text):
+ """
+ Yield pairs (position, token), ignoring comments and
+ whitespace. Numbers count as tokens.
+ """
+ pos = 0
+ while pos < len(text):
+ match = self._comment.match(text[pos:]) or self._whitespace.match(text[pos:])
+ if match:
+ pos += match.end()
+ elif text[pos] == '(':
+ start = pos
+ pos += 1
+ depth = 1
+ while depth:
+ match = self._instring.search(text[pos:])
+ if match is None: return
+ if match.group() == '(':
+ depth += 1
+ pos += 1
+ elif match.group() == ')':
+ depth -= 1
+ pos += 1
+ else:
+ pos += 2
+ yield (start, text[start:pos])
+ elif text[pos:pos+2] in ('<<', '>>'):
+ yield (pos, text[pos:pos+2])
+ pos += 2
+ elif text[pos] == '<':
+ start = pos
+ pos += text[pos:].index('>')
+ yield (start, text[start:pos])
+ else:
+ match = self._token.match(text[pos:])
+ if match:
+ yield (pos, match.group())
+ pos += match.end()
+ else:
+ yield (pos, text[pos])
+ pos += 1
+
+ enc_starts, enc_ends = None, None
+ state = 0
+ # State transitions:
+ # 0 -> /Encoding -> 1
+ # 1 -> StandardEncoding -> 2 -> def -> (ends)
+ # 1 -> dup -> 4 -> put -> 5
+ # 5 -> dup -> 4 -> put -> 5
+ # 5 -> def -> (ends)
+ for pos,token in tokens(self.parts[0]):
+ if state == 0 and token == '/Encoding':
+ enc_starts = pos
+ state = 1
+ elif state == 1 and token == 'StandardEncoding':
+ state = 2
+ elif state in (2,5) and token == 'def':
+ enc_ends = pos+3
+ break
+ elif state in (1,5) and token == 'dup':
+ state = 4
+ elif state == 4 and token == 'put':
+ state = 5
+ self.enc_starts, self.enc_ends = enc_starts, enc_ends
+
+
if __name__ == '__main__':
import sys
font = Type1Font(sys.argv[1])
parts = font.parts
print len(parts[0]), len(parts[1]), len(parts[2])
+ print parts[0][font.enc_starts:font.enc_ends]
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-07 20:52:17
|
Revision: 6504
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6504&view=rev
Author: leejjoon
Date: 2008-12-07 20:52:13 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
axes.py : a slight change in the numpy version checking code
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-07 20:40:12 UTC (rev 6503)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-07 20:52:13 UTC (rev 6504)
@@ -6551,8 +6551,7 @@
binsgiven = (cbook.iterable(bins) or range != None)
# check the version of the numpy
- np_version = float(".".join(np.__version__.split(".")[:2]))
- if np_version < 1.2: # version 1.1
+ if np.__version__ < "1.2": # version 1.1
hist_kwargs = dict(range=range,
normed=bool(normed), new=True)
else: # version 1.2 and later, drop new=True
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-07 20:40:17
|
Revision: 6503
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6503&view=rev
Author: leejjoon
Date: 2008-12-07 20:40:12 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
drop "new" keyword of np.histogram() for numpy 1.2 or later
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-06 23:17:10 UTC (rev 6502)
+++ trunk/matplotlib/CHANGELOG 2008-12-07 20:40:12 UTC (rev 6503)
@@ -1,3 +1,6 @@
+2008-12-07 drop the deprecated "new" keyword of np.histogram() for
+ numpy 1.2 or later. -JJL
+
2008-12-06 Fixed a bug in svg backend that new_figure_manager()
ignores keywords arguments such as figsize, etc. -JJL
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-06 23:17:10 UTC (rev 6502)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-07 20:40:12 UTC (rev 6503)
@@ -6550,12 +6550,20 @@
# case do not autoscale axes.
binsgiven = (cbook.iterable(bins) or range != None)
+ # check the version of the numpy
+ np_version = float(".".join(np.__version__.split(".")[:2]))
+ if np_version < 1.2: # version 1.1
+ hist_kwargs = dict(range=range,
+ normed=bool(normed), new=True)
+ else: # version 1.2 and later, drop new=True
+ hist_kwargs = dict(range=range,
+ normed=bool(normed))
+
n = []
for i in xrange(len(x)):
# this will automatically overwrite bins,
# so that each histogram uses the same bins
- m, bins = np.histogram(x[i], bins, range=range,
- normed=bool(normed), new=True)
+ m, bins = np.histogram(x[i], bins, **hist_kwargs)
n.append(m)
if cumulative:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-06 23:17:16
|
Revision: 6502
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6502&view=rev
Author: leejjoon
Date: 2008-12-06 23:17:10 +0000 (Sat, 06 Dec 2008)
Log Message:
-----------
Fixed a small bug in svg backend
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-06 14:36:35 UTC (rev 6501)
+++ trunk/matplotlib/CHANGELOG 2008-12-06 23:17:10 UTC (rev 6502)
@@ -1,3 +1,6 @@
+2008-12-06 Fixed a bug in svg backend that new_figure_manager()
+ ignores keywords arguments such as figsize, etc. -JJL
+
2008-12-05 Fixed a bug that the handlelength of the new legend class
set too short when numpoints=1 -JJL
Modified: trunk/matplotlib/lib/matplotlib/backends/backend_svg.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-12-06 14:36:35 UTC (rev 6501)
+++ trunk/matplotlib/lib/matplotlib/backends/backend_svg.py 2008-12-06 23:17:10 UTC (rev 6502)
@@ -27,7 +27,7 @@
def new_figure_manager(num, *args, **kwargs):
FigureClass = kwargs.pop('FigureClass', Figure)
- thisFig = FigureClass(*args)
+ thisFig = FigureClass(*args, **kwargs)
canvas = FigureCanvasSVG(thisFig)
manager = FigureManagerSVG(canvas, num)
return manager
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-06 14:36:45
|
Revision: 6501
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6501&view=rev
Author: jswhit
Date: 2008-12-06 14:36:35 +0000 (Sat, 06 Dec 2008)
Log Message:
-----------
update blue marble URL
Modified Paths:
--------------
trunk/toolkits/basemap/examples/warpimage.py
Modified: trunk/toolkits/basemap/examples/warpimage.py
===================================================================
--- trunk/toolkits/basemap/examples/warpimage.py 2008-12-06 14:35:51 UTC (rev 6500)
+++ trunk/toolkits/basemap/examples/warpimage.py 2008-12-06 14:36:35 UTC (rev 6501)
@@ -66,7 +66,7 @@
# define orthographic projection centered on Europe.
m = Basemap(projection='ortho',lat_0=40,lon_0=40,resolution='l')
# plot a gray-scale image specified from a URL.
-im = m.warpimage("http://earthobservatory.nasa.gov/Newsroom/BlueMarble/Images/gebco_bathy.5400x2700.jpg")
+im = m.warpimage("http://earthobservatory.nasa.gov/Features/BlueMarble/Images/gebco_bathy.5400x2700.jpg")
# draw coastlines.
m.drawcoastlines(linewidth=0.5,color='0.5')
# draw lat/lon grid lines every 30 degrees.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <js...@us...> - 2008-12-06 14:36:02
|
Revision: 6500
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6500&view=rev
Author: jswhit
Date: 2008-12-06 14:35:51 +0000 (Sat, 06 Dec 2008)
Log Message:
-----------
updated blue marble URL
Modified Paths:
--------------
trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-05 21:09:42 UTC (rev 6499)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-12-06 14:35:51 UTC (rev 6500)
@@ -3167,7 +3167,7 @@
Specified image must have pixels covering the whole globe in a regular
lat/lon grid, starting and -180W and the South Pole.
Works with the global images from
- http://earthobservatory.nasa.gov/Newsroom/BlueMarble/BlueMarble_monthlies.html.
+ http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php.
Extra keyword ``ax`` can be used to override the default axis instance.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-05 21:09:45
|
Revision: 6499
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6499&view=rev
Author: leejjoon
Date: 2008-12-05 21:09:42 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Fixed a handlelegth bug in the legend class
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-05 19:30:28 UTC (rev 6498)
+++ trunk/matplotlib/CHANGELOG 2008-12-05 21:09:42 UTC (rev 6499)
@@ -1,3 +1,6 @@
+2008-12-05 Fixed a bug that the handlelength of the new legend class
+ set too short when numpoints=1 -JJL
+
2008-12-04 Added support for data with units (e.g. dates) to
Axes.fill_between. -RM
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-05 19:30:28 UTC (rev 6498)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-05 21:09:42 UTC (rev 6499)
@@ -418,7 +418,7 @@
npoints)
xdata_marker = xdata
elif npoints == 1:
- xdata = np.linspace(0, self.handlelength, 2)
+ xdata = np.linspace(0, self.handlelength*self.fontsize, 2)
xdata_marker = [0.5*self.handlelength*self.fontsize]
if isinstance(handle, Line2D):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-05 19:30:34
|
Revision: 6498
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6498&view=rev
Author: ryanmay
Date: 2008-12-05 19:30:28 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Forgot to update Changelog.
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-05 15:56:26 UTC (rev 6497)
+++ trunk/matplotlib/CHANGELOG 2008-12-05 19:30:28 UTC (rev 6498)
@@ -1,3 +1,6 @@
+2008-12-04 Added support for data with units (e.g. dates) to
+ Axes.fill_between. -RM
+
2008-12-04 Added fancybox keyword to legend. Also applied some changes
for better look, including baseline adjustment of the
multiline texts so that it is center aligned. -JJL
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-05 15:56:33
|
Revision: 6497
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6497&view=rev
Author: ryanmay
Date: 2008-12-05 15:56:26 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
Add support for data with units to Axes.fill_between().
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 14:48:45 UTC (rev 6496)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 15:56:26 UTC (rev 6497)
@@ -5578,7 +5578,15 @@
%(PolyCollection)s
"""
- x = np.asarray(x)
+ # Handle united data, such as dates
+ self._process_unit_info(xdata=x, ydata=y1, kwargs=kwargs)
+ self._process_unit_info(ydata=y2)
+
+ # Convert the arrays so we can work with them
+ x = np.asarray(self.convert_xunits(x))
+ y1 = np.asarray(self.convert_yunits(y1))
+ y2 = np.asarray(self.convert_yunits(y2))
+
if not cbook.iterable(y1):
y1 = np.ones_like(x)*y1
@@ -5588,8 +5596,6 @@
if where is None:
where = np.ones(len(x), np.bool)
- y1 = np.asarray(y1)
- y2 = np.asarray(y2)
where = np.asarray(where)
assert( (len(x)==len(y1)) and (len(x)==len(y2)) and len(x)==len(where))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mme...@us...> - 2008-12-05 14:48:51
|
Revision: 6496
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6496&view=rev
Author: mmetz_bn
Date: 2008-12-05 14:48:45 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
hist docstring updated & exception added
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 00:08:43 UTC (rev 6495)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-05 14:48:45 UTC (rev 6496)
@@ -6430,6 +6430,10 @@
are ignored. If not provided, *range* is (x.min(), x.max()).
Range has no effect if *bins* is a sequence.
+ If *bins* is a sequence or *range* is specified, autoscaling is
+ set off (*autoscale_on* is set to *False*) and the xaxis limits
+ are set to encompass the full specified bin range.
+
*normed*:
If *True*, the first element of the return tuple will
be the counts normalized to form a probability density, i.e.,
@@ -6533,6 +6537,8 @@
for i in xrange(len(x)):
tx.append( np.array(x[i]) )
x = tx
+ else:
+ raise ValueError, 'Can not use providet data to create a histogram'
# Check whether bins or range are given explicitly. In that
# case do not autoscale axes.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-05 00:08:45
|
Revision: 6495
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6495&view=rev
Author: leejjoon
Date: 2008-12-05 00:08:43 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
minor fix for legend.py
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/legend.py
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-05 00:06:26 UTC (rev 6494)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-05 00:08:43 UTC (rev 6495)
@@ -383,7 +383,7 @@
labelboxes = []
for l in labels:
- textbox = TextArea(l, textprops=label_prop
+ textbox = TextArea(l, textprops=label_prop,
multilinebaseline=True, minimumdescent=True)
text_list.append(textbox._text)
labelboxes.append(textbox)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <lee...@us...> - 2008-12-05 00:06:31
|
Revision: 6494
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6494&view=rev
Author: leejjoon
Date: 2008-12-05 00:06:26 +0000 (Fri, 05 Dec 2008)
Log Message:
-----------
some minor changes for the legend
Modified Paths:
--------------
trunk/matplotlib/CHANGELOG
trunk/matplotlib/examples/pylab_examples/legend_demo3.py
trunk/matplotlib/lib/matplotlib/legend.py
trunk/matplotlib/lib/matplotlib/offsetbox.py
Modified: trunk/matplotlib/CHANGELOG
===================================================================
--- trunk/matplotlib/CHANGELOG 2008-12-04 22:13:57 UTC (rev 6493)
+++ trunk/matplotlib/CHANGELOG 2008-12-05 00:06:26 UTC (rev 6494)
@@ -1,3 +1,7 @@
+2008-12-04 Added fancybox keyword to legend. Also applied some changes
+ for better look, including baseline adjustment of the
+ multiline texts so that it is center aligned. -JJL
+
2008-12-02 The transmuter classes in the patches.py are reorganized as
subclasses of the Style classes. A few more box and arrow
styles are added. -JJL
Modified: trunk/matplotlib/examples/pylab_examples/legend_demo3.py
===================================================================
--- trunk/matplotlib/examples/pylab_examples/legend_demo3.py 2008-12-04 22:13:57 UTC (rev 6493)
+++ trunk/matplotlib/examples/pylab_examples/legend_demo3.py 2008-12-05 00:06:26 UTC (rev 6494)
@@ -2,6 +2,7 @@
import matplotlib.pyplot as plt
import numpy as np
+import pylab
def myplot(ax):
t1 = np.arange(0.0, 1.0, 0.1)
@@ -21,7 +22,7 @@
ax3 = plt.subplot(3,1,3)
myplot(ax3)
-ax3.legend(loc=1, ncol=4, mode="expand", shadow=True)
+ax3.legend(loc=1, ncol=4, mode="expand", fancybox=False, shadow=True)
#title('Damped oscillation')
Modified: trunk/matplotlib/lib/matplotlib/legend.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/legend.py 2008-12-04 22:13:57 UTC (rev 6493)
+++ trunk/matplotlib/lib/matplotlib/legend.py 2008-12-05 00:06:26 UTC (rev 6494)
@@ -113,6 +113,7 @@
ncol=1, # number of columns
mode=None, # mode for horizontal distribution of columns. None, "expand"
+ fancybox=True,
shadow = None,
):
"""
@@ -130,6 +131,7 @@
numpoints the number of points in the legend line
prop the font property
markerscale the relative size of legend markers vs. original
+ fancybox if True, draw a frame with a round fancybox.
shadow if True, draw a shadow behind legend
scatteryoffsets a list of yoffsets for scatter symbols in legend
@@ -263,8 +265,11 @@
# The width and height of the legendPatch will be set (in the
# draw()) to the length that includes the padding. Thus we set
# pad=0 here.
- self.legendPatch.set_boxstyle("round",pad=0, #self.borderpad,
- rounding_size=0.2)
+ if fancybox == True:
+ self.legendPatch.set_boxstyle("round",pad=0,
+ rounding_size=0.2)
+ else:
+ self.legendPatch.set_boxstyle("square",pad=0)
self._set_artist_props(self.legendPatch)
@@ -378,7 +383,8 @@
labelboxes = []
for l in labels:
- textbox = TextArea(l, textprops=label_prop)
+ textbox = TextArea(l, textprops=label_prop
+ multilinebaseline=True, minimumdescent=True)
text_list.append(textbox._text)
labelboxes.append(textbox)
@@ -387,8 +393,8 @@
# The approximate height and descent of text. These values are
# only used for plotting the legend handle.
- height = self._approx_text_height() * 0.6
- descent = 0. #height/6.
+ height = self._approx_text_height() * 0.7
+ descent = 0.
# each handle needs to be drawn inside a box of
# (x, y, w, h) = (0, -descent, width, height).
@@ -440,9 +446,9 @@
legline._legmarker = legline_marker
elif isinstance(handle, Patch):
- p = Rectangle(xy=(0, -0.*descent),
+ p = Rectangle(xy=(0., 0.),
width = self.handlelength*self.fontsize,
- height=0.*descent+(height-descent)*.9,
+ height=(height-descent),
)
p.update_from(handle)
self._set_artist_props(p)
@@ -513,12 +519,12 @@
num_smallcol = self._ncol-num_largecol
# starting index of each column and number of rows in it.
- largecol = zip(range(0, num_largecol*(nrows+1), (nrows+1)),
- [nrows+1] * num_largecol)
- smallcol = zip(range(num_largecol*(nrows+1), len(handleboxes), nrows),
- [nrows] * num_smallcol)
+ largecol = safezip(range(0, num_largecol*(nrows+1), (nrows+1)),
+ [nrows+1] * num_largecol)
+ smallcol = safezip(range(num_largecol*(nrows+1), len(handleboxes), nrows),
+ [nrows] * num_smallcol)
- handle_label = zip(handleboxes, labelboxes)
+ handle_label = safezip(handleboxes, labelboxes)
columnbox = []
for i0, di in largecol+smallcol:
# pack handleBox and labelBox into itemBox
@@ -526,6 +532,8 @@
sep=self.handletextpad*self.fontsize,
children=[h, t], align="baseline")
for h, t in handle_label[i0:i0+di]]
+ # minimumdescent=False for the text of the last row of the column
+ itemBoxes[-1].get_children()[1].set_minimumdescent(False)
# pack columnBox
columnbox.append(VPacker(pad=0,
Modified: trunk/matplotlib/lib/matplotlib/offsetbox.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/offsetbox.py 2008-12-04 22:13:57 UTC (rev 6493)
+++ trunk/matplotlib/lib/matplotlib/offsetbox.py 2008-12-05 00:06:26 UTC (rev 6494)
@@ -23,9 +23,9 @@
from matplotlib.patches import bbox_artist as mbbox_artist
DEBUG=False
# for debuging use
-def bbox_artist(*kl, **kw):
+def bbox_artist(*args, **kwargs):
if DEBUG:
- mbbox_artist(*kl, **kw)
+ mbbox_artist(*args, **kwargs)
# _get_packed_offsets() and _get_aligned_offsets() are coded assuming
@@ -122,9 +122,9 @@
The OffsetBox is a simple container artist. The child artist are meant
to be drawn at a relative position to its parent.
"""
- def __init__(self, *kl, **kw):
+ def __init__(self, *args, **kwargs):
- super(OffsetBox, self).__init__(*kl, **kw)
+ super(OffsetBox, self).__init__(*args, **kwargs)
self._children = []
self._offset = (0, 0)
@@ -441,10 +441,18 @@
- def __init__(self, s, textprops=None, **kw):
+ def __init__(self, s,
+ textprops=None,
+ multilinebaseline=None,
+ minimumdescent=True,
+ ):
"""
- *s* : a string to be displayer.
- *trnaspose* : transformation matrrix
+ *s* : a string to be displayed.
+ *textprops* : property dictionary for the text
+ *multilinebaseline* : If True, baseline for multiline text is
+ adjusted so that it is (approximatedly)
+ center-aligned with singleline text.
+ *minimumdescent* : If True, the box has a minimum descent of "p".
"""
if textprops is None:
textprops = {}
@@ -462,9 +470,48 @@
self.offset_transform = mtransforms.Affine2D()
self.offset_transform.clear()
self.offset_transform.translate(0, 0)
- self._text.set_transform(self.offset_transform)
+ self._baseline_transform = mtransforms.Affine2D()
+ self._text.set_transform(self.offset_transform+self._baseline_transform)
+ self._multilinebaseline = multilinebaseline
+ self._minimumdescent = minimumdescent
+
+ def set_multilinebaseline(self, t):
+ """
+ Set multilinebaseline .
+
+ If True, baseline for multiline text is
+ adjusted so that it is (approximatedly) center-aligned with
+ singleline text.
+ """
+ self._multilinebaseline = t
+
+
+ def get_multilinebaseline(self):
+ """
+ get multilinebaseline .
+ """
+ return self._multilinebaseline
+
+
+ def set_minimumdescent(self, t):
+ """
+ Set minimumdescent .
+
+ If True, extent of the single line text is adjusted so that
+ it has minimum descent of "p"
+ """
+ self._minimumdescent = t
+
+
+ def get_minimumdescent(self):
+ """
+ get minimumdescent.
+ """
+ return self._minimumdescent
+
+
def set_transform(self, t):
"""
set_transform is ignored.
@@ -507,17 +554,34 @@
bbox, info = self._text._get_layout(renderer)
w, h = bbox.width, bbox.height
+
line = info[0][0] # first line
_, hh, dd = renderer.get_text_width_height_descent(
line, self._text._fontproperties, ismath=ismath)
- d = h-(hh-dd) # the baseline of the first line
- # for multiple lines, h or d may greater than h_ or d_.
- h_d = max(h_ - d_, h-d)
- d = max(d, d_)
- h = h_d + d
+ self._baseline_transform.clear()
+ if len(info) > 1 and self._multilinebaseline: # multi line
+ d = h-(hh-dd) # the baseline of the first line
+ d_new = 0.5 * h - 0.5 * (h_ - d_)
+
+ self._baseline_transform.translate(0, d - d_new)
+ d = d_new
+
+ else: # single line
+
+ h_d = max(h_ - d_, h-dd)
+
+ if self.get_minimumdescent():
+ ## to have a minimum descent, #i.e., "l" and "p" have same
+ ## descents.
+ d = max(dd, d_)
+ else:
+ d = dd
+
+ h = h_d + d
+
return w, h, 0., d
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ry...@us...> - 2008-12-04 22:15:57
|
Revision: 6493
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6493&view=rev
Author: ryanmay
Date: 2008-12-04 22:13:57 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
Replace tabs in indentation with spaces.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/axes.py
Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-04 21:02:36 UTC (rev 6492)
+++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-04 22:13:57 UTC (rev 6493)
@@ -5579,14 +5579,14 @@
"""
x = np.asarray(x)
- if not cbook.iterable(y1):
- y1 = np.ones_like(x)*y1
+ if not cbook.iterable(y1):
+ y1 = np.ones_like(x)*y1
- if not cbook.iterable(y2):
- y2 = np.ones_like(x)*y2
+ if not cbook.iterable(y2):
+ y2 = np.ones_like(x)*y2
- if where is None:
- where = np.ones(len(x), np.bool)
+ if where is None:
+ where = np.ones(len(x), np.bool)
y1 = np.asarray(y1)
y2 = np.asarray(y2)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-04 21:02:39
|
Revision: 6492
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6492&view=rev
Author: mdboom
Date: 2008-12-04 21:02:36 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
Trivial change
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-04 20:05:40 UTC (rev 6491)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-04 21:02:36 UTC (rev 6492)
@@ -2735,7 +2735,7 @@
hlist = Hlist(parts)
return hlist
-####
+###
##############################################################################
# MAIN
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2008-12-04 20:05:43
|
Revision: 6491
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6491&view=rev
Author: astraw
Date: 2008-12-04 20:05:40 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
git documentation: actually make 'install from git' section describe how to install
Modified Paths:
--------------
trunk/matplotlib/doc/faq/installing_faq.rst
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst 2008-12-04 19:02:48 UTC (rev 6490)
+++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-12-04 20:05:40 UTC (rev 6491)
@@ -125,6 +125,9 @@
.. _matplotlib github mirror: http://github.com/astraw/matplotlib
+To install from this cloned repository, use the commands in the
+:ref:`svn installation <install-svn>` section.
+
To update your git repository with the latest svn updates from SourceForge::
git svn rebase
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2008-12-04 19:02:58
|
Revision: 6490
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6490&view=rev
Author: astraw
Date: 2008-12-04 19:02:48 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
fix minor typo
Modified Paths:
--------------
trunk/matplotlib/doc/faq/installing_faq.rst
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst 2008-12-04 19:01:44 UTC (rev 6489)
+++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-12-04 19:02:48 UTC (rev 6490)
@@ -110,8 +110,8 @@
================
There is an experimental `matplotlib github mirror`_ of the subversion
-repository. To make a local clone it the directory ``mpl.git``, enter
-the following commands::
+repository. To make a local clone of it in the directory ``mpl.git``,
+enter the following commands::
# This will create your copy in the mpl.git directory
git clone git://github.com/astraw/matplotlib.git mpl.git
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <md...@us...> - 2008-12-04 19:01:48
|
Revision: 6489
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6489&view=rev
Author: mdboom
Date: 2008-12-04 19:01:44 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
Fix autosized angle brackets in mathtext.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/mathtext.py
Modified: trunk/matplotlib/lib/matplotlib/mathtext.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-04 18:49:16 UTC (rev 6488)
+++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-12-04 19:01:44 UTC (rev 6489)
@@ -737,7 +737,9 @@
r'\widehat' : [('rm', '\x5e'), ('ex', '\x62'), ('ex', '\x63'),
('ex', '\x64')],
r'\widetilde': [('rm', '\x7e'), ('ex', '\x65'), ('ex', '\x66'),
- ('ex', '\x67')]
+ ('ex', '\x67')],
+ r'<' : [('cal', 'h'), ('ex', 'D')],
+ r'>' : [('cal', 'i'), ('ex', 'E')]
}
for alias, target in [('\leftparen', '('),
@@ -843,8 +845,7 @@
if fontname == 'it' and isinstance(self, StixFonts):
return self._get_glyph('rm', font_class, sym, fontsize)
warn("Font '%s' does not have a glyph for '%s'" %
- (cached_font.font.postscript_name,
- sym.encode('ascii', 'backslashreplace')),
+ (fontname, sym.encode('ascii', 'backslashreplace')),
MathTextWarning)
warn("Substituting with a dummy symbol.", MathTextWarning)
fontname = 'rm'
@@ -956,6 +957,12 @@
except ValueError:
return [(fontname, sym)]
+ fix_ups = {
+ ord('<'): 0x27e8,
+ ord('>'): 0x27e9 }
+
+ uniindex = fix_ups.get(uniindex, uniindex)
+
for i in range(6):
cached_font = self._get_font(i)
glyphindex = cached_font.charmap.get(uniindex)
@@ -2068,9 +2075,9 @@
| \| / \backslash \uparrow \downarrow \updownarrow \Uparrow
\Downarrow \Updownarrow .""".split())
- _leftDelim = set(r"( [ { \lfloor \langle \lceil".split())
+ _leftDelim = set(r"( [ { < \lfloor \langle \lceil".split())
- _rightDelim = set(r") ] } \rfloor \rangle \rceil".split())
+ _rightDelim = set(r") ] } > \rfloor \rangle \rceil".split())
def __init__(self):
# All forward declarations are here
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <as...@us...> - 2008-12-04 18:49:20
|
Revision: 6488
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6488&view=rev
Author: astraw
Date: 2008-12-04 18:49:16 +0000 (Thu, 04 Dec 2008)
Log Message:
-----------
git documentation: remove README.git and add to FAQ
Modified Paths:
--------------
trunk/matplotlib/doc/faq/installing_faq.rst
Removed Paths:
-------------
trunk/matplotlib/README.git
Deleted: trunk/matplotlib/README.git
===================================================================
--- trunk/matplotlib/README.git 2008-12-04 01:58:58 UTC (rev 6487)
+++ trunk/matplotlib/README.git 2008-12-04 18:49:16 UTC (rev 6488)
@@ -1,29 +0,0 @@
-There is an experimental `matplotlib github mirror`_ of the subversion
-repository. To make a local clone it the directory ``mpl.git``, enter
-the following commands. These instructions assume you already have a
-github login (-- they use the personal gi...@gi... clone URL
-instead of the git://github.com clone URL)::
-
- # This will create your copy in the mpl.git directory
- git clone gi...@gi...:astraw/matplotlib.git mpl.git
- cd mpl.git
- git config --add remote.origin.fetch +refs/remotes/*:refs/remotes/*
- git fetch
- git svn init --trunk=trunk/matplotlib --tags=tags https://matplotlib.svn.sourceforge.net/svnroot/matplotlib
-
- # Now just get the latest svn revisions from the SourceForge SVN repository
- git svn fetch -r 6300:HEAD
-
-.. _matplotlib github mirror: http://github.com/astraw/matplotlib
-
-To update your git repository with the latest svn updates from SourceForge::
-
- git svn rebase
-
-To list what changes will be committed to svn::
-
- git svn dcommit -n
-
-To commit your changes to svn::
-
- git svn dcommit
Modified: trunk/matplotlib/doc/faq/installing_faq.rst
===================================================================
--- trunk/matplotlib/doc/faq/installing_faq.rst 2008-12-04 01:58:58 UTC (rev 6487)
+++ trunk/matplotlib/doc/faq/installing_faq.rst 2008-12-04 18:49:16 UTC (rev 6488)
@@ -106,8 +106,50 @@
> cd matplotlib
> python setup.py install
+Install from git
+================
+There is an experimental `matplotlib github mirror`_ of the subversion
+repository. To make a local clone it the directory ``mpl.git``, enter
+the following commands::
+ # This will create your copy in the mpl.git directory
+ git clone git://github.com/astraw/matplotlib.git mpl.git
+ cd mpl.git
+ git config --add remote.origin.fetch +refs/remotes/*:refs/remotes/*
+ git fetch
+ git svn init --trunk=trunk/matplotlib --tags=tags https://matplotlib.svn.sourceforge.net/svnroot/matplotlib
+
+ # Now just get the latest svn revisions from the SourceForge SVN repository
+ git svn fetch -r 6300:HEAD
+
+.. _matplotlib github mirror: http://github.com/astraw/matplotlib
+
+To update your git repository with the latest svn updates from SourceForge::
+
+ git svn rebase
+
+To list what changes will be committed to svn::
+
+ git svn dcommit -n
+
+To commit your changes to svn::
+
+ git svn dcommit
+
+A note about git write access
+-----------------------------
+
+The matplotlib developers need to figure out if there should be write
+access to the git repository. This implies using the personal URL
+(``gi...@gi...:astraw/matplotlib.git``) rather than the public URL
+(``git://github.com/astraw/matplotlib.git``) for the
+repository. However, doing so may make life complicated in the sense
+that then there are two writeable matplotlib repositories, which must
+be synced to prevent divergence. This is probably not an
+insurmountable problem, but it is a problem that the developers should
+reach a consensus about. Watch this space...
+
Backends
========
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|