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





Showing results of 303

<< < 1 .. 3 4 5 6 7 .. 13 > >> (Page 5 of 13)
From: Jeff W. <js...@fa...> - 2010年05月24日 17:51:53
On 5/24/10 8:45 AM, Benjamin Root wrote:
>
>
> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker <js...@fa... 
> <mailto:js...@fa...>> wrote:
>
>
> On 5/21/10 3:57 PM, Benjamin Root wrote:
>> I did some more digging and I think I have a hypothesis for what
>> is happening.
>>
>> There is only one main difference between a call to .drawstates()
>> and .readshapefiles() with respect to loading and plotting data. 
>> .drawstates() loads *only* the line segments that coincide with
>> the defined map boundaries, while .readshapefiles() loads all of
>> the data in the shapefile. Therefore, the LineCollection that
>> gets attached to the axis contains data from outside the stated
>> domain.
>>
>> In addition, the basemap versions of the plotting functions have
>> the benefit of finishing their calls with a call to
>> .set_axes_limits(), which keeps the axes in check. However, a
>> non-basemap version would not call that automatically, thereby
>> having its axes automatically expanded to contain all of the data
>> in the LineCollection.
>>
>> I am not sure what exactly should be done about this. This is
>> certainly un-intuitive behavior, though. Maybe there could be a
>> keyword option in .readshapefile() to have only the data for the
>> stated domain loaded? That might solve the issue.
>>
>> Thanks,
>> Ben Root
>
> Ben: That's why you should use the basemap methods where possible
> (they handle these things for you).
>
>
> Yeah, that wasn't possible in my case. In addition, not all pyplot 
> plotting functions are available (nor do I expect Basemap to have all 
> of them available). Therefore, it often makes more sense for me to 
> use the pyplot functions and just give Basemap the axes.
>
> You could also turn autoscaling off on your axes using
>
> ax.set_autoscaleon(False)
>
> and then they won't automatically expand when you plot data
> outside your map region. Or, you could just call the
> set_axes_limits() methods before you draw the plot.
>
> At the least, I think this advice should be thoroughly documented, 
> especially in the docstring for readshapefile(). This behavior was 
> quite perplexing to me and it took a while to figure out the cause. I 
> am one of those people who will not leave well enough alone...
>
>
> Clipping the polygons to the map projection region is non-trivial,
> and I don't think I want to add that to readshapefile.
>
> Personally, I think there should be a family of .draw*() functions 
> that behave like .drawstates(). One of those functions can be 
> .drawshapefile(). Then there would be a family of .read*() functions 
> that could be called either by the user or by the .draw*() functions. 
> The .read*() function could have an option to perform a clip of the 
> incoming data.
>
> If you like to discuss this further, I would be more than happy to 
> help out.
>
> Ben Root
Ben: The shapefile stuff in Basemap certainly could use some work. If 
you'd like to help, that would be great.
-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-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jeff W. <js...@fa...> - 2010年05月24日 17:44:59
On 5/24/10 10:24 AM, Christopher Barker wrote:
> Benjamin Root wrote:
> 
>> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker<js...@fa...
>> Ben: That's why you should use the basemap methods where possible
>> (they handle these things for you).
>>
>>
>> Yeah, that wasn't possible in my case. In addition, not all pyplot
>> plotting functions are available (nor do I expect Basemap to have all of
>> them available).
>> 
> Though it would be nice to add more as we need them. I assume Jeff will
> take contributions.
>
> I need to be able to draw a filled polygon from coordinates in memory,
> for instance, but didn't see a way to do this directly. If I get a
> chance, I will look into .drawshapefile(), and figure I can see how to
> do it from there.
>
> -Chris
>
>
>
> 
Chris: If you have the map projection coordinates of the polygon, you 
can just use the pyplot commands or axes methods, and then use the 
Basemap set_axes_limits method to make sure the aspect ratio and axes 
limits get reset correctly.
-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-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jeff W. <js...@fa...> - 2010年05月24日 17:43:10
On 5/24/10 10:09 AM, P. R.M. wrote:
> Hi,
> Im trying to create a precipitation contour plot using imshow() and 
> basemap.
> Id like to draw the imshow() plot so that it overlays the filled 
> continents, yet NOT the continental outlines.
> unfortunately, it appears that imshow()'s graphics are always drawn 
> before everything else, so its 'zorder' argument is useless with basemap.
> the imshow() output is always at the bottom layer, with everthing else 
> being overlaid on it & covering it up.
>
> is there a work-around for this, so that I can layer imshow()'s output 
> between my calls to 'basemap.fillcontinents()' and 
> 'basemap.drawcoastlines()'???
>
> please help,
>
> thanks,
> p.romero
I don't think this is possible - zorder doesn't work with images. You 
can use transparency though.
-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-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Dharhas P. <Dha...@tw...> - 2010年05月24日 17:08:53
Attachments: 08176500.zip
Hi,
I'm trying to use plot_date to plot some USGS daily flow data. I seem to have hit a bug in the plotting where large spikes in data are not being plotted at all scales.
For example in the attached data file there is a spike in the flow that hits a maximum of 30700 on 1998年10月20日. When plotted with the commands below this portion of the dataset does not show up. If I drag the plot window to make the x axis 2 to 3 times wider than normal there is point at which this data spike suddenly appears. This problem doesn't exist if I use a symbol like .,+ etc only with lines.
code:
----
import datetime
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
qfile = '08176500.txt'
#q_file = qfile.split('.')[0].split('\\')[-1]
q_ts = np.genfromtxt(qfile,comments='#',dtype=None,usecols=(2,3),names='dates,discharge')
dt = np.array([datetime.date(year=int(date.split('-')[0]), month=int(date.split('-')[1]), day=int(date.split('-')[2])) for date in q_ts['dates']])
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot_date(mpl.dates.date2num(dt), q_ts['discharge'],'-')
plt.show()
----
Any help is appreciated.
thanks,
- dharhas
From: Christopher B. <Chr...@no...> - 2010年05月24日 16:24:27
Benjamin Root wrote:
> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker <js...@fa... 
> Ben: That's why you should use the basemap methods where possible
> (they handle these things for you).
> 
> 
> Yeah, that wasn't possible in my case. In addition, not all pyplot 
> plotting functions are available (nor do I expect Basemap to have all of 
> them available).
Though it would be nice to add more as we need them. I assume Jeff will 
take contributions.
I need to be able to draw a filled polygon from coordinates in memory, 
for instance, but didn't see a way to do this directly. If I get a 
chance, I will look into .drawshapefile(), and figure I can see how to 
do it from there.
-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: P. R.M. <rom...@ho...> - 2010年05月24日 16:09:51
Hi,
Im trying to create a precipitation contour plot using imshow() and basemap.
Id like to draw the imshow() plot so that it overlays the filled continents, yet NOT the continental outlines.
unfortunately, it appears that imshow()'s graphics are always drawn before everything else, so its 'zorder' argument is useless with basemap.
the imshow() output is always at the bottom layer, with everthing else being overlaid on it & covering it up.
is there a work-around for this, so that I can layer imshow()'s output between my calls to 'basemap.fillcontinents()' and 'basemap.drawcoastlines()'??? 
please help,
thanks,
p.romero
 		 	 		 
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 
From: Pau <vim...@go...> - 2010年05月24日 15:40:48
Dear all,
I am producing some plots and in many of them I have in the y-axis typically
0.00001 0.00003 ... 0.00009
In previous versions of matplotlib this would go into a
1, 3 .... 9
and then a x10^-4
close to the top. This was very nice.
This feature seems to be lost, at least with the defaults.
How can I reset this?
I would also like to know how to specify the number of ticks to be
used for an axis.
Thanks,
Pau
On Thu, May 20, 2010 at 1:06 AM, ayuffa <ay...@gm...> wrote:
>
> Does anyone have another fix for this problem that DOES NOT produce HUGE
> PDF/EPS files?
>
> I believe that the latest SVN revision should allow you to set
rasterized=True for the call to contourf. I don't know if the relevant code
has been checked in or not. This should help with producing pdf files (and
theoretically, eps files, although that backend might need some more
work...).
Ben Root
From: Benjamin R. <ben...@ou...> - 2010年05月24日 14:45:33
On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker <js...@fa...> wrote:
>
> On 5/21/10 3:57 PM, Benjamin Root wrote:
>
> I did some more digging and I think I have a hypothesis for what is
> happening.
>
> There is only one main difference between a call to .drawstates() and
> .readshapefiles() with respect to loading and plotting data. .drawstates()
> loads *only* the line segments that coincide with the defined map
> boundaries, while .readshapefiles() loads all of the data in the shapefile.
> Therefore, the LineCollection that gets attached to the axis contains data
> from outside the stated domain.
>
> In addition, the basemap versions of the plotting functions have the
> benefit of finishing their calls with a call to .set_axes_limits(), which
> keeps the axes in check. However, a non-basemap version would not call that
> automatically, thereby having its axes automatically expanded to contain all
> of the data in the LineCollection.
>
> I am not sure what exactly should be done about this. This is certainly
> un-intuitive behavior, though. Maybe there could be a keyword option in
> .readshapefile() to have only the data for the stated domain loaded? That
> might solve the issue.
>
> Thanks,
> Ben Root
>
>
> Ben: That's why you should use the basemap methods where possible (they
> handle these things for you).
>
Yeah, that wasn't possible in my case. In addition, not all pyplot plotting
functions are available (nor do I expect Basemap to have all of them
available). Therefore, it often makes more sense for me to use the pyplot
functions and just give Basemap the axes.
> You could also turn autoscaling off on your axes using
>
> ax.set_autoscaleon(False)
>
> and then they won't automatically expand when you plot data outside your
> map region. Or, you could just call the set_axes_limits() methods before
> you draw the plot.
>
> At the least, I think this advice should be thoroughly documented,
especially in the docstring for readshapefile(). This behavior was quite
perplexing to me and it took a while to figure out the cause. I am one of
those people who will not leave well enough alone...
Clipping the polygons to the map projection region is non-trivial, and I
> don't think I want to add that to readshapefile.
>
> Personally, I think there should be a family of .draw*() functions that
behave like .drawstates(). One of those functions can be .drawshapefile().
Then there would be a family of .read*() functions that could be called
either by the user or by the .draw*() functions. The .read*() function
could have an option to perform a clip of the incoming data.
If you like to discuss this further, I would be more than happy to help out.
Ben Root
From: Fredrik P. <pi....@gm...> - 2010年05月24日 14:04:58
Hi,
My boss asked me to provide a list of the source-code distribution per
folder in a project.
Using cloc http://cloc.sourceforge.net/ and some python give me all the numbers.
The problem comes when using pie to display the result, since many folders have
a small distribution, labels are printed ontop of each other making it
impossible to
read.
Using linux-2.6.34 kernel as an example:
----8<----
#!/usr/bin/env python
from pylab import *
#linux-2.6.34
dirs=['arch', 'block', 'crypto', 'Documentation', 'drivers',
'firmware', 'fs', 'include', 'init', 'ipc', 'kernel', 'lib', 'mm',
'net', 'samples', 'scripts', 'security', 'sound', 'tools', 'usr',
'virt']
result=[8433016,1662987,11234,38484,44922,4596534,2048,678518,255574,2289,5478,102723,22516,46726,425009,625,31712,31006,440266,29128,549,3973]
fracs=[100*i/float(result[0]) for i in result[1:]]
#difficult to see all the pie-elements,
for f,l in zip(fracs,dirs):
 print l.rjust(20),round(f,2),'\t%'
# make a square figure and axes
figure(1, figsize=(8,8))
ax = axes([0.1, 0.1, 0.8, 0.8])
p=pie(fracs, labels=dirs)
show()
----8<----
some googling gives this thread:
http://www.mail-archive.com/mat...@li.../msg16191.html
but that doesn't solve the problem, just makes it different...
Anyone know of a solution to this problem?
cheers
//Fredrik
From: David <Da...@we...> - 2010年05月23日 01:21:16
Thanks for your help Werner. 
When I read that in the wiki I thought the setup.py
needed to be modified and since I had no reference 
to the fix in my setup Ididn't know where to change it. 
I made the change in mlab.py ( thank you again)
and it works fine. 
From: Jeff W. <js...@fa...> - 2010年05月21日 22:16:14
On 5/21/10 3:57 PM, Benjamin Root wrote:
> I did some more digging and I think I have a hypothesis for what is 
> happening.
>
> There is only one main difference between a call to .drawstates() and 
> .readshapefiles() with respect to loading and plotting data. 
> .drawstates() loads *only* the line segments that coincide with the 
> defined map boundaries, while .readshapefiles() loads all of the data 
> in the shapefile. Therefore, the LineCollection that gets attached to 
> the axis contains data from outside the stated domain.
>
> In addition, the basemap versions of the plotting functions have the 
> benefit of finishing their calls with a call to .set_axes_limits(), 
> which keeps the axes in check. However, a non-basemap version would 
> not call that automatically, thereby having its axes automatically 
> expanded to contain all of the data in the LineCollection.
>
> I am not sure what exactly should be done about this. This is 
> certainly un-intuitive behavior, though. Maybe there could be a 
> keyword option in .readshapefile() to have only the data for the 
> stated domain loaded? That might solve the issue.
>
> Thanks,
> Ben Root
Ben: That's why you should use the basemap methods where possible (they 
handle these things for you). You could also turn autoscaling off on 
your axes using
ax.set_autoscaleon(False)
and then they won't automatically expand when you plot data outside your 
map region. Or, you could just call the set_axes_limits() methods 
before you draw the plot.
Clipping the polygons to the map projection region is non-trivial, and I 
don't think I want to add that to readshapefile.
-Jeff
>
> On Fri, May 21, 2010 at 4:08 PM, Benjamin Root <ben...@ou... 
> <mailto:ben...@ou...>> wrote:
>
> Hello,
>
> I have been tracking down an annoying (but easily worked around)
> issue with Basemap. It seems that if you call .readshapefile() to
> create, for example, roads on your image, and then call any pyplot
> command afterwards for that axis, the axis will reset itself to
> the entire domain (I guess it would be the complete domain stated
> in the shapefile, maybe?). This does not happen if you call the
> equivalent function from the Basemap instance, though. Also, this
> does not happen with drawstates() and its ilk.
>
> I have made a test script and a couple of supporting shapefile in
> a tar.gz file to demonstrate the issue. It is available here:
> http://dl.dropbox.com/u/7325604/basemaptest.tar.gz
>
>
> I have also attached a png file showing the resulting image as it
> appears on my computer. I have no clue as to the cause and I hope
> that someone here might have an idea.
>
> Thanks,
> Ben Root
>
>
>
> ------------------------------------------------------------------------------
>
> 
>
>
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
-- 
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-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jae-Joon L. <lee...@gm...> - 2010年05月21日 22:15:55
set_array method only update the underlying array, and no more.
The problem is that, the first imshow results in clim=(0,0) and
set_array does not change this.
You may manually update the clim of the image, or you may explicitly
call autoscale() after set_array.
Regards,
-JJ
On Fri, May 21, 2010 at 1:56 PM, Chiara Caronna
<chi...@ho...> wrote:
> Hi,
> I am trying to update the image plotted in a figure. From what I understood,
> this code should do the job:
>
> import pylab as p
>
> image=p.zeros((20,20))
> p.ion()
> ax=p.imshow(image)
> p.draw()
>
> for i in range(10):
> print i
> p.ion()
> image[i,:]=i
> ax.set_array(image)
> p.draw()
>
>
> But the image is not updated at all....
> what am I doing wrong?
>
> I have the 0.99.1.1 version of matplotlib.
>
> Cheers,
> Chiara
>
>
> ________________________________
> Hotmail: Powerful Free email with security by Microsoft. Get it now.
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Benjamin R. <ben...@ou...> - 2010年05月21日 20:35:45
Andreas,
With respect to the large PDF file, while hexbin() would help in that
regards, if you need further improvement in filesize, there is a kwarg for
some plotting functions: rasterized=True. You might need to use a svn
checkout of matplotlib for it to work though, but I am dealing with the same
problem as well.
Ben Root
On Fri, May 21, 2010 at 3:24 PM, Andreas Hilboll <li...@hi...> wrote:
> > You want to make a kernel density estimate (a.k.a. a "heatmap").
>
> Thanks for the link, i'll look into it and compare it to the suggested
> hexbin().
>
> > This approach would
> > likely
> > be a bit slow if you have a very large number of points, though. It's
> > usually less visually messy to just plot the image
>
> Well, that's not an option. I once tried to create a 'normal' scatterplot
> of my data (it's a couple of million points), and that took a *long* time.
> Plus, it made me see a 700M pdf file for the first time in my life ;)
>
> Cheers,
>
> Andreas.
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Andreas H. <li...@hi...> - 2010年05月21日 20:22:17
> You want to make a kernel density estimate (a.k.a. a "heatmap").
Thanks for the link, i'll look into it and compare it to the suggested
hexbin().
> This approach would
> likely
> be a bit slow if you have a very large number of points, though. It's
> usually less visually messy to just plot the image
Well, that's not an option. I once tried to create a 'normal' scatterplot
of my data (it's a couple of million points), and that took a *long* time.
Plus, it made me see a 700M pdf file for the first time in my life ;)
Cheers,
Andreas.
From: Stan W. <sta...@nr...> - 2010年05月21日 20:16:17
> From: MONTAGU Thierry [mailto:thi...@ce...] 
> Sent: Friday, May 21, 2010 09:37
> 
> has anyone ever tried to make a quantile-quantile plot with pylab?
> is there any build in function named say "qqplot" available ?
For a plot comparing samples to a theoretical distribution (and if you don't
need masking as in Paul's example), you might be able to use
scipy.stats.probplot, as follows:
 import matplotlib.pyplot as plt
 import scipy.stats as st
 values = st.norm.rvs(size=(100,)) # example data
 fig = plt.figure() # set up plot
 ax = fig.add_subplot(1, 1, 1)
 osm, osr = st.probplot(values, fit=0, dist='norm') # compute
 ax.plot(osm, osr, '.') # plot
One way to include the fit line is
 (osm, osr), (m, b, r) = st.probplot(values, dist='norm') # compute
 osmf = osm.take([0, -1]) # endpoints
 osrf = m * osmf + b # fit line
 ax.plot(osm, osr, '.', osmf, osrf, '-')
From: Benjamin R. <ben...@ou...> - 2010年05月21日 20:14:35
Andreas,
Check out hexbin(), it is the easiest way to do what you want.
Ben Root
On Fri, May 21, 2010 at 2:52 PM, Andreas Hilboll <li...@hi...> wrote:
> Hi there,
>
> the attached figure shows a scatterplot, where the colors indicate the
> density of measurement points.
>
> Is there any way to do this with matplotlib?
>
> Thanks for your insight,
>
> Andreas.
>
>
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Andreas H. <li...@hi...> - 2010年05月21日 20:08:40
Attachments: correlation.png
Hi there,
the attached figure shows a scatterplot, where the colors indicate the 
density of measurement points.
Is there any way to do this with matplotlib?
Thanks for your insight,
Andreas.
From: Chiara C. <chi...@ho...> - 2010年05月21日 17:56:38
Hi,
I am trying to update the image plotted in a figure. From what I understood, this code should do the job:
import pylab as p
image=p.zeros((20,20))
p.ion()
ax=p.imshow(image)
p.draw()
for i in range(10):
 print i
 p.ion()
 image[i,:]=i
 ax.set_array(image)
 p.draw()
But the image is not updated at all....
what am I doing wrong?
I have the 0.99.1.1 version of matplotlib.
Cheers,
Chiara
 		 	 		 
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969 
morever
computer gets stuck for code
 
from multiprocessing import Process
from matplotlib.pyplot import plot, show
def plot_graph(*args):
 for data in args:
 plot(data)
 show()
p = Process(target=plot_graph, args=([1, 2, 3],))
p.start()
print 'yay'
print 'computation continues...'
print 'that rocks.'
print 'Now lets wait for the graph be closed to continue...:'
p.join()
 
from
http://stackoverflow.com/questions/458209/is-there-a-way-to-detach-matplotlib-plots-so-that-the-computation-can-continue
 
 
since this code multipliers number of pyhon.exe running till memory is full in my case 6 GB
 
is it problem for Vista only?
Sandy
 
 
> Date: 2010年5月18日 18:14:11 -0400
> From: ala...@gm...
> To: mat...@li...
> CC: cd...@li...
> Subject: Re: [Gnuplot-py-users] is it possible to continue to Debug when figure is created??
> 
> > http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show
> 
> 
> Here is some more detail, that I actually think
> should be added to the above link.
> http://stackoverflow.com/questions/458209/is-there-a-way-to-detach-matplotlib-plots-so-that-the-computation-can-continue
> 
> hth,
> Alan Isaac
> 
 		 	 		 
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969 
From: Alan G I. <ala...@gm...> - 2010年05月21日 16:59:59
On 5/21/2010 12:35 PM, Sandy Ydnas wrote:
> nothing from
> http://stackoverflow.com/questions/458209/is-there-a-way-to-detach-matplotlib-plots-so-that-the-computation-can-continue
>
> working on Vista for Wings IDE
What if you ditch the IDE and just run the script?
Alan Isaac
sorry 
but nothing from
http://stackoverflow.com/questions/458209/is-there-a-way-to-detach-matplotlib-plots-so-that-the-computation-can-continue
 
working on Vista for Wings IDE
do you use it for LInux?
Sandy
 
> Date: 2010年5月18日 18:14:11 -0400
> From: ala...@gm...
> To: mat...@li...
> CC: cd...@li...
> Subject: Re: [Gnuplot-py-users] is it possible to continue to Debug when figure is created??
> 
> > http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show
> 
> 
> Here is some more detail, that I actually think
> should be added to the above link.
> http://stackoverflow.com/questions/458209/is-there-a-way-to-detach-matplotlib-plots-so-that-the-computation-can-continue
> 
> hth,
> Alan Isaac
> 
 		 	 		 
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969 
From: <PH...@Ge...> - 2010年05月21日 16:02:19
Thierry,
You need either scipy or rpy2 (and R) to do this. I've attached some code below. Please keep in mind that I've written for the general case of having a censored data set, therefore I rely on masked arrays from numpy.ma and scipy.stats.mstats -- but I have apply the mask midway through the process, which is different than the numpy's standard operating procedure. Let me know if any of this isn't clear.
I also have code that generates a quick comparison of the results from scipy.stats.mstats and ryp2+R, if you're interested.
HTH,
-paul
# code...
import matplotlib.pyplot as pl
import scipy.stats as st
import numpy as np
def censoredProbPlot(data, mask):
 ppos = st.mstats.plotting_positions(data)
 qntl = st.distributions.norm.ppf(ppos)
 
 qntlMask = np.ma.MaskedArray(qntl, mask=mask)
 dataMask = np.ma.MaskedArray(data, mask=mask)
 
 fit = st.mstats.linregress(dataMask, qntlMask)
 mu = -fit[1]
 sigma = fit[0]
 d_ = np.linspace(np.min(data),np.max(data))
 q_ = sigma * d_ - mu
 
 maskedProbPlot = {"mskData" : dataMask,
 "mskQntl" : qntlMask,
 "unmskData" : data,
 "unmskQntl" : qntl,
 "bestFitD" : d_,
 "bestFitQ" : q_,
 "mu" : mu,
 "sigma" : sigma}
 return maskedProbPlot
if 1:
 #~~ you need to put your data here:
 #data = np.array([])
 #mask = np.array([],dtype=bool)
 mpp = censoredProbPlot(data, mask)
 fig = pl.figure()
 ax1 = fig.add_subplot(111)
 ax1.plot(mpp['mskQntl'], mpp['mskData'], 'ko', ms=6, label='Detected Samples')
 ax1.plot(mpp['unmskQntl'], mpp['unmskData'], 'r.', ms=6, label='Raw Samples')
 ax1.plot(mpp['bestFitQ'], mpp['bestFitD'], 'b-', lw=2)
 fig.savefig('example_censoredProbPlot.png')
> -----Original Message-----
> From: MONTAGU Thierry [mailto:thi...@ce...]
> Sent: Friday, May 21, 2010 6:37 AM
> To: mat...@li...
> Subject: [Matplotlib-users] qqplot
> 
> hi all
> 
> has anyone ever tried to make a quantile-quantile plot with pylab?
> is there any build in function named say "qqplot" available ?
> 
> thanks
> Thierry
> 
> -------------------------------------------------------------------------
> -----
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jae-Joon L. <lee...@gm...> - 2010年05月21日 15:01:55
On Wed, May 19, 2010 at 5:47 PM, Solomon M Negusse
<sol...@tw...> wrote:
> Hello,
> I came across problem of label rotation with autofmt_xdate() in subplothost
> too. Is there a new version with the bug fixed or a workaround to doing the
> label rotation in subplothost?
>
While this is fixed in the svn, there is no release yet.
One workaround is to turn off axisline mode.
host = SubplotHost(fig, 111)
host.toggle_axisline(False)
Note that, with this change, things like
host.axis["left"].label.set_color(drawRxByt.get_color())
won't work and you have to use the methods of original matplotlib Axes.
Regards,
-JJ
From: MONTAGU T. <thi...@ce...> - 2010年05月21日 14:14:58
hi all
has anyone ever tried to make a quantile-quantile plot with pylab?
is there any build in function named say "qqplot" available ?
thanks
Thierry
9 messages has been excluded from this view by a project administrator.

Showing results of 303

<< < 1 .. 3 4 5 6 7 .. 13 > >> (Page 5 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 によって変換されたページ (->オリジナル) /