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

Showing 7 results of 7

From: David W. <dav...@gm...> - 2011年12月21日 21:13:48
Hello all,
I am installing matplotlib on a remote network in a virtualenv setup. The installation goes great but when I try to run the testing, matplotlib freezes and has to be killed from another terminal. I've attached the complete output.
Cheers,
Dave 
----
David Welch
dav...@gm...
Something you entered
transcended parameters.
So much is unknown.
-Salon Magazine, Error Haiku Challenge
From: Brad M. <bra...@gm...> - 2011年12月21日 16:55:06
Jeff,
Thanks. That indeed did work (after downloading python-dev package). I just
didn't know that 'install' was the argument that I was supposed to pass to
it =)
After installing I tried griddata again. My input data was originally a
list. The new griddata didn't like this and so I simply used
a=array(thelist) to convert to an array and tried again. It took quite a
bit longer than the old griddata, but the resulting output now looks
correct! Better a slow and correct answer than a fast and garbage one.
Thanks again Jeff (and thanks for the new griddata if you are the one that
made it)!
Brad
On Wed, Dec 21, 2011 at 5:55 AM, Jeff Whitaker <js...@fa...> wrote:
> On 12/21/11 12:31 AM, Brad Malone wrote:
>
> Hi, I'm still working on my interpolating from an irregularly space grid
> and then running pcolormesh on the resulting output. With some of the newer
> data I've been plotting I've noticed that my plots are complete garbage. I
> realized that this was actually because of the output from griddata rather
> than some problem with pcolormesh/pcolor/etc (basically I get huge negative
> values like -80000 from the interpolation when all of my data points lie
> within [0,20]) .
>
> Googling I found out that the default griddata has some problems, and
> that there is a better, more robust version available through natgrid. I
> downloaded the natgrid-0.2.1 package from here
> http://sourceforge.net/projects/matplotlib/files%2Fmatplotlib-toolkits%2Fnatgrid-0.2/
> .
>
> My question now is, how do I install this and give it a shot? I'm
> running on Ubuntu (or Xubuntu rather). The README doesn't seem to have any
> directions.
>
> Brad:
>
> python setup.py install should do it. matplotlib will automatically use
> it if it's installed.
>
> -Jeff
>
>
> Also, let's say that this new griddata doesn't work for me, is there
> something else I could try? The interpolation problems are strange, because
> I can break my data into 3 segments (I read 3 files to obtain the data so
> this is the natural way to do it) and I can plot and interpolate correctly
> any segment individually. It's only when I do all 3 segments together that
> the interpolation begins to fail.
>
> Any ideas?
>
> Thanks for the continued help!
>
> Brad
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/joinhttp://p.sf.net/sfu/intel-appdev
>
>
>
> _______________________________________________
> Matplotlib-users mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
From: Jeff W. <js...@fa...> - 2011年12月21日 13:56:00
On 12/21/11 12:31 AM, Brad Malone wrote:
> Hi, I'm still working on my interpolating from an irregularly space 
> grid and then running pcolormesh on the resulting output. With some of 
> the newer data I've been plotting I've noticed that my plots are 
> complete garbage. I realized that this was actually because of the 
> output from griddata rather than some problem with 
> pcolormesh/pcolor/etc (basically I get huge negative values like 
> -80000 from the interpolation when all of my data points lie within 
> [0,20]) .
>
> Googling I found out that the default griddata has some problems, and 
> that there is a better, more robust version available through natgrid. 
> I downloaded the natgrid-0.2.1 package from here 
> http://sourceforge.net/projects/matplotlib/files%2Fmatplotlib-toolkits%2Fnatgrid-0.2/. 
>
>
> My question now is, how do I install this and give it a shot? I'm 
> running on Ubuntu (or Xubuntu rather). The README doesn't seem to have 
> any directions.
Brad:
python setup.py install should do it. matplotlib will automatically use 
it if it's installed.
-Jeff
>
> Also, let's say that this new griddata doesn't work for me, is there 
> something else I could try? The interpolation problems are strange, 
> because I can break my data into 3 segments (I read 3 files to obtain 
> the data so this is the natural way to do it) and I can plot and 
> interpolate correctly any segment individually. It's only when I do 
> all 3 segments together that the interpolation begins to fail.
>
> Any ideas?
>
> Thanks for the continued help!
>
> Brad
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Nico S. <nic...@gm...> - 2011年12月21日 13:31:12
> I don't see it.
You're right. -- I've looked at it again and I can confirm that the
outlines are drawn with LINETOs.
> This shows a set of vertices with a matching set of LINETO (after an
> initial MOVETO). contour and contourf generate piece-wise linear paths
> with vertices on grid cell boundaries; they make no attempt to smooth
> out the contours.
I looked at the example in
http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_log.html
and used the point information in the LINETOs to reproduce the figure.
It seems that, except for the blue patches in the corners, this
information is really rough. Take a peek at the file I attached; left:
matplotlib rendering, right: lines manually redrawn.
Do you know what's going on?
--Nico
On Tue, Dec 13, 2011 at 11:39 PM, Eric Firing <ef...@ha...> wrote:
> On 12/13/2011 11:03 AM, Nico Schlömer wrote:
>> Hi all,
>>
>> when drawing contourf plots, I inspected the underlying
>> matplotlib.path.Path elements that determine the curves and noticed
>> that they are all of code LINETO (see
>> http://matplotlib.sourceforge.net/api/path_api.html#matplotlib.path.Path)
>> although the number of vertices is 6, actually suggesting a CURVE4.
>>
>> Would that be a bug?
>
> I don't see it.
>
> x = np.arange(9)
> x.shape = (3,3)
> cs = contourf(x, 1)
> print cs.collections.get_paths()
>
> This shows a set of vertices with a matching set of LINETO (after an
> initial MOVETO). contour and contourf generate piece-wise linear paths
> with vertices on grid cell boundaries; they make no attempt to smooth
> out the contours.
>
> Eric
>
>>
>> Cheers,
>> Nico
>
>
> ------------------------------------------------------------------------------
> Systems Optimization Self Assessment
> Improve efficiency and utilization of IT resources. Drive out cost and
> improve service delivery. Take 5 minutes to use this Systems Optimization
> Self Assessment. http://www.accelacomm.com/jaw/sdnl/114/51450054/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Nils W. <nw...@ia...> - 2011年12月21日 08:53:41
On 2011年12月20日 10:48:42 -0600
 Ryan May <rm...@gm...> wrote:
> On Tue, Dec 20, 2011 at 8:00 AM, Nils Wagner
> <nw...@ia...> wrote:
>> Hi all,
>>
>> How do I use animation.FuncAnimation to plot real-life
>> data from parsing a text file ?
> 
> Here's a version that does what I think you want:
> 
> import matplotlib.pyplot as plt
> import matplotlib.animation as animation
> import sys
> import time
> import re
> 
> x_data = [] # x
> y_data = [] # y
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> curve,= ax.plot([],[],lw=2)
> ax.set_xlim(0,5)
> ax.set_ylim(0,25)
> ax.grid()
> 
> def tail_f(file):
> while True:
> where = file.tell() # current file position, an 
>integer (may
> be a long integer).
> line = file.readline()
> if re.search('without errors',line): break
> # Always yield the line so that we return back to the 
>event loop. If we
> # need to go back and read again, we'll get a free 
>delay from the
> # animation system.
> yield line
> if not line:
> file.seek(where) # seek(offset[, whence]) 
>->None. Move to
> new file position.
> 
> 
> def run(line, curve, x, y):
> if re.search('x=',line):
> liste = line.split('=')
> x.append(liste[1].strip())
> if re.search('y=',line):
> liste = line.split('=')
> y.append(liste[1].strip())
> 
> curve.set_data(x,y)
> print x,y
> return curve
> 
> # The passed in frames can be a func that returns a 
>generator. This
> # generator keeps return "frame data"
> def data_source(fname=sys.argv[1]):
> return tail_f(open(fname))
> 
> # This init function initializes for drawing returns any 
>initialized
> # artists.
> def init():
> curve.set_data([],[])
> return curve
> 
> line_ani = animation.FuncAnimation(fig, run, 
>data_source, init_func=init,
> fargs=(curve,x_data,y_data), interval=100)
> 
> plt.show()
> 
> 
> Ben was also right in that you could subclass 
>FuncAnimation and
> override/extend methods. This would have the benefit of 
>giving more
> control over the handling of seek(). (Something else for 
>my todo
> list...)
> 
> Ryan
> 
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
Hi Ryan,
is it possible to autoscale the axes whenever it is needed 
by a new chunk of data ?
Nils
From: Brad M. <bra...@gm...> - 2011年12月21日 07:31:44
Hi, I'm still working on my interpolating from an irregularly space grid
and then running pcolormesh on the resulting output. With some of the newer
data I've been plotting I've noticed that my plots are complete garbage. I
realized that this was actually because of the output from griddata rather
than some problem with pcolormesh/pcolor/etc (basically I get huge negative
values like -80000 from the interpolation when all of my data points lie
within [0,20]) .
Googling I found out that the default griddata has some problems, and that
there is a better, more robust version available through natgrid. I
downloaded the natgrid-0.2.1 package from here
http://sourceforge.net/projects/matplotlib/files%2Fmatplotlib-toolkits%2Fnatgrid-0.2/
.
My question now is, how do I install this and give it a shot? I'm running
on Ubuntu (or Xubuntu rather). The README doesn't seem to have any
directions.
Also, let's say that this new griddata doesn't work for me, is there
something else I could try? The interpolation problems are strange, because
I can break my data into 3 segments (I read 3 files to obtain the data so
this is the natural way to do it) and I can plot and interpolate correctly
any segment individually. It's only when I do all 3 segments together that
the interpolation begins to fail.
Any ideas?
Thanks for the continued help!
Brad
From: Eric F. <ef...@ha...> - 2011年12月21日 00:11:15
On 12/20/2011 10:48 AM, Brad Malone wrote:
> Tony,
>
> Thanks for the pcolormesh suggestion! It is quite a bit faster than
> pcolor for me (maybe 50-100x faster)!
There is also the Axes.pcolorfast() method. It has no pylab wrapper, 
and it is fussier than the others about its input arguments, but it uses 
the fastest method that the input grid permits. In your case it would 
be the speed of imshow, which is faster than pcolormesh.
http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.pcolorfast
Note that like pcolor and pcolormesh its grid is based on the 
specification of the boundaries, not the centers, but unlike pcolormesh 
and pcolor it will not automatically chop off a row and a column of the 
2-D color array to be plotted if you give it a grid with the same 
dimensions as the color array.
Eric
>
> Best,
> Brad
>
> On Tue, Dec 20, 2011 at 10:10 AM, Tony Yu <ts...@gm...
> <mailto:ts...@gm...>> wrote:
>
>
>
> On Tue, Dec 20, 2011 at 9:22 AM, Brad Malone <bra...@gm...
> <mailto:bra...@gm...>> wrote:
>
> HI Paul,
>
> Thanks. I didn't realize it was that simple (appears that doing
> this essentially plots everything against integers in x and y).
> This will be a good backup plan if I can't get pcolor to work,
> although as you say, I'll have to fiddle around some with the
> axis formatters and such I suppose to get a good final plot out
> of this.
>
> Best,
> Brad
>
> On Tue, Dec 20, 2011 at 12:12 AM, Paul Ivanov
> <piv...@gm... <mailto:piv...@gm...>> wrote:
>
> Hey again, Brad,
>
> Brad Malone, on 2011年12月19日 23:44, wrote:
> > Hi, I am plotting a grid with pcolor. Below I've got a
> 1000x1000 grid.
> >
> > xi=linspace(-0.1,x[-1]+2,1000)
> > > yi=linspace(-0.1,maxfreq+10,1000)
> > > print 'Calling griddata...'
> > > zi=griddata(x,y,z,xi,yi,interp='nn')
> > > plt.pcolor(xi,yi,zi,cmap=plt.cm.hot)
> ...
> > How could I modify my above data (which is in xi,yi,and
> zi) to
> > work with imshow (which seems to take 1 argument for data).
>
> Try either:
>
> plt.matshow(zi,cmap=plt.cm.hot)
>
> or
>
> plt.imshow(zi,cmap=plt.cm.hot)
>
> The first should be the quickest - it doesn't do any
> fancy interpolation, and actually just passes some arguments to
> the second. Using imshow directly, however, allows you to set a
> different type of interpolation, should you desire it. If
> you want xi and yi to be accurately reflect in the plot, you
> might have to play around with changing the axis formatters
> (though there might be an easier way of doing that, which
> escapes
> me right now)
>
> best,
> --
> Paul Ivanov
>
>
> You may also want to try:
>
> plt.pcolormesh(xi,yi,zi,cmap=plt.cm.hot)
>
> If I remember correctly, pcolormesh is faster but a bit more
> restrictive. (I think it's slower than matshow and imshow).
>
> -Tony
>
> P.S. I never knew about matshow; thanks Paul!
>
>
>
>
> ------------------------------------------------------------------------------
> Write once. Port to many.
> Get the SDK and tools to simplify cross-platform app development. Create
> new or port existing apps to sell to consumers worldwide. Explore the
> Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
> http://p.sf.net/sfu/intel-appdev
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Showing 7 results of 7

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 によって変換されたページ (->オリジナル) /