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


Showing 18 results of 18

From: Auré G. <aur...@ya...> - 2011年03月10日 22:01:55
Thanks, I read some of your previous posts dealing with the pcolor and tried 
this route but didn't succeed yet...
I really agree with you on the interest of having an option to pass an array 
rather than value for the alpha keyword !
________________________________
De : Benjamin Root <ben...@ou...>
À : Auré Gourrier <aur...@ya...>
Cc : mat...@li...
Envoyé le : Jeu 10 mars 2011, 18h 43min 31s
Objet : Re: [Matplotlib-users] alternative to imshow with polar axes ?
On Thu, Mar 10, 2011 at 8:40 AM, Auré Gourrier <aur...@ya...> 
wrote:
Dear all,
>
>Once again, I turn for help.
>I'm trying to plot a polar image using colormap values for the theta values and 
>increasing alpha values along the radius.
>I do this using imshow passing the rgba tuple at each pixel position which works 
>very nicely with rectangular axes, but fails to display using polar axes (see 
>code below). 
>
>As usual, I've done a fair bit of digging to find where the problem is and 
>whether I could make out an alternate solution but haven't managed to come 
>through. I've tried using pcolormesh but I don't see how to pass the rgba tuple
>Can anyone point me in the right direction.
>I'm using matplotlib 1.0.1 and Python 2.4
>
>Cheers,
>
>Auré
>
>
It appears that imshow() (and matshow()) do not support non-rectilinear axes. I 
don't know if this is a bug or if there is no way to make it support polar 
projections. Hopefully, someone else more knowledgable could chime in on this.
I am also not exactly sure how to accomplish what you want using pcolor. A 
really slow, painful way would be to pcolor each row with the rest masked out, 
setting the alpha value for that row. I have long wondered if the alpha kwarg 
in various functions could be improved by allowing array values and take 
advantage of numpy broadcasting.
Ben Root
 
From: Søren N. <sor...@gm...> - 2011年03月10日 21:12:09
Hi,
When I do an errorbar plot (a.errorbar(), a = axis) with negative values and
then try to change the yscale to log (a.set_yscale('log')) matplotlib
crashes with:
Traceback (most recent call last):
 File "/usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
line 14636, in <lambda>
 lambda event: event.callable(*event.args, **event.kw) )
 File "/home/specuser/new_workspace/TestDriven/src/RAWPlot.py", line 371,
in plotSASM
 line, ec, el = a.errorbar(sasm.q[q_min:q_max], sasm.i[q_min:q_max],
sasm.err[q_min:q_max], picker = 3, label = legend_label, **kwargs)
 File "/usr/lib64/python2.6/site-packages/matplotlib/axes.py", line 4872,
in errorbar
 barcols.append( self.vlines(x, lower, upper, **lines_kw) )
 File "/usr/lib64/python2.6/site-packages/matplotlib/axes.py", line 3302,
in vlines
 self.autoscale_view()
 File "/usr/lib64/python2.6/site-packages/matplotlib/axes.py", line 1627,
in autoscale_view
 YL = self.yaxis.get_major_locator().view_limits(y0, y1)
 File "/usr/lib64/python2.6/site-packages/matplotlib/ticker.py", line 1119,
in view_limits
 if not is_decade(vmin,self._base): vmin = decade_down(vmin,self._base)
 File "/usr/lib64/python2.6/site-packages/matplotlib/ticker.py", line 1030,
in is_decade
 return lx==int(lx)
OverflowError: cannot convert float infinity to integer
Traceback (most recent call last):
 File "/usr/lib64/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
line 14636, in <lambda>
 lambda event: event.callable(*event.args, **event.kw) )
 File "/home/specuser/new_workspace/TestDriven/src/RAW.py", line 1953, in
addItem
 newItem = ManipItemPanel(self.underpanel, sasm, font_colour =
item_colour)
 File "/home/specuser/new_workspace/TestDriven/src/RAW.py", line 2353, in
__init__
 color = conv.to_rgb(self.sasm.line.get_mfc())
AttributeError: 'NoneType' object has no attribute 'get_mfc'
I don't think this should be the expected outcome.. rather it should not
plot values that are illegal/negative (i.e. ignore them).
Is there a way I can get around this without having to search through my
data and remove points that are negative or NaN or INF when the yscale needs
to be log? That would also show an incorrect curve since a line would be
drawn across the points that were removed.. It should rather be gaps in the
line.
Thanks,
Soren
From: Gökhan S. <gok...@gm...> - 2011年03月10日 20:46:26
Yung-Yu,
We are advertised on this blog
http://pycon.blogspot.com/2011/03/pycon-2011-outside-talks-poster-session.html
I will be in the conference venue by tomorrow morning. There are many
interesting talks and posters that I look forward seeing plus meeting
those presenters.
See you in Atlanta.
On 3/9/11, Yung-Yu Chen <yy...@so...> wrote:
> I will be there tomorrow, and giving a talk about solving PDEs on Saturday
> morning (plus a poster). Looking forward to meet you guys and to learn more
> about contribution to the community.
>
> with regards,
> Yung-Yu Chen
>
> --
> Yung-Yu Chen
> PhD candidate of Mechanical Engineering
> The Ohio State University, Columbus, Ohio
> +1 (614) 859 2436
> http://solvcon.net/yyc/
>
-- 
Gökhan
From: Steve S. <ssk...@li...> - 2011年03月10日 19:33:06
I'm a frequent user of matplotlib on my Windows XP machine. I
recently attempted to install a program that modified my Tcl
installation, and I now get an error message when I attempt to plot
anything in matplotlib. Here is the error message:
---
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\Python25\lib\lib-tk\Tkinter.py", line 3758, in _test
 root = Tk()
 File "C:\Python25\lib\lib-tk\Tkinter.py", line 1647, in __init__
 self.tk = _tkinter.create(screenName, baseName, className,
interactive, want
objects, useTk, sync, use)
_tkinter.TclError: Can't find a usable init.tcl in the following
directories:
 {C:\Program Files\Tcl\lib\tcl8.3} {C:\Program Files\Tcl\lib
\tcl8.3} {C:/Prog
ram Files/Tcl/lib/tcl8.4} C:/Python25/lib/tcl8.4 C:/lib/tcl8.4 C:/
library
This probably means that Tcl wasn't installed properly.
---
I attempted a complete reinstall of python (hoping it would reinstall
Tcl with correct file paths), but I get the same error. Any
suggestions would be appreciated.
Thanks!
Steve Skripnik, P.E.
Project Engineer
LimnoTech
1705 DeSales St NW
Suite 600
Washington, DC 20036
ssk...@li...<mailto:ssk...@li...>
http://www.limno.com<http://www.limno.com/>
Phone: (202) 833-9140 Fax: (202) 833-9094
Water | Environment | Scientists | Engineers
From: Benjamin R. <ben...@ou...> - 2011年03月10日 17:43:52
On Thu, Mar 10, 2011 at 8:40 AM, Auré Gourrier
<aur...@ya...>wrote:
> Dear all,
>
> Once again, I turn for help.
> I'm trying to plot a polar image using colormap values for the theta values
> and increasing alpha values along the radius.
> I do this using imshow passing the rgba tuple at each pixel position which
> works very nicely with rectangular axes, but fails to display using polar
> axes (see code below).
> As usual, I've done a fair bit of digging to find where the problem is and
> whether I could make out an alternate solution but haven't managed to come
> through. I've tried using pcolormesh but I don't see how to pass the rgba
> tuple
> Can anyone point me in the right direction.
> I'm using matplotlib 1.0.1 and Python 2.4
>
> Cheers,
>
> Auré
>
>
It appears that imshow() (and matshow()) do not support non-rectilinear
axes. I don't know if this is a bug or if there is no way to make it
support polar projections. Hopefully, someone else more knowledgable could
chime in on this.
I am also not exactly sure how to accomplish what you want using pcolor. A
really slow, painful way would be to pcolor each row with the rest masked
out, setting the alpha value for that row. I have long wondered if the
alpha kwarg in various functions could be improved by allowing array values
and take advantage of numpy broadcasting.
Ben Root
From: Daniel M. <dan...@go...> - 2011年03月10日 17:24:42
Hi Ben,
thanks a lot, this really helpes in the simple example, I'll try to
find out how to use it in the complex script. It seems 1.0.0 is recent
enough for this!
Thanks again,
Daniel
2011年3月10日 Benjamin Root <ben...@ou...>:
>
>
> On Thu, Mar 10, 2011 at 4:54 AM, Daniel Mader
> <dan...@go...> wrote:
>>
>> Hi,
>>
>> is it possible to change the default y-axis scaling so that the
>> ticks/label are not with respect to the large offset?
>>
>> For example:
>>
>> import scipy
>> import pylab
>>
>> x = scipy.arange(100)
>> y = scipy.rand(100) + 1000006
>>
>> pylab.figure()
>> pylab.plot(x,y)
>> pylab.grid()
>>
>> pylab.show()
>>
>> This gives the y-limits as (0,1) with respect to 1000006. This makes
>> it very hard to read. I'd like to be able to configure this manually.
>>
>> Thanks in advance,
>> Daniel
>>
>
> I tried to fix matplotlib to be smarter about choosing the offset value a
> while back, but I couldn't come up with something that worked well in the
> general case. You can manually turn it off completely, and have the full
> value displayed (or even manually set the offset value). If you have a very
> recent matplotlib:
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> x = np.arange(100)
> y = np.random.rand(100) + 1000006
>
> plt.figure()
> plt.plot(x, y)
> plt.grid()
> plt.ticklabel_format(useOffset=1000000, axis='y')
>
> plt.show()
>
> Or you can turn it off by setting useOffset to False.
>
> If you don't have a recent enough matplotlib, you can turn it off completely
> by doing something like this:
>
> import matplotlib.pyplot as plt
> import numpy as np
> from matplotlib.ticker import ScalarFormatter
>
> x = np.arange(100)
> y = np.random.rand(100) + 1000006
>
> fig = plt.figure()
> ax = fig.gca()
> ax.plot(x, y)
> ax.grid()
> ax.yaxis.set_major_formatter(ScalarFormatter(useOffset=False))
>
> plt.show()
>
>
> I hope this helps!
> Ben Root
>
>
From: Benjamin R. <ben...@ou...> - 2011年03月10日 16:37:30
On Thu, Mar 10, 2011 at 4:54 AM, Daniel Mader <
dan...@go...> wrote:
> Hi,
>
> is it possible to change the default y-axis scaling so that the
> ticks/label are not with respect to the large offset?
>
> For example:
>
> import scipy
> import pylab
>
> x = scipy.arange(100)
> y = scipy.rand(100) + 1000006
>
> pylab.figure()
> pylab.plot(x,y)
> pylab.grid()
>
> pylab.show()
>
> This gives the y-limits as (0,1) with respect to 1000006. This makes
> it very hard to read. I'd like to be able to configure this manually.
>
> Thanks in advance,
> Daniel
>
>
I tried to fix matplotlib to be smarter about choosing the offset value a
while back, but I couldn't come up with something that worked well in the
general case. You can manually turn it off completely, and have the full
value displayed (or even manually set the offset value). If you have a very
recent matplotlib:
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(100)
y = np.random.rand(100) + 1000006
plt.figure()
plt.plot(x, y)
plt.grid()
plt.ticklabel_format(useOffset=1000000, axis='y')
plt.show()
Or you can turn it off by setting useOffset to False.
If you don't have a recent enough matplotlib, you can turn it off completely
by doing something like this:
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import ScalarFormatter
x = np.arange(100)
y = np.random.rand(100) + 1000006
fig = plt.figure()
ax = fig.gca()
ax.plot(x, y)
ax.grid()
ax.yaxis.set_major_formatter(ScalarFormatter(useOffset=False))
plt.show()
I hope this helps!
Ben Root
From: Roban H. K. <rob...@ph...> - 2011年03月10日 16:25:26
The hist function expects a list of values that it bins up and counts
to form the histogram (see numpy.hist). That's why it is plotting one
"count" for each of the values you gave it.
You already have your counts, you just want to make a step plot out of
them. Look at the "drawstyle" keyword of the "plot" function:
drawstyle: [ 'default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post' ]
Hope that puts you on the right track.
-Roban
On Thu, Mar 10, 2011 at 4:18 PM, Andrea Crotti
<and...@gm...> wrote:
> I'm having some troubles understanding basic concepts.
> Suppose I want to do something like this, given a dictionary
>
> values = { (0,10) : 0.5,
>     (10, 20) : 0.3 }
> and so on, where the key is a time slot interval and the value is the
> value I want to plot.
>
> What should be the correct way to get what I want?
>
> In theory the data that I want to plot is [0.5, 0.3]
> but if I do
>
> plt.hist(values.values())
>
> I don't get that, but I get 2 bars of length 1 located in that x
> coordinate. So how should I proceed then?
>
> Thanks,
> Andrea
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Andrea C. <and...@gm...> - 2011年03月10日 15:19:24
I'm having some troubles understanding basic concepts.
Suppose I want to do something like this, given a dictionary
values = { (0,10) : 0.5,
 (10, 20) : 0.3 }
and so on, where the key is a time slot interval and the value is the
value I want to plot.
What should be the correct way to get what I want?
In theory the data that I want to plot is [0.5, 0.3]
but if I do
plt.hist(values.values())
I don't get that, but I get 2 bars of length 1 located in that x
coordinate. So how should I proceed then?
Thanks,
Andrea
From: Andrea C. <and...@gm...> - 2011年03月10日 15:18:54
I'm having some troubles understanding basic concepts.
Suppose I want to do something like this, given a dictionary
values = { (0,10) : 0.5,
 (10, 20) : 0.3 }
and so on, where the key is a time slot interval and the value is the
value I want to plot.
What should be the correct way to get what I want?
In theory the data that I want to plot is [0.5, 0.3]
but if I do
plt.hist(values.values())
I don't get that, but I get 2 bars of length 1 located in that x
coordinate. So how should I proceed then?
Thanks,
Andrea
From: Jouni K. S. <jk...@ik...> - 2011年03月10日 15:16:12
Andrea Crotti <and...@gm...> writes:
> values = { (0,10) : 0.5,
> (10, 20) : 0.3 }
> and so on, where the key is a time slot interval and the value is the
> value I want to plot.
>
> What should be the correct way to get what I want?
Something like this perhaps:
 left, width = zip(*[(a, b-a) for (a,b) in values.keys()])
 bar(left, values.values(), width)
That is, turn the sequence of intervals into a sequence of coordinates
where the bars should start (left) and another sequence of bar widths.
Then use bar to plot the values.
> In theory the data that I want to plot is [0.5, 0.3]
> but if I do
>
> plt.hist(values.values())
The hist function not only plots the histogram bars but computes them
from the data. Use bar when you already have the coordinates you want to
plot.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Auré G. <aur...@ya...> - 2011年03月10日 14:40:14
Dear all,
Once again, I turn for help.
I'm trying to plot a polar image using colormap values for the theta values and 
increasing alpha values along the radius.
I do this using imshow passing the rgba tuple at each pixel position which works 
very nicely with rectangular axes, but fails to display using polar axes (see 
code below).
As usual, I've done a fair bit of digging to find where the problem is and 
whether I could make out an alternate solution but haven't managed to come 
through. I've tried using pcolormesh but I don't see how to pass the rgba tuple
Can anyone point me in the right direction.
I'm using matplotlib 1.0.1 and Python 2.4
Cheers,
Auré
------
import matplotlib as mpl
from matplotlib import pylab
import numpy as np
#build custom colormap
cm_sym =customfunc()
#define mesh grid
theta = np.arange(0.,2.*math.pi+2.*math.pi/9,2.*math.pi/9)
r = np.arange(0,1.1,0.1)
X,Y = np.meshgrid(r,theta)
#define rgba array
polarcolorseq = mpl.cm.ScalarMappable(cmap=cm_hsvsym).to_rgba(Y)
#set an increasing alpha value along the radius
polarcolorseq[:,:,-1] = [list(np.arange(0,1.1,.1))]*10
pylab.figure(figsize=(10,5),dpi=100,facecolor='white')
#display using rectangular axis
ax = pylab.subplot((121),axisbg='k')
ax.imshow(np.flipud(np.swapaxes(polarcolorseq,0,1)))
#display using polar axis
ax2 = pylab.subplot((122),axisbg='k',projection='polar') #also tried with 
polar=True
ax2.imshow(np.flipud(np.swapaxes(polarcolorseq,0,1)))
pylab.draw() 
 
From: Andrea C. <and...@gm...> - 2011年03月10日 14:22:27
I'm having some troubles understanding basic concepts.
Suppose I want to do something like this, given a dictionary
values = { (0,10) : 0.5,
 (10, 20) : 0.3 }
and so on, where the key is a time slot interval and the value is the
value I want to plot.
What should be the correct way to get what I want?
In theory the data that I want to plot is [0.5, 0.3]
but if I do
plt.hist(values.values())
I don't get that, but I get 2 bars of length 1 located in that x
coordinate. So how should I proceed then?
Thanks,
Andrea
Maybe I should mention that there are actually two reasons why I don't
like this behavior:
1) it's sometimes very hard to read what's going on,
2) there also seems to be a bug when the limits are changed later, see
attached results: the upper subplot is default, the lower subplot uses
the padding.
##--------------------------
def update_ax2(ax1):
 '''
 Automatically update ylim of ax2 when ylim of ax1 changes.
 '''
 y1, y2 = ax1.get_ylim()
 ## modify the limits
 ax2.set_ylim((Tc(y1), Tc(y2)))
 ax2.figure.canvas.draw()
 Both plots are actually identical but use a different x-axis. In
ordert to create a nicely padded plot, I use the following function,
which breaks the scaling information AND the calculation of the second
axis limits:
##--------------------------
def axispaddingAX(ax):
 '''
 Saubere bzw. schoene Achsenskalierung für MPL-Skripten.
 '''
 lines = ax.get_lines()
 xtemp = []
 ytemp = []
 for line in lines:
 xtemp.append(min(line.get_xdata()))
 xtemp.append(max(line.get_xdata()))
 ytemp.append(min(line.get_ydata()))
 ytemp.append(max(line.get_ydata()))
 xmin,xmax = min(xtemp),max(xtemp)
 ymin,ymax = min(ytemp),max(ytemp)
 span = 0.05
 rangex = (xmin-span*(xmax-xmin), xmax+span*(xmax-xmin))
 rangey = (ymin-span*(ymax-ymin), ymax+span*(ymax-ymin))
 ax.set_xlim(rangex)
 ax.set_ylim(rangey)
Thanks a lot in advance for any hint or comment on this,
Daniel
2011年3月10日 Daniel Mader <dan...@go...>:
> Hi,
>
> is it possible to change the default y-axis scaling so that the
> ticks/label are not with respect to the large offset?
>
> For example:
>
> import scipy
> import pylab
>
> x = scipy.arange(100)
> y = scipy.rand(100) + 1000006
>
> pylab.figure()
> pylab.plot(x,y)
> pylab.grid()
>
> pylab.show()
>
> This gives the y-limits as (0,1) with respect to 1000006. This makes
> it very hard to read. I'd like to be able to configure this manually.
>
> Thanks in advance,
> Daniel
>
From: Daniel M. <dan...@go...> - 2011年03月10日 10:54:49
Hi,
is it possible to change the default y-axis scaling so that the
ticks/label are not with respect to the large offset?
For example:
import scipy
import pylab
x = scipy.arange(100)
y = scipy.rand(100) + 1000006
pylab.figure()
pylab.plot(x,y)
pylab.grid()
pylab.show()
This gives the y-limits as (0,1) with respect to 1000006. This makes
it very hard to read. I'd like to be able to configure this manually.
Thanks in advance,
Daniel
From: Nicolas S. <sch...@gm...> - 2011年03月10日 08:30:25
Hi all,
I am stuck on matplotlib generating a segfault when invoking 'plot'.
I've ben trying to solve this problem for a while now but no luck.
I've seen many duplicates of this problem on the web, some with
solutions, some without. The solution must be something more generic
that I'm missing.
Here are some of these pointers to the same problem that I have (the
backtrace, that I pasted further below, has the same properties)
http://old.nabble.com/101-Point-Segmentation-Fault-td27552745.html
http://old.nabble.com/weird-error-with-gcc-4.4,-gomp,-cython,-and-matplotlib-td27351399.html
http://bugs.gentoo.org/show_bug.cgi?id=338513
So here's my specific setup and backtrace. I hope I can find some help!
I'm using the 'agg' backend that's it, and the build and install dir
were cleaned up.
Thanks so much!
===
Solaris10, 64bits, Python 2.7, numpy 1.5.1, gcc 4.4.1 #all compiled from source
backtrace:
gdb python
(gdb) run -c 'import pylab;pylab.clf(); pylab.plot([4])'
Starting program: python -c 'import pylab;pylab.clf(); pylab.plot([4])'
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
terminate called after throwing an instance of 'std::exception'
terminate called recursively
Program received signal SIGABRT, Aborted.
[Switching to Thread 1 (LWP 1)]
0xfffffd7fff0ae88a in _lwp_kill () from /lib/64/libc.so.1
#0 0xfffffd7fff0ae88a in _lwp_kill () from /lib/64/libc.so.1
#1 0xfffffd7fff0a98b3 in thr_kill () from /lib/64/libc.so.1
#2 0xfffffd7fff0577e9 in raise () from /lib/64/libc.so.1
#3 0xfffffd7fff03a7d0 in abort () from /lib/64/libc.so.1
#4 0xfffffd7ff46d1a56 in __gnu_cxx::__verbose_terminate_handler () at
../../../../../libstdc++-v3/libsupc++/vterminate.cc:48
#5 0xfffffd7ff46cef6a in __cxxabiv1::__terminate (handler=0x1) at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
#6 0xfffffd7ff46cefb3 in std::terminate () at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
#7 0xfffffd7ff46cf03e in __cxxabiv1::__cxa_rethrow () at
../../../../../libstdc++-v3/libsupc++/eh_throw.cc:116
#8 0xfffffd7ff46d1af6 in __gnu_cxx::__verbose_terminate_handler () at
../../../../../libstdc++-v3/libsupc++/vterminate.cc:78
#9 0xfffffd7ff46cef6a in __cxxabiv1::__terminate (handler=0x1) at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:38
#10 0xfffffd7ff46cefb3 in std::terminate () at
../../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
#11 0xfffffd7ff46cf0b6 in __cxxabiv1::__cxa_throw (obj=<value
optimized out>, tinfo=<value optimized out>, dest=<value optimized
out>)
 at ../../../../../libstdc++-v3/libsupc++/eh_throw.cc:83
#12 0xfffffd7ff4a22fd8 in py_to_agg_transformation_matrix
(obj=0x774380, errors=<value optimized out>) at
src/agg_py_transforms.cpp:22
#13 0xfffffd7ff4a32e7c in _path_module::update_path_extents
(this=<value optimized out>, args=...) at src/path.cpp:380
#14 0xfffffd7ff4a34d90 in
Py::ExtensionModule<_path_module>::invoke_method_varargs (this=<value
optimized out>,
 method_def=<value optimized out>, args=...) at
./CXX/Python2/ExtensionModule.hxx:184
#15 0xfffffd7ff4a209b7 in Py::method_varargs_call_handler
(_self_and_name_tuple=<value optimized out>, _args=<value optimized
out>)
 at CXX/Python2/cxx_extensions.cxx:1714
#16 0x00000000004a6071 in call_function (f=0x2024770, throwflag=<value
optimized out>)
 at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:4012
#17 PyEval_EvalFrameEx (f=0x2024770, throwflag=<value optimized out>)
at /usr/local/src/lang/Python-2.7.1/Python/ceval.c:2665
#18 0x00000000004a79c1 in PyEval_EvalCodeEx (co=0x124e230,
globals=<value optimized out>, locals=<value optimized out>,
args=0x2024910,
 argcount=<value optimized out>, kws=0x3, kwcount=2,
defs=0x155c888, defcount=3, closure=0x0)
From: Benjamin R. <ben...@ou...> - 2011年03月10日 02:49:14
On Wed, Mar 9, 2011 at 8:25 PM, Andrew Chapkowski <ach...@es...>wrote:
> Can someone please explain how to coordinates need to be passed to
> contour for 3D graphs? I see all the examples use sample data, but I can't
> find any information on how the input points need to be formatted.
> Currently I have three array, one for the X, one for Y, and another for a Z
> value, and I was to plot each set on a 3D contour graph. What do I need to
> do to format these points correctly?
>
>
> Thank you
>
> Andrew
>
>
Andrew,
The data input for contourf3d is pretty much the same as it is for regular
2-D contourf. Essentially, X and Y are the grid coordinates, while Z
represents the value at those grid points. Z should be a NxM array. X and
Y should be NxM, or X is length N, with Y being length M.
I hope that clears it up.
Ben Root
From: Andrew C. <ach...@es...> - 2011年03月10日 02:25:43
Can someone please explain how to coordinates need to be passed to contour for 3D graphs? I see all the examples use sample data, but I can't find any information on how the input points need to be formatted.
Currently I have three array, one for the X, one for Y, and another for a Z value, and I was to plot each set on a 3D contour graph. What do I need to do to format these points correctly?
Thank you
Andrew

Showing 18 results of 18

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