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

Showing results of 398

<< < 1 2 3 4 5 6 .. 16 > >> (Page 4 of 16)
From: Steve B. <st...@ru...> - 2006年03月25日 16:15:35
I am using pylab in a web application server (TurboGears/CherryPy). 
I need to be able to render a plot (actually a pie) in png, jpg, or gif 
format directly into a variable that I can return to the application 
server. I'm currently using the rather ugly method of writing to a temp 
file and then reading it back in and returning the data. Is there a way 
to do this completely in memory?
Thanks,
Steve Bergman
From: Darren D. <dd...@co...> - 2006年03月24日 16:33:20
On Friday 24 March 2006 10:20, Humufr wrote:
> Hello,
>
> today I found a strange bug when I'm trying to save in eps format. The
> color green is not saved in color but in black in an eps file (it's
> working correctly in png) but the other color (at least blue and red in
> my test) are working so the problem is not that the postscript backend
> is working only in black and white but other things.
>
> regards,
>
> N.
>
> test.py
>
> import pylab
> pylab.plot([2,3],[5,6],'go')
> pylab.plot([5,2],[1,3],'ro')
> pylab.xlim(0,10)
> pylab.ylim(0,10)
> pylab.savefig('test.eps')
> pylab.savefig('test.png')
> pylab.show()
This was a bug in the new draw_markers, and is fixed in svn:
- if rgbFace[0]==rgbFace[0] and rgbFace[0]==rgbFace[2]:
+ if rgbFace[0]==rgbFace[1] and rgbFace[0]==rgbFace[2]:
From: Alan G I. <ai...@am...> - 2006年03月24日 15:36:28
On 2006年3月24日, Humufr apparently wrote:=20
> The color green is not saved in color but in black in an=20
> eps file
> import pylab=20
> pylab.plot([2,3],[5,6],'go')=20
> pylab.plot([5,2],[1,3],'ro')=20
> pylab.xlim(0,10)=20
> pylab.ylim(0,10)=20
> pylab.savefig('test.eps')=20
> pylab.savefig('test.png')=20
> pylab.show()=20
Works fine here.
mpl version 0.86.1
Cheers,
Alan Isaac
From: Humufr <hu...@ya...> - 2006年03月24日 15:20:08
 Hello,
today I found a strange bug when I'm trying to save in eps format. The 
color green is not saved in color but in black in an eps file (it's 
working correctly in png) but the other color (at least blue and red in 
my test) are working so the problem is not that the postscript backend 
is working only in black and white but other things.
regards,
N.
test.py
import pylab
pylab.plot([2,3],[5,6],'go')
pylab.plot([5,2],[1,3],'ro')
pylab.xlim(0,10)
pylab.ylim(0,10)
pylab.savefig('test.eps')
pylab.savefig('test.png')
pylab.show()
python test.py --verbose-helpful
matplotlib data path 
/usr/local/lib/python2.4/site-packages/matplotlib/mpl-data
$HOME=/home/humufr
CONFIGDIR=/home/humufr/.matplotlib
loaded rc file /home/humufr/.matplotlib/matplotlibrc
matplotlib version 0.88svn
verbose.level helpful
interactive is False
platform is linux2
numerix numarray 1.5.1
font search path 
['/usr/local/lib/python2.4/site-packages/matplotlib/mpl-data', '.', 
'/home/humufr/.fonts']
loaded ttfcache file /home/humufr/.matplotlib/ttffont.cache
backend GTKAgg version 2.8.0
From: Steve S. <el...@gm...> - 2006年03月24日 10:23:29
Hi
I discovered that when I plot many (e.g. 20) data sets in one plot and 
request a normal boxed legend the whitespace between the lower and upper 
box bounds and the firet and last legend entries increases with the 
number of data sets (i.e. legend entries). Is there a way to make this 
whitespace offset independent from the length of the legend?
cheers,
steve
-- 
When danger or in doubt, run in circles, scream and shout.
From: Derek B. <db...@ya...> - 2006年03月23日 22:09:33
If I rotate the xticks labels on this scatter plot the axes label is pushed off the figure. Do I
need to make the figuresize bigger or is matplotlib calculating it incorrectly?
from pylab import *
prediction_experiment = [(0.0001, 0.0001),(2, 250.797999999999998), (313.11000000000001,
25.797999999999998), (4499.1999999999998, 25000.0), (168830.0, 440000.0), (143090.0,
78571.399999999994), (34811.0, 78571.399999999994), (161240.0, 70967.699999999997)]
def roundUpLogDecade(x):
 """ Round up to the nearest logarithmic decade"""
 return math.ceil(x)
def roundDownLogDecade(x):
 """ Round up to the nearest logarithmic decade"""
 return math.floor(x)
def integer(x, pos):
 if x >= 1:
 return '%i' % (int(x))
 else:
 return '%.4f' % x
auc_cutoff = 50
ax = subplot(111)
# Axis scale must be set prior to declaring the Formatter
# If it is not the Formatter will use the default log labels for ticks.
ax.set_xscale('log')
ax.set_yscale('log')
formatter = FuncFormatter(integer)
ax.xaxis.set_major_formatter(formatter)
ax.yaxis.set_major_formatter(formatter)
tp_prediction_experiment = [[x[0], x[1]] for x in prediction_experiment if x[1] < auc_cutoff]
tn_prediction_experiment = [[x[0], x[1]] for x in prediction_experiment if x[1] > auc_cutoff]
ax.scatter( [x[0] for x in tn_prediction_experiment], [x[1] for x in tn_prediction_experiment],
s=3, c='r', marker='s', faceted=False)
ax.scatter( [x[0] for x in tp_prediction_experiment], [x[1] for x in tp_prediction_experiment],
s=3, c='b', marker='s', faceted=False)
# Must add 1 to allow the last decades label to be shown
ax.set_xlim(10**roundDownLogDecade(log10(min([x[0] for x in prediction_experiment]))),
10**roundUpLogDecade(log10(max([x[0] for x in prediction_experiment])))+1)
ax.set_ylim(10**roundDownLogDecade(log10(min([x[1] for x in prediction_experiment]))),
10**roundUpLogDecade(log10(max([x[1] for x in prediction_experiment])))+1)
grid(True) 
xlabel(r"Prediction", fontsize = 12)
ylabel(r"Experimental IC50 [nM]", fontsize = 12)
xlocs, xlabels = xticks()
setp(xlabels, rotation=45)
ylocs, ylabels = yticks()
setp(ylabels, rotation=45)
show()
Thanks,
Derek Basch
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
From: Eric F. <ef...@ha...> - 2006年03月23日 19:25:46
Michael,
Thanks, this is now fixed in svn.
Eric
O'Keefe, Michael wrote:
> Line 733 in ticker.py in matplotlib 0.87.2 has a potential divide by zero error:
> 
> var = dv/max(abs(vmin),abs(vmax))
> 
> I've triggered it with the following:
> 
> import pylab
> import numpy as np
> t = np.array([0.,1.,2.,3.],float)
> a = np.array([0.,0.,0.,0.],float)
> pylab.plot(t,a)
> 
> The error is:
> 
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2018, in plot
> ret = gca().plot(*args, **kwargs)
> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2790, in plot
> self.autoscale_view()
> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 817, in autoscal
> e_view
> self.set_ylim(locator.autoscale())
> File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 798, in autosc
> ale
> return take(self.bin_boundaries(dmin, dmax), [0,-1])
> File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 768, in bin_bo
> undaries
> scale, offset = scale_range(vmin, vmax, nbins)
> File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 733, in scale_
> range
> var = dv/max(abs(vmin), abs(vmax))
> ZeroDivisionError: float division
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid1720ドル&dat1642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Glen W. M. <Gle...@sw...> - 2006年03月23日 19:17:14
I'm using 0.86.2 (Debian 0.86.2-3). With the following line in
matplotlibrc, 
 font.sans-serif : Courier 10 Pitch, Bitstream Vera Sans, Lucida Grande, Verdana, Geneva, Lucida, Bitstream Vera Sans, Arial, Helvetica, sans-serif
when I run 
 
 python embedding_in_wx.py
 python embedding_in_wx2.py
 python embedding_in_wx3.py
 python embedding_in_gtk.py
I see the Courier font used. But when I run
 python embedding_in_gtk3.py
 python embedding_in_qt.py
 python embedding_in_tk.py
 python embedding_in_tk2.py
 python embedding_in_wx4.py
I see the Lucida Grande font used. Any ideas?
Thank you,
Glen Mabey
From: Robert H. <he...@ta...> - 2006年03月23日 18:58:20
You may double check to see that MPL is finding the correct versions 
of Freetype. There is a version in Apple's X11 that does not work 
with MPL -- make sure you are not picking up this one by mistake. 
Otherwise, the build method you described has worked for me. It 
seems like you are doing all the right things.
-Rob.
On Mar 22, 2006, at 12:17 PM, Tom Loredo wrote:
>
> Hi folks,
>
> I've just installed MacPy 2.4.1, the latest numpy & scipy, and
> mpl-0.87.2 on a colleague's Panther PowerBook. numpy & scipy
> installed fine and passed all tests. For mpl, we installed
> zlib from source, and initially installed Freetype2 and libpng
> via the i-Installer. mpl built and installed fine, but gave
> a bus error when trying to plot ("import matplotlib" would
> work fine, but "import pylab" would give the error).
>
> The .matplotlib/matplotlibrc file we're using does have TkAgg
> and numpy specified, and we've verified that Tkinter is
> working via a "Hello World" test script.
>
> Suspecting one of the libraries, we then installed Freetype2
> and libpng from source. We deleted all the mpl stuff in
> site-packages and the mpl build directory, and built and
> installed mpl again from scratch. We still get a bus error
> from pylab. I am stumped as to what to try next. I've
> copied verbose output below; I hope someone can offer us
> some clues.
>
> Thanks,
> Tom Loredo
>
> $ pythonw simple_plot.py --verbose-debug-annoying
> matplotlib data path
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ 
> site-packages/matplotlib/mpl-data
> $HOME=/Users/bill
> CONFIGDIR=/Users/bill/.matplotlib
> loaded rc file /Users/bill/.matplotlib/matplotlibrc
> matplotlib version 0.87.2
> verbose.level debug-annoying
> interactive is False
> platform is darwin
> loaded modules: ['pylab', '_bisect', '__future__', 'copy_reg',
> 'sre_compile', 'distutils', 'itertools', '_sre', '__main__', 'site',
> '__builtin__', 'datetime', 'matplotlib.re', 'matplotlib.tempfile',
> 'encodings', 'pytz.datetime', 'shutil', 'distutils.string',
> 'dateutil', 'matplotlib.datetime', 'posixpath', '_random',
> 'tempfile', 'errno', 'matplotlib.warnings', 'binascii',
> 'encodings.codecs', 'sre_constants', 're', 'matplotlib.md5',
> 'os.path', 'pytz.sys', '_codecs', 'distutils.sysconfig',
> 'encodings.exceptions', 'pytz.sets', 'math', 'fcntl', 'stat',
> 'zipimport', 'string', 'warnings', 'encodings.types', 'UserDict',
> 'encodings.ascii', 'matplotlib.sys', 'matplotlib', 'distutils.os',
> 'sys', 'pytz.tzinfo', 'pytz', 'matplotlib.__future__', 'codecs',
> 'distutils.re', 'matplotlib.pytz', 'types', 'md5',
> 'matplotlib.dateutil', 'matplotlib.os', 'thread', 'sre', 'bisect',
> 'matplotlib.distutils', 'signal', 'distutils.errors', 'random',
> 'linecache', 'matplotlib.shutil', 'posix', 'encodings.aliases',
> 'sets', 'exceptions', 'sre_parse', 'pytz.bisect', 'distutils.sys',
> 'os', 'strop']
> numerix numpy 0.9.6
> Bus error
>
>
>
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting 
> language
> that extends applications into web and mobile media. Attend the 
> live webcast
> and join the prime developer group breaking into this new coding 
> territory!
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: he...@ta..., w: http://pong.tamu.edu
From: Charlie M. <cw...@gm...> - 2006年03月23日 15:08:15
This came up on the dev list, and I believe is fixed in svn now.
Thanks,
On 3/23/06, O'Keefe, Michael <Mic...@nr...> wrote:
> Line 733 in ticker.py in matplotlib 0.87.2 has a potential divide by zero=
 error:
>
> var =3D dv/max(abs(vmin),abs(vmax))
>
> I've triggered it with the following:
>
> import pylab
> import numpy as np
> t =3D np.array([0.,1.,2.,3.],float)
> a =3D np.array([0.,0.,0.,0.],float)
> pylab.plot(t,a)
>
> The error is:
>
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2018, in=
 plot
> ret =3D gca().plot(*args, **kwargs)
> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2790, in =
plot
> self.autoscale_view()
> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 817, in a=
utoscal
> e_view
> self.set_ylim(locator.autoscale())
> File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 798, in=
 autosc
> ale
> return take(self.bin_boundaries(dmin, dmax), [0,-1])
> File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 768, in=
 bin_bo
> undaries
> scale, offset =3D scale_range(vmin, vmax, nbins)
> File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 733, in=
 scale_
> range
> var =3D dv/max(abs(vmin), abs(vmax))
> ZeroDivisionError: float division
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid1720ドル&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: O'Keefe, M. <Mic...@nr...> - 2006年03月23日 14:32:42
Line 733 in ticker.py in matplotlib 0.87.2 has a potential divide by =
zero error:
var =3D dv/max(abs(vmin),abs(vmax))
I've triggered it with the following:
import pylab
import numpy as np
t =3D np.array([0.,1.,2.,3.],float)
a =3D np.array([0.,0.,0.,0.],float)
pylab.plot(t,a)
The error is:
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 2018, =
in plot
 ret =3D gca().plot(*args, **kwargs)
 File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 2790, in =
plot
 self.autoscale_view()
 File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 817, in =
autoscal
e_view
 self.set_ylim(locator.autoscale())
 File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 798, =
in autosc
ale
 return take(self.bin_boundaries(dmin, dmax), [0,-1])
 File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 768, =
in bin_bo
undaries
 scale, offset =3D scale_range(vmin, vmax, nbins)
 File "c:\python24\lib\site-packages\matplotlib\ticker.py", line 733, =
in scale_
range
 var =3D dv/max(abs(vmin), abs(vmax))
ZeroDivisionError: float division
From: Charlie M. <cw...@gm...> - 2006年03月23日 13:27:20
Attachments: backend_aqt.py
On 3/22/06, lan...@qw... <lan...@qw...> wrote:
> Does matplotlib work with AquaTerm as a backend?
Recently an AquaTerm backend was donated to matplotlib. I haven't had
a chance to test or commit it to svn yet though. I am attaching it
for anyone interested.
- Charlie
From: Gary R. <gr...@bi...> - 2006年03月23日 11:39:15
Hi John,
I've found the source of this figimage problem.
In _backend_agg.cpp RendererAgg::draw_image is expecting 4 arguments and 
is being passed 5 by the FigureImage draw method in image.py
The offending line is:
renderer.draw_image(self.ox, self.oy, im, self.origin, self.figure.bbox)
Changing this to
renderer.draw_image(self.ox, self.oy, im, self.figure.bbox)
solved the problem for me.
I checked and found that the RendererAgg draw_image() virtual method has 
5 arguments, which seems to be the source of the problem, so either this 
needs changing or the backend code does.
_draw_image() in backend_agg.py makes the call with 3 arguments, so this 
needs fixing too.
The draw_image() method in backend_emf.py has a stub override with 5 
arguments, so this may need changing too, although it isn't causing harm 
yet. I'm not sure all of these are real problems because I didn't try 
too hard to understand how the backends work.
regards,
Gary R.
John Hunter wrote:
>>>>>> "gruben@bigpond" == gruben@bigpond net au <gr...@bi...> writes:
> 
> gruben@bigpond> It's possible I've done something stupid, but
> gruben@bigpond> imshow works, so I don't think so. I suspect this
> gruben@bigpond> may have been broken for a while. I haven't tried
> gruben@bigpond> 0.87.2 (because I can't be bothered with the new
> gruben@bigpond> numpy/scipy/matplotlib version interdependency).
> 
> matplotlib does not require numpy or scipy to build or run. You can
> simply set 'numerix : Numeric' or 'numerix : numarray' in your rc file
> and still use the same old libs you want. 
> 
> So feel free to update to the latest version if you want. I will look
> into the figimage problem later.
> 
> JDH
From: Ryan K. <rya...@gm...> - 2006年03月22日 19:27:22
Move the %la inside:
xlabel(r'\textbf{Residue }%s'%la,fontsize=3D18)
On 3/22/06, Juergen Haas <jh...@gw...> wrote:
> Dear, All,
>
>
> I am using matplotlib's rc to label x axes:
> rc('text', usetex=3DTrue)
> pl.xlabel(r'\textbf{Residue}')
> I would like to use something more dynamic like:
>
> la=3D'5';pl.xlabel(r'\textbf{Residue }%s',fontsize=3D18) %la
>
> But i get:
> TypeError: unsupported operand type(s) for %: 'instance' and 'str'
> if la is float and int the error is reported accordingly..
>
>
> How would be the best way to go about it?
>
> with eval I was aiming at resolving the problem but so far I failed...
>
> best regards
> Juergen
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat=
=3D121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: James B. <bo...@ll...> - 2006年03月22日 19:17:08
The Changelog that comes with basemap-0.8.2 indicates that there is a 
'huge' speed increase for numpy (not Numeric or numarray).
Is this relative, i.e. the new numpy version is much faster that the 
previous or is the increase absolute i.e. numpy is much faster than the 
other two.
I have been dragging my feet switching over to numpy but a big speed up 
in basemap might increase my urgency. I do not use basemap because on 
my old hardware it is so slow as to be unusable.
Thanks for any info.
--Jim
From: Juergen H. <jh...@gw...> - 2006年03月22日 19:14:08
Dear, All,
I am using matplotlib's rc to label x axes:
rc('text', usetex=True)
pl.xlabel(r'\textbf{Residue}')
I would like to use something more dynamic like:
la='5';pl.xlabel(r'\textbf{Residue }%s',fontsize=18) %la
But i get:
TypeError: unsupported operand type(s) for %: 'instance' and 'str'
if la is float and int the error is reported accordingly..
How would be the best way to go about it?
with eval I was aiming at resolving the problem but so far I failed...
best regards
Juergen
From: John H. <jdh...@ac...> - 2006年03月22日 18:21:45
>>>>> "Tom" == Tom Loredo <lo...@as...> writes:
 Tom> Hi folks,
 Tom> I've just installed MacPy 2.4.1, the latest numpy & scipy,
 Tom> and mpl-0.87.2 on a colleague's Panther PowerBook. numpy &
 Tom> scipy installed fine and passed all tests. For mpl, we
 Tom> installed zlib from source, and initially installed Freetype2
 Tom> and libpng via the i-Installer. mpl built and installed
 Tom> fine, but gave a bus error when trying to plot ("import
 Tom> matplotlib" would work fine, but "import pylab" would give
 Tom> the error).
It would be useful to create a test script
 from pylab import figure, show
 fig = figure()
 ax.plot((1,2,3))
 fig.savefig('test')
 show()
and run it under different backends
 > python myscript.py -dPS
 > python myscript.py -dAgg
 > python myscript.py -dTkAgg
to see if all have the bus error. If we could isolate it to TkAgg or
*Agg, that would be informative.
Also, try installing Numeric and test to see if it is numpy specific
 > python myscript.py --Numeric
 > python myscript.py --numpy
JDH
From: Tom L. <lo...@as...> - 2006年03月22日 18:18:16
Hi folks,
I've just installed MacPy 2.4.1, the latest numpy & scipy, and
mpl-0.87.2 on a colleague's Panther PowerBook. numpy & scipy 
installed fine and passed all tests. For mpl, we installed
zlib from source, and initially installed Freetype2 and libpng
via the i-Installer. mpl built and installed fine, but gave
a bus error when trying to plot ("import matplotlib" would
work fine, but "import pylab" would give the error).
The .matplotlib/matplotlibrc file we're using does have TkAgg
and numpy specified, and we've verified that Tkinter is
working via a "Hello World" test script.
Suspecting one of the libraries, we then installed Freetype2
and libpng from source. We deleted all the mpl stuff in
site-packages and the mpl build directory, and built and
installed mpl again from scratch. We still get a bus error
from pylab. I am stumped as to what to try next. I've
copied verbose output below; I hope someone can offer us
some clues.
Thanks,
Tom Loredo
$ pythonw simple_plot.py --verbose-debug-annoying
matplotlib data path 
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/mpl-data
$HOME=/Users/bill
CONFIGDIR=/Users/bill/.matplotlib
loaded rc file /Users/bill/.matplotlib/matplotlibrc
matplotlib version 0.87.2
verbose.level debug-annoying
interactive is False
platform is darwin
loaded modules: ['pylab', '_bisect', '__future__', 'copy_reg', 
'sre_compile', 'distutils', 'itertools', '_sre', '__main__', 'site', 
'__builtin__', 'datetime', 'matplotlib.re', 'matplotlib.tempfile', 
'encodings', 'pytz.datetime', 'shutil', 'distutils.string', 
'dateutil', 'matplotlib.datetime', 'posixpath', '_random', 
'tempfile', 'errno', 'matplotlib.warnings', 'binascii', 
'encodings.codecs', 'sre_constants', 're', 'matplotlib.md5', 
'os.path', 'pytz.sys', '_codecs', 'distutils.sysconfig', 
'encodings.exceptions', 'pytz.sets', 'math', 'fcntl', 'stat', 
'zipimport', 'string', 'warnings', 'encodings.types', 'UserDict', 
'encodings.ascii', 'matplotlib.sys', 'matplotlib', 'distutils.os', 
'sys', 'pytz.tzinfo', 'pytz', 'matplotlib.__future__', 'codecs', 
'distutils.re', 'matplotlib.pytz', 'types', 'md5', 
'matplotlib.dateutil', 'matplotlib.os', 'thread', 'sre', 'bisect', 
'matplotlib.distutils', 'signal', 'distutils.errors', 'random', 
'linecache', 'matplotlib.shutil', 'posix', 'encodings.aliases', 
'sets', 'exceptions', 'sre_parse', 'pytz.bisect', 'distutils.sys', 
'os', 'strop']
numerix numpy 0.9.6
Bus error
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
From: Antonio G. <Ant...@ki...> - 2006年03月22日 14:57:28
Darren Dale wrote:
> Hi Antonio,
>=20
> This is a blast from the past, it's a limitation of AGG:
> http://sourceforge.net/mailarchive/message.php?msg_id=3D9175398
>=20
> Darren
Thanks for replying, Darren. Actually, while searching for an answer to m=
y=20
problem a few days ago, I read the thread that you point out. It's just t=
hat,=20
since such thread is already a couple of years old, I was hoping someone =
had=20
come with a way of sorting the problem out.
Anyway, I'll cut my data down to some useful length. Thanks,
Antonio
--=20
Antonio Gonzalez, MD MSc PhD
Department of Neuroscience
Karolinska Institutet
Retzius v=C3=A4g. 8
171 77 Stockholm
Sweden
From: Ralf G. <r.g...@uc...> - 2006年03月22日 13:13:47
Hi everyone,
I am looking for a way to use an axis break in one of the axes of a normal 
scatter plot. I searched the mailing lists and users guide but couldn't find 
anything. 
I can transform my data and manually set the tick labels so the graph looks 
the way I want, but that does not give me the actual axis break symbol 
(double straight or squiggly lines perpendicular to the axis).
If anyone knows how to do this I'd appreciate the help.
Cheers,
Ralf
From: Darren D. <dd...@co...> - 2006年03月22日 12:27:20
Hi Antonio,
This is a blast from the past, it's a limitation of AGG:
http://sourceforge.net/mailarchive/message.php?msg_id=9175398
Darren
On Wednesday 22 March 2006 7:13 am, Antonio Gonzalez wrote:
> Dear all,
>
> I have problems displaying plots for large datasets. Briefly, when
> attempting to plot a large number of data points these are not displayed,
> or only partially displayed. The simplest way for reproducing my problem
> is:
>
> from pylab import *
> datalen = 100000
>
> data = rand(datalen)
> plot(data)
> show()
>
> Here, if datalen is 10000, then the graph looks as expected. However, if
> datalen is increased, say, to 100000, then the resulting plot is incomplete
> (as shown in snapshot1). Moreover, when trying to zoom, the axes display
> the new values reflecting the zoomed scale, but the data are not actually
> zoomed (eg snapshot2). I have no clue as to what can be wrong, since no
> error is returned. Also, no error results from running the example above
> with --verbose-helpful:
>
> antonio@linux:~/python> python test.py --verbose-helpful
> matplotlib data path
> /usr/lib/python2.4/site-packages/matplotlib/mpl-data $HOME=/home/antonio
> CONFIGDIR=/home/antonio/.matplotlib
> loaded rc file /home/antonio/.matplotlib/matplotlibrc
> matplotlib version 0.88svn
> verbose.level helpful
> interactive is False
> platform is linux2
> numerix numpy 0.9.6.2206
> font search path
> ['/usr/lib/python2.4/site-packages/matplotlib/mpl-data'] loaded ttfcache
> file /home/antonio/.matplotlib/ttffont.cache
> backend TkAgg version 8.4
>
> In a real example of what I'm trying to do: I read a fragment of data from
> a large file, then plot such fragment of data; convolve it and plot the
> result (as in snapshot3); interactively make some decisions according to
> such plot, and then move to the next fragment of my large file to repeat
> the process. However, whenever I attempt to plot large chunks of data, the
> plot is not displayed (eg snapshot4). As mentioned, no error is returned,
> and thus I have no clue as to how to fix this problem.
>
> (For the record, in snapshot3 the length of data plotted is 671334 [top]
> and 132829 [bottom]. In snapshot4 it is 1162554 [top] and 231073 [bottom].)
>
> Any help will be much appreciated.
>
> Antonio
-- 
Darren S. Dale, Ph.D.
dd...@co...
From: Antonio G. <Ant...@ki...> - 2006年03月22日 12:13:34
Dear all,
I have problems displaying plots for large datasets. Briefly, when attemp=
ting to=20
plot a large number of data points these are not displayed, or only parti=
ally=20
displayed. The simplest way for reproducing my problem is:
 from pylab import *
 datalen =3D 100000
 data =3D rand(datalen)
 plot(data)
 show()
Here, if datalen is 10000, then the graph looks as expected. However, if =
datalen=20
is increased, say, to 100000, then the resulting plot is incomplete (as s=
hown in=20
snapshot1). Moreover, when trying to zoom, the axes display the new value=
s=20
reflecting the zoomed scale, but the data are not actually zoomed (eg=20
snapshot2). I have no clue as to what can be wrong, since no error is ret=
urned.=20
Also, no error results from running the example above with --verbose-help=
ful:
 antonio@linux:~/python> python test.py --verbose-helpful
 matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-d=
ata
 $HOME=3D/home/antonio
 CONFIGDIR=3D/home/antonio/.matplotlib
 loaded rc file /home/antonio/.matplotlib/matplotlibrc
 matplotlib version 0.88svn
 verbose.level helpful
 interactive is False
 platform is linux2
 numerix numpy 0.9.6.2206
 font search path ['/usr/lib/python2.4/site-packages/matplotlib/mpl-dat=
a']
 loaded ttfcache file /home/antonio/.matplotlib/ttffont.cache
 backend TkAgg version 8.4
In a real example of what I'm trying to do: I read a fragment of data fro=
m a=20
large file, then plot such fragment of data; convolve it and plot the res=
ult (as=20
in snapshot3); interactively make some decisions according to such plot, =
and=20
then move to the next fragment of my large file to repeat the process. Ho=
wever,=20
whenever I attempt to plot large chunks of data, the plot is not displaye=
d (eg=20
snapshot4). As mentioned, no error is returned, and thus I have no clue a=
s to=20
how to fix this problem.
(For the record, in snapshot3 the length of data plotted is 671334 [top] =
and=20
132829 [bottom]. In snapshot4 it is 1162554 [top] and 231073 [bottom].)
Any help will be much appreciated.
Antonio
--=20
Antonio Gonzalez, MD MSc PhD
Department of Neuroscience
Karolinska Institutet
Retzius v=C3=A4g. 8
171 77 Stockholm
Sweden
From: Chris S. <chr...@ai...> - 2006年03月22日 11:21:26
Some time ago (before the arrow patch), I wrote a small function to do 
this. I hope that this is also useful for you.
---------------------------
def arrow(p1, p2, style=None, linewidth=1):
	import math
	import pylab as P
	linex = [p1[0], p2[0]]
	liney = [p1[1], p2[1]]
	theta0 = math.atan2(liney[1]-liney[0], linex[1]-linex[0])
	thetaa = math.pi/12
	theta1 = theta0 - thetaa
	theta2 = theta0 + thetaa
	L = 0.05
	xh = linex[1]
	yh = liney[1]
	xa1 = xh - L*math.cos(theta1)
	ya1 = yh - L*math.sin(theta1)
	xa2 = xh - L*math.cos(theta2)
	ya2 = yh - L*math.sin(theta2)
	P.plot(linex, liney, style, linewidth=linewidth)
	P.plot([xa1, xh, xa2], [ya1, yh, ya2], 'k-', linewidth=linewidth)
---------------------------
Nils Wagner wrote:
> Dear Matplotlib-Users,
> 
> I would like to add arrows at the corners of the
> blue line to illustrate the order of the
> iterates. Is it possible to realize it with
> matplotlib ?
> 
> Nils
> 
> ------------------------------------------------------------------------
> 
From: Nils W. <nw...@me...> - 2006年03月22日 08:18:39
Hi John,
Thank you for your hint.
python arrow_demo.py --verbose-helpful yields
matplotlib data path /usr/lib64/python2.4/site-packages/matplotlib/mpl-data
$HOME=/home/nwagner
CONFIGDIR=/home/nwagner/.matplotlib
loaded rc file /home/nwagner/.matplotlib/matplotlibrc
matplotlib version 0.88svn
verbose.level helpful
interactive is False
platform is linux2
numerix numpy 0.9.7.2264
font search path ['/usr/lib64/python2.4/site-packages/matplotlib/mpl-data']
loaded ttfcache file /home/nwagner/.matplotlib/ttffont.cache
backend GTKAgg version 2.8.0
Traceback (most recent call last):
 File "arrow_demo.py", line 307, in ?
 make_arrow_plot(d, display=display, linewidth=0.001, edgecolor=None,
NameError: name 'd' is not defined
Nils
 
From: John H. <jdh...@ac...> - 2006年03月21日 21:25:30
>>>>> "Mads" == Mads Ipsen <mp...@os...> writes:
 Mads> If you can provide a few pointers to the relevant files in
 Mads> the matplotlib source, I'll have a look and see what I can
 Mads> do.
You will only need to modify one file
lib/matplotlib/backends/backend_qtagg and add the following three
methods
 * background = canvas.copy_from_bbox(ax.bbox) - copy the region in
 ax.bbox into a pixel buffer and return it in an object type of
 your choosing. bbox is a matplotlib BBox instance from the [WWW]
 transforms module. background is not used by the matplotlib
 frontend, but it stores it and passes it back to the backend in
 the restore_region method. You will probably want to store not
 only the pixel buffer but the rectangular region of the canvas
 from whence it came in the background object.
 * canvas.restore_region(background) - restore the region copied
 above to the canvas.
 * canvas.blit(bbox) - transfer the pixel buffer in region bounded
 by bbox to the canvas.
The pixel buffer is provided by backend_agg's RendererAgg. QtAggg
inherits from Agg, so has access to these methods. GTKAgg, WXAgg and
TkAgg currently do the pixel transfer in extension code (see
src/_gtkagg.cpp, src/_tkagg.cpp and src/_wxagg.cpp) but this is not
necessary. For example, one can use the pygtk pixel buffer methods to
do the transfer and it would probably be as efficient, but this has
not been implemented yet. The hard part is to get all the vertical
offsets right, with the origin at the top versus bottom stuff worked
out.
Take a look at the paintEvent method in FigureCanvasQtAgg which does
the pixel buffer of the entire agg buffer to the qt canvas. For
the "blit" method, you'll want to emulate this but transfer only the
region in the bbox. The bbox is a matplotlib.transforms.BBox
instance. See the docs at
 http://matplotlib.sf.net/matplotlib.transforms.html
Good luck, and feel free to ask questions!
JDH
5 messages has been excluded from this view by a project administrator.

Showing results of 398

<< < 1 2 3 4 5 6 .. 16 > >> (Page 4 of 16)
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 によって変換されたページ (->オリジナル) /