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




Showing 13 results of 13

From: Carol L. <car...@sr...> - 2004年11月10日 22:35:28
Is it possible to control the text of the polar grid labels?
I would like to have 8 grid lines in theta, but label only 4 of them. I 
also want to set my own labels, such as "NE", "NW", "SW" and "SE".
I would like to turn off the labels along r completely or replace them 
with my own set of labels.
The comments in polar_demo.py indicate that the properties of the 
gridlines and labels can be accessed directly from the polar axes. How 
can I find out what keywords can be set for each of the attributes: 
thetagridlines, rgridlines, thatagridlabels and rgridlabels?
-- 
Ms. Carol A. Leger
SRI International			Phone: (650) 859-4114
333 Ravenswood Avenue G-273
Menlo Park, CA 94025 e-mail: le...@sr...
From: John H. <jdh...@ac...> - 2004年11月10日 22:26:29
>>>>> "seberino" == seberino <seb...@sp...> writes:
 seberino> Stephen Thanks for the help. The format of the data is
 seberino> ASCII files and/or Python arrays that contain (x, y)
 seberino> coordinates or (x, y, z) coordinates for 3D.
 seberino> For starters, what is best way to plot triples in this
 seberino> list?...
 seberino> [ (0, 0, 3.3), (0, 1, 4.4), (1, 0, 2.2), (1, 1, 2.34)]
 seberino> I want to duplicate color plot on screenshots page:
 seberino> http://matplotlib.sourceforge.net/screenshots/pcolor_demo_large.png
You have a 2x2 grid. pcolor is a bit funny in that for an MxN grid it
only plots M-1 x N-1 rectangles since it doesn't know how to handle
the edges. So it's a bit of a pathalogical case for pcolor.
Basically you need to transform your list of 3 tuples into 3 arrays
x,y,z, and then reshape the array. Here I'll use imshow which
doesn't have the edge problem
 from matplotlib.matlab import *
 data = [ (0, 0, 3.3), (0, 1, 4.4), (1, 0, 2.2), (1, 1, 2.34)]
 x,y,z = zip(*data)
 z = array(z); z.shape = 2,2
 imshow(z, interpolation='nearest', extent=(0,1,0,1))
 show()
If you had a longer data sequence, say 5x5, you would use pcolor like
 from matplotlib.matlab import *
 data = ....
 x,y,z = zip(*data)
 x = array(x); x.shape = 5,5
 y = array(y); y.shape = 5,5
 z = array(z); z.shape = 5,5
 pcolor(x,y,z)
 show()
In short, there is nothing special about plotting "data" versus
"functions". Both are simply cases of plotting 1-D or 2-D arrays as
far as matplotlib is concerned. Your task is to get your data in to
the right array shape.
JDH
From: <seb...@sp...> - 2004年11月10日 21:04:24
Stephen
Thanks for the help.
The format of the data is ASCII files and/or Python arrays
that contain (x, y) coordinates or (x, y, z) coordinates for 3D.
For starters, what is best way to plot triples in this list?...
[ (0, 0, 3.3), (0, 1, 4.4), (1, 0, 2.2), (1, 1, 2.34)]
I want to duplicate color plot on screenshots page:
 http://matplotlib.sourceforge.net/screenshots/pcolor_demo_large.png
Chris
On Wed, Nov 10, 2004 at 12:21:00PM -0800, Stephen Walton wrote:
> On Wed, 2004年11月10日 at 10:06 -0800, seb...@sp... wrote:
> > The examples on the screenshots page are great and very helpful.
> > I hope to never use any other plotting app again except Matplotlib.
> >
> > What is easiest/cleanest way to modify examples to accept
> > precalculated /data/ rather than use a mathematical /function/???
>
> You have asked a _huge_ question. What format are these data in? ASCII
> files? HDF files? FITS images? JPEG images?
>
> --
> Stephen Walton, Professor of Physics and Astronomy,
> California State University, Northridge
> ste...@cs...
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for FREE
> LinuxWorld Reader's Choice Award Winner for best database on Linux.
> http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
_______________________________________
Christian Seberino, Ph.D.
SPAWAR Systems Center San Diego
Code 2872
49258 Mills Street, Room 158
San Diego, CA 92152-5385
U.S.A.
Phone: (619) 553-9973
Fax : (619) 553-6521
Email: seb...@sp...
_______________________________________
From: Stephen W. <ste...@cs...> - 2004年11月10日 20:22:39
On Wed, 2004年11月10日 at 10:06 -0800, seb...@sp... wrote:
> The examples on the screenshots page are great and very helpful.
> I hope to never use any other plotting app again except Matplotlib.
> 
> What is easiest/cleanest way to modify examples to accept
> precalculated /data/ rather than use a mathematical /function/???
You have asked a _huge_ question. What format are these data in? ASCII
files? HDF files? FITS images? JPEG images?
-- 
Stephen Walton, Professor of Physics and Astronomy,
California State University, Northridge
ste...@cs...
From: Paul B. <ba...@st...> - 2004年11月10日 19:09:21
Andy Beardmore wrote:
>I finally bit the bullet and upgraded my laptop from mandrake 9.1 to
>Ubuntu 4.01. I have been wanting a debian based distro on it for ages...
>
>In the process I upgraded matplotlib from 0.61.x to 0.63.4.
>I installed the python-matplotlib deb package linked to from the
>matplotlib website, and finally managed to solve all the dependencies
>in order to get matplotlib to work - there was a numarray
>extension package that needed to be installed in addition to the main
>numarray one.
>
>Anyway, the upshot is matplotlib runs but it is not finding the
>sans font and makes a poor substitute in its place. For exampe the output
>from simple_demo.py is :
>
>examples/simple_plot.py
>/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1077:
>DeprecationWarning:
> self.append_space()
>/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1077:
>GtkWarning: mixing deprecated and non-deprecated GtkToolbar API is not
>allowed
> self.append_space()
>/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1080:
>DeprecationWarning:
> self.append_widget(self.message, '', '')
>/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtk.py:1080:
>GtkWarning: mixing deprecated and non-deprecated GtkToolbar API is not
>allowed
> self.append_widget(self.message, '', '')
>Could not match sans-serif, normal, normal. Returning
>/usr/share/matplotlib/cmmi10.ttf
>Could not match sans-serif, normal, normal. Returning
>/usr/share/matplotlib/cmmi10.ttf
>Could not match sans-serif, normal, normal. Returning
>/usr/share/matplotlib/cmmi10.ttf
>
>
>Is there any way I can force it to use a better looking font ?
>Or even find out what has happened to the sans-serif font?
> 
>
Have you tried setting the TTFPATH environment variable to the paths 
where your other TTF fonts are located? It appears that the default 
font paths that matplotlib uses are not the ones used by Ubuntu. It 
might also be useful to print the FontManager.ttfdict attribute to see 
what fonts have actually been found.
 -- Paul
-- 
Paul Barrett, PhD Space Telescope Science Institute
Phone: 410-338-4475 ESS/Science Software Branch
FAX: 410-338-4767 Baltimore, MD 21218
From: <seb...@sp...> - 2004年11月10日 18:06:11
The examples on the screenshots page are great and very helpful.
I hope to never use any other plotting app again except Matplotlib.
What is easiest/cleanest way to modify examples to accept
precalculated /data/ rather than use a mathematical /function/???
e.g.
x = arange(xmin, xmax, dx)
y = arange(ymin, ymax, dy)
X,Y = meshgrid(x, y)
Z = my_function(X, Y)
im = imshow(Z, extent=(xmin, xmax, ymin, ymax))
How supply "Z" data myself rather than define my_function for Z?
====================
Also,
plot(t, my_function(t))
Same question here for this 2D plot. (I have the 2D data already calculated.)
thanks!
Chris
--
_______________________________________
Christian Seberino, Ph.D.
SPAWAR Systems Center San Diego
Code 2872
49258 Mills Street, Room 158
San Diego, CA 92152-5385
U.S.A.
Phone: (619) 553-9973
Fax : (619) 553-6521
Email: seb...@sp...
_______________________________________
From: <na...@te...> - 2004年11月10日 16:03:19
John Hunter wrote:
> I haven't seen this one before. Intermittent errors are the hardest
> to track down. What GUI is PSPad based on. Is any of the information
> at http://matplotlib.sourceforge.net/faq.html#FREEZE helpful?
PSPad is based on native toolkit, I think. It is not open source,
though it is freeware. Information on the FAQ didn't help, but I
tried running some of the examples and my scripts on every IDE,
and got basically the same results. I think the DOS box message
error is the most helpful of them, but not that much.
Double-clicking from Windows Explorer: Microsoft Visual C++ Runtime
Error - abnormal programa termination
DOS command line:
 Fatal Python Error: PyEval_RestoreThread: NULL state
Interpreter running in a DOS box: shows no error, but gives me
a Microsoft Visual C++ error as above when I quit the DOS box.
IDLE: shows no error, but gives me a Microsoft Visual C++ error
as above.
Pyshell: BSODs.
I noticed, however, that it only happens when I save the figure,
and _never_ when I show them in a windows. And, in every case, the
picture is saved with no problems before the error occurs. I am
using the previous binary version of matplotlib (I'm downloading
the newest version right now and will test as soon as possible),
with Python-2.3.4. I double-checked to see if I was using the
right versions (it could have happen), but I don't think that this
is the problem. If there is any other information that could be
helpful, I can find it here.
> You can use
> axes to make the axes any size you want. The syntax is
I'm sorry to ask so simple questions. The main reason is that the
matlab interface is so simple that I rarely need to do more than
what it provides. This will help a lot, thanks!
---
José Alexandre Nalon
na...@te...
From: John H. <jdh...@ac...> - 2004年11月10日 14:55:21
>>>>> "Jos=E9" =3D=3D Jos=E9 Alexandre Nalon <na...@te...> writes:
 Jos=E9> Hello, Matplotlib has been helping me a lot with my graphic
 Jos=E9> needs. I am still surprised by the looking of the
 Jos=E9> pictures. Many thanks for the great software.
 Jos=E9> I'm having some issues, though. Sometimes I get error
 Jos=E9> messages, usually an error in KERNEL32.DLL on Windows ME,
 Jos=E9> and on Windows only, I don't get this behaviour in
 Jos=E9> Linux. It's not as bad as it may seem, as every script runs
 Jos=E9> completely, the pictures are saved and, besides the message
 Jos=E9> box informing the error, nothing weird happens. I don't know
 Jos=E9> how to reproduce the errors - when I run from the DOS prompt
 Jos=E9> or from IDLE, I get the messages. When I run from my IDE (I
 Jos=E9> use PSPad) I usually don't get error messages, with the same
 Jos=E9> scripts. Any hint to what I can be doing wrong, or how to
 Jos=E9> find out what is happening?
I haven't seen this one before. Intermittent errors are the hardest
to track down. What GUI is PSPad based on. Is any of the information
at http://matplotlib.sourceforge.net/faq.html#FREEZE helpful?
 Jos=E9> Also, I'm in need of some help. I must draw six subplots,
 Jos=E9> one below the other (subplot(6, ...)), but the way things
 Jos=E9> are coming out, the plots are to thin, and, although the
 Jos=E9> picture looks good, I thought that if I could make each
 Jos=E9> subplot a little bigger, that would help a lot. Is there any
 Jos=E9> way this can be done?
subplot is simply a thin wrapper to axes -
http://matplotlib.sf.net/matplotlib.matlab.html#-axes . You can use
axes to make the axes any size you want. The syntax is
 # left, bottom, width, height
 ax1 =3D axes([0.125, 0.1, 0.7, .8])
where all values are fractions of the total figure size. See
http://matplotlib.sourceforge.net/examples/ganged_plots.py for an
example where no space is left between the axes, and xlabels are put
only on the bottom.
 Jos=E9> In other plots, I need to index the subplots (label them
 Jos=E9> '(a)', '(b)', ... for reference in text). I was using xlabel
 Jos=E9> to do that, but when I have more than two subplots, the
 Jos=E9> xlabel is shadowed by the following subplot. Is there any
 Jos=E9> way to make the space between the plots bigger, so the
 Jos=E9> xlabels can be shown, or is there any other (better) way to
 Jos=E9> do that?
You can use the text command to place text anywhere in the figure you
want - http://matplotlib.sourceforge.net/matplotlib.matlab.html#-text.
You can place text in data coordinates
 text(.5, 12, 'hi mom')
in which case the text will "move" visually if you pan and zoom the
axes, or in axes coordinates (0,0) is lower left and 1,1 is upper
right, in which case the text will remain stationary with respect to
changes in the axes limits
 text(0.05, 0.9, 'hi mom', transform=3Dgca().transAxes)
See http://matplotlib.sourceforge.net/examples/alignment_test.py for
lots of examples showing text placement and alignment.
You can also place text outside the axes using the text command
 # to the left and above the axes box
 text(-0.1, 1.05, 'hi mom', transform=3Dgca().transAxes)
Hope this helps,
JDH
From: John H. <jdh...@ac...> - 2004年11月10日 14:45:01
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
 Dominique> However, if I plot only one line, the legend appears
 Dominique> vertically:
 >>>> plot( [1,2,3], [4,5,6] ) legend( ( 'line1' ), 'lower right' )
 >>>> show()
 Dominique> Finally,
 >>>> plot( [1,2,3], [4,5,6] ) legend( ( 'line1', ), 'lower right'
 >>>> ) show()
 Dominique> (note the comma after 'line1') produces the horizontal
 Dominique> text.
 Dominique> This isn't a big deal, but I am not sure where in
 Dominique> legend.py I should fix that.
This isn't a legend bug exactly, but perhaps legend could detect this
common error and warn you. Legend expects a sequence of legend
labels. When you pass it
'my label' or equivalently ('my label') you are simply passing it a
string which is a length 8 sequence of characters. When you pass it
('my label', ) you are passing a length 1 tuple with a string as the
first element.
Admittedly legend could be smarter, and just "do what you mean".
JDH
From: John H. <jdh...@ac...> - 2004年11月10日 14:42:52
>>>>> "Greg" == Greg Novak <no...@uc...> writes:
 Greg> I upgraded to Fedora Core 3 and hence spent some time
 Greg> rebuiding all of the Python modules I use frequently...
Makes you wish for a good python package manager ...
 Greg> In order to compile matplotlib, I had to install pycxx as a
 Greg> separate package. I noticed that there was a cxx directory
 Greg> in the matplotlib tree, but it didn't seem to be using it.
 Greg> I got it to compile and it seems to be working. This
 Greg> message is just for someone's information to point out the
 Greg> dependency, or the fact that the stuff in the cxx directory
 Greg> doesn't seem to be satisfying it.
You shouldn't need a separate pycxx - all the cxx requirements ship
with matplotlib, and the paths to them are hardwired in the setup.py
file. Try this ( I know you already got it working but it would be
helpful for me if there is a problem to know the source of it)
 1) get a new copy of matplotlib (perhaps you got an incomplete
 download) -
 http://aleron.dl.sourceforge.net/sourceforge/matplotlib/matplotlib-0.64.tar.gz
 2) unpack it in a new directory so that you have a clean build tree
 3) rm -rf your site-packages/matplotlib tree
 4) python setup.py build. If the build fails, please capture the
 standard output and standard error from the build process and send
 it to me.
Thanks,
JDH
From: Steve C. <ste...@ya...> - 2004年11月10日 13:08:56
On Tue, 2004年11月09日 at 12:24, matthew arnison wrote:
> 2. I was getting errors that the 
> matplotlib.backends.backend_mod.IMAGE_FORMAT attribute was not
> found, during toolbar initialization. I put in a workaround.
Is this happening when using the classes directly rather than using the
matlab interface? Are you doing something similar to the example
"embedding_in_gtk2.py" - that works OK for me.
Could you provide a minimal example to demonstrate this.
Steve
From: Steve C. <ste...@ya...> - 2004年11月10日 08:19:25
On Wed, 2004年11月10日 at 12:16,
mat...@li... wrote:
> John Hunter wrote:
> > Perhaps it would be better to define a constant in
> > matplotlib.__init__.py, something like
> > 
> > matplotlib.PY2EXE = hasattr(sys, 'frozen')
> > 
> > because then the code which is conditional upon py2exe would be more
> > readable
> > 
> > if not matplotlib.PY2EXE
> > pygtk.require('2.0')
> > 
> > or something like that...
> 
> Except that Py2EXE is not the only method of "freezing" apps. In 
> particular, you'd want this to work with OS-X's Py2App, and probably 
> other methods of bundling apps.
> 
> you might want:
> 
> matplotlib.FROZEN = hasattr(sys, 'frozen')
> 
> and
> 
> if not matplotlib.FROZEN
> pygtk.require('2.0')
> 
> Then you could also accommodate other keywords that other bundling 
> methods use.
> 
> BTW, is someone really successfully using PyGTK on Windows? Cool!
> 
> -Chris
I added matplotlib.FROZEN to matplotlib.__init__.py.
It did not work because matplotlib has not yet been imported when 
pygtk.require() is called. So I changed the import order and it seems to
be working on now.
Steve
From: Greg N. <no...@uc...> - 2004年11月10日 07:29:02
I upgraded to Fedora Core 3 and hence spent some time rebuiding all of
the Python modules I use frequently... 
In order to compile matplotlib, I had to install pycxx as a separate
package. I noticed that there was a cxx directory in the matplotlib
tree, but it didn't seem to be using it.
I got it to compile and it seems to be working. This message is just
for someone's information to point out the dependency, or the fact
that the stuff in the cxx directory doesn't seem to be satisfying it.
Greg
2 messages has been excluded from this view by a project administrator.

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