SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S




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

Showing 15 results of 15

From: Eric F. <ef...@ha...> - 2008年05月09日 21:18:24
Bryan Fodness wrote:
> i have used this command on windows vista with no problem.
> 
> fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r')
> 
> but when i run on fedora 8, i receive the following.
[...]
> File "/usr/lib/python2.5/site-packages/matplotlib/colors.py", line 
> 429, in tob
> raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' % (str(arg), 
> exc))
> ValueError: to_rgb: Invalid rgb arg "None"
> invalid literal for float(): None
> could someone tell me if i am missing something?
> 
Sounds like you have an older mpl version on the Fedora machine than on 
the Win box.
Eric
From: Bryan F. <bry...@gm...> - 2008年05月09日 20:16:02
i have used this command on windows vista with no problem.
 fill([x1,x2,x2,x1], [y1,y1,y2,y2], fc='None', ec='r')
but when i run on fedora 8, i receive the following.
 (most recent call last):
 File "./program.py", line 361, in <module>
 savefig(outfile)
 File "/usr/lib/python2.5/site-packages/matplotlib/pylab.py", line 796,
in savg
 return fig.savefig(*args, **kwargs)
 File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 727,
in sag
 self.canvas.print_figure(*args, **kwargs)
 File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py", le
 self.draw()
 File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_agg.py", lw
 self.figure.draw(renderer)
 File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line 569,
in drw
 for a in self.axes: a.draw(renderer)
 File "/usr/lib/python2.5/site-packages/matplotlib/axes.py", line 1155,
in draw
 a.draw(renderer)
 File "/usr/lib/python2.5/site-packages/matplotlib/patches.py", line
209, in dw
 else: rgbFace = colorConverter.to_rgb(self._facecolor)
 File "/usr/lib/python2.5/site-packages/matplotlib/colors.py", line 429,
in tob
 raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' % (str(arg),
exc))
 ValueError: to_rgb: Invalid rgb arg "None"
 invalid literal for float(): None
could someone tell me if i am missing something?
-- 
"The game of science can accurately be described as a never-ending insult to
human intelligence." - João Magueijo
From: John H. <jd...@gm...> - 2008年05月09日 19:36:39
On Fri, May 9, 2008 at 2:31 PM, Bryan Fodness <bry...@gm...> wrote:
> i have been using the fill function to highlight a region on my plot, but
> now i do not want it to be filled. i have tried using alpha=0.1, but that
> also makes my edgecolor transparent. is there a "box" function that does
> not fill a region yet still has the outline of the "box". i tried using
> patch.rectangle, but it was not what i needed.
Use a matplotlib.patches.Rectangle, and set the facecolor='None':
import matplotlib.pyplot as plt
import matplotlib.patches as patches
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3], [1,2,3])
# use zorder to make sure it is over the line
rect = patches.Rectangle((1.5, 1.5), 1.0, 1.0, facecolor='None', zorder=10)
ax.add_patch(rect)
plt.show()
Hope this helps,
JDH
From: Bryan F. <bry...@gm...> - 2008年05月09日 19:31:24
i have been using the fill function to highlight a region on my plot, but
now i do not want it to be filled. i have tried using alpha=0.1, but that
also makes my edgecolor transparent. is there a "box" function that does
not fill a region yet still has the outline of the "box". i tried using
patch.rectangle, but it was not what i needed.
-- 
"The game of science can accurately be described as a never-ending insult to
human intelligence." - João Magueijo
Hallo,
thank you for this huge amount of input.
I think, that is what I needed.
Have a nice weekend.
Regards..
Thomas
John Hunter-4 wrote:
> 
> On Thu, May 8, 2008 at 10:10 AM, dertom <tw...@ar...> wrote:
> 
>> Please, can anybody tell me, if there is a solution, to call the show()
>> method more than one time,while my main script is running?
> 
> To do this right, you will probably need to write a tk application and
> embed matplotlib in it, rather than try to use pylab. See the
> embedding_in_tk*.py examples at http://matplotlib.sf.net/examples/.
> There is also a tutorial on working with the matplotlib artist API at
> http://matplotlib.sf.net/pycon
> 
> http://matplotlib.sourceforge.net/pycon/artist_api_tut.pdf
> 
> There are a couple of other FAQs that are relevant
> 
> http://matplotlib.sf.net/faq.html#OO
> http://matplotlib.sf.net/faq.html#SHOW
> 
> JDH
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save 100ドル. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/How-to-handle-different-Figures%2C-created-from-different-instances-tp17127297p17153058.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Christopher B. <c-...@as...> - 2008年05月09日 17:13:17
Hi John,
JH> or you can manually change this with
JH>
JH> fig.subplots_adjust(bottom=0.2)
Aha! I had been using rc('figure.subplot', bottom=0.2), but I was 
looking for a better way. Thanks!
-- 
Chris
From: John H. <jd...@gm...> - 2008年05月09日 15:13:03
On Fri, May 9, 2008 at 9:38 AM, Neal Becker <ndb...@gm...> wrote:
> I have sets of data to plot on semilogy. I want the minimum y axis set to
> some value, say 10e-10.
>
> I do:
> axis([0,1,1e-10,1])
> hold(True)
> for (whatever):
> semilogy (x, y)
> grid()
> legend()
> show()
semilogy calls the autoscale machinery, so you either need to call
"axis" at the end, or turn off autoscaling after you have set it:
ax.set_autoscale_on(False)
JDH
From: Neal B. <ndb...@gm...> - 2008年05月09日 14:39:43
I have sets of data to plot on semilogy. I want the minimum y axis set to
some value, say 10e-10.
I do:
 axis([0,1,1e-10,1])
 hold(True)
 for (whatever):
 semilogy (x, y)
 grid()
 legend()
 show()
But the data is not clipped in y from [1e-10..1] as I wanted. What's wrong
here?
From: John H. <jd...@gm...> - 2008年05月09日 13:49:19
On Thu, May 8, 2008 at 10:10 AM, dertom <tw...@ar...> wrote:
> Please, can anybody tell me, if there is a solution, to call the show()
> method more than one time,while my main script is running?
To do this right, you will probably need to write a tk application and
embed matplotlib in it, rather than try to use pylab. See the
embedding_in_tk*.py examples at http://matplotlib.sf.net/examples/.
There is also a tutorial on working with the matplotlib artist API at
http://matplotlib.sf.net/pycon
 http://matplotlib.sourceforge.net/pycon/artist_api_tut.pdf
There are a couple of other FAQs that are relevant
 http://matplotlib.sf.net/faq.html#OO
 http://matplotlib.sf.net/faq.html#SHOW
JDH
From: John H. <jd...@gm...> - 2008年05月09日 13:41:40
On Thu, May 8, 2008 at 11:39 PM, Tim Mitchell <tim...@gm...> wrote:
> I can use the axes position to work I guess but that seems rather
> unsatisfactory as I'll have to figure out when it's being displayed or
> not, font sizing and spacing blah blah blah.
> Is there an easier way around this (or a fix?)? I'm using v0.90.0
There is no current way to automate this easily -- Michael has done
some experimental work for autosizing the axes to make room for the
text on the svn trunk, but it is not complete. There is a parameter
that you can set in your matplotlibrc figure.subplot.bottom to make
the bottom of the axes higher by default, or you can manually change
this with
fig.subplots_adjust(bottom=0.2)
JDH
From: Michael D. <md...@st...> - 2008年05月09日 12:23:56
Søren Nielsen wrote:
>
> Søren Nielsen wrote:
>
> Also, if I want to use matplotlib.patches on a canvas where I
> can actually see individual pixels, is it possible to only
> draw on the available pixels showing, and not just make a nice
> high resolution line that is plotted on top of my image?
>
> I'm not sure I understand the question. You mean to draw a line
> using large pixels, rather than as a vector? I don't think
> there's an easy way on that one -- but maybe someone else here can
> think of a creative way to do it.
>
>
> Yes you understod it correctly, I guess I could figure out what pixels 
> are involved in a line or a circle for instance, and then do a scatter 
> plot on those pixels to form the shape.. but it sounds really 
> computationally heavy.. and I need something that works fast, (the 
> user should be able to mask a circle in an image using the pixels 
> available in the image) Also the circle should be shown as it is 
> created (like choosing a center and moving the mouse enlarges the 
> circle).
>
> Maybe someone tried this? masking stuff in an image seems like a 
> fairly common thing :)
Of the top of my head and hand waving over all of the gory details -- 
you could try drawing the line to one plot, saving the image (to a 
CStringIO in-memory "file"), and then loading that into another plot 
using imshow(). (Easier said than done, but should be theoretically 
possible, and not extremely slow).
Mike
>
> Thanks for the help!
> Soren
>
>
> 
>
>
> Cheers,
> Mike
>
>
> Thanks,
> Soren
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM)
> Conference Don't miss this year's exciting event. There's
> still time to save 100ドル. Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
>
>
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2008年05月09日 12:19:18
Jouni K. Seppänen wrote:
> Christopher Brown <c-...@as...> writes:
>
> 
>> I have read a little bit online about the difference between types 1
>> and 3, but I can't find a description of which font is which type. So
>> what font should I use?
>> 
>
> Try setting the pdf.fonttype parameter in your matplotlibrc file to 42
> and see if the resulting file passes validation. Matplotlib currently
> only uses TrueType fonts, which can be embedded in either Type 3 or Type
> 42 format. I seem to recall there was some problem with the Type 42
> format so Type 3 was made the default; Michael Droettboom probably
> remembers it better.
Type 42 fonts are currently working, as far as I know. There was a 
transient problem with them but I think that's fixed. Type 3 is the 
default just because it makes the files smaller.
Cheers,
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Behnam K. <bka...@gm...> - 2008年05月09日 07:14:50
Hi,
First I want to thanks for this amazing Matplotlib. It's fantastic!
My newbie question is how I can show the (zoom, pan, etc) toolbar in
embedding_in_qt.py example?
I have noticed that in animation_blit_qt.py the toolbar is available, but it
seems to be done in a different way.
Appreciate your help!
Thank you,
/Behnam
From: Tim M. <t.m...@ar...> - 2008年05月09日 04:39:18
Attachments: noscale.png
Hi,
When matplotlib uses an axis multiplier, as in x-axis in the script 
below, the scale factor is not positioned properly on the figure as is 
shown in the attached picture. The 'x1e+30' in the bottom right corner 
is clipped unless I enlarge the window.
--------------------
import Numeric, gtk
import matplotlib
matplotlib.use('GTK')
import matplotlib.figure, matplotlib.axes, matplotlib.backends.backend_gtk
# data
values = Numeric.array([-1e30, -1e30, 0,1,2,3,4,5,6,7,8,9], 'd')
# figure
figsize=(6,3)
figure = matplotlib.figure.Figure(figsize=figsize)
canvas = matplotlib.backends.backend_gtk.FigureCanvasGTK(figure)
axes = matplotlib.axes.Subplot(figure, 111)
figure.add_axes(axes)
axes.hist(values, bins=10)
axes.set_title('X-scale multiplier is hidden', fontsize=10)
# window to display
window = gtk.Window()
window.connect('destroy', gtk.main_quit)
window.add(canvas)
window.show_all()
gtk.main()
--------------------
I can use the axes position to work I guess but that seems rather 
unsatisfactory as I'll have to figure out when it's being displayed or 
not, font sizing and spacing blah blah blah.
Is there an easier way around this (or a fix?)? I'm using v0.90.0
Thanks
Tim
-- 
Tim Mitchell
Software Engineer
Applied Research Associates (NZ) Ltd. (www.aranz.com)
Ph: +64 (3) 374-6120 ext: 203
Fax: +64 (3) 374-6130
Skype: tim-mitchell
From: Tim M. <tim...@gm...> - 2008年05月09日 04:39:14
Attachments: noscale.png
Hi,
When matplotlib uses an axis multiplier, as in x-axis in the script
below, the scale factor is not positioned properly on the figure as is
shown in the attached picture. The 'x1e+30' in the bottom right corner
is clipped unless I enlarge the window.
--------------------
import Numeric, gtk
import matplotlib
matplotlib.use('GTK')
import matplotlib.figure, matplotlib.axes, matplotlib.backends.backend_gtk
# data
values = Numeric.array([-1e30, -1e30, 0,1,2,3,4,5,6,7,8,9], 'd')
# figure
figsize=(6,3)
figure = matplotlib.figure.Figure(figsize=figsize)
canvas = matplotlib.backends.backend_gtk.FigureCanvasGTK(figure)
axes = matplotlib.axes.Subplot(figure, 111)
figure.add_axes(axes)
axes.hist(values, bins=10)
axes.set_title('X-scale multiplier is hidden', fontsize=10)
# window to display
window = gtk.Window()
window.connect('destroy', gtk.main_quit)
window.add(canvas)
window.show_all()
gtk.main()
--------------------
I can use the axes position to work I guess but that seems rather
unsatisfactory as I'll have to figure out when it's being displayed or
not, font sizing and spacing blah blah blah.
Is there an easier way around this (or a fix?)? I'm using v0.90.0
Thanks
Tim

Showing 15 results of 15

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