SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S




1
(17)
2
(3)
3
(2)
4
(11)
5
(8)
6
(22)
7
(16)
8
(9)
9
(14)
10
(1)
11
(8)
12
(5)
13
(7)
14
(10)
15
(28)
16
(8)
17
(20)
18
(6)
19
(5)
20
(15)
21
(8)
22
(7)
23
(14)
24
(10)
25
(6)
26
(8)
27
(9)
28
(11)
29
(13)
30
(20)

Showing 22 results of 22

On Tue, Sep 6, 2011 at 12:58 PM, Benjamin Root <ben...@ou...> wrote:
>
> I don't know the full details, but the idea was that we didn't want to have
> SciPy as a dependency, so mlab was used to replicate many of the functions
> found in SciPy. I don't know why the calling conventions are different,
> though.
>
> Ben Root
Apologies for drifting off-topic. I understand the desire to not
require scipy, but how likely is that to change? I've written a BCa
bootstrapper[1] for boxplots, but it needs scipy, so I can't
contribute it back to the community.
[1] - http://staff.ustc.edu.cn/~zwp/teach/Stat-Comp/Efron_Bootstrap_CIs.pdf
Cheers,
-paul
From: Ethan G. <gu...@uc...> - 2011年09月06日 20:04:47
Hi, 
I'm trying to move plot windows programmatically, or at least control where
a new window opens. At the moment, every new window opens 20px further
down/right from the previous new window, but can I tell it to open e.g. 0px
down and 100px right? Or can I move it after it opens? I've dug around a
bit and gotten lost in fig.canvas.get_tk_widget(), am I looking in the wrong
place? 
At the moment I'm using the TkAgg backend with matplotlib 1.0.1 (python 2.6)
on Mac OS X. 
thanks,
Ethan
-- 
View this message in context: http://old.nabble.com/Moving-plot-windows--tp32411243p32411243.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2011年09月06日 19:58:49
On Tue, Sep 6, 2011 at 2:48 PM, Matt Funk <mat...@gm...> wrote:
> Hi Aman,
> thanks for your code. I am testing it right now, but i think this might
> what i need.
> Not sure if you know this: what is the difference between:
> 1) scipy.interpolate.griddata
> 2) matplotlib.mlab.griddata
>
> For 2) you have specify the interpolation method and i think the calling
> convention is different. Is one a wrapper for the other?
>
> thanks
> matt
>
>
No, they are not wrappers.
I don't know the full details, but the idea was that we didn't want to have
SciPy as a dependency, so mlab was used to replicate many of the functions
found in SciPy. I don't know why the calling conventions are different,
though.
Ben Root
Hi Aman,
thanks for your code. I am testing it right now, but i think this might
what i need.
Not sure if you know this: what is the difference between:
1) scipy.interpolate.griddata
2) matplotlib.mlab.griddata
For 2) you have specify the interpolation method and i think the calling
convention is different. Is one a wrapper for the other?
thanks
matt
On 9/6/2011 12:36 PM, Aman Thakral wrote:
> Hi Matt,
>
> Something like this?:
>
> def create_map(ax, llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat):
> m =
> Basemap(llcrnrlon=llcrnrlon,llcrnrlat=llcrnrlat,urcrnrlon=urcrnrlon,urcrnrlat=urcrnrlat,resolution='i',projection='cyl',lon_0=(urcrnrlon+llcrnrlon)/2,lat_0=(urcrnrlat+llcrnrlat)/2)
> m.drawcoastlines()
> m.drawmapboundary()
> m.drawstates(linewidth=3)
> m.fillcontinents(color='lightgrey',lake_color='white')
> m.drawcountries(linewidth=3)
> return m
>
>
> def plotMapData(ax,data):
>
> lats = []
> lons = []
> val = []
> 
> for k,v in data.iteritems():
> lats.append(float(k[0]))
> lons.append(float(k[1]))
> val.append(float(v))
> 
> value = np.array(val)
> lat = np.array(lats)
> lon = np.array(lons)
> 
> llcrnlon = lon.min()-0.5
> llcrnlat = lat.min()-0.5
> urcrnlon = lon.max()+0.5
> urcrnlat = lat.max()+0.5
>
> xi = np.linspace(llcrnlon,urcrnlon,1000)
> yi = np.linspace(llcrnlat,urcrnlat,1000)
> zi = griddata(lon,lat,value,xi,yi)
>
> cmap = cm.jet
> m = create_map(ax,llcrnlon,llcrnlat,urcrnlon,urcrnlat)
> cs = ax.contour(xi,yi,zi,15,linewidth=0.5,cmap=cmap,alpha=0.5) 
> ax.contourf(xi,yi,zi,15,cmap=cmap,zorder=1000,alpha=0.5)
>
> colorscale = cm.ScalarMappable()
> colorscale.set_array(value)
> colorscale.set_cmap(cmap)
>
> colors = colorscale.to_rgba(value)
> ax.scatter(lon,lat,c=colors,zorder=1000,cmap=cmap,s=10)
> colorbar(colorscale, shrink=0.50, ax=ax,extend='both')
> 
>
> On Tue, Sep 6, 2011 at 1:28 PM, Matt Funk <mat...@gm...
> <mailto:mat...@gm...>> wrote:
>
> Hi,
> i want to interpolate irregular spaced satellite data onto a regular
> spaced grid. The regular spaced grid should have cell sizes of
> 1km^2. Is
> it possible to use basemap to create such a grid. It looked like it
> includes some facilities like that, but i am not sure if they are
> meant
> to be used by end user or more like internal fcns (the makegrid
> fcn for
> example).
>
> Any advice would be appreciated.
>
> thanks
> matt
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Matt Funk
Research Associate
Plant and Environmental Scienc. Dept.
New Mexico State University
From: surfcast23 <sur...@gm...> - 2011年09月06日 18:52:00
Benjamin Root-2 wrote:
> 
> On Tue, Sep 6, 2011 at 12:01 PM, surfcast23 <sur...@gm...> wrote:
> 
>>
>> Thanks for everyone responses and help
>>
>> Che,
>>
>> You are correct on what I have to do. The problem is that I have a data
>> set
>> with ~1250 so I cant' do the sorting or finding the mean by hand. I guess
>> what I need to to is to write a script that will sort the values, bin
>> them,
>> and keep track of the number of values in each bin. Then find the mean
>> value
>> in each bin. Then the scrip has to take the number of values in each bin
>> and
>> plot that versus the mean of each bin. I apologies for the lack of
>> clarity
>> in my earlier posts. It was unclear to me what exactly had to be done
>> until
>> this weekend.
>>
>>
>>
> I think you really need to read up on the NumPy documentation. There are
> functions that will do this for you. NumPy can load/save data, sort them,
> bin them, find means and standard deviations, etc... You don't need to
> re-invent the wheel.
> 
> Plus, you keep on talking about having a script for each part. While it
> is
> great that you like modularity, Python does support the use of functions,
> and I would encourage you to use them.
> 
> Cheers,
> Ben Root
> 
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better 
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
Hi Ben,
 I will read up the numpy docs when I get some time. I am only writing one
script that will do everything sorry if I gave the impression of having
multiple scripts. 
-- 
View this message in context: http://old.nabble.com/How-do-you-Plot-data-generated-by-a-python-script--tp32328822p32410694.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi Matt,
Something like this?:
def create_map(ax, llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat):
 m =
Basemap(llcrnrlon=llcrnrlon,llcrnrlat=llcrnrlat,urcrnrlon=urcrnrlon,urcrnrlat=urcrnrlat,resolution='i',projection='cyl',lon_0=(urcrnrlon+llcrnrlon)/2,lat_0=(urcrnrlat+llcrnrlat)/2)
 m.drawcoastlines()
 m.drawmapboundary()
 m.drawstates(linewidth=3)
 m.fillcontinents(color='lightgrey',lake_color='white')
 m.drawcountries(linewidth=3)
 return m
def plotMapData(ax,data):
 lats = []
 lons = []
 val = []
 for k,v in data.iteritems():
 lats.append(float(k[0]))
 lons.append(float(k[1]))
 val.append(float(v))
 value = np.array(val)
 lat = np.array(lats)
 lon = np.array(lons)
 llcrnlon = lon.min()-0.5
 llcrnlat = lat.min()-0.5
 urcrnlon = lon.max()+0.5
 urcrnlat = lat.max()+0.5
 xi = np.linspace(llcrnlon,urcrnlon,1000)
 yi = np.linspace(llcrnlat,urcrnlat,1000)
 zi = griddata(lon,lat,value,xi,yi)
 cmap = cm.jet
 m = create_map(ax,llcrnlon,llcrnlat,urcrnlon,urcrnlat)
 cs = ax.contour(xi,yi,zi,15,linewidth=0.5,cmap=cmap,alpha=0.5)
 ax.contourf(xi,yi,zi,15,cmap=cmap,zorder=1000,alpha=0.5)
 colorscale = cm.ScalarMappable()
 colorscale.set_array(value)
 colorscale.set_cmap(cmap)
 colors = colorscale.to_rgba(value)
 ax.scatter(lon,lat,c=colors,zorder=1000,cmap=cmap,s=10)
 colorbar(colorscale, shrink=0.50, ax=ax,extend='both')
On Tue, Sep 6, 2011 at 1:28 PM, Matt Funk <mat...@gm...> wrote:
> Hi,
> i want to interpolate irregular spaced satellite data onto a regular
> spaced grid. The regular spaced grid should have cell sizes of 1km^2. Is
> it possible to use basemap to create such a grid. It looked like it
> includes some facilities like that, but i am not sure if they are meant
> to be used by end user or more like internal fcns (the makegrid fcn for
> example).
>
> Any advice would be appreciated.
>
> thanks
> matt
>
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Matt F. <mat...@gm...> - 2011年09月06日 17:29:19
Hi,
i want to interpolate irregular spaced satellite data onto a regular
spaced grid. The regular spaced grid should have cell sizes of 1km^2. Is
it possible to use basemap to create such a grid. It looked like it
includes some facilities like that, but i am not sure if they are meant
to be used by end user or more like internal fcns (the makegrid fcn for
example).
Any advice would be appreciated.
thanks
matt
From: C M <cmp...@gm...> - 2011年09月06日 17:19:40
>> The problem is that I have a data set
>> with ~1250 so I cant' do the sorting or finding the mean by hand.
That's not a problem--that's programming! Even if you had a data set
with five items you should be in the mind set that "by hand" is an
18th century approach. This will drive further progress in your
coding abilities.
> I think you really need to read up on the NumPy documentation. There are
> functions that will do this for you. NumPy can load/save data, sort them,
> bin them, find means and standard deviations, etc... You don't need to
> re-invent the wheel.
Ben, that's a good idea. The only thing here, though, is that
probably the OP would be well served in practicing Python basics and
learning how to think up procedures, write them down, and then put
them into Python code. Re-inventing the wheel, *at least to learn*
could really be useful here. I've also found that sometimes it is
easier to just reinvent a wheel than learn a library's API, at least
to get started. Considering his task requires mostly just creating
lists based on conditionals and then doing some 5th grade math, he
might want to try it himself before he uses NumPy. But of course he
can get there either way.
Che
From: Eric F. <ef...@ha...> - 2011年09月06日 17:18:52
On 09/06/2011 04:48 AM, Michael Droettboom wrote:
> On 08/31/2011 01:20 PM, Eric Firing wrote:
>> On 08/31/2011 06:45 AM, Jeffrey Blackburne wrote:
>>> Hi,
>>>
>>> Are the edges of the rectangles returned by plt.bar() supposed to conform to the 'lines.solid_joinstyle' rcParam? If not, is there another method for specifying that joinstyle?
>>>
>>> I have not been able to change the joinstyle using this method in versions 1.0.0 (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a minimal example script if requested.
>>>
>> The bar rectangles are Patch object outlines, not Line2D objects, and
>> solid_joinstyle is not presently supported by patches, as far as I can see.
>>
>
> I suppose it probably should be supported, though. Do you agree?
Yes, that would be a nice enhancement.
Eric
>
> Mike
>
From: Benjamin R. <ben...@ou...> - 2011年09月06日 17:08:28
On Tue, Sep 6, 2011 at 12:01 PM, surfcast23 <sur...@gm...> wrote:
>
> Thanks for everyone responses and help
>
> Che,
>
> You are correct on what I have to do. The problem is that I have a data
> set
> with ~1250 so I cant' do the sorting or finding the mean by hand. I guess
> what I need to to is to write a script that will sort the values, bin them,
> and keep track of the number of values in each bin. Then find the mean
> value
> in each bin. Then the scrip has to take the number of values in each bin
> and
> plot that versus the mean of each bin. I apologies for the lack of clarity
> in my earlier posts. It was unclear to me what exactly had to be done until
> this weekend.
>
>
>
I think you really need to read up on the NumPy documentation. There are
functions that will do this for you. NumPy can load/save data, sort them,
bin them, find means and standard deviations, etc... You don't need to
re-invent the wheel.
Plus, you keep on talking about having a script for each part. While it is
great that you like modularity, Python does support the use of functions,
and I would encourage you to use them.
Cheers,
Ben Root
From: surfcast23 <sur...@gm...> - 2011年09月06日 17:01:24
Thanks for everyone responses and help
 
Che,
 You are correct on what I have to do. The problem is that I have a data set
with ~1250 so I cant' do the sorting or finding the mean by hand. I guess
what I need to to is to write a script that will sort the values, bin them,
and keep track of the number of values in each bin. Then find the mean value
in each bin. Then the scrip has to take the number of values in each bin and
plot that versus the mean of each bin. I apologies for the lack of clarity
in my earlier posts. It was unclear to me what exactly had to be done until
this weekend. 
 
 
Chelonian wrote:
> 
> On Sat, Sep 3, 2011 at 7:32 PM, mdekauwe <mde...@gm...> wrote:
>>
>> So you do want a histogram then? I assume you have all of this sorted
>> then,
>> the histogram function is very good.
> 
> I don't think he's describing a histogram, because he is not plotting
> frequency of observations on the y axis, but data values (means of
> each bin). I think what surfcast23 wants is just a bar graph.
> 
> So, surfcast23, I'd suggest you break it down into your two steps.
> First, how will you average your values by bin? You can probably
> figure that out by writing it out on paper in pseudo-code and then
> just putting it in Python. Then you'll have a list of means, and you
> will pass that to the bar function in matplotlib, something like:
> 
> from pylab import *
> ax = subplot(111)
> x = arange(4)
> your_list_of_means = [4,5,7,11] #computed earlier
> bar(x, your_list_of_means)
> xticks( x + 0.5, ('Bin1', 'Bin2', 'Bin3', 'Bin4') )
> show()
> 
> Che
> 
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better 
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://old.nabble.com/How-do-you-Plot-data-generated-by-a-python-script--tp32328822p32409886.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2011年09月06日 16:42:38
Sorry for the noise -- I missed that this was already replied to (and 
with much greater detail).
Mike
On 09/06/2011 12:41 PM, Michael Droettboom wrote:
> When you call savefig(), you can pass "quality", "optimize" and
> "progressive", as defined in the print_jpg docstring:
>
> def print_jpg(self, filename_or_obj, *args, **kwargs):
> """
> Supported kwargs:
>
> *quality*: The image quality, on a scale from 1 (worst) to
> 95 (best). The default is 75. Values above 95 should
> be avoided; 100 completely disables the JPEG
> quantization stage.
>
> *optimize*: If present, indicates that the encoder should
> make an extra pass over the image in order to select
> optimal encoder settings.
>
> *progressive*: If present, indicates that this image
> should be stored as a progressive JPEG file.
> """
>
> Mike
>
> On 09/05/2011 01:21 PM, Frank Breitling wrote:
>> Hi,
>>
>> I am using matplotlib.savefig to save my figures as JPEG files.
>> Now I need to reduce the JPG compression ratio.
>> How can I do this?
>>
>> Any hint is appreciated.
>>
>> Frank
>>
>> ------------------------------------------------------------------------------
>> Special Offer -- Download ArcSight Logger for FREE!
>> Finally, a world-class log management solution at an even better
>> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
>> download Logger. Secure your free ArcSight Logger TODAY!
>> http://p.sf.net/sfu/arcsisghtdev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Michael D. <md...@st...> - 2011年09月06日 16:40:16
When you call savefig(), you can pass "quality", "optimize" and 
"progressive", as defined in the print_jpg docstring:
 def print_jpg(self, filename_or_obj, *args, **kwargs):
 """
 Supported kwargs:
 *quality*: The image quality, on a scale from 1 (worst) to
 95 (best). The default is 75. Values above 95 should
 be avoided; 100 completely disables the JPEG
 quantization stage.
 *optimize*: If present, indicates that the encoder should
 make an extra pass over the image in order to select
 optimal encoder settings.
 *progressive*: If present, indicates that this image
 should be stored as a progressive JPEG file.
 """
Mike
On 09/05/2011 01:21 PM, Frank Breitling wrote:
> Hi,
>
> I am using matplotlib.savefig to save my figures as JPEG files.
> Now I need to reduce the JPG compression ratio.
> How can I do this?
>
> Any hint is appreciated.
>
> Frank
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Michael D. <md...@st...> - 2011年09月06日 16:17:01
Indeed that is a bug. That is one of about a dozen missing symbols from 
the mapping that I just found be comparing the legacy Adobe Type1 
name-to-Unicode mapping in matplotlib to the LaTeX-to-Unicode mapping 
that is currently used. I committed these to master here:
 
https://github.com/matplotlib/matplotlib/commit/7f55623c84eaa7df7c8c534350ac03a72c32fb83
Mike
On 09/01/2011 10:25 AM, Alejandro Weinstein wrote:
> Hi:
>
> I am having problems with the \dagger LaTex symbol. The following code
>
> import matplotlib.pyplot as plt
>
> plt.plot([1,2,3])
> plt.title(r'$ \dagger $')
> plt.show()
>
> produce a long Traceback that ends in
>
> File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line 1997,
> in raise_error
> raise ParseFatalException(msg + "\n" + s)
> ParseFatalException: Expected end of math '$'
> $ \dagger $ (at char 0), (line:1, col:1)
>
> Other LaTex symbols works OK. For instance, if I use plt.title(r'$
> \diamond $') instead, it works. I checked in mathtext.py, and \dagger
> is in the list of symbols.
>
> I am running Matplotlib '0.99.1.1'.
>
> Any idea about this problem?
>
> Alejandro.
>
> ------------------------------------------------------------------------------
> Special Offer -- Download ArcSight Logger for FREE!
> Finally, a world-class log management solution at an even better
> price-free! And you'll get a free "Love Thy Logs" t-shirt when you
> download Logger. Secure your free ArcSight Logger TODAY!
> http://p.sf.net/sfu/arcsisghtdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Jeffrey B. <jbl...@al...> - 2011年09月06日 15:47:17
On Sep 6, 2011, at 10:48 AM, Michael Droettboom wrote:
>On 08/31/2011 01:20 PM, Eric Firing wrote:
>> On 08/31/2011 06:45 AM, Jeffrey Blackburne wrote:
>>> Hi,
>>>
>>> Are the edges of the rectangles returned by plt.bar() supposed to conform
>>> to the 'lines.solid_joinstyle' rcParam? If not, is there another method for
>>> specifying that joinstyle?
>>>
>>> I have not been able to change the joinstyle using this method in versions 1.0.0
>>> (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a minimal example
>>>script if requested.
>>>
>> The bar rectangles are Patch object outlines, not Line2D objects, and
>> solid_joinstyle is not presently supported by patches, as far as I can see.
>>
>
>I suppose it probably should be supported, though. Do you agree?
It would be nice to have. Since the patch edge seemed to be using a "round" style and I wanted "miter", my workaround was just to use a separate step plot to overlay the outline. But for more general cases (e.g., a bar plot not created from a histogram or if I wanted a "bevel" style), I'm not sure how I would do it.
Thanks,
Jeff
From: Jeffrey S. <jef...@gm...> - 2011年09月06日 15:10:01
Attachments: 220ActSteps.png
I made the plot below but I don't want it to clip at the top because 
cuts off half of the boxes at the top. So it ends up looking a little 
weird when it goes flat. Then I turn clipping off and since the lines go 
outside they trail off past the graph. Can I specify horizontal or 
vertical clipping?? Or what is the best way to get around this?
-- 
________________________
Jeffrey Spencer
jef...@gm...
From: Michael D. <md...@st...> - 2011年09月06日 14:56:31
On 08/31/2011 11:21 PM, Eric Firing wrote:
> On 08/31/2011 01:59 PM, Benjamin Root wrote:
>> On Wed, Aug 31, 2011 at 6:35 PM, Craig Finch<cf...@ie...
>> <mailto:cf...@ie...>> wrote:
>>
>> I figured it out! I accidentally did something weird. When I built
>> NumPy and SciPy, I used the --user option to tell distutils to build
>> them in my home directory. I had not realized that --user installs
>> the packages in ~/.local/lib/python2.7/site-packages/. I was
>> assuming they would be installed in ~/lib/python2.7/site-packages,
>> but I didn't notice they were "missing" until just now. When I
>> reinstalled NumPy and Scipy using the option --prefix=/home/cfinch
>> and then rebuilt matplotlib, everything started working. I didn't
>> have to rebuild pycairo or pygtk; I just had to get everything in
>> the same location. This is the first I've heard of installing
>> anything in a .local directory...why is that even an option???
>>
>> Thanks for your help!
>>
>>
>> It is a standard directory in linux now. Started by the freedesktop.org
>> <http://freedesktop.org>, I think. Personally, I prefer it over having
>> ~/lib, ~/bin and such cluttering my home directory.
>>
>> http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
> Aha! So that's where .config came from, also. IPython is using it; I
> suppose we should, too.
I've created a github issue to discuss and/or implement this here:
https://github.com/matplotlib/matplotlib/issues/454
Mike
From: Michael D. <md...@st...> - 2011年09月06日 14:50:22
On 08/31/2011 01:20 PM, Eric Firing wrote:
> On 08/31/2011 06:45 AM, Jeffrey Blackburne wrote:
>> Hi,
>>
>> Are the edges of the rectangles returned by plt.bar() supposed to conform to the 'lines.solid_joinstyle' rcParam? If not, is there another method for specifying that joinstyle?
>>
>> I have not been able to change the joinstyle using this method in versions 1.0.0 (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a minimal example script if requested.
>>
> The bar rectangles are Patch object outlines, not Line2D objects, and
> solid_joinstyle is not presently supported by patches, as far as I can see.
>
I suppose it probably should be supported, though. Do you agree?
Mike
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: dpo <dom...@gm...> - 2011年09月06日 02:27:08
efiring wrote:
> 
> On 09/05/2011 03:01 PM, dpo wrote:
>>
>> Hi,
>>
>> Upon trying to install Matplotlib from PyPi, I get the following error
>> message:
>>
>> ---
>> Traceback (most recent call last):
>> File "<string>", line 14, in<module>
>> File "/Users/dpo/.virtualenvs/tsp/build/matplotlib/setup.py", line
>> 162, in<module>
>> if check_for_tk() or (options['build_tkagg'] is True):
>> File "setupext.py", line 832, in check_for_tk
>> (Tkinter.__version__.split()[-2], Tkinter.TkVersion,
>> Tkinter.TclVersion))
>> IndexError: list index out of range
>> Complete output from command python setup.py egg_info:
>> basedirlist is: []
>> ---
> 
> This is fixed in the git repo. I think it is a problem that arises only 
> with some builds of Python 2.7.
> 
You may want to upload the fix to PyPi. That's where most people look for
matplotlib I would guess.
-- 
View this message in context: http://old.nabble.com/Can%27t-install-from-PyPi-tp32404788p32405040.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Eric F. <ef...@ha...> - 2011年09月06日 01:42:45
On 09/05/2011 03:01 PM, dpo wrote:
>
> Hi,
>
> Upon trying to install Matplotlib from PyPi, I get the following error
> message:
>
> ---
> Traceback (most recent call last):
> File "<string>", line 14, in<module>
> File "/Users/dpo/.virtualenvs/tsp/build/matplotlib/setup.py", line
> 162, in<module>
> if check_for_tk() or (options['build_tkagg'] is True):
> File "setupext.py", line 832, in check_for_tk
> (Tkinter.__version__.split()[-2], Tkinter.TkVersion,
> Tkinter.TclVersion))
> IndexError: list index out of range
> Complete output from command python setup.py egg_info:
> basedirlist is: []
> ---
This is fixed in the git repo. I think it is a problem that arises only 
with some builds of Python 2.7.
Eric
>
> This concerns Matplotlib 1.0.1 on OSX 10.6.8 with Python 2.7 (home built as
> a framework via Homebrew) in a virtual environment (if that matters).
>
> Changing line 832 of setupext.py from
>
> (Tkinter.__version__.split()[-2], Tkinter.TkVersion,
> Tkinter.TclVersion))
>
> to
>
> (Tkinter.__version__, Tkinter.TkVersion, Tkinter.TclVersion))
>
> works, but this is the output I get during the build:
>
> Tkinter: Tkinter: $Revision$
>
>
> Dominique
From: dpo <dom...@gm...> - 2011年09月06日 01:01:25
Hi,
Upon trying to install Matplotlib from PyPi, I get the following error
message:
---
 Traceback (most recent call last):
 File "<string>", line 14, in <module>
 File "/Users/dpo/.virtualenvs/tsp/build/matplotlib/setup.py", line
162, in <module>
 if check_for_tk() or (options['build_tkagg'] is True):
 File "setupext.py", line 832, in check_for_tk
 (Tkinter.__version__.split()[-2], Tkinter.TkVersion,
Tkinter.TclVersion))
 IndexError: list index out of range
 Complete output from command python setup.py egg_info:
 basedirlist is: []
---
This concerns Matplotlib 1.0.1 on OSX 10.6.8 with Python 2.7 (home built as
a framework via Homebrew) in a virtual environment (if that matters).
Changing line 832 of setupext.py from
 (Tkinter.__version__.split()[-2], Tkinter.TkVersion,
Tkinter.TclVersion))
to
 (Tkinter.__version__, Tkinter.TkVersion, Tkinter.TclVersion))
works, but this is the output I get during the build:
 Tkinter: Tkinter: $Revision$
Dominique
-- 
View this message in context: http://old.nabble.com/Can%27t-install-from-PyPi-tp32404788p32404788.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jae-Joon L. <lee...@gm...> - 2011年09月06日 00:58:14
Hi,
I think this is partly because the current clabel implementation of
matpltolib does not correctly account the dpi setting. I opened a pull
request I think fix this problem. Please try that fix if you can.
https://github.com/matplotlib/matplotlib/pull/453
Otherwise, I think you can workaround this by using the default dpi
(72 or similar).
Regards,
-JJ
On Fri, Sep 2, 2011 at 11:28 PM, R. O'Gara <ron...@ya...> wrote:
> Jae-Joon, thanks for your reply.
> There is a combination of effects that make my contour labels placed in unfortunate positions. Here is a self-contained example (somewhat different from issue I originally explained, but illustrates the fact clabels are not where I'd like them to be)
>
>
> import numpy as np
> import matplotlib as mpl
> ff = 10
> params = {
>   'text.usetex': True,
>   'axes.labelsize': ff,
>   'axes.fontsize': ff,
>   'legend.fontsize' : ff,
>   'xtick.labelsize' : ff,
>   'ytick.labelsize' : ff,
>   'figure.dpi': 150,
>   'figure.figsize' : [5,2],
> }
> mpl.rcParams.update(params)
> import matplotlib.pyplot as plt
> import matplotlib.gridspec as gridspec
>
> gs = gridspec.GridSpec(1,2)
>
> ax = plt.subplot(gs[0])
>
> xi = np.linspace(0,0.4,100)
> yi = np.linspace(0,0.4,100)
> xx,yy = np.meshgrid(xi,yi)
> zi = np.sin(5*xx*yy)
>
> v = np.arange(0.0, 0.5, 0.1)
> cplot = ax.contour(xi, yi, zi, v, linewidths=0.5, colors='k')
> ax.clabel(cplot, v,
>   fontsize = 8,
>   inline=True,
>   fmt = "%0.2f",
> )
> ax.axis([np.min(xi),np.max(xi),np.min(yi),np.max(yi)])
> plt.show()
>
>
>
> The end result is that contour labels are placed almost outside of the grid, with most of the area in the center being blank. I am pretty sure it has to do with the way rcParams are set, but I have no idea why. Params I do need to set are text.usetex, figure.dpi, and figure.figsize. I am using matplotlib 1.0.1.
>
> Thanks for your help,
>
>
>
> ----- Original Message -----
> From: Jae-Joon Lee <lee...@gm...>
> To: R. O'Gara <ron...@ya...>
> Cc: "mat...@li..." <mat...@li...>
> Sent: Monday, August 22, 2011 11:56 PM
> Subject: Re: [Matplotlib-users] contour's clabels overlap each other in an ImageGrid
>
> Can you post an simple self-contained script that reproduces your problem?
> I just tried something similar but could not reproduces your problem.
> Here is what I did,
> Also, what version of matplotlb are you using?
>
> Regards,
>
> -JJ
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> from mpl_toolkits.axes_grid1 import ImageGrid
>
> fig = plt.figure(1)
>
> arr = np.arange(100).reshape((10, 10))
>
> grid = ImageGrid(fig, 111, (2, 2))
>
>
> cntr0 = grid[0].contour(arr)
> cntr1 = grid[1].contour(arr)
> cntr2 = grid[2].contour(arr)
> cntr3 = grid[3].contour(arr)
>
> plt.clabel(cntr0, manual=True)
> plt.clabel(cntr1, manual=True)
> plt.clabel(cntr2, manual=True)
> plt.clabel(cntr3, manual=True)
>
>
>
> On Thu, Aug 18, 2011 at 1:10 PM, R. O'Gara <ron...@ya...> wrote:
>> Hey guys,
>>
>>
>> I was hoping someone could provide a hint for how I should go about correcting this. As you can see, locations for the inline labels for
>> contours in this image are unfortunately chosen, and they overlap with one another. If I set manual to 'True' then I get this weird behavior
>> where I can only choose labels in the top left grid and nothing is shownin any of the other grids.
>>
>> I am using a 2x2 Image Grid (I get the same problem when using gridspec instead of image grid), and loadingcontour data (2x2 array) from a file.
>>
>> Thanks for your help,
>> Ron
>> ------------------------------------------------------------------------------
>> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
>> user administration capabilities and model configuration. Take
>> the hassle out of deploying and managing Subversion and the
>> tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>

Showing 22 results of 22

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /