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






Showing 13 results of 13

From: Elfnor <el...@gm...> - 2008年08月05日 23:26:27
The new ginput function is great.
Would it be possible to have a version that looks to the user like a
RectangleSelector widget but works for the programmer like ginput? That is,
it returns the coordinates of the rectangle. 
This would be really useful for implementing a user image crop function,
similar to matlab's imcrop for example.
One can functionally do this with:
import os.path, sys
import pylab
import Image
img = Image.open('test_image.png')
fig = pylab.imshow(img, origin='lower')
print "Please click on top left, bottom right of crop area"
x = pylab.ginput(2)
#PIL and matplotlib have different origin
roi = img.crop([int(x[0][0]),int(img.size[1]-x[0][1]),
int(x[1][0]),int(img.size[1]-x[1][1])])
filenm = os.path.join(sys.path[0], 'crop_image.png')
roi.save(filenm)
show()
But users expect a rectangle for cropping.
I've had a look a the BlockingMouseInput class but its all a bit beyond me
at the moment.
Eleanor
-- 
View this message in context: http://www.nabble.com/Feature-Request%3A-RectangleSelector-BlockingInput-tp18841798p18841798.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: John H. <jd...@gm...> - 2008年08月05日 23:07:48
On Tue, Aug 5, 2008 at 3:46 PM, Mark Bakker <ma...@gm...> wrote:
> But if I replace the Inf by a nan: y[2] = np.nan, then it plots fine.
>
> I know, I know, I can do this with masked arrays, but it cannot be that hard
> to make this work correctly, and wouldn't that be much nicer? Desirable?
The question is: what should happen with inf? Do you know what matlab does?
JDH
From: B C. <clo...@ya...> - 2008年08月05日 22:46:48
Ewald,
It is very much a work in progress (and poorly named) but you can check out a project of mine:
http://code.google.com/p/subplot/
I created a custom matplotlib widget that you can promote from a regular widget in Designer. I hope it helps, let me know if you have any questions. The ui files are also included in the SVN. One thing to note there was a recent change to the Qt backend that altered the nature of the toolbar so you may want to comment that part out if you are using the latest matplotlib. If it is a must have I think I'm sure I could update the code when I find some time (Currently, I'm using v 0.91 I believe). Good luck.
Cheers,
Brian
--- On Tue, 8/5/08, Ewald Zietsman <ewa...@gm...> wrote:
From: Ewald Zietsman <ewa...@gm...>
Subject: [Matplotlib-users] Using matplotlib in Qt4/Qt4 Designer
To: mat...@li...
Date: Tuesday, August 5, 2008, 10:06 AM
Hi All,
I'd like to use a matplotlib widget in a GUI app I'm working on. I have tried qwt but I know matplotlib a lot better and would like to use it instead. Is there anybody who have done this before? More specifically, does anyone know how to add a matplotlib widget as a custom widget in qt4 designer?
Any help will be greatly appreciated,
Ewald Zietsman
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
From: Mark B. <ma...@gm...> - 2008年08月05日 21:25:32
Hello list -
There is a recent matlab script floating around that downloads an image from
google map and plots it in a matlab figure.
Can we do the same? I am sure we can (not sure we want, as Google has been
somewhat difficult to people writing scripts to manipulate images from
google maps).
My second question is: Has someone done it and does he/she want to share?
Thanks, Mark
From: Mark B. <ma...@gm...> - 2008年08月05日 20:46:59
I have a question about plotting an array with an inf.
For example:
y = np.array([2.,1.,0,1.,2.])
y = 1.0 / y
So y is array([ 0.5, 1. , Inf, 1. , 0.5])
When I plot this, I get an error, of which the last line is:
OverflowError: math range error
I presume the problem is using the autoscale or something like that to set
the data limits.
But if I replace the Inf by a nan: y[2] = np.nan, then it plots fine.
I know, I know, I can do this with masked arrays, but it cannot be that hard
to make this work correctly, and wouldn't that be much nicer? Desirable?
Mark
From: Michael D. <md...@st...> - 2008年08月05日 19:03:55
This has now been fixed in SVN r5975 and r5976. This should make it 
into the next official release, or if you can try applying the patches 
from those SVN revisions. The fixes are a bit scattered, so YMMV.
Cheers,
Mike
Ben Axelrod wrote:
> Thanks,
>
> I think it is great that the color can be specified as either 3 or 4 columns. It would be nice if the bar plot color arguments also had this flexibility. They currently fail when the color has 4 columns.
>
> Will this bug fix need to wait until the next official release? (I am constrained to using the official releases and not the svn code).
>
> Thanks,
> -Ben
>
> -----Original Message-----
> From: Michael Droettboom [mailto:md...@st...]
> Sent: Monday, August 04, 2008 10:17 AM
> To: Ben Axelrod
> Cc: mat...@li...
> Subject: Re: [Matplotlib-users] 0.98.3 scatter plot color bug?
>
> Looks like a bug -- it should accept either 3 or 4 columns. I'll have a
> chance to look at this further this afternoon.
>
> Cheers,
> Mike
>
> Ben Axelrod wrote:
> 
>> I get an error when I use the scatter plot and set the 'c' value to a
>> list of 3-tuples. The error goes away if I use 4-tuples instead. Are
>> colors with only 3 values not supported anymore?
>>
>> ...
>>
>> File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 4807, in
>> scatter
>>
>> colors = mcolors.colorConverter.to_rgba_array(c, alpha)
>>
>> File "C:\Python24\Lib\site-packages\matplotlib\colors.py", line 343,
>> in to_rgba_array
>>
>> c[i] = self.to_rgba(cc, alpha) # change in place
>>
>> ValueError: shape mismatch: objects cannot be broadcast to a single shape
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> 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: Jonathan H. <jjh...@gm...> - 2008年08月05日 17:40:07
I've never worked with qt (only wx) but have you checked out the qt 
embedding examples in the /examples/user_interfaces/ directory? Should 
be a good start. There is also
http://www.scipy.org/Cookbook/Matplotlib/Qt_with_IPython_and_Designer
from the matplotlib cookbook which seems to address embedding a 
matplotlib widget using Designer.
Cheers,
-Jonathan Helmus
Ewald Zietsman wrote:
> Hi All,
>
> I'd like to use a matplotlib widget in a GUI app I'm working on. I 
> have tried qwt but I know matplotlib a lot better and would like to 
> use it instead. Is there anybody who have done this before? More 
> specifically, does anyone know how to add a matplotlib widget as a 
> custom widget in qt4 designer?
>
> Any help will be greatly appreciated,
>
> Ewald Zietsman
From: Sandro T. <mat...@gm...> - 2008年08月05日 17:27:28
On Mon, Aug 4, 2008 at 15:41, Sandro Tosi <mat...@gm...> wrote:
> 2008年8月4日 Michael Droettboom <md...@st...>:
>> The graphviz failing is my bad. I failed to test the latex doc build (since
>> it never works for me anyway due to a too-old version of latex). This is
>> fixed in SVN r5962, and a patch against doc/sphinxext/inheritance_diagram.py
>> is attached.
> I'll apply it once at home and test if works in Debian: Thanks for the
> prompt reply!!
Patch applied and matplotlib 0.98.3 version has just been uploaded in
Debian: thank you guys for the support!!
A mail to Debian Release Team has been sent[1], let's see if they'll
accept it for Lenny.
Cheers,
Sandro
[1] http://lists.debian.org/debian-release/2008/08/msg00258.html
-- 
Sandro Tosi (aka morph, Morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Ewald Z. <ewa...@gm...> - 2008年08月05日 16:06:49
Hi All,
I'd like to use a matplotlib widget in a GUI app I'm working on. I have
tried qwt but I know matplotlib a lot better and would like to use it
instead. Is there anybody who have done this before? More specifically, does
anyone know how to add a matplotlib widget as a custom widget in qt4
designer?
Any help will be greatly appreciated,
Ewald Zietsman
From: Jonathan H. http://JonathansCorner.c. <chr...@gm...> - 2008年08月05日 15:49:49
P.S.
I have found that I can mitigate the problem by changing the axes: changing,
ax = pylab.axes([0.1, 0.1, 0.8, 0.8])
to
ax = pylab.axes([0.2, 0.2, 0.6, 0.6])
shrinks almost everything towards the center, meaning that some things no
longer get cut off.
(But this is at the expense of a smaller overall picture, that isn't doing
quite the same job graphically.)
This offers a partial workaround, but it's nowhere near so good as it would
be to move the labels inward so they don't get cut off (while keeping the
pie graph at a preferred size for the graph itself).
On Tue, Aug 5, 2008 at 10:42 AM, Mathieu Leplatre <lep...@gm...>wrote:
> On Tue, Aug 5, 2008 at 12:21 PM, Jonathan Hayward,
> http://JonathansCorner.com <chr...@gm...>
> wrote:
> > The pie chart sometimes cuts off even relatively short labels that extend
> > beyond the edge of the image (.1, .1, .8, .8).
> >
> > What is the best way to dodge labels getting cut off, or is there not
> much
> > of a good way?
> >
> > TIA,
>
> I think I am facing a similar problem. I would like to auto-adjust the
> chart frame.
>
> For example, doing this, the title is cropped :
>
> import pylab
> pylab.plot([1,2,3])
> pylab.title('Big One', fontsize=72)
> pylab.show()
>
-- 
-- Jonathan Hayward, chr...@gm...
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
From: Mathieu L. <lep...@gm...> - 2008年08月05日 15:42:44
On Tue, Aug 5, 2008 at 12:21 PM, Jonathan Hayward,
http://JonathansCorner.com <chr...@gm...>
wrote:
> The pie chart sometimes cuts off even relatively short labels that extend
> beyond the edge of the image (.1, .1, .8, .8).
>
> What is the best way to dodge labels getting cut off, or is there not much
> of a good way?
>
> TIA,
I think I am facing a similar problem. I would like to auto-adjust the
chart frame.
For example, doing this, the title is cropped :
import pylab
pylab.plot([1,2,3])
pylab.title('Big One', fontsize=72)
pylab.show()
From: Jonathan H. http://JonathansCorner.c. <chr...@gm...> - 2008年08月05日 15:21:56
The pie chart sometimes cuts off even relatively short labels that extend
beyond the edge of the image (.1, .1, .8, .8).
What is the best way to dodge labels getting cut off, or is there not much
of a good way?
TIA,
-- 
-- Jonathan Hayward, chr...@gm...
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
++ Would you like to curl up with one of my hardcover books?
++ You can now get my books from http://CJSHayward.com
From: Mikhail G. <dot...@do...> - 2008年08月05日 07:39:50
Twas brillig at 15:54:08 03.08.2008 UTC+07 when dot...@do... did gyre and gimble:
 MG> As Lenny is already in freeze, I backported fix to 0.4.1 and now
 MG> trying to get the confirmation from release team to upload it to
 MG> testing-proposed-updates.
sphinx 0.4.1-2lenny1 is now in testing-proposed-updates.
-- 

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