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
(17) |
3
(14) |
4
(28) |
5
(23) |
6
(12) |
|
7
(3) |
8
(11) |
9
(29) |
10
(31) |
11
(9) |
12
(35) |
13
(3) |
|
14
(9) |
15
(16) |
16
(14) |
17
(10) |
18
(7) |
19
(3) |
20
|
|
21
(4) |
22
(6) |
23
(14) |
24
(16) |
25
(10) |
26
(5) |
27
(4) |
|
28
(8) |
29
(19) |
30
(21) |
|
|
|
|
|
From: jmariette <Jer...@to...> - 2009-06-22 11:33:47
|
Hi everybody,
I have some probleme with Matplot/numpy !
I'm using matplot v0.91.2 and I'm trying to get the hist function working !!
I'm using the sample code of matplot:
----------------------------------------------------------
#!/usr/bin/env python
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
mu, sigma = 100, 15
x = mu + sigma*np.random.randn(10000)
# the histogram of the data
n, bins, patches = plt.hist(x, 50, normed=1, facecolor='green', alpha=0.75)
print len(n)
print len(bins)
print n
print bins
# add a 'best fit' line
y = mlab.normpdf( bins, mu, sigma)
l = plt.plot(bins, y, 'r--', linewidth=1)
plt.xlabel('Smarts')
plt.ylabel('Probability')
plt.title(r'$\mathrm{Histogram\ of\ IQ:}\ \mu=100,\ \sigma=15$')
plt.axis([40, 160, 0, 0.03])
plt.grid(True)
plt.show()
------------------------------------------------------------
With the same matplot lib but a different version of numpy I get 2 different
number of bins !!! How is that possible ???
using the 1.0.4 version of numpy, I get len(n) = 50 and len(bins) = 50 ...
what sounds pretty right to me !! but using the version 1.2.1 (the last one
I guess) I got len(n) = 50 and len(bins) = 51 What looks weird, doesn't it
???
do you guys have an explanation ??
Anybody faced the same problem ?
thx, Jerome
--
View this message in context: http://www.nabble.com/Matplot-Numpy-possible-bug-%21-tp24145696p24145696.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-06-22 01:26:28
|
On Sun, Jun 21, 2009 at 4:42 PM, Thomas
Robitaille<tho...@gm...> wrote:
> Hi Jae-Joon,
>
> Thanks for the quick fix! Just looked in the svn browser, and noticed you
> changed line 5290 of axes.py to
>
> 'o' : (0,0,3),
>
> Should this not be
>
> 'o' : (0,3,0),
>
> ?
No, somehow the meaning of each item is different there. The last item
is the symbol style, unlike the input parameter for scatter where the
second one is the symbol style. For example,
's' : (4,math.pi/4.0,0), # square
Regards,
-JJ
>
> Thanks,
>
> Tom
>
> On Jun 21, 2009, at 2:59 PM, Jae-Joon Lee wrote:
>
>> Thanks for the report.
>> And, this turned out to be a bug. The symbol style code was simply
>> ignored when its value is 3.
>>
>> While the bug should now be fixed (both in the trunk and the maint.
>> branch), you may use marker style like (20,0,0) (or increase the first
>> number when symbol is large) for a workaround.
>>
>> Regards,
>>
>> -JJ
>>
>>
>> On Sun, Jun 21, 2009 at 1:09 PM, Thomas
>> Robitaille<tho...@gm...> wrote:
>>>
>>> Hi,
>>>
>>> I'm trying to use the scatter method, making use of the option to specify
>>> the marker as a tuple. From the documentation, it would seem that
>>> specifying
>>> marker=(0,3,0) should draw a circle. However, this is not the case. If
>>> you
>>> consider the following code:
>>>
>>> import matplotlib
>>> matplotlib.use('Agg')
>>> import matplotlib.pyplot as mpl
>>>
>>> fig = mpl.figure()
>>> ax = fig.add_subplot(111)
>>> #ax.scatter([x],[y],c='red',marker=(0,3,0.))
>>> ax.scatter([10.],[10.],c='red',marker=(3,3,0.))
>>> ax.scatter([11.],[10.],c='red',marker=(6,3,0.))
>>> ax.set_xlim(5.,15.)
>>> fig.savefig('scatter.png')
>>>
>>> The first ax.scatter causes an error, the second plots a triangle, and
>>> the
>>> third a hexagon. However, the documentation states that (a) setting the
>>> second element to '3' should plot a circle, and (b) the other arguments
>>> should be ignored, so the first ax.scatter should not cause an error.
>>>
>>> Is this a bug, or am I misunderstanding the documentation?
>>>
>>> Thanks,
>>>
>>> Thomas
>>> --
>>> View this message in context:
>>> http://www.nabble.com/possible-bug-with-scatter-tp24136534p24136534.html
>>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Are you an open source citizen? Join us for the Open Source Bridge
>>> conference!
>>> Portland, OR, June 17-19. Two days of sessions, one day of unconference:
>>> $250.
>>> Need another reason to go? 24-hour hacker lounge. Register today!
>>>
>>> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>
>
|
|
From: Thomas R. <tho...@gm...> - 2009-06-21 21:10:50
|
Hi Jae-Joon,
Thanks for the quick fix! Just looked in the svn browser, and noticed
you changed line 5290 of axes.py to
'o' : (0,0,3),
Should this not be
'o' : (0,3,0),
?
Thanks,
Tom
On Jun 21, 2009, at 2:59 PM, Jae-Joon Lee wrote:
> Thanks for the report.
> And, this turned out to be a bug. The symbol style code was simply
> ignored when its value is 3.
>
> While the bug should now be fixed (both in the trunk and the maint.
> branch), you may use marker style like (20,0,0) (or increase the first
> number when symbol is large) for a workaround.
>
> Regards,
>
> -JJ
>
>
> On Sun, Jun 21, 2009 at 1:09 PM, Thomas
> Robitaille<tho...@gm...> wrote:
>>
>> Hi,
>>
>> I'm trying to use the scatter method, making use of the option to
>> specify
>> the marker as a tuple. From the documentation, it would seem that
>> specifying
>> marker=(0,3,0) should draw a circle. However, this is not the case.
>> If you
>> consider the following code:
>>
>> import matplotlib
>> matplotlib.use('Agg')
>> import matplotlib.pyplot as mpl
>>
>> fig = mpl.figure()
>> ax = fig.add_subplot(111)
>> #ax.scatter([x],[y],c='red',marker=(0,3,0.))
>> ax.scatter([10.],[10.],c='red',marker=(3,3,0.))
>> ax.scatter([11.],[10.],c='red',marker=(6,3,0.))
>> ax.set_xlim(5.,15.)
>> fig.savefig('scatter.png')
>>
>> The first ax.scatter causes an error, the second plots a triangle,
>> and the
>> third a hexagon. However, the documentation states that (a) setting
>> the
>> second element to '3' should plot a circle, and (b) the other
>> arguments
>> should be ignored, so the first ax.scatter should not cause an error.
>>
>> Is this a bug, or am I misunderstanding the documentation?
>>
>> Thanks,
>>
>> Thomas
>> --
>> View this message in context: http://www.nabble.com/possible-bug-with-scatter-tp24136534p24136534.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> Are you an open source citizen? Join us for the Open Source Bridge
>> conference!
>> Portland, OR, June 17-19. Two days of sessions, one day of
>> unconference: $250.
>> Need another reason to go? 24-hour hacker lounge. Register today!
>> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-06-21 19:06:06
|
Thanks for the report.
And, this turned out to be a bug. The symbol style code was simply
ignored when its value is 3.
While the bug should now be fixed (both in the trunk and the maint.
branch), you may use marker style like (20,0,0) (or increase the first
number when symbol is large) for a workaround.
Regards,
-JJ
On Sun, Jun 21, 2009 at 1:09 PM, Thomas
Robitaille<tho...@gm...> wrote:
>
> Hi,
>
> I'm trying to use the scatter method, making use of the option to specify
> the marker as a tuple. From the documentation, it would seem that specifying
> marker=(0,3,0) should draw a circle. However, this is not the case. If you
> consider the following code:
>
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as mpl
>
> fig = mpl.figure()
> ax = fig.add_subplot(111)
> #ax.scatter([x],[y],c='red',marker=(0,3,0.))
> ax.scatter([10.],[10.],c='red',marker=(3,3,0.))
> ax.scatter([11.],[10.],c='red',marker=(6,3,0.))
> ax.set_xlim(5.,15.)
> fig.savefig('scatter.png')
>
> The first ax.scatter causes an error, the second plots a triangle, and the
> third a hexagon. However, the documentation states that (a) setting the
> second element to '3' should plot a circle, and (b) the other arguments
> should be ignored, so the first ax.scatter should not cause an error.
>
> Is this a bug, or am I misunderstanding the documentation?
>
> Thanks,
>
> Thomas
> --
> View this message in context: http://www.nabble.com/possible-bug-with-scatter-tp24136534p24136534.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Thomas R. <tho...@gm...> - 2009-06-21 17:09:33
|
Hi,
I'm trying to use the scatter method, making use of the option to specify
the marker as a tuple. From the documentation, it would seem that specifying
marker=(0,3,0) should draw a circle. However, this is not the case. If you
consider the following code:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl
fig = mpl.figure()
ax = fig.add_subplot(111)
#ax.scatter([x],[y],c='red',marker=(0,3,0.))
ax.scatter([10.],[10.],c='red',marker=(3,3,0.))
ax.scatter([11.],[10.],c='red',marker=(6,3,0.))
ax.set_xlim(5.,15.)
fig.savefig('scatter.png')
The first ax.scatter causes an error, the second plots a triangle, and the
third a hexagon. However, the documentation states that (a) setting the
second element to '3' should plot a circle, and (b) the other arguments
should be ignored, so the first ax.scatter should not cause an error.
Is this a bug, or am I misunderstanding the documentation?
Thanks,
Thomas
--
View this message in context: http://www.nabble.com/possible-bug-with-scatter-tp24136534p24136534.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Sandro T. <mat...@gm...> - 2009-06-21 15:55:23
|
Hello,
I'm using blit to animate my plot, and I'd like to add a grid on it
but I failed at it.
What I do is:
1. prepare Figure, Axes, etc without plotting anything
2. save teh background with
self.bg = self.canvas.copy_from_bbox(self.ax.bbox)
(on graph update)
3. restore background with
self.canvas.restore_region(self.bg)
4. <line>.set_ydata(...)
5. self.ax.draw_artist(self.<line>)
6. self.canvas.blit(self.ax.bbox)
Now, I tried to place a "self.ax.grid(True)" in almost every possible
position, but never a grid came out :(
What is the right approach to solve it? Thanks in advance
Regards,
--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
|
|
From: Jeremiah J. <jer...@pa...> - 2009-06-19 20:08:31
|
Chris, Do you have any online tutorial for this topic? Thanks, JJ On Thu, 2009-06-18 at 08:38 -0700, Chris Withers wrote: > Hi All, > > Too many people in the Python community *still* think the only way to > work with Excel files in Python is using COM on Windows. > > To try and correct this, I'm giving a tutorial at this year's > EuroPython > conference in Birmingham, UK on Monday, 29th June that will cover > working with Excel files in Python using the pure-python libraries > xlrd, > xlwt and xlutils. > > I'll be looking to cover: > > - Reading Excel Files > > Including extracting all the data types, formatting and working > with > large files. > > - Writing Excel Files > > Including formatting, many of the useful frilly extras and writing > large excel files. > > - Modifying and Filtering Excel Files > > A run through of taking existing Excel files and modifying them in > various ways. > > - Workshop for your problems > > I'm hoping anyone who attends will get a lot out of this! If you're > planning on attending and have a particular problem you'd like to > work > on in this part of the tutorial, please drop me an email and I'll > try > and make sure I come prepared! > > All you need for the tutorial is a working knowledge of Excel and > Python, with a laptop as an added benefit, and to be at EuroPython > this > year: > > http://www.europython.eu/ > > I look forward to seeing you all there! > > Chris > > -- > Simplistix - Content Management, Zope & Python Consulting > - http://www.simplistix.co.uk > > > -- > http://mail.python.org/mailman/listinfo/python-announce-list > > Support the Python Software Foundation: > http://www.python.org/psf/donations.html > > > Disclaimer: The information contained in this transmission, including any attachments, may contain confidential information of Panasonic Avionics Corporation. This transmission is intended only for the use of the addressee(s) listed above. Unauthorized review, dissemination or other use of the information contained in this transmission is strictly prohibited. If you have received this transmission in error or have reason to believe you are not authorized to receive it, please notify the sender by return email and promptly delete the transmission. |
|
From: Jae-Joon L. <lee...@gm...> - 2009-06-19 16:34:14
|
Hi, You can try to manually adjust x-limits. plt.xlim(dateList[0], dateList[-1]) However, manual adjustments will become a bit more difficult as your plot gets more complex. Well, I think the best way is to install a newer version of mpl on your ubuntu 8.10 if possible. -JJ On Thu, Jun 18, 2009 at 2:18 PM, Dave Coutts<dac...@go...> wrote: > Hi All > > Just wondering if anybody could give me some pointers on the problem I have > described below ? > > For those that getting redirected to the freehostia main page for what ever > reason, please try this link. > http://waka.freehostia.com/python/ > > Thanks > >> Hi >> >> I am developing on a Desktop install Ubuntu 9.04 machine with matplotlib >> 0.98.5.2, >> and running the scripts on a Server install Ubuntu 8.10 machine with >> matplotlib 0.98.3. >> >> I have found that the X axis layout for the same script varies between the >> two machines. >> Both have standard matplotlib installs using apt-get. I haven't made any >> tweaks. >> >> Rather than go into great detail about the problem, please see the script >> below and links to the resulting png files. >> I hope the png files tell the story. >> >> http://waka.freehostia.com/python/date_axis_scaling_test.py >> http://waka.freehostia.com/python/date_axis_scaling_test_0_98_3.png >> http://waka.freehostia.com/python/date_axis_scaling_test_0_98_5_2.png >> >> The plot produced by >> matplotlib 0.98.3 isn't what I want. >> Id like the plot to go edge to edge on the x axis grid, as the matplotlib >> 0.98.5.2 version does. >> >> Help and advise would be appreciated. >> PS : I'm new to python & >> matplotlib >> >> >> ###################################################################################### >> #!/usr/bin/env python >> import matplotlib >> matplotlib.use('Agg') >> import matplotlib.pyplot as plt >> from datetime import datetime, timedelta >> >> version = matplotlib.__version__ >> HOURSBACK = 365 * 24 >> now = datetime.now() >> valueList = [] >> dateList = [] >> >> for i in range(HOURSBACK): >> hoursBack = timedelta( hours = (HOURSBACK - i) ) >> then = now - hoursBack >> valueList.append( i ) >> dateList.append( then ) >> >> fig = plt.figure( figsize=(12, 9), dpi=100 ) >> ax = fig.add_subplot(111) >> ax.plot(dateList, valueList) >> plt.title('Date axis scaling test for matplotlib version : %s' % ( >> version ) ) >> plt.grid(True) >> plt.ylabel('Widgets') >> plt.xlabel('Date') >> fig.autofmt_xdate() >> >> plt.savefig( "date_axis_scaling_test_%s.png" % version.replace('.','_'), >> format='png' ) >> >> quit() >> >> ###################################################################################### >> >> > > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Gert-Jan <gj_...@ho...> - 2009-06-19 13:12:01
|
Hey there,
In the application I'm building, I'm using Python 2.5 to place a toolbar
from Matplotlib 0.98.5.2 in a Qt 4 environment. Now I'd like to modify the
toolbar to suit our needs. So, I've done the following:
> from PyQt4 import QtGui
> from matplotlib.backends.backend_qt4 import NavigationToolbar2QT
> from matplotlib.backend_bases import NavigationToolbar2
>
> class Toolbar(NavigationToolbar2QT) :
> def __init__(self , parent , canvas, coordinates=True) :
> self.canvas = canvas
> self.coordinates = coordinates
> QtGui.QWidget.__init__( self, parent )
> NavigationToolbar2.__init__( self, canvas )
>
I'd like to delete the configure subplots button, and add a new button in
it's place. However, I can't seem to find the configure subplots button, as
it is not listed in its method/object list. So, I had to use this crude
method:
> pushButtonCounter = -1
> for child in self.children():
> if str( type(child) ) == "<class 'PyQt4.QtGui.QToolButton'>":
> pushButtonCounter += 1
> if pushButtonCounter == 6:
> configuresubplots_button = child
>
Also, Python 2.5 crashes when trying to do certain things with the button:
> configuresubplots_button.deleteLater() # Crashes
> # Ugh, I forgot what other kinds of operations make Python crash... I
> think trying to connect and disconnect functions didn't go right... not
> sure though.
>
These things, however, do work (or at least don't make Python crash):
> configuresubplots_button.setEnabled(False) # Works
> configuresubplots_button.setHidden(True) # Does not work, but doesn't
> cause a crash, either.
> configuresubplots_button.setIcon(QtGui.QIcon('newicon.PNG')) # Works
> configuresubplots_button.setToolTip('Another tool tip') # Works
> configuresubplots_button.connect(child, QtCore.SIGNAL('clicked()'),
> self.new_fuction) # Works, though this should only be done after you
> instantiate this class in your GUI. So, you have to loop again to find the
> button to connect it.
>
So, in the end, I managed to change the configure_subplots button into the
button I want. However, such a method should not be necessary.
The question is whether I was doing something wrong, and if so, how I could
have done this differently?
My sincere thanks for your time and efforts!
Cheers,
Gert-Jan
--
View this message in context: http://www.nabble.com/Qt4-backend-question-tp24110367p24110367.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Tony S Yu <to...@MI...> - 2009-06-18 23:24:57
|
I'd like to plot a collection and scale the size of the collection
elements in relation to the data. My guess is that I need to use the
data transformation (ax.transData) since I would like the size of the
collection elements altered when zooming in/out.
Unfortunately, my attempt has led to weird results: the collection
offsets are shifted from the desired coordinates when using
ax.transData. Weirder still: the collection elements move *relative to
the data coordinates* when panning the figure.
I suspect that setting the collection transform to ax.transData is
somehow applying some part of the transform twice. Does anyone know
what I'm doing wrong here and how I can fix this?
Thanks!
-Tony
Attached is a toy example of what I'm trying to do. The radii of the
circles are plotted correctly, but notice the x, y coordinates don't
match the circle centers in the plot. Also, try panning the plot and
watch as the circles move relative to the tick marks.
>>> import matplotlib.pyplot as plt
>>> import matplotlib.transforms as transforms
>>> import numpy as np
>>> fig = plt.figure()
>>> ax = fig.add_subplot(111)
>>> x = [0.25, 0.75, 0.25, 0.75]
>>> y = [0.25, 0.25, 0.75, 0.75]
>>> r = 0.1 * np.ones(4)
>>> col = plt.scatter(x, y, np.pi*r**2)
>>> pts2pixels = transforms.Affine2D().scale(72.0/fig.dpi)
>>> col.set_transform(pts2pixels + ax.transData)
>>> plt.axis('equal')
>>> plt.show()
|
|
From: Dave C. <dac...@go...> - 2009-06-18 18:18:42
|
Hi All Just wondering if anybody could give me some pointers on the problem I have described below ? For those that getting redirected to the freehostia main page for what ever reason, please try this link. http://waka.freehostia.com/python/ Thanks Hi > > I am developing on a Desktop install Ubuntu 9.04 machine with matplotlib > 0.98.5.2, > and running the scripts on a Server install Ubuntu 8.10 machine with > matplotlib 0.98.3. > > I have found that the X axis layout for the same script varies between the > two machines. > Both have standard matplotlib installs using apt-get. I haven't made any > tweaks. > > Rather than go into great detail about the problem, please see the script > below and links to the resulting png files. > I hope the png files tell the story. > > http://waka.freehostia.com/python/date_axis_scaling_test.py > http://waka.freehostia.com/python/date_axis_scaling_test_0_98_3.png > http://waka.freehostia.com/python/date_axis_scaling_test_0_98_5_2.png > > The plot produced by matplotlib 0.98.3 isn't what I want. > Id like the plot to go edge to edge on the x axis grid, as the matplotlib > 0.98.5.2 version does. > > Help and advise would be appreciated. > PS : I'm new to python & matplotlib > > > ###################################################################################### > #!/usr/bin/env python > import matplotlib > matplotlib.use('Agg') > import matplotlib.pyplot as plt > from datetime import datetime, timedelta > > version = matplotlib.__version__ > HOURSBACK = 365 * 24 > now = datetime.now() > valueList = [] > dateList = [] > > for i in range(HOURSBACK): > hoursBack = timedelta( hours = (HOURSBACK - i) ) > then = now - hoursBack > valueList.append( i ) > dateList.append( then ) > > fig = plt.figure( figsize=(12, 9), dpi=100 ) > ax = fig.add_subplot(111) > ax.plot(dateList, valueList) > plt.title('Date axis scaling test for matplotlib version : %s' % ( version > ) ) > plt.grid(True) > plt.ylabel('Widgets') > plt.xlabel('Date') > fig.autofmt_xdate() > > plt.savefig( "date_axis_scaling_test_%s.png" % version.replace('.','_'), > format='png' ) > > quit() > > ###################################################################################### > > > |
|
From: Chris W. <ch...@si...> - 2009-06-18 16:03:55
|
Hi All, Too many people in the Python community *still* think the only way to work with Excel files in Python is using COM on Windows. To try and correct this, I'm giving a tutorial at this year's EuroPython conference in Birmingham, UK on Monday, 29th June that will cover working with Excel files in Python using the pure-python libraries xlrd, xlwt and xlutils. I'll be looking to cover: - Reading Excel Files Including extracting all the data types, formatting and working with large files. - Writing Excel Files Including formatting, many of the useful frilly extras and writing large excel files. - Modifying and Filtering Excel Files A run through of taking existing Excel files and modifying them in various ways. - Workshop for your problems I'm hoping anyone who attends will get a lot out of this! If you're planning on attending and have a particular problem you'd like to work on in this part of the tutorial, please drop me an email and I'll try and make sure I come prepared! All you need for the tutorial is a working knowledge of Excel and Python, with a laptop as an added benefit, and to be at EuroPython this year: http://www.europython.eu/ I look forward to seeing you all there! Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk |
|
From: Elan P. <ep...@gm...> - 2009-06-18 15:59:10
|
Hi John, I solved the bug. In my application I have several threads. One of the threads updates the graph on a timer and another gets data from the application in order to plot. The thread updating the limits was based on data coming from the application. As I stated this is a two part process where the first part is setting the limits and the second is redrawing the graph (followed by updating the background). The problem is when the thread loses control between these two stages. In this case the background is updated to the old limits although the 'real' limits remain the updated version. The solution is to use a lock to ensure that everything is done atomically. This results in the desired behaviour. IOW it was completely my fault although an interesting bug:) Elan --- Fortunately, the second-to-last bug has just been fixed. - Ray Simard On Wed, Jun 17, 2009 at 7:20 PM, John Hunter<jd...@gm...> wrote: > On Wed, Jun 17, 2009 at 5:27 PM, Elan Pavlov<ep...@gm...> wrote: >> Hi, >> I'm using an animated graph in which most of the time I don't want it >> to autoscale (due to speed). Once in a while I want it to change the >> limits of the y-axis. In order to do this I use set_ylim and follow by >> a canvas.draw(). However it does not actually redraw the canvas and >> the old tick labels remain (although the scales are reset). When I >> manually resize the canvas in updates the tick labels. Any ideas what >> I'm doing wrong? > > This doesn't sound right -- a call to canvas.draw should redraw the > whole canvas cleanly, with the exception of Artists where the animated > property is set. Can you reduce your code to a free-standing example > that we can run? > > JDH > -- If I knew that a man was coming to my house with the conscious design of doing me good, I should run for my life. - Henry David Thoreau |
|
From: Alexandar H. <vio...@gm...> - 2009-06-18 15:34:17
|
Ok, fair enough. Let's use that:
------------------
import numpy as np
import matplotlib.cm as cm
import matplotlib.pyplot as plt
n = 100000
x = np.random.standard_normal(n)
y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)
xmin = x.min()
xmax = x.max()
ymin = y.min()
ymax = y.max()
plt.hexbin(x,y, cmap=cm.jet, gridsize=(50,50), extent=[-2,2,-10,10])
plt.axis([xmin, xmax, ymin, ymax])
plt.title("Hexagon binning")
cb = plt.colorbar()
cb.set_label('counts')
plt.show()
----------------------
I trimmed this from the example, which works fine. Without the extent
option, I get the expected plot of all the data. But, what I'd like is to
trim out some of the empty regions. If I just reset xmin, xmax, etc. the
binning of the data still occurs over the entire range of the data in x and
y, although the plot is correct, but the plot doesn't have the desired 50x50
bins. With the "extent" option I get these errors:
Traceback (most recent call last):
File "HexBin.py", line 23, in <module>
plt.hexbin(x,y, cmap=cm.jet, extent=[-2,2,-10,10])
File "/usr/lib64/python2.5/site-packages/matplotlib/pyplot.py", line 1920,
in hexbin
ret = gca().hexbin(*args, **kwargs)
File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line 5447,
in hexbin
collection.update(kwargs)
File "/usr/lib64/python2.5/site-packages/matplotlib/artist.py", line 548,
in update
raise AttributeError('Unknown property %s'%k)
AttributeError: Unknown property extent
The same thing as before. It doesn't know what 'extent' is for some reason.
Or, perhaps more accurately, hexbin knows what it is but artist.py doesn't?
The only "solution" i've come up with is to trim the original data that I
input, but that is far from ideal.
Best,
Alex
On Wed, Jun 17, 2009 at 7:50 PM, John Hunter <jd...@gm...> wrote:
> On Wed, Jun 17, 2009 at 5:31 PM, Alexandar Hansen<vio...@gm...>
> wrote:
> > Hello,
> >
> > I've been having fun using hexbin, but I'd like to have consistent bin
> sizes
> > and plot ranges for different sets of data. What I'm finding is that the
> bin
> > sizes are primarily determined by the input data mins and maxes. For
> > instance, I'm plotting data with something like:
>
> Instead of a "something like" could you please post a complete example
> that we can run so we can replicate the error. This saves us a lot of
> time. Also, please report any version info, as described at
>
>
> http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-problem
>
> For example, the following runs for me using mpl svn:
>
> import numpy as np
> import matplotlib.cm as cm
> import matplotlib.pyplot as plt
>
> n = 100000
> x = np.random.standard_normal(n)
> y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n)
> xmin = x.min()
> xmax = x.max()
> ymin = y.min()
> ymax = y.max()
>
> plt.subplots_adjust(hspace=0.5)
> plt.subplot(121)
> plt.hexbin(x,y, cmap=cm.jet, extent=[xmin, xmax, ymin, ymax])
> plt.axis([xmin, xmax, ymin, ymax])
> plt.title("Hexagon binning")
> cb = plt.colorbar()
> cb.set_label('counts')
>
> plt.subplot(122)
> plt.hexbin(x,y,bins='log', cmap=cm.jet)
> plt.axis([xmin, xmax, ymin, ymax])
> plt.title("With a log color scale")
> cb = plt.colorbar()
> cb.set_label('log10(N)')
>
> plt.show()
>
|
|
From: Paul N. <pn...@il...> - 2009-06-18 04:14:06
|
Pardon me, but I was hasty in sending the diff. The following diff will
put a multiplication symbol in the tick label where large numbers are
expected, but it also removes any possibility of getting a number
written as 1e10, for example, so it definitely is not complete.
Hopefully, this is a starting point for someone else to fix this properly.
Thanks,
Paul
Index: lib/matplotlib/ticker.py
===================================================================
--- lib/matplotlib/ticker.py (revision 7225)
+++ lib/matplotlib/ticker.py (working copy)
@@ -384,18 +384,10 @@
offsetStr = self.format_data(self.offset)
if self.offset > 0: offsetStr = '+' + offsetStr
if self.orderOfMagnitude:
- if self._usetex or self._useMathText:
- sciNotStr = self.format_data(10**self.orderOfMagnitude)
- else:
- sciNotStr = '1e%d'% self.orderOfMagnitude
- if self._useMathText:
- if sciNotStr != '':
- sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
+ sciNotStr = self.format_data(10**self.orderOfMagnitude)
+ if sciNotStr != '':
+ sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
s =
''.join(('$',sciNotStr,r'\mathdefault{',offsetStr,'}$'))
- elif self._usetex:
- if sciNotStr != '':
- sciNotStr = r'\times%s' % sciNotStr
- s = ''.join(('$',sciNotStr,offsetStr,'$'))
else:
s = ''.join((sciNotStr,offsetStr))
@@ -476,19 +468,15 @@
significand = tup[0].rstrip('0').rstrip('.')
sign = tup[1][0].replace('+', '')
exponent = tup[1][1:].lstrip('0')
- if self._useMathText or self._usetex:
- if significand == '1':
- # reformat 1x10^y as 10^y
- significand = ''
- if exponent:
- exponent = '10^{%s%s}'%(sign, exponent)
- if significand and exponent:
- return r'%s{\times}%s'%(significand, exponent)
- else:
- return r'%s%s'%(significand, exponent)
+ if significand == '1':
+ # reformat 1x10^y as 10^y
+ significand = ''
+ if exponent:
+ exponent = '10^{%s%s}'%(sign, exponent)
+ if significand and exponent:
+ return r'%s{\times}%s'%(significand, exponent)
else:
- s = ('%se%s%s' %(significand, sign, exponent)).rstrip('e')
- return s
+ return r'%s%s'%(significand, exponent)
except IndexError, msg:
return s
|
|
From: Paul N. <pn...@il...> - 2009-06-18 04:04:23
|
Hello,
I think there is an unused parameter in matplotlibrc, the text.markup
which defaults to 'plain'. text.markup is not found in rcsetup.py.
Similarly, there is a keyword to ScalarFormatter, useMathText, that is
always set to its default, False, in ticker.py; no other function
accesses or uses that keyword. It seems that could be eliminated without
ill-effect.
I came across this while looking for a way to have the tick formatter
include a multiplication sign when writing very large numbers, instead
of using engineering notation such as 1e10. I would like to be able to
do this using the mathtext facilities native to matplotlib, and not have
to resort to usetex.
The following diff changes the tick formatter to work as I would like
it, but it also probably breaks something else because I have not tested
it at all. Please consider it as a starting point.
Paul
Index: ticker.py
===================================================================
--- ticker.py (revision 7225)
+++ ticker.py (working copy)
@@ -384,18 +384,10 @@
offsetStr = self.format_data(self.offset)
if self.offset > 0: offsetStr = '+' + offsetStr
if self.orderOfMagnitude:
- if self._usetex or self._useMathText:
- sciNotStr = self.format_data(10**self.orderOfMagnitude)
- else:
- sciNotStr = '1e%d'% self.orderOfMagnitude
- if self._useMathText:
- if sciNotStr != '':
- sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
+ sciNotStr = self.format_data(10**self.orderOfMagnitude)
+ if sciNotStr != '':
+ sciNotStr = r'\times\mathdefault{%s}' % sciNotStr
s =
''.join(('$',sciNotStr,r'\mathdefault{',offsetStr,'}$'))
- elif self._usetex:
- if sciNotStr != '':
- sciNotStr = r'\times%s' % sciNotStr
- s = ''.join(('$',sciNotStr,offsetStr,'$'))
else:
s = ''.join((sciNotStr,offsetStr))
|
|
From: John H. <jd...@gm...> - 2009-06-17 23:51:53
|
On Wed, Jun 17, 2009 at 5:31 PM, Alexandar Hansen<vio...@gm...> wrote: > Hello, > > I've been having fun using hexbin, but I'd like to have consistent bin sizes > and plot ranges for different sets of data. What I'm finding is that the bin > sizes are primarily determined by the input data mins and maxes. For > instance, I'm plotting data with something like: Instead of a "something like" could you please post a complete example that we can run so we can replicate the error. This saves us a lot of time. Also, please report any version info, as described at http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-problem For example, the following runs for me using mpl svn: import numpy as np import matplotlib.cm as cm import matplotlib.pyplot as plt n = 100000 x = np.random.standard_normal(n) y = 2.0 + 3.0 * x + 4.0 * np.random.standard_normal(n) xmin = x.min() xmax = x.max() ymin = y.min() ymax = y.max() plt.subplots_adjust(hspace=0.5) plt.subplot(121) plt.hexbin(x,y, cmap=cm.jet, extent=[xmin, xmax, ymin, ymax]) plt.axis([xmin, xmax, ymin, ymax]) plt.title("Hexagon binning") cb = plt.colorbar() cb.set_label('counts') plt.subplot(122) plt.hexbin(x,y,bins='log', cmap=cm.jet) plt.axis([xmin, xmax, ymin, ymax]) plt.title("With a log color scale") cb = plt.colorbar() cb.set_label('log10(N)') plt.show() |
|
From: John H. <jd...@gm...> - 2009-06-17 23:21:35
|
On Wed, Jun 17, 2009 at 5:27 PM, Elan Pavlov<ep...@gm...> wrote: > Hi, > I'm using an animated graph in which most of the time I don't want it > to autoscale (due to speed). Once in a while I want it to change the > limits of the y-axis. In order to do this I use set_ylim and follow by > a canvas.draw(). However it does not actually redraw the canvas and > the old tick labels remain (although the scales are reset). When I > manually resize the canvas in updates the tick labels. Any ideas what > I'm doing wrong? This doesn't sound right -- a call to canvas.draw should redraw the whole canvas cleanly, with the exception of Artists where the animated property is set. Can you reduce your code to a free-standing example that we can run? JDH |
|
From: Alexandar H. <vio...@gm...> - 2009-06-17 22:32:37
|
Hello,
I've been having fun using hexbin, but I'd like to have consistent bin sizes
and plot ranges for different sets of data. What I'm finding is that the bin
sizes are primarily determined by the input data mins and maxes. For
instance, I'm plotting data with something like:
# import matplotlib.pyplot as plt
# plt.hexbin(x,y, cmap=cm.hot, gridsize=(50,50))
# plt.axis([xmin, xmax, ymin, ymax])
# plt.title("2D Histogram")
# cb = plt.colorbar()
# cb.set_label('counts')
# plt.show()
where xmin, etc are a fixed range. If my data sets span sizeably different
ranges, then the hexagon sizes come out completely different. I'd like to
avoid increasing the gridsize in one or both dimensions too much as that
would require very large grids in some instances.
I thought my solution to the problems would be to use the extent function in
hexbin but when I try, for instance:
# plt.hexbin(x,y, cmap=cm.hot, gridsize=(50,50),
extent=[xmin,xmax,ymin,ymax])
I get these strange errors:
File "HexPlotLog.py", line 64, in <module>
plt.hexbin(x,y, cmap=cm.hot, gridsize=(50,50), extent=[xmin, xmax, ymin,
ymax])
File "/usr/lib64/python2.5/site-packages/matplotlib/pyplot.py", line 1920,
in hexbin
ret = gca().hexbin(*args, **kwargs)
File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line 5447,
in hexbin
collection.update(kwargs)
File "/usr/lib64/python2.5/site-packages/matplotlib/artist.py", line 548,
in update
raise AttributeError('Unknown property %s'%k)
AttributeError: Unknown property extent
The other thing I'd like to do is to set the background color of the plot to
black, or otherwise the same color as a bin of zero. I imagine this is
something I can find in the manuals, but since I'm asking questions, may as
well include it :)
I appreciate any help that can be offered.
Best,
Alex
|
|
From: Elan P. <ep...@gm...> - 2009-06-17 22:28:54
|
Hi, I'm using an animated graph in which most of the time I don't want it to autoscale (due to speed). Once in a while I want it to change the limits of the y-axis. In order to do this I use set_ylim and follow by a canvas.draw(). However it does not actually redraw the canvas and the old tick labels remain (although the scales are reset). When I manually resize the canvas in updates the tick labels. Any ideas what I'm doing wrong? Elan -- If I knew that a man was coming to my house with the conscious design of doing me good, I should run for my life. - Henry David Thoreau |
|
From: Gökhan S. <gok...@gm...> - 2009-06-17 22:22:02
|
For those who haven't seen the article on slashdot: A Visual Expedition Inside the Linux File Systems<http://cs.jhu.edu/%7Erazvanm/fs-expedition/> Some figures are highly eye-catching. Some of which I haven't seen in matplotlib gallery nor could be produced with. Gökhan |
|
From: Yeates, M. C <mat...@jp...> - 2009-06-17 17:49:30
|
Thanks. The svn trunk worked for me. -----Original Message----- From: Michael Droettboom [mailto:md...@st...] Sent: Wednesday, June 17, 2009 9:27 AM To: Yeates, Mathew C Cc: mat...@li... Subject: Re: [Matplotlib-users] drawing a line segment wjhen using polar coordinates You can pass "resolution=1" to the axes function. Unfortunately, when doing that you will lose the grid lines. This is a known bug. Better yet, update to SVN trunk which does this by default and has working grid lines. Mike Yeates, Mathew C wrote: > > The following produces an arc instead of a line. What am I doing wrong? > > > > ax = axes(polar=True,rmax=1.0) > > polar([1,2],[0.2,0.3]) #or plot([1,2],[0.2,0.3]) > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > ------------------------------------------------------------------------ > > _______________________________________________ > 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 |
|
From: Michael D. <md...@st...> - 2009-06-17 16:29:22
|
You can pass "resolution=1" to the axes function. Unfortunately, when doing that you will lose the grid lines. This is a known bug. Better yet, update to SVN trunk which does this by default and has working grid lines. Mike Yeates, Mathew C wrote: > > The following produces an arc instead of a line. What am I doing wrong? > > > > ax = axes(polar=True,rmax=1.0) > > polar([1,2],[0.2,0.3]) #or plot([1,2],[0.2,0.3]) > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Crystal Reports - New Free Runtime and 30 Day Trial > Check out the new simplified licensing option that enables unlimited > royalty-free distribution of the report engine for externally facing > server and web deployment. > http://p.sf.net/sfu/businessobjects > ------------------------------------------------------------------------ > > _______________________________________________ > 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 |
|
From: Yeates, M. C <mat...@jp...> - 2009-06-17 16:15:27
|
The following produces an arc instead of a line. What am I doing wrong? ax = axes(polar=True,rmax=1.0) polar([1,2],[0.2,0.3]) #or plot([1,2],[0.2,0.3]) |
|
From: Jeff W. <js...@fa...> - 2009-06-17 02:29:32
|
Andrew Straw wrote: > Zane Selvans wrote: > >> Yep, looks like the trunk has fixed the contourf() issue. >> >> Unfortunately there also seems to be some new incompatibility with the >> Basemap toolkit, even after re-installing Basemap from source. I get: >> >> AttributeError: Axes.frame was removed in favor of Axes.spines >> > > > It appears Basemap hasn't caught up with the new Axes.spines usage. > > Can you change mpl_toolkits/basemap/__init__.py line 1265 from:: > > ax.frame.set_linewidth(linewidth) > > to:: > > for spine in ax.spines.itervalues(): > spine.set_linewidth(linewidth) > > There may be more issues, here -- this is just the first one and based > off your traceback. > > Jeff: I had to drop the Axes.frame to implement spines that could be > moved relative to the Axes boundary. I made sure this worked with the > custom projection examples in the main MPL distribution, so I imagine it > won't take too much to convert basemap. Please see svn r7144, 7145, and > 7170 for my changes to lib/matplotlib/projections/geo.py > > -Andrew > Andrew: This is now fixed in SVN. BTW: basemap predates the custom projection support in matplotlib, so it actually doesn't use it. -Jeff |