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





Showing results of 318

<< < 1 .. 8 9 10 11 12 13 > >> (Page 10 of 13)
From: John H. <jd...@gm...> - 2007年04月07日 02:28:42
On 4/6/07, Eric Firing <ef...@ha...> wrote:
> The size argument, s, is given in squared points; that is, it is a
> measure of area, not of linear dimensions.
>
> This strikes me as counterintuitive and not particularly useful. It
> seems more natural that the size be a linear dimension; if a user wants
> size to vary with area, the user can pass in the square root of the area.
>
> Would anyone object to this change? How strenuously? I am not actually
This strikes me as a foolish consistency that may be best to live
with. The basic scatter signature is the same as matlab's, which also
uses size in points squared. It has never been intuitive to me
either, but I simply slavishly followed their convention. By now we
have three constituencies who may find a change irksome: current
users who have written code around the long-standing implementation,
prospective users coming from matlab who will find it confusing that
the signature is otherwise the same as matlab's but the size argument
is different, and developers who have to update the code, the
examples, the website screenshots, and the user's guide.
Since this irksome, somewhat counter-intuitive feature is well
documented, it seems preferable to me to let people simply square
their sizes for scatter and not break anyone's code. It's not too
hard to do
 r = 10*rand(20) # radii
 scatter(x, y, 2*pi*r**2)
Maybe we should simply add an example like the one above to the docstring.
Now there are those who are dusting off their pens as I type, getting
ready to point out that we should not slavishly follow matlab but
rather do the best thing possible. Fair enough. But we should also
be hesitant to break the API and existing code to fix a minor
annoyance that is easy to work around. I think one thing that has
contributed to the success of matplotlib is that the API has been
extremely stable.
Code written against mpl 0.1 for the most part still runs, though
maybe an import statement needs to be changed (replace
matplotlib.matlab with matplotlib.pylab). The major reason for this
is that we emulated matlab's API from the start. In many cases we've
extended the matlab functionality significantly, particularly with all
of the stuff we do with keyword args, but we have rarely if ever
removed matlab compatibility once it was in place. Hence people who
wrote their code against the original matlab-like API can still use
their code now.
JDH
From: Eric F. <ef...@ha...> - 2007年04月07日 00:36:28
In the course of responding to a request regarding the color handling in 
Axes.scatter and pylab.scatter, I decided to raise a more general 
question for input from users:
The scatter method has the following signature:
 def scatter(self, x, y, s=20, c='b', marker='o', cmap=None, norm=None,
 vmin=None, vmax=None, alpha=1.0, linewidths=None,
 faceted=True, verts=None,
 **kwargs):
The size argument, s, is given in squared points; that is, it is a 
measure of area, not of linear dimensions.
This strikes me as counterintuitive and not particularly useful. It 
seems more natural that the size be a linear dimension; if a user wants 
size to vary with area, the user can pass in the square root of the area.
Would anyone object to this change? How strenuously? I am not actually 
all that eager to make the change right now myself, so if someone else 
wants to do it, that is fine. But in the interests of having mpl 
converge on an API that is easy to use and doesn't surprise people any 
more than necessary, I think this change is needed.
If the change is made, some mechanism could be used to provide a gradual 
changeover so that existing code specifying the squared points would not 
suddenly break without warning.
Comments, please.
Eric
From: Christopher B. <Chr...@no...> - 2007年04月06日 18:17:39
Ken McIvor wrote:
> I recommend you play around with 
> the FloatCanvas demo, then look at the documentation and source code 
> to get an idea of how fast you can get up and running with it.
Thanks for the endorsement, Ken.
I will say that while I think FloatCanvas is a good tool for the job, it 
is going to take more than a "few hours" unless the user is already 
experienced with wxPython
If it does look promising, be sure to get the latest version from:
http://www.mithis.com/~chrisb
In addition to a few more features, it includes a bunch of small Demos 
that show you how to do a variety of things with it. There's a mailing 
list for questions, too:
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Tommy G. <tg...@ma...> - 2007年04月06日 17:17:40
On Apr 6, 2007, at 1:04 PM, Jeff Whitaker wrote:
> Tommy Grav wrote:
>> I have two lists that I would like to plot as two separate 
>> histograms inside the same
>> plot. However
>>
>> pylab.hist(h1list,26,facecolor='r')
>> pylab.hist(h2list,26,alpha=0.3)
>> pylab.show()
>>
>> seems to plot the two histograms with different x-y limits on the 
>> axis. Also how can
>> I force the bins to have the same start and end?
>>
>> Cheers
>> Tommy
>>
>>
>
> Tommy: Use the 'bins' keyword to pylab.hist (http:// 
> matplotlib.sourceforge.net/matplotlib.pylab.html#-hist).
Thanks. I noticed that on my own and for the first time in my python 
programming history
used a list comprehension to generate the bins list :) The histograms 
are now displayed
correctly.
Cheers
 Tommy
From: Ken M. <mc...@ii...> - 2007年04月06日 17:08:40
On Apr 5, 2007, at 8:41 PM, belinda thom wrote:
>
> So, how do the above observations relate to John Hunter's 
> recommendation that I use a timer or idler? It was the reply from 
> him that led me to think I might be able to come up w/something 
> that worked w/o too much dorking.
My understanding is that John was recommending a method for writing a 
GUI application that used matplotlib. You might be able to use that 
approach to write the whole shebang in pylab, but I suspect it would 
be difficult to do well.
> Understood. If I could get something working really quickly, I 
> might go that route. But it would have to take a few hours tops, 
> and that would include me figuring out how to get in mouse clicks 
> and draw graphics.
If you need a simple front-end for drawing and receiving mouse 
clicks, wxPython's FloatCanvas is probably a fine choice. The OSX 
version of wxPython includes a demo application that showcases the 
different UI elements it provides. I recommend you play around with 
the FloatCanvas demo, then look at the documentation and source code 
to get an idea of how fast you can get up and running with it.
Ken
From: Jeff W. <js...@fa...> - 2007年04月06日 17:04:41
Tommy Grav wrote:
> I have two lists that I would like to plot as two separate histograms 
> inside the same
> plot. However
>
> pylab.hist(h1list,26,facecolor='r')
> pylab.hist(h2list,26,alpha=0.3)
> pylab.show()
>
> seems to plot the two histograms with different x-y limits on the 
> axis. Also how can
> I force the bins to have the same start and end?
>
> Cheers
> Tommy
>
> 
Tommy: Use the 'bins' keyword to pylab.hist 
(http://matplotlib.sourceforge.net/matplotlib.pylab.html#-hist).
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Tommy G. <tg...@ma...> - 2007年04月06日 16:53:41
I have two lists that I would like to plot as two separate histograms 
inside the same
plot. However
pylab.hist(h1list,26,facecolor='r')
pylab.hist(h2list,26,alpha=0.3)
pylab.show()
seems to plot the two histograms with different x-y limits on the 
axis. Also how can
I force the bins to have the same start and end?
Cheers
 Tommy
From: <jk...@ik...> - 2007年04月06日 16:00:40
Timothy <te...@xm...> writes:
> Hope this isn't a sore subject, but are there ways with Matplotlib to 
> generate dendrograms?
I have no idea why it should be a sore subject, but there seems to be
nothing built in for drawing dendrograms. I'm sure contributions will
be welcomed. :-)
I guess the first task is to think about how to specify the input.
Matlab's dendrogram function takes a three-column matrix where the
first two columns encode a binary tree and the third column holds the
cluster distances. I think a more intuitive interface should be
possible in Python.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <jk...@ik...> - 2007年04月06日 15:33:09
David Fokkema <dfo...@il...> writes:
> If I choose center, the result is that my histogram is calculated
> for edge values but the bars are placed at center values which is
> completely misleading and wrong! I'd say this is a bug, but I may be
> overlooking something here...
Looks like a bug to me. Could you file it at
http://sf.net/tracker/?group_id=80706&atid=560720
so it isn't forgotten?
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <jk...@ik...> - 2007年04月06日 14:46:18
Dominik Szczerba <do...@vi...> writes:
> I want bright information (fonts,lines) on dark background (figure
> bg, axes bg) and I can fully achieve this goal while DISPLAYING
> plots. However, SAVING damages their colors
The following works for me (svn revision 3159):
 figure(facecolor='k')
 subplot(111, axisbg='k')
 plot([3,1,4,1,5,9,2], color='w', lw=2)
 savefig('foo.png', facecolor='k')
 savefig('foo.pdf', facecolor='k')
> ingloriously (I could not trace down the rule what is aimed to be achieved) 
> and tweaking the two options in the example matplotlibrc (savefig.facecolor 
> and savefig.edgecolor) would not help. 
The following works for me:
 rc('savefig', facecolor='k')
 savefig('foo.png'); savefig('foo.pdf')
Perhaps this has been fixed by somebody between your question and now.
If you are still having problems, could you be more specific about how
you are trying to accomplish your goal?
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Tim H. <hi...@re...> - 2007年04月06日 14:16:53
oops, my bad. thanks for the correction.
t
Robert Kern wrote:
> Tim Hirzel wrote:
> 
>> Its a little tough right now that os x doesn't have one python 
>> install to rule them all.
>> 
>
> Yes it does.
>
> http://www.python.org/download/
>
> 
From: massimo s. <mas...@un...> - 2007年04月06日 09:34:35
Attachments: massimo.sandal.vcf
Christopher Barker ha scritto:
> Matplotlib is a plotting library -- it's not a gui development lib. I'd 
> think about using a tool designed for the job. I don't know what you 
> want the graphics of your game to look like, but depending on that, some 
> suggestions:
> 
> PyGame -- good for fancy raster graphics, not so good if you have a need 
> for other GUI elements -- all the typical controls, text boxes etc.
> 
> TkInter -- it has a Canvas people like a lot that gives a lot of 
> flexibility.
> 
> wxPython -- The wxPython FloatCanvas (full disclosure -- it's my baby) 
> could probably help you out a lot here, if you're dealing with vector 
> graphics, and particularly if you want zooming and panning.
> 
> I'm sure you could do it with pyGTK or pyQT also.
> 
> Deciding between all these options is hard, they all have their 
> strengths. What's best for you is a function of what the needs of your 
> app are, what your future needs may be, what platforms you need to 
> support, and taste.
> 
> Even if MPL is a perfect fit for your graphics, if you get beyond a 
> basic "calculate and plot" app, you'll probably want to use MPL embedded 
> in a GUI toolkit, TK, GTK or wx.
I fully endorse what it's said here. I only want to add: Don't let 
yourself confused by the fact that most MPL documentation makes 
references to Pylab. This is a really confusing aspect that I've already 
pointed out in this ml. MPL is a fully featured Python plotting library. 
It is conceived (also) to be used inside a fully featured GUI app, and 
addons like wxMPL make the merging quite painless. Pylab is a Pythonic 
interactive environment that makes use of MPL and it's good for people 
that already have confidence with python AND want an interactive 
environment for quick scripts and interaction à là Matlab. But MPL is 
*much more* than Pylab.
m.
-- 
Massimo Sandal
University of Bologna
Department of Biochemistry "G.Moruzzi"
snail mail:
Via Irnerio 48, 40126 Bologna, Italy
email:
mas...@un...
tel: +39-051-2094388
fax: +39-051-2094387
From: Fernando P. <fpe...@gm...> - 2007年04月06日 02:27:31
On 4/5/07, belinda thom <bt...@cs...> wrote:
> Darn. I am writing this reply as a desperate attempt to make sure
> there's not some quick fix to make it work in my specific case; I'm
> about ready to give up or try something like Tk, but am running out
> of time. We might, alas, have to settle for a command-line based
> game :-(.
This has already been mentioned, but not in this theread:
http://gael-varoquaux.info/computers/traits_tutorial/index.html
You may find it useful, he describes a number of concepts that are
involved in this discussion in a step-by-step fashion.
regards,
f
From: belinda t. <bt...@cs...> - 2007年04月06日 01:42:07
On Apr 5, 2007, at 1:20 PM, Ken McIvor wrote:
> On Apr 5, 2007, at 2:14 PM, belinda thom wrote:
>>
>> I do think its valuable to be able to write a blocking mouse
>> function. After your pointer to Timer (which led me to the threading
>> Python library) and idle handler (which I didn't find useful doc on,
>> so didn't persue), I came up with the code I'll append below. My
>> printing of time elapsed seems to imply the thing is working as I'd
>> expect (I see times that differ by about 1 second). Problem is, I
>> still get the twirling wheel of deadness on my Mac that led me to
>> post my original message.
>
> You will probably always have this problem when you do things that 
> prevent the GUI's event loop from running.
Hmmm. Makes sense. I'll include a tidbit from Chris that I received 
via personal email b/c it relates:
------
Thinking about your issue a bit -- the problem here is that MPL does 
not provide an event loop. In Matlab, the command line and figure 
windows share an event loop. In MPL, the event loop is provided by 
the hosting GUI toolkit, and is separate from command line event 
loop. For that reason, MPL itself is a bit divorced from the process. 
That why Ken and I have suggested that you'd be better off embedding 
MPL in a gui toolkit, if it's just the kind of plotting you need, or 
using another drawing widget in a GUI toolkit if you really need non- 
plotting type drawing.
If it hadn't been for the bugs, TK probably would have been a fine 
option for you.
---------
> Are you running your code from within iPython or as a script?
>
>> And then I got Chris's great reply, which makes me wonder if I'm
>> trying to do too much.
>
> I'd have to agree with Chris that you are trying to do too much 
> from within pylab.
Darn. I am writing this reply as a desperate attempt to make sure 
there's not some quick fix to make it work in my specific case; I'm 
about ready to give up or try something like Tk, but am running out 
of time. We might, alas, have to settle for a command-line based 
game :-(.
So, how do the above observations relate to John Hunter's 
recommendation that I use a timer or idler? It was the reply from him 
that led me to think I might be able to come up w/something that 
worked w/o too much dorking.
>> I've been using pyrorobotics, which relies heavily on Tk, but their
>> plotting facilities are not great. So I started using matplotlib and
>> really like it. And I ran into problems w/their Tk interface where
>> windows wouldn't update correctly on the mouse unless the mouse was
>> clicked in the window. Found some stuff via google implying this was
>> some nasty bug on Mac, didn't find an easy work around, so now try to
>> use matplotlib whenever possible, which explains my current path to
>> trying to use it to provide a simple graphic interface to a python
>> Connect 4 game that I wrote so my students can have fun writing
>> "smart" game players in my AI course.
>
> If that's what you're aiming for you'd probably be happier with the 
> result if you write something using Tkinter's Canvas or the 
> wxPython FloatCanvas.
Understood. If I could get something working really quickly, I might 
go that route. But it would have to take a few hours tops, and that 
would include me figuring out how to get in mouse clicks and draw 
graphics.
>> In Matlab, I'm used to building applications, so I was hoping it
>> would be possible to do something similar in matplotlib.
>
> Well, it's entirely possible to build applications that use 
> matplotlib. The thing to remember is that matplotlib isn't its own 
> programming language or development environment -- it ties Python 
> and and bunch of libraries together to provide a Matlab-like 
> interface in the 'pylab' module.
Fair enough. Thanks for the valuable observation.
>
>> Perhaps matplotlib is not currently set up for such things (in 
>> which case I'd
>> like to ask if this is something you'd like to include in the 
>> future).
>
> Although I'm matplotlib is going to continue becoming more powerful 
> and flexible, I'd personally be surprised if that ever becomes one 
> of the project's goals. I obviously can't speak for anyone else, 
> but it seems to me that people who want to build GUI applications 
> using matplotlib should be doing so by using matplotlib from within 
> Python. I also suspect that the engineering effort involved in 
> making this functionality happen might be beyond the scope of the 
> project.
Ditto.
Thx,
--b
From: Andrew S. <str...@as...> - 2007年04月06日 01:04:11
Joshua J. Kugler wrote:
> Installing an egg today, I got this message from easy_install:
>
> /usr/bin/easy_install:5: UserWarning: Module dateutil was already imported 
> from /usr/lib/python2.4/site-packages/matplotlib-0.87.7-py2.4-linux-i686.egg/dateutil/__init__.pyc, 
> but /usr/lib/python2.4/site-packages/python_dateutil-1.1-py2.4.egg is being 
> added to sys.path
> from pkg_resources import load_entry_point
>
> Investigating, it seems that Matplotlib includes python-dateutils wholesale in 
> its egg, instead of depending on the python-dateutils egg and installing 
> that, thus generating warning messages like these.
Where did you get that matplotlib egg? Particularly on linux (which you
appear to be using), distributing .eggs for matplotlib would be
problematic because of all the 3rd party libraries required, so I didn't
think they'd be officially distributed. Indeed, I don't see one for
linux on the matplotlib download page.
> Would be possible to 
> remove the dateutil module from future matplotlib eggs and simply rely on the 
> python-dateutils egg?
> 
Since matplotlib doesn't require setuptools (other than for Python 2.3),
there can be no install_requires field. (And even if we had it in the
install_requires field, does your linux distribution's python-dateutil
package include the egg info required for the install_requires field to
work?)
If you built the egg yourself, you can re-build it with dateutil
installed and then matplotlib's setup.py file won't include its own
dateutil. Ditto for pytz.
-Andrew
From: Fernando P. <fpe...@gm...> - 2007年04月05日 20:47:31
On 4/5/07, Eric Firing <ef...@ha...> wrote:
> Grant Edwards wrote:
> > I've just started using matplotlib, and I'm stumped on where to
> > find basic info. I've search the users guide, tutorial, and
> > FAQ, and I can't find things as simple as a list of what the
> > color specifiers are. I've figured out that 'r' is red, 'k' is
> > black, but I can't figure out where stuff like that is
> > documented.
> >
> > Likewise for line-style.
> >
> > Where is the basic usage info at?
http://www.scipy.org/wikis/topical_software/Tutorial
Highly useful. Ignore the numarray/astronomy language; it's being
updated for numpy, and it contains precisely all those really handy
tables you're asking for.
Regards,
f
From: Grant E. <gr...@vi...> - 2007年04月05日 20:29:26
On 2007年04月05日, C M <cmp...@gm...> wrote:
> I've had some luck using Google also to find such things, either official
> documentation or a posting about it on a group or such. E.g., searching the
> terms "matplotlib" and "colors", gave as the first hit:
Thanks. I searched for various combinations, but my mistake
seems to have been using "color" instead of "colors".
> But where are these pages generally? They're under the Class Library link
> under documentation. If you look through the classes there maybe that will
> help?
Yup. Between that and docstrings (as somebody else pointed out),
that should do it.
-- 
Grant Edwards grante Yow! .. I see TOILET
 at SEATS...
 visi.com 
From: C M <cmp...@gm...> - 2007年04月05日 20:25:21
[I also forgot to forward this to the list]
Grant,
I've had some luck using Google also to find such things, either official
documentation or a posting about it on a group or such. E.g., searching the
terms "matplotlib" and "colors", gave as the first hit:
http://matplotlib.sourceforge.net/matplotlib.colors.html
And that should help on colors. For example, you can put:
plot(x,y, 'go',markersize=9')
for green (g=green) circles (o=circle). Or you could put it as
plot(x,y, '>', color='chartreuse', markersize=9)
for chartreuse triangles (>) facing to the right. The options for different
types of markers is found here
http://matplotlib.sourceforge.net/matplotlib.pylab.html
(Search the page for "the marker can be one of" you'll see some choices
below it.)
...as well as under the table for "Line Properties" in the Tutorial.
Unfortunately some of the useful links on that Tutorial page, like to "plot"
and "color", appear to be broken.
But where are these pages generally? They're under the Class Library link
under documentation. If you look through the classes there maybe that will
help?
There's probably a better way to know this stuff. Anybody have
recommendations?
Good luck,
Che
On 4/5/07, Grant Edwards < gr...@vi...> wrote:
>
> I've just started using matplotlib, and I'm stumped on where to
> find basic info. I've search the users guide, tutorial, and
> FAQ, and I can't find things as simple as a list of what the
> color specifiers are. I've figured out that 'r' is red, 'k' is
> black, but I can't figure out where stuff like that is
> documented.
>
> Likewise for line-style.
>
> Where is the basic usage info at?
>
> --
> Grant Edwards grante Yow! If I pull this
> SWITCH
> at I'll be RITA HAYWORTH!!
> Or
> visi.com a SCIENTOLOGIST!
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Ken M. <mc...@ii...> - 2007年04月05日 20:21:35
I forgot to CC the list on my reply.
Perhaps the colors and styles deserve to have a table in the tutorial?
Ken
On Apr 5, 2007, at 2:57 PM, Ken McIvor wrote:
> On Apr 5, 2007, at 2:42 PM, Grant Edwards wrote:
>>
>> I've just started using matplotlib, and I'm stumped on where to
>> find basic info. I've search the users guide, tutorial, and
>> FAQ, and I can't find things as simple as a list of what the
>> color specifiers are. I've figured out that 'r' is red, 'k' is
>> black, but I can't figure out where stuff like that is
>> documented.
>>
>> Likewise for line-style.
>>
>> Where is the basic usage info at?
>
> It's hiding in plain sight. Go to http://matplotlib.sf.net and 
> scroll down. There will be a table of pylab commands, organized 
> alphabetically. Click the "plot" link. Viola!
>
> Ken
From: Ken M. <mc...@ii...> - 2007年04月05日 20:20:57
On Apr 5, 2007, at 2:14 PM, belinda thom wrote:
>
> I do think its valuable to be able to write a blocking mouse
> function. After your pointer to Timer (which led me to the threading
> Python library) and idle handler (which I didn't find useful doc on,
> so didn't persue), I came up with the code I'll append below. My
> printing of time elapsed seems to imply the thing is working as I'd
> expect (I see times that differ by about 1 second). Problem is, I
> still get the twirling wheel of deadness on my Mac that led me to
> post my original message.
You will probably always have this problem when you do things that 
prevent the GUI's event loop from running.
Are you running your code from within iPython or as a script?
> And then I got Chris's great reply, which makes me wonder if I'm
> trying to do too much.
I'd have to agree with Chris that you are trying to do too much from 
within pylab.
> I've been using pyrorobotics, which relies heavily on Tk, but their
> plotting facilities are not great. So I started using matplotlib and
> really like it. And I ran into problems w/their Tk interface where
> windows wouldn't update correctly on the mouse unless the mouse was
> clicked in the window. Found some stuff via google implying this was
> some nasty bug on Mac, didn't find an easy work around, so now try to
> use matplotlib whenever possible, which explains my current path to
> trying to use it to provide a simple graphic interface to a python
> Connect 4 game that I wrote so my students can have fun writing
> "smart" game players in my AI course.
If that's what you're aiming for you'd probably be happier with the 
result if you write something using Tkinter's Canvas or the wxPython 
FloatCanvas.
> In Matlab, I'm used to building applications, so I was hoping it
> would be possible to do something similar in matplotlib.
Well, it's entirely possible to build applications that use 
matplotlib. The thing to remember is that matplotlib isn't its own 
programming language or development environment -- it ties Python and 
and bunch of libraries together to provide a Matlab-like interface in 
the 'pylab' module.
> Perhaps matplotlib is not currently set up for such things (in 
> which case I'd
> like to ask if this is something you'd like to include in the future).
Although I'm matplotlib is going to continue becoming more powerful 
and flexible, I'd personally be surprised if that ever becomes one of 
the project's goals. I obviously can't speak for anyone else, but it 
seems to me that people who want to build GUI applications using 
matplotlib should be doing so by using matplotlib from within 
Python. I also suspect that the engineering effort involved in 
making this functionality happen might be beyond the scope of the 
project.
Ken
From: Joshua J. K. <jo...@ee...> - 2007年04月05日 20:17:30
Installing an egg today, I got this message from easy_install:
/usr/bin/easy_install:5: UserWarning: Module dateutil was already imported 
from /usr/lib/python2.4/site-packages/matplotlib-0.87.7-py2.4-linux-i686.egg/dateutil/__init__.pyc, 
but /usr/lib/python2.4/site-packages/python_dateutil-1.1-py2.4.egg is being 
added to sys.path
 from pkg_resources import load_entry_point
Investigating, it seems that Matplotlib includes python-dateutils wholesale in 
its egg, instead of depending on the python-dateutils egg and installing 
that, thus generating warning messages like these. Would be possible to 
remove the dateutil module from future matplotlib eggs and simply rely on the 
python-dateutils egg?
Thanks!
j
-- 
Joshua Kugler 
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ ID 0xDB26D7CE
PO Box 80086 -- Fairbanks, AK 99708 -- Ph: 907-456-5581 Fax: 907-456-3111
From: Eric F. <ef...@ha...> - 2007年04月05日 19:58:46
Grant Edwards wrote:
> I've just started using matplotlib, and I'm stumped on where to
> find basic info. I've search the users guide, tutorial, and
> FAQ, and I can't find things as simple as a list of what the
> color specifiers are. I've figured out that 'r' is red, 'k' is
> black, but I can't figure out where stuff like that is
> documented.
> 
> Likewise for line-style.
> 
> Where is the basic usage info at?
> 
There is quite a bit of information in docstrings. If you use ipython 
-pylab (highly recommended), then try:
plot?
 From a standard python shell, the equivalent is
import pylab
help(pylab.plot)
Eric
From: Grant E. <gr...@vi...> - 2007年04月05日 19:45:15
I've just started using matplotlib, and I'm stumped on where to
find basic info. I've search the users guide, tutorial, and
FAQ, and I can't find things as simple as a list of what the
color specifiers are. I've figured out that 'r' is red, 'k' is
black, but I can't figure out where stuff like that is
documented.
Likewise for line-style.
Where is the basic usage info at?
-- 
Grant Edwards grante Yow! If I pull this SWITCH
 at I'll be RITA HAYWORTH!! Or
 visi.com a SCIENTOLOGIST!
From: belinda t. <bt...@cs...> - 2007年04月05日 19:14:50
On Apr 5, 2007, at 6:27 AM, John Hunter wrote:
> On 4/5/07, belinda thom <bt...@cs...> wrote:
>
>> My app needs to look something like this:
>>
>> ------
>>
>> create a game and display it in a matplotlib figure
>>
>> while game not over :
>>
>> if its player 1's turn, get player 1's valid mouse input,
>> otherwise get player 2's
>>
>
> You need to get out of the mold of thinking about while loops with
> blocking input. Instead make everything event driven and track state
> variables to decide which player's mouse events to process. So
> instead of getting a blocking input, simply do nothing on events
> unless you are in a certain state. You can use a timer or an idle
> handler for recurring processing rather than a while loop.
This was the kind of advice I was looking for. Being so new to 
Python, I hadn't a clue what to look for.
I do think its valuable to be able to write a blocking mouse 
function. After your pointer to Timer (which led me to the threading 
Python library) and idle handler (which I didn't find useful doc on, 
so didn't persue), I came up with the code I'll append below. My 
printing of time elapsed seems to imply the thing is working as I'd 
expect (I see times that differ by about 1 second). Problem is, I 
still get the twirling wheel of deadness on my Mac that led me to 
post my original message.
And then I got Chris's great reply, which makes me wonder if I'm 
trying to do too much.
I've been using pyrorobotics, which relies heavily on Tk, but their 
plotting facilities are not great. So I started using matplotlib and 
really like it. And I ran into problems w/their Tk interface where 
windows wouldn't update correctly on the mouse unless the mouse was 
clicked in the window. Found some stuff via google implying this was 
some nasty bug on Mac, didn't find an easy work around, so now try to 
use matplotlib whenever possible, which explains my current path to 
trying to use it to provide a simple graphic interface to a python 
Connect 4 game that I wrote so my students can have fun writing 
"smart" game players in my AI course.
In Matlab, I'm used to building applications, so I was hoping it 
would be possible to do something similar in matplotlib. Perhaps 
matplotlib is not currently set up for such things (in which case I'd 
like to ask if this is something you'd like to include in the future).
Thanks again,
--b
class Mouse :
 def __init__(self,f,cb) :
 self.data = None
 self.cb = cb
 def getClick(event) :
 self.data = event.xdata
 self.cb()
 f.canvas.mpl_connect("button_press_event",getClick)
def blockMouse(f,rng) :
 import threading
 import time
 startTime = time.time()
 e = threading.Event()
 def cb() :
 e.set()
 m = Mouse(f,cb)
 def valid(val,rng) :
 print "time elapsed is %g" % (time.time()-startTime)
 if val == None :
 return False
 for i in rng :
 if i-.4 <= val <= i+.4 :
 return True
 return False
 # poll til valid
 while True :
 e.wait(1)
 if valid(m.data,rng) :
 break
 else:
 e.clear()
 m.data = None
 return m.data
def app() :
 import pylab
 pylab.close('all')
 f = pylab.figure()
 rng = [1,2,3]
 pylab.plot([1,2,3],[1,2,3])
 pylab.axis([0,4,0,4])
 while True :
 mouse = blockMouse(f, rng)
 if mouse == 2 :
 break
 else :
 print mouse
From: Timothy <te...@xm...> - 2007年04月05日 16:36:35
Hope this isn't a sore subject, but are there ways with Matplotlib to 
generate dendrograms?
Thanks,
Tim
1 message has been excluded from this view by a project administrator.

Showing results of 318

<< < 1 .. 8 9 10 11 12 13 > >> (Page 10 of 13)
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 によって変換されたページ (->オリジナル) /