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




Showing 6 results of 6

From: Pau <vim...@go...> - 2009年03月22日 18:21:32
Hello,
using 0.98.5.2 under OpenBSD -current
I have made a plot and, when I try to save it as eps/ps, I get the
error "float argument required" in a pop-up window, whilst the
terminal shows this error message:
/usr/local/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py:1054:
GtkWarning: Unable to find default local directory monitor type
 if self.run() != int(gtk.RESPONSE_OK):
I can save it as pdf, but the quality is not what I want. The curves
do not have the thickness I gave them.
I reproduced the same running it under Fedora 10.
I have googled and yahooed. Found nothing.
It looks as if the some function was expecting a decimal-point number
but got something else.
I can send the .py and data, if you wish.
Thanks,
Pau
From: Xavier G. <xav...@gm...> - 2009年03月22日 18:09:34
Attachments: test2PyQt.py
Hi,
I'm trying to write a pyqt4 application including pylab plotting
capabilities.
Up to now, it looks like this (see in attachment).
The picker works fine (I get the msg) *but* I also would like to get the
(x,y) coordinates and the the corresponding value A[x,y].
Could someone tell me what I should do in on_pick with this "event" to
get these data??
Xavier
From: Alan G I. <ala...@gm...> - 2009年03月22日 13:13:47
On 3/21/2009 11:33 PM Gary Ruben apparently wrote:
> Whilst agreeing with Kaushik's sentiments on the greatness of 
> matplotlib, I thought his example plot nicely illustrates a layout wart 
> that I think is easily fixed by changing the default xtick.major.pad, 
> xtick.minor.pad, ytick.major.pad and ytick.minor.pad values from 4 to 6.
> As well as preventing the x- and y-axis labels running into each other 
> in Kaushik's example, the most common case of a 2D plot with 0 lower 
> bound on both the x- and y-axes [e.g. plot(rand(10))] looks better with 
> the default font when pad=6.
Yes indeed.
I would like to see examples justifying the current default.
Alan Isaac
(another user)
From: Deltarodigy <Del...@gm...> - 2009年03月22日 04:28:33
For the past few days I have been trying to get contour graphs working in my
pyqt files. I am lost at trying to implement the actual plot. How is it that
I can do this, so far I can only get axes to show in the window.
http://code.google.com/p/scc08/source/browse/#svn/branch/realistic2d is
where my project is, NOTE: most of the files are for generating data for the
graphs.
-- 
View this message in context: http://www.nabble.com/Matplotlib-and-contour-graphs-and-pyqt-tp22643299p22643299.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Gary R. <gr...@bi...> - 2009年03月22日 03:33:58
Whilst agreeing with Kaushik's sentiments on the greatness of 
matplotlib, I thought his example plot nicely illustrates a layout wart 
that I think is easily fixed by changing the default xtick.major.pad, 
xtick.minor.pad, ytick.major.pad and ytick.minor.pad values from 4 to 6.
As well as preventing the x- and y-axis labels running into each other 
in Kaushik's example, the most common case of a 2D plot with 0 lower 
bound on both the x- and y-axes [e.g. plot(rand(10))] looks better with 
the default font when pad=6. Just to bolster my case, according to the 
gestalt theory "Law of Proximity" 
<http://en.wikipedia.org/wiki/Gestalt_psychology>, the labels, which are 
currently closer to each other at the axis intersection than to the axes 
themselves become separated enough from one another so that they become 
visually associated with the axes in this region.
As an aside, I went looking for Matlab plotting examples and some appear 
to match the pad=4 padding whereas others are more like pad=6.
Of course I shall change this in my matplotlibrc file. I just thought 
I'd see if I could provoke a revolution,
Gary R.
From: Eric F. <ef...@ha...> - 2009年03月22日 00:10:01
Mike Bauer wrote:
> Eric,
> 
> Here's an example of a working hexbin (attached). What I want to do is 
> compare this with another dataset with many fewer points. What I'd 
> really like is for the color bar to reflect the cumulative percent of 
> the total count each cell holds, but I'd settle for what I thought 
> normalized gives which is scaling the colors from 0 - 1 instead of 
> showing the number count. I don't care about comparing numbers I care 
> about the relative frequency of each cell.
I don't have a solution for you, but it looks to me like you can do the 
sort of thing you are looking for via suitable choice of the C and 
reduce_C_function kwargs to hexbin. This is not a job for the norm kwarg.
Actually, here is a stab at what I think you are describing:
x = np.random.normal(size=(10000,))
y = np.random.normal(size=(10000,))
imask = (x > -1) & (x < 1) & (y > -1) & (y < 1)
x = x[imask]
y = y[imask]
c = np.ones_like(x) * 100 / len(x)
hexbin(x, y, C=c, reduce_C_function=np.sum, gridsize=20)
colorbar()
I think this is giving percentage of hits in each bin. The numbers are 
very small because there are many bins.
Eric
> 
> Thanks for the pointer to colors.LogNorm(). I'll look into that.
> 
> Mike
> 
> Here's my script (sorry, you'll see it's a temporary hack).
> 
> 
> 
> 
> 
> On Mar 20, 2009, at 7:10 PM, Eric Firing wrote:
> 
>> Mike Bauer wrote:
>>> Eric,
>>> Thanks for the reply. I'm trying to show the relative 2d distribuion 
>>> between 2 sets of data. I thought the normalization would ease the 
>>> comparison. Fixing the ' doesn't help.
>>> So are you saying I need an instance of something.normalize rather 
>>> than just passing norm='normalize'?
>>
>> It sounds like you are misunderstanding the norm kwarg; it is for 
>> controlling the mapping of an arbitrary range of numbers to the 0-1 
>> range that is used in color mapping. The default is a linear mapping; 
>> one can use a log mapping instead ("norm=colors.LogNorm()"), or make 
>> your own mapping function, etc. The norm kwarg takes an instance of a 
>> Normalize class or subclass. See colors.py to find out what Normalize 
>> subclasses are available. But, you may not need to specify one at 
>> all, depending on what it is you are trying to do.
>>
>> I still don't understand what it is that you wanted to "normalize". 
>> What was the undesirable characteristic of the plot you had before you 
>> put in the norm kwarg?
>>
>> Eric
>>
>>> Mike
>>> Sent from my iPhone
>>> On Mar 20, 2009, at 5:15 PM, Eric Firing <ef...@ha...> wrote:
>>>> Mike Bauer wrote:
>>>>> Hello,
>>>>> Quick note. I'm making plots with hexbin and everything works 
>>>>> correctly until I try to use the norm='Normalize' option at which 
>>>>> point I get:
>>>>> Traceback (most recent call last):
>>>>> File "diff_engine_v2tmp.py", line 731, in <module>
>>>>> kept_and_discards)
>>>>> File "diff_engine_v2tmp.py", line 605, in main
>>>>> plt.hexbin(xdat,ydat,cmap=cm.jet,gridsize=25,norm=Normalize' )
>>>>
>>>> What is that single quote mark doing after Normalize? If we ignore 
>>>> it, then it looks like you are passing a class, not a class instance 
>>>> as the kwarg needs.
>>>>
>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/ 
>>>>> lib/python2.5/site-packages/matplotlib/pyplot.py", line 1920, in 
>>>>> hexbin
>>>>> ret = gca().hexbin(*args, **kwargs)
>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/ 
>>>>> lib/python2.5/site-packages/matplotlib/axes.py", line 5452, in hexbin
>>>>> collection.autoscale_None()
>>>>> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.5/ 
>>>>> lib/python2.5/site-packages/matplotlib/cm.py", line 148, in 
>>>>> autoscale_None
>>>>> self.norm.autoscale_None(self._A)
>>>>> AttributeError: 'int' object has no attribute 'autoscale_None'
>>>>
>>>> This part of the traceback is also a little puzzling; I'm not sure 
>>>> why self.norm is an int at this point.
>>>>
>>>>> I assume this a bug of some sort.
>>>>
>>>> No, I think the problem is that you are passing a class instead of 
>>>> an instance of a class as the norm kwarg to hexbin. (It is not 
>>>> completely clear to me from the traceback, however--there is that 
>>>> strange single quote mark.) What kind of normalization are you 
>>>> trying to to? In other words, what are you trying to accomplish by 
>>>> specifying the norm kwarg?
>>>>
>>>> Eric
>>>>
>>>>
>>>>> Thanks for any ideas.
>>>>> Mike
>>>>> Using:
>>>>> os-x 10.5.6
>>>>> python 2.5.4 from macports
>>>>> matplotlib 0.98.5.2 from macports
>>>>> ------------------------------------------------------------------------------ 
>>>>>
>>>>> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) 
>>>>> are
>>>>> powering Web 2.0 with engaging, cross-platform capabilities. 
>>>>> Quickly and
>>>>> easily build your RIAs with Flex Builder, the Eclipse(TM)based 
>>>>> development
>>>>> software that enables intelligent coding and step-through debugging.
>>>>> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
>>>>> _______________________________________________
>>>>> Matplotlib-users mailing list
>>>>> Mat...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>>
>>
> 
> ------------------------------------------------------------------------
> 

Showing 6 results of 6

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