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



Showing results of 397

<< < 1 .. 9 10 11 12 13 .. 16 > >> (Page 11 of 16)
From: Thomas R. <tho...@gm...> - 2010年06月08日 21:16:54
Hello,
I updated to svn r8396 today, and the MacOSX backend is broken. The following code
import matplotlib
matplotlib.use('MacOSX')
import matplotlib.pyplot as mpl
fig = mpl.figure()
ax = fig.add_subplot(1,1,1)
fig.canvas.draw()
produces the following error:
 File "/Users/tom/Library/Python/2.6/site-packages/matplotlib/lines.py", line 522, in draw
 gc.set_alpha(self._alpha)
TypeError: a float is required
I have submitted a bug report with full error transcript here:
https://sourceforge.net/tracker/?func=detail&aid=3013440&group_id=80706&atid=560720
Cheers,
Tom
From: Benjamin R. <ben...@ou...> - 2010年06月08日 19:36:05
Waléria,
I repeat, you need to add parentheses for the denominator of that quantity
in order to match what you wrote out on paper. You are missing a set of
parentheses that is causing (3e14**2) to be *multiplied* rather than
divided. This explains the huge values you are getting.
Ben Root
On Tue, Jun 8, 2010 at 2:05 PM, Waléria Antunes David <
wal...@gm...> wrote:
> no, I think, did not understand my functions.....see....i made a change my
> second function in the attached.
>
>
> On Tue, Jun 8, 2010 at 3:48 PM, Benjamin Root <ben...@ou...> wrote:
>
>> I think I found your errors.
>>
>> First, you are correct, the scientific notation in python is as you
>> understand, there is nothing wrong with that.
>>
>> Instead, you have a problem with order of operations. In the last
>> quantity, you have "((x**2)/4*(1e4**2)*(3e14**2))"
>> According to the equation that you wrote out in the attached image, you
>> need: "((x**2)/*(*4*(*2*e4**2)*(3e14**2))*)*"
>> Note that you needed parentheses for the entire denominator. Also, the
>> 1e4**2 should have been 2e4**2.
>>
>> This gives me values between 4.3125e-48 and 5.5359e-48.
>>
>> Ben Root
>>
>> On Tue, Jun 8, 2010 at 12:47 PM, Waléria Antunes David <
>> wal...@gm...> wrote:
>>
>>> I understand what you are saying, but my functions are these, attached.
>>>
>>>
>>>
>>>
>>>
>>>
>>> Scientific notation in Python is not so?
>>>
>>> *Math * *Python*
>>>
>>>
>>>
>>>
>>>
>>>
>>> Pinc = 10-6 Pinc = 1e-6
>>>
>>> 3,0x1014 3e14
>>>
>>>
>>>
>>>
>>>
>>> ?
>>>
>>>
>>> Then, changing my functions of the images attached for python is as bellow:
>>>
>>>
>>>
>>>
>>>
>>>
>>> y1 = -108*(x**2)/(3e14**2)
>>>
>>> y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))
>>>
>>> Is not it?
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Jun 8, 2010 at 1:34 PM, Gökhan Sever <gok...@gm...>wrote:
>>>
>>>>
>>>>
>>>> On Tue, Jun 8, 2010 at 10:19 AM, Waléria Antunes David <
>>>> wal...@gm...> wrote:
>>>>
>>>>> Hello!!!
>>>>>
>>>>> My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And
>>>>> I'd like to make a question. I'm in trouble to generate a two functions
>>>>> graph.
>>>>>
>>>>> I have a problem to generate a graph of the two functions. I have this
>>>>> functions, is bellow:
>>>>>
>>>>> *y1 = -108*(x**2)/(3e14**2)*
>>>>>
>>>>> *y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))*
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> You might need to check your y2. You are mixing integers and floats
>>>> which possible have resulted with some rounding errors. I get e+30 when I
>>>> assert the terms as floats in y2.
>>>>
>>>> For the plotting: y1 is around -e-20 whereas y2 goes up to e+30. You
>>>> can't see the trend easily on one axes even if you could scale
>>>> them logarithmically (hint logarithm is only defined for positive numbers).
>>>> You can make a positive assumption for the y1 and plot them on one y-axes
>>>>
>>>> yscale('log')
>>>> axis(ymin=1e+20, ymax=1e+30)
>>>>
>>>> Still this won't let you see the functions trends that you are looking
>>>> to see. I would suggest you to use multipe figures or investing a bit more
>>>> time to use parasite axes example of JJ.
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Gökhan
>>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> lucky parental unit. See the prize list and enter to win:
>>> http://p.sf.net/sfu/thinkgeek-promo
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
From: Gökhan S. <gok...@gm...> - 2010年06月08日 19:17:00
On Tue, Jun 8, 2010 at 2:05 PM, Waléria Antunes David <
wal...@gm...> wrote:
> no, I think, did not understand my functions.....see....i made a change my
> second function in the attached.
You can further simplify your function. Try grouping 10 powers under one
term. You can then Pythonify your function (less terms to write less prone
to typing errors). Actually, if you previously define your terms before the
function definition you don't need any simplifications or such.
-- 
Gökhan
From: Benjamin R. <ben...@ou...> - 2010年06月08日 18:48:31
I think I found your errors.
First, you are correct, the scientific notation in python is as you
understand, there is nothing wrong with that.
Instead, you have a problem with order of operations. In the last quantity,
you have "((x**2)/4*(1e4**2)*(3e14**2))"
According to the equation that you wrote out in the attached image, you
need: "((x**2)/*(*4*(*2*e4**2)*(3e14**2))*)*"
Note that you needed parentheses for the entire denominator. Also, the
1e4**2 should have been 2e4**2.
This gives me values between 4.3125e-48 and 5.5359e-48.
Ben Root
On Tue, Jun 8, 2010 at 12:47 PM, Waléria Antunes David <
wal...@gm...> wrote:
> I understand what you are saying, but my functions are these, attached.
>
>
> Scientific notation in Python is not so?
>
> *Math * *Python*
>
>
> Pinc = 10-6 Pinc = 1e-6
>
> 3,0x1014 3e14
>
>
> ?
>
>
> Then, changing my functions of the images attached for python is as bellow:
>
>
> y1 = -108*(x**2)/(3e14**2)
>
> y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))
>
> Is not it?
>
>
>
>
>
>
> On Tue, Jun 8, 2010 at 1:34 PM, Gökhan Sever <gok...@gm...>wrote:
>
>>
>>
>> On Tue, Jun 8, 2010 at 10:19 AM, Waléria Antunes David <
>> wal...@gm...> wrote:
>>
>>> Hello!!!
>>>
>>> My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And
>>> I'd like to make a question. I'm in trouble to generate a two functions
>>> graph.
>>>
>>> I have a problem to generate a graph of the two functions. I have this
>>> functions, is bellow:
>>>
>>> *y1 = -108*(x**2)/(3e14**2)*
>>>
>>> *y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))*
>>>
>>>
>>> You might need to check your y2. You are mixing integers and floats which
>> possible have resulted with some rounding errors. I get e+30 when I assert
>> the terms as floats in y2.
>>
>> For the plotting: y1 is around -e-20 whereas y2 goes up to e+30. You can't
>> see the trend easily on one axes even if you could scale
>> them logarithmically (hint logarithm is only defined for positive numbers).
>> You can make a positive assumption for the y1 and plot them on one y-axes
>>
>> yscale('log')
>> axis(ymin=1e+20, ymax=1e+30)
>>
>> Still this won't let you see the functions trends that you are looking to
>> see. I would suggest you to use multipe figures or investing a bit more
>> time to use parasite axes example of JJ.
>>
>>
>>
>>
>> --
>> Gökhan
>>
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Alan G I. <ala...@gm...> - 2010年06月08日 18:46:07
> On Tue, Jun 8, 2010 at 1:34 PM, Gökhan Sever <gok...@gm...> 
wrote:
> > You might need to check your y2. You are mixing integers and floats
> > which possible have resulted with some rounding errors. I get e+30
> > when I assert the terms as floats in y2.
On 6/8/2010 1:47 PM, Waléria Antunes David wrote:
> I understand what you are saying, but my functions are these, attached.
So my assumption in my previous post that you had parentheses where
you wanted them was wrong. (See the post.) Also, see my posted
example explaining Gökhan's point. (He is correct.)
hth,
Alan Isaac
From: Ilan S. <isc...@en...> - 2010年06月08日 18:38:36
Hello,
I am pleased to announce that EPD (Enthought Python Distribution)
version 6.2 has been released. This release includes an update to
Python 2.6.5, SciPy 0.8.0beta1, as well updates to many other
packages and bug fixes. You can find a complete list of updates in
the change log:
 http://www.enthought.com/EPDChangelog.html
To find more information about EPD, as well as download a 30 day
free trial, visit this page:
 http://www.enthought.com/products/epd.php
In order to be able to serve the Python community better, we made
a small survey. Please consider taking a few minutes:
 http://www.surveygizmo.com/s/307237/epd-user-feedback
About EPD
---------
The Enthought Python Distribution (EPD) is a "kitchen-sink-included"
distribution of the Python Programming Language, including over 80
additional tools and libraries. The EPD bundle includes NumPy, SciPy,
IPython, 2D and 3D visualization, and many other tools.
 http://www.enthought.com/products/epdlibraries.php
It is currently available as a single-click installer for Windows XP,
Vista and 7, MacOS (10.5 and 10.6), RedHat 3, 4 and 5, as well as
Solaris 10 (x86 and x86_64/amd64 on all platforms).
The 32-bit EPD is free for academic use. An annual subscription
including installation support is available for individual and
commercial use. Additional support options, including customization,
bug fixes and training classes are also available:
 http://www.enthought.com/products/support_level_table.php
- Ilan
On 6/8/2010 10:39 AM, John Hunter wrote:
> On Tue, Jun 8, 2010 at 11:53 AM, David Goldsmith
> <d.l...@gm...> wrote:
>> On Tue, Jun 8, 2010 at 9:52 AM, David Goldsmith<d.l...@gm...>
>> wrote:
>>>
>>> --------- Forwarded message ----------
>>> From: SourceForge.net<no...@so...>
>>> Date: Mon, Jun 7, 2010 at 6:06 AM
>>> Subject: [ matplotlib-Bugs-2949906 ] finance.quotes_historical_yahoo
>>> raises ZeroDivisionError
>>> To: no...@so...
>>>
>>> Bugs item #2949906, was opened at 2010年02月11日 13:44
>>> Message generated for change (Comment added) made by jdh2358
>>> You can respond by visiting:
>>>
>>> https://sourceforge.net/tracker/?func=detail&atid=560720&aid=2949906&group_id=80706
>>>
>>> Category: None
>>> Group: None
>>> Status: Closed
>>> Resolution: Duplicate
>>> Priority: 5
>>> Private: No
>>> Submitted By: David Goldsmith (olydlg)
>>>> Assigned to: John Hunter (jdh2358)
>>> Summary: finance.quotes_historical_yahoo raises ZeroDivisionError
>>>> Comment By: John Hunter (jdh2358)
>>> Date: 2010年06月07日 08:06
>>>
>>> Message:
>>> This is fixed in svn 8392. Look for it in the upcoming release. Please
>>> test from svn if you are able
>>>
>>> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
>>>
>>> Thanks for the report,
>>> JDH
>>>
>>> Hi, John, etc. I checked-out current revision (8396 I believe), tried to
>>> build using python setup.py build, got error: Unable to find vcvarsall.bat.
>>> Googled, determined that it was something I'm supposed to get w/ a VC
>>> runtime, so grabbed the most recent version (VC2010 or some such),
>>> installed, determined that I now have a vcvarsall.bat and added it's
>>> location to my path, but am still getting the error. Any ideas?
>>> Windows 7 home prem. 64 bit. Python 2.6. Thanks!
>>>
>>> DG
>>
>> Oh, and the error happens after building 'matplotlib.ft2font' extension.
>> Thanks again,
>
> Perhaps Christoph, who builds the win32 binaries, can let you know
> what he does. It's never as simple a python setup.py install, though.
> You may want to look in the release/win32 directory at the README.txt
> and Makefile.
>
You need Visual Studio 2008 (MSVC9) to compile extensions for Python 
 >=2.6 on Windows. "python setup.py build" works once you have built the 
prerequisites. See 
<http://matplotlib.sourceforge.net/users/installing.html>. I link 
against the static libraries of libpng, zlib, and freetype, compiled 
with the /MD switch. You may have to adjust your %LIB% and %INCLUDE% 
environment variables and rename the lib files in order to be found by 
the matplotlib build system.
-- Christoph
From: Ted K. <ted...@go...> - 2010年06月08日 17:56:49
Thanks Ben. worked brilliantly.
Ted
On 8 June 2010 18:48, Benjamin Root <ben...@ou...> wrote:
> Ted,
>
> You can call ylim([0, 100]) after you create your plot. If you have the
> axes object (from gca()), you can directly manipulate the limits using
> set_ylim([0, 100]).
>
> Ben Root
>
>
>
> On Tue, Jun 8, 2010 at 10:50 AM, Ted Kord <ted...@go...>wrote:
>
>> Hi
>>
>> How do I set the range of the y-axis on a bar chart , e.g, from 0 to 100?
>>
>> Thanks
>>
>> Ted
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit. See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Benjamin R. <ben...@ou...> - 2010年06月08日 17:56:40
Then I haven't a clue. Maybe someone else has some insight?
Ben Root
On Mon, Jun 7, 2010 at 4:10 PM, Dharhas Pothina <
Dha...@tw...> wrote:
> Ben,
>
> The matplotlib on the other working machine is using python 2.6.4. On this
> machine I am using python 2.6.5.
>
> The default python on both machines in python 2.4 but I set up python 2.6
> as an alternate install in /opt/python26.
>
> - dharhas
>
>
> >>> Benjamin Root <ben...@ou...> 6/7/2010 3:56 PM >>>
> Dharhas,
>
> Is it possible to find out which version of python was installed for your
> other RHEL5 machine? I don't know if that makes a difference or not, but
> RHEL5 by default uses Python 2.4.
>
> Ben Root
>
>
> On Mon, Jun 7, 2010 at 1:48 PM, Dharhas Pothina <
> Dha...@tw...> wrote:
>
> > Hi,
> >
> > I have Python 2.6 installed on RHEL5 (and Numpy 1.4.1) and am trying to
> > install matplotlib. Installation occurs without any error messages
> although
> > I do get a bunch of warnings at the end.
> >
> > /usr/bin/ld: skipping incompatible /usr/lib/libtk8.4.so when searching
> for
> > -ltk8.4
> > /usr/bin/ld: skipping incompatible /usr/lib/libtcl8.4.so when searching
> > for -ltcl8.4
> > /usr/bin/ld: skipping incompatible /usr/lib/libfreetype.so when searching
> > for -lfreetype
> > /usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for
> -lz
> > /usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
> > /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for
> -lm
> > /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
> > /usr/bin/ld: skipping incompatible /usr/lib/libm.so when searching for
> -lm
> > /usr/bin/ld: skipping incompatible /usr/lib/libm.a when searching for -lm
> > /usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching
> > for -lpthread
> > /usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching
> for
> > -lpthread
> > /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for
> -lc
> > /usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
> >
> > When I try using matplotlib I get the following error:
> >
> > Python 2.6.5 (r265:79063, May 18 2010, 11:20:57)
> > [GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import matplotlib.pyplot as plt
> > >>> plt.plot([1,0],[2,3])
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in <module>
> > File
> >
> "/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/pyplot.py",
> > line 2141, in plot
> > ret = ax.plot(*args, **kwargs)
> > File
> >
> "/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py",
> > line 3437, in plot
> > self.autoscale_view(scalex=scalex, scaley=scaley)
> > File
> >
> "/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/axes.py",
> > line 1624, in autoscale_view
> > XL = self.xaxis.get_major_locator().view_limits(x0, x1)
> > File
> >
> "/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/matplotlib/ticker.py",
> > line 1014, in view_limits
> > return np.take(self.bin_boundaries(dmin, dmax), [0,-1])
> > File
> >
> "/home/swdata/.virtualenvs/web/lib/python2.6/site-packages/numpy/core/fromnumeric.py",
> > line 103, in take
> > return take(indices, axis, out, mode)
> > IndexError: index out of range for array
> >
> >
> > Any help would be appreciated. I've tried several versions of matplotlib.
> I
> > also was able to get it installed on a different RHEL5 machine a while
> back
> > and am not sure what is different about this machine.
> >
> > thanks
> >
> > - dharhas
> >
> >
> >
> ------------------------------------------------------------------------------
> > ThinkGeek and WIRED's GeekDad team up for the Ultimate
> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> > lucky parental unit. See the prize list and enter to win:
> > http://p.sf.net/sfu/thinkgeek-promo
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
From: Benjamin R. <ben...@ou...> - 2010年06月08日 17:48:30
Ted,
You can call ylim([0, 100]) after you create your plot. If you have the
axes object (from gca()), you can directly manipulate the limits using
set_ylim([0, 100]).
Ben Root
On Tue, Jun 8, 2010 at 10:50 AM, Ted Kord <ted...@go...> wrote:
> Hi
>
> How do I set the range of the y-axis on a bar chart , e.g, from 0 to 100?
>
> Thanks
>
> Ted
>
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Eric F. <ef...@ha...> - 2010年06月08日 17:47:03
On 06/08/2010 04:31 AM, Benjamin Root wrote:
> Todd,
>
> I am glad that worked for you.
[...]
>
> Anyway, you can always call "plt.ion()" to turn interactive mode on, and
> "plt.ioff()" to turn it off, or you can use ipython with the "-pylab"
> argument (although I don't know if this is the same as turning
> interactive mode on...).
Partly. In addition, the -pylab mode sets up a separate thread for 
plotting so that the command line remains active. This is not needed 
for every backend. (It also does "from pylab import *" so you get 
everything from the pyplot and numpy namespaces.) For interactive work 
and for debugging scripts and modules, "ipython -pylab" is highly 
recommended. Use the ipython "run" command to run scripts and modules 
for testing.
Eric
>
> I hope this is informative.
>
> Ben Root
On Tue, Jun 8, 2010 at 11:53 AM, David Goldsmith
<d.l...@gm...> wrote:
> On Tue, Jun 8, 2010 at 9:52 AM, David Goldsmith <d.l...@gm...>
> wrote:
>>
>> --------- Forwarded message ----------
>> From: SourceForge.net <no...@so...>
>> Date: Mon, Jun 7, 2010 at 6:06 AM
>> Subject: [ matplotlib-Bugs-2949906 ] finance.quotes_historical_yahoo
>> raises ZeroDivisionError
>> To: no...@so...
>>
>> Bugs item #2949906, was opened at 2010年02月11日 13:44
>> Message generated for change (Comment added) made by jdh2358
>> You can respond by visiting:
>>
>> https://sourceforge.net/tracker/?func=detail&atid=560720&aid=2949906&group_id=80706
>>
>> Category: None
>> Group: None
>> Status: Closed
>> Resolution: Duplicate
>> Priority: 5
>> Private: No
>> Submitted By: David Goldsmith (olydlg)
>> >Assigned to: John Hunter (jdh2358)
>> Summary: finance.quotes_historical_yahoo raises ZeroDivisionError
>> >Comment By: John Hunter (jdh2358)
>> Date: 2010年06月07日 08:06
>>
>> Message:
>> This is fixed in svn 8392. Look for it in the upcoming release. Please
>> test from svn if you are able
>>
>> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
>>
>> Thanks for the report,
>> JDH
>>
>> Hi, John, etc. I checked-out current revision (8396 I believe), tried to
>> build using python setup.py build, got error: Unable to find vcvarsall.bat.
>> Googled, determined that it was something I'm supposed to get w/ a VC
>> runtime, so grabbed the most recent version (VC2010 or some such),
>> installed, determined that I now have a vcvarsall.bat and added it's
>> location to my path, but am still getting the error. Any ideas?
>> Windows 7 home prem. 64 bit. Python 2.6. Thanks!
>>
>> DG
>
> Oh, and the error happens after building 'matplotlib.ft2font' extension.
> Thanks again,
Perhaps Christoph, who builds the win32 binaries, can let you know
what he does. It's never as simple a python setup.py install, though.
 You may want to look in the release/win32 directory at the README.txt
and Makefile.
From: Alan G I. <ala...@gm...> - 2010年06月08日 16:56:46
On 6/8/2010 11:19 AM, Waléria Antunes David wrote:
> the first function isdecrescent an the second is crescent
Decreasing and increasing over the specified range, you mean.
You won't see that when you plot them together
because they have very different scales,
so the one with the small scale will look flat.
Alan Isaac
PS I suspect you did integer division without intending to.
Here's a fix for that. You might also want to check your
parentheses, noting 1.0/2*4 is 2 (not 1/8), but I assumed
you had what you wanted.
PPS Sorry if this is sent twice ...
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(3000,3400, dtype=np.float) #use floats; not integers!
x2 = x*x
scale1 = -108 / 3e14**2
y1 = scale1 * x2
scale2 = 1*((1.38e-23*(1e0+4)/1e-6)*(1.0/4*(1e4**2)*(3e14**2)))
scale2b = 1.38e19 * 11.25 #more accurate; less costly
print scale2, scale2b, scale2 - scale2b # unnecessary error
y2 = scale2b * x2
fig = plt.figure()
ax = fig.add_subplot(1,2,1)
ax.plot(x,y1)
ax = fig.add_subplot(1,2,2)
ax.plot(x,y2)
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.plot(x, y1, label='y1')
ax.plot(x, y2, label='y2')
ax.legend()
plt.show()
On Tue, Jun 8, 2010 at 9:52 AM, David Goldsmith <d.l...@gm...>wrote:
> --------- Forwarded message ----------
> From: SourceForge.net <no...@so...>
> Date: Mon, Jun 7, 2010 at 6:06 AM
> Subject: [ matplotlib-Bugs-2949906 ] finance.quotes_historical_yahoo raises
> ZeroDivisionError
> To: no...@so...
>
> Bugs item #2949906, was opened at 2010年02月11日 13:44
> Message generated for change (Comment added) made by jdh2358
> You can respond by visiting:
>
> https://sourceforge.net/tracker/?func=detail&atid=560720&aid=2949906&group_id=80706
>
> Category: None
> Group: None
> Status: Closed
> Resolution: Duplicate
> Priority: 5
> Private: No
> Submitted By: David Goldsmith (olydlg)
> >Assigned to: John Hunter (jdh2358)
> Summary: finance.quotes_historical_yahoo raises ZeroDivisionError
> >Comment By: John Hunter (jdh2358)
> Date: 2010年06月07日 08:06
>
> Message:
> This is fixed in svn 8392. Look for it in the upcoming release. Please
> test from svn if you are able
>
> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
>
> Thanks for the report,
> JDH
>
> Hi, John, etc. I checked-out current revision (8396 I believe), tried to
> build using python setup.py build, got error: Unable to find
> vcvarsall.bat. Googled, determined that it was something I'm supposed to
> get w/ a VC runtime, so grabbed the most recent version (VC2010 or some
> such), installed, determined that I now have a vcvarsall.bat and added it's
> location to my path, but am still getting the error. Any ideas?
> Windows 7 home prem. 64 bit. Python 2.6. Thanks!
>
> DG
>
Oh, and the error happens after building 'matplotlib.ft2font' extension.
Thanks again,
DG
--------- Forwarded message ----------
From: SourceForge.net <no...@so...>
Date: Mon, Jun 7, 2010 at 6:06 AM
Subject: [ matplotlib-Bugs-2949906 ] finance.quotes_historical_yahoo raises
ZeroDivisionError
To: no...@so...
Bugs item #2949906, was opened at 2010年02月11日 13:44
Message generated for change (Comment added) made by jdh2358
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=560720&aid=2949906&group_id=80706
Category: None
Group: None
Status: Closed
Resolution: Duplicate
Priority: 5
Private: No
Submitted By: David Goldsmith (olydlg)
>Assigned to: John Hunter (jdh2358)
Summary: finance.quotes_historical_yahoo raises ZeroDivisionError
>Comment By: John Hunter (jdh2358)
Date: 2010年06月07日 08:06
Message:
This is fixed in svn 8392. Look for it in the upcoming release. Please
test from svn if you are able
http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
Thanks for the report,
JDH
Hi, John, etc. I checked-out current revision (8396 I believe), tried to
build using python setup.py build, got error: Unable to find vcvarsall.bat.
Googled, determined that it was something I'm supposed to get w/ a VC
runtime, so grabbed the most recent version (VC2010 or some such),
installed, determined that I now have a vcvarsall.bat and added it's
location to my path, but am still getting the error. Any ideas?
Windows 7 home prem. 64 bit. Python 2.6. Thanks!
DG
From: Gökhan S. <gok...@gm...> - 2010年06月08日 16:42:03
On Tue, Jun 8, 2010 at 10:19 AM, Waléria Antunes David <
wal...@gm...> wrote:
> Hello!!!
>
> My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And I'd
> like to make a question. I'm in trouble to generate a two functions graph.
>
> I have a problem to generate a graph of the two functions. I have this
> functions, is bellow:
>
> *y1 = -108*(x**2)/(3e14**2)*
>
> *y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))*
>
> You might need to check your y2. You are mixing integers and floats which
possible have resulted with some rounding errors. I get e+30 when I assert
the terms as floats in y2.
For the plotting: y1 is around -e-20 whereas y2 goes up to e+30. You can't
see the trend easily on one axes even if you could scale
them logarithmically (hint logarithm is only defined for positive numbers).
You can make a positive assumption for the y1 and plot them on one y-axes
yscale('log')
axis(ymin=1e+20, ymax=1e+30)
Still this won't let you see the functions trends that you are looking to
see. I would suggest you to use multipe figures or investing a bit more
time to use parasite axes example of JJ.
-- 
Gökhan
From: Alan G I. <ala...@gm...> - 2010年06月08日 16:39:46
On 6/8/2010 11:19 AM, Waléria Antunes David wrote:
> the first function isdecrescent an the second is crescent
Decreasing and increasing over the specified range, you mean.
You won't see that when you plot them together
because they have very different scales,
so the one with the small scale will look flat.
Alan Isaac
PS I suspect you did integer division without intending to.
Here's a fix for that. You might also want to check your
parentheses, noting 1.0/2*4 is 2 (not 1/8), but I assumed
you had what you wanted.
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(3000,3400, dtype=np.float) #use floats; not integers!
x2 = x*x
scale1 = -108 / 3e14**2
y1 = scale1 * x2
scale2 = 1*((1.38e-23*(1e0+4)/1e-6)*(1.0/4*(1e4**2)*(3e14**2)))
scale2b = 1.38e19 * 11.25 #more accurate; less costly
print scale2, scale2b, scale2 - scale2b # unnecessary error
y2 = scale2b * x2
fig = plt.figure()
ax = fig.add_subplot(1,2,1)
ax.plot(x,y1)
ax = fig.add_subplot(1,2,2)
ax.plot(x,y2)
fig = plt.figure()
ax = fig.add_subplot(1,1,1)
ax.plot(x, y1, label='y1')
ax.plot(x, y2, label='y2')
ax.legend()
plt.show()
From: Jim V. <Jim...@no...> - 2010年06月08日 16:32:42
Waléria Antunes David wrote:
> Hello!!!
>
> My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And 
> I'd like to make a question. I'm in trouble to generate a two 
> functions graph.
>
> I have a problem to generate a graph of the two functions. I have this 
> functions, is bellow:
>
> *y1 = -108*(x**2)/(3e14**2)*
>
> *y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))*
>
> However, i need to plot a graph these two functions, the first function is decrescent an the second is crescent. I made some tests that cite below:
>
>
> 1 - I plotted only function at a time and the result was, the result of the first test is attached;
> 2- Then, I see the example below: http://matplotlib.sourceforge.net/examples/pylab_examples/set_and_get.html 
>
> So, I made a change in the example over, I changed the functions in the example and added my functions as falows below:
>
> *from pylab import *
>
> x = arange(3000,3400)
>
> y1 = -108*(x**2)/(3e14**2)
>
>
> y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2)))
>
> lines = plot(x, y1, x, y2)*
>
> However, the result in my opinion is incorrect, because the first function is decrescent and second is crescent, see the result of second test, is attached.
>
>
> As can see in the image, first appers a continuous line and to ber a constant function should be of the type y=x for the example, the second function is crescent, ou seja, the first function is incorrect, i gave a print in the 
>
> functions y1 and y2, the output values are correct, for function y1 the values are always decrescent and function(negative values) and for y2 the values are crescent ( positive values). 
>
> As you 
>
> can see in the image first appears a continuous line, and to be a 
> constant function should be of the type y = x for example, the second 
> function is increasing, ie, the first function is being displayed 
> incorrectly.
>
>
> Already relize tests using GNUPLOT and the results is equal to the tests over.
>
> I would like to thank your support.
> Best regards
Hello Waleria,
I'm not clear on what you are expecting to see in your plots.
I added print statements, for y1 and y2, to your code and the results are:
 * y1 min and max: -1.38638412e-20 -1.08e-20
 * y2 min and max: 1.39725e+27 1.7936343e+27
So your first plot appears to be correct.
Plotting y2 and y1, on the same (linear) figure will show y1 to be 
essentially zero because y2 is 27 orders of magnitude greater.
What am I misunderstanding?
-- jv
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit. See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Benjamin R. <ben...@ou...> - 2010年06月08日 16:18:54
I tried to reproduce your attached plots using the functions you gave.
While I was able to reproduce your first graph (values from -1.08e-20 to
-1.386e-20) I could not reproduce your second graph. My y2 has values from
1.397e27 to 1.7936e27. Your second graph shows values ranging from 1.7e-27
to 2.2e-27.
As for your third graph, I am not sure where that came from, but the red
line has values around 1e50 which is nowhere near the values of your other
two graphs.
y1 seems to be the only one that is correct here. Could it be that the y2
function was typed incorrectly somewhere? I noticed some of the notation is
awkward, for example *"**(1e0+4)*", shouldn't that simpilfy to 5?
I hope this helps,
Ben Root
On Tue, Jun 8, 2010 at 10:19 AM, Waléria Antunes David <
wal...@gm...> wrote:
> Hello!!!
>
> My name is Waleria. I work at INPE in Sao Jose dos Campos, Brazil. And I'd
> like to make a question. I'm in trouble to generate a two functions graph.
>
> I have a problem to generate a graph of the two functions. I have this
> functions, is bellow:
>
> *y1 = -108*(x**2)/(3e14**2)*
>
> *y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2))))*
>
> However, i need to plot a graph these two functions, the first function is decrescent an the second is crescent. I made some tests that cite below:
>
>
> 1 - I plotted only function at a time and the result was, the result of the first test is attached;
> 2- Then, I see the example below: http://matplotlib.sourceforge.net/examples/pylab_examples/set_and_get.html
>
>
> So, I made a change in the example over, I changed the functions in the example and added my functions as falows below:
>
> *from pylab import *
>
> x = arange(3000,3400)
>
> y1 = -108*(x**2)/(3e14**2)
>
>
> y2 = 1*((1.38e-23*(1e0+4)/1e-6)*((x**2)/4*(1e4**2)*(3e14**2)))
>
> lines = plot(x, y1, x, y2)*
>
> However, the result in my opinion is incorrect, because the first function is decrescent and second is crescent, see the result of second test, is attached.
>
>
> As can see in the image, first appers a continuous line and to ber a constant function should be of the type y=x for the example, the second function is crescent, ou seja, the first function is incorrect, i gave a print in the
>
>
> functions y1 and y2, the output values are correct, for function y1 the values are always decrescent and function(negative values) and for y2 the values are crescent ( positive values).
>
> As you
>
>
> can see in the image first appears a continuous line, and to be a
> constant function should be of the type y = x for example, the second
> function is increasing, ie, the first function is being displayed
> incorrectly.
>
>
> Already relize tests using GNUPLOT and the results is equal to the tests over.
>
> I would like to thank your support.
> Best regards
>
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Ted K. <ted...@go...> - 2010年06月08日 15:50:27
Hi
How do I set the range of the y-axis on a bar chart , e.g, from 0 to 100?
Thanks
Ted
From: Vladimir R. <vla...@re...> - 2010年06月08日 15:03:47
I am a new user and I need to make a GUI with QT4 in which you can plot, just 
like using Matlab's GUIDE. Someone can send me a littel example (or tutorial) 
for doing this.
Thanks
From: Benjamin R. <ben...@ou...> - 2010年06月08日 14:31:41
Todd,
I am glad that worked for you.
I am assuming that you are coming from a Matlab-like experience where every
plot command did produced a graphical result when called? If so, I can see
how this behavior can be a little confusing. I will admit I was a little
confused at first when I started using matplotlib, but it turns out that
this is a strength of matplotlib.
Matplotlib has the ability to turn on/off the "interactive mode". If you
imagine that Matlab defaults to interactive mode as 'on', then matplotlib
defaults to 'off'. This way, you can generate all of your plots before
spending time rendering them (and re-rendering them). I have personally
found this to be valuable with pcolor. In Matlab, each subsequent call to a
pcolor figure (for axes labeling, colorbar and such) would require another
re-render of the plot and was very slow on my computer. Matplotlib does not
suffer from this with interactive mode turned off.
Therefore, by default, you should write up your scripts so that you call
"plt.show()" last (even after any savefig() calls) if you wish to have the
figured displayed to the screen. (I know I have seen a statement to this
effect before, but I forget where...).
Anyway, you can always call "plt.ion()" to turn interactive mode on, and
"plt.ioff()" to turn it off, or you can use ipython with the "-pylab"
argument (although I don't know if this is the same as turning interactive
mode on...).
I hope this is informative.
Ben Root
On Mon, Jun 7, 2010 at 10:46 PM, Todd V Rovito <rov...@gm...> wrote:
> Ben,
> That worked great, thanks!!! Just a few points. The documentation
> under the image tutorial section does not specify that a user has to do
> "plt.show()", should I submit a bug report or something? I changed my code
> and listed it below it works as long as I comment out the plot c section.
> In other words if I perform a normal 2d plot then close plot window the
> image plot does not product a result. If I comment out the plot c section
> then the image plot works great. Any ideas?
>
> Even the stink bug example is working when I read a image from disk.
> Thanks.
>
>
> # -*- coding: utf-8 -*-
> from numpy import *
> import matplotlib.pyplot as plt
> import matplotlib.image as mpimg
>
> print "Numpy version: " + __version__
>
> a = array([10,20,30,40])
> print "result of a"
> print a
>
> b = arange(4)
> print "result of b"
> print b
>
> c = linspace(-pi, pi, 30)
> print "result of c"
> print c
>
> # this plot code works
> print "plot c"
> plt.plot(c)
> plt.ylabel("-pi to + pi")
> plt.xlabel("value of c")
> plt.show()
>
> # this image processing code does not work
> print "doing image processing stuff"
> img=mpimg.imread("/Users/rovitotv/Desktop/stinkbug.png") # this does not
> work
> ##img = zeros((10, 10), dtype=uint8)
> ##for i in range(10):
> ## img[i,i] = 255;
>
> plt.imshow(img)
> plt.show()
>
> print "data type of img:"
> print img.dtype
> print "size of img:" + str(img.size)
> print img
>
>
>
> On Mon, Jun 7, 2010 at 10:04 AM, Benjamin Root <ben...@ou...> wrote:
>
>> Todd,
>>
>> I think you are missing a "plt.show()" at the end of your code.
>> matplotlib, by default on most systems, does not show a plot until you tell
>> it to using plt.show() command.
>>
>> See if that works,
>> Ben Root
>>
>> On Mon, Jun 7, 2010 at 7:57 AM, Todd V Rovito <rov...@gm...>wrote:
>>
>>> Greetings,
>>> I just installed Python 2.6 (python.org), Numpy 1.4.1, and
>>> Matplotlib 0.99.1.2 all on Mac OS X 10.6 in an attempt to learn about
>>> scientific programming in python. Go easy on me since I am a begginer. The
>>> Python and Numpy seem to be working correctly. I can get matplotlib to make
>>> plots but I can't get it to show images. I tried the stinkbug example in
>>> the Matplotlib users guide documentation with no success. Errors are _NOT_
>>> generated but neither are any results on the screen. The imread command
>>> produces a float32 matrix that contains all 1. values so I tried creating my
>>> own uint8 matrix with a diagnoal line. My code is below. Thanks for any
>>> help you can provide.
>>>
>>>
>>>
>>> # -*- coding: utf-8 -*-
>>> from numpy import *
>>> import matplotlib.pyplot as plt
>>> import matplotlib.image as mpimg
>>>
>>> print "Numpy version: " + __version__
>>> a = array([10,20,30,40])
>>> print "result of a"
>>> print a
>>>
>>> b = arange(4)
>>> print "result of b"
>>> print b
>>>
>>> c = linspace(-pi, pi, 30)
>>> print "result of c"
>>> print c
>>>
>>> # this plot code works
>>> print "plot c"
>>> plt.plot(c)
>>> plt.ylabel("-pi to + pi")
>>> plt.xlabel("value of c")
>>> plt.show()
>>>
>>> # this image processing code does not work
>>> print "doing image processing stuff"
>>> # img=mpimg.imread("/Users/rovitotv/Desktop/stinkbug.png") # this does
>>> not work
>>> img = zeros((10, 10), dtype=uint8)
>>> for i in range(10):
>>> img[i,i] = 255;
>>>
>>> plt.imshow(img)
>>> print "data type of img:"
>>> print img.dtype
>>> print "size of img:" + str(img.size)
>>> print img
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> lucky parental unit. See the prize list and enter to win:
>>> http://p.sf.net/sfu/thinkgeek-promo
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit. See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
From: Nie, J. <jn...@bn...> - 2010年06月08日 14:02:43
John,
I just tried all backends I have on my Win7 system (Qt4Agg, WXAgg, TkAgg) and found none of them could allow the animation in the line_editor.py. Please let me know whether I have to use GTK or GTKAgg to get the animation. Thanks.
--
Jinsuo
-----Original Message-----
From: John Hunter [mailto:jd...@gm...] 
Sent: Monday, June 07, 2010 12:19 PM
To: Nie, Jinsuo
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Animated Line2D
On Mon, Jun 7, 2010 at 10:14 AM, Nie, Jinsuo <jn...@bn...> wrote:
> I modified the path_editor.py example in order to make a line editor, as
> attached. However, the line is not animated even the line has been
> correctly updated. It seems canvas.blit is not functioning correctly in
> motion_notify_callback.  Canvas.blit works in draw_callback because the
> initial line can be plotted.
Unfortunately, I cannot understand your problem. I have tried running
your attached example and it seems to run fine on my system (I can
drag the vertices and the line drawing is updated). Can you describe
the problem you are seeing? Could this be a version problem -- what
version of mpl are you running?
 johnh@udesktop191:Downloads> python -c 'import matplotlib; print
matplotlib.__version__'
 1.0.svn
> I read the Curse implement which uses lines. This implementation uses
> visible but not animated property to achieve the animation. Any reason for
> that?
Do you mean matplotlib.widgets.Cursor? It does use the animated
property -- at least in the svn version. See the line in the __init__
function:
 if useblit:
 lineprops['animated'] = True
JDH
From: Michael D. <md...@st...> - 2010年06月08日 12:44:15
The problem is that the LogLocator expects the data to be 
non-log-transformed, since it is providing the log transform itself. It 
actually is doing the right thing since the data passed to plot ranges 
from 1 to 4.
As a workaround, you can manually set the ticks with set_xticks, 
set_xmajorticklabels and set_xminorticklabels -- you will need to set 
the tick positions and their display separately since you are trying to 
print values that are not the actual values of the data you're passing in.
If you want your graph to be interactive, however, you will probably 
want to look into writing a custom scale. See this document:
 http://matplotlib.sourceforge.net/devel/add_new_projection.html
and this example:
 
http://matplotlib.sourceforge.net/examples/api/custom_scale_example.html?highlight=custom_scale_example
Mike
On 06/07/2010 09:46 PM, Shareef Dabdoub wrote:
> Hello All,
>
> I have data that I need to apply log-based transformations to followed
> by plotting. Ideally I would like the plot to display the nicely
> formatted log-scale major/minor ticks as when setting xscale('log').
> Of course, doing that applies the default log transformation to
> already log-transformed data.
>
> I played around with the matplotlib.ticker classes, but the LogLocator
> only seems to work properly when applied to a plot with axes set to
> log scale or plotted with something like semilog (as in
> http://old.nabble.com/ticks---labels-td18931344.html).
>
> An example:
>
> import matplotlib.pyplot as plt
> import matplotlib.ticker as mt
> import numpy as np
>
> x = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 600,
> 700, 800, 900, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000,
> 10000]
> xlog = np.log10(x) #or some other more complex transform
> y = [1 for i in x]
>
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.plot(xlog,y, '.', c='blue', ms=2)
> ax.xaxis.set_major_locator(mt.LogLocator())
> plt.show()
>
> Resulting in: http://imgur.com/MtsLE.png
> As opposed to what I would like: http://imgur.com/QELVD.png (plotting
> x instead of xlog, and ax.set_xscale('log'))
>
> I'm probably missing something simple, but I haven't been able to
> figure it out as of yet.
>
> Thanks in advance for any suggestions/help.
> Shareef
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Fabrice S. <si...@lm...> - 2010年06月08日 11:47:12
Le vendredi 04 juin 2010 à 15:25 +0200, Thøger Emil Juul Thorsen a
écrit :
> Hello list; 
> 
> I'm new to python/matplotlib, migrating from IDL. I need to do some
> interactive point selection with mouse, and the pyplot.ginput() routine
> seemed to be just the right thing here. I do however need to be able to
> make a not previously specified number of clicks, so ginput(n=0) is a
> requirement. 
> 
> However, when I press enter on my laptop (with no middle mouse button),
> I get the error message:
> 
> TypeError: stop_event_loop() takes exactly 1 argument (2 given)
> 
> I've tried two different pieces of example code from the matplotlib SF
> page.
> I'm using Matplotlib 0.99.1 on Ubuntu 10.04.
> Is there any solution or workaround? If I cannot have this
> functionality, it is, unfortunately, kind of a deal breaker for at least
> some of my work, and I'd like to keep it purely Python.
See
http://sourceforge.net/tracker/?func=detail&atid=560720&aid=2908085&group_id=80706
To temporarily solve the problem and be able to use ginput, I applied
patch 8078 against my matplotlib installation (on debian)
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=rev&revision=8078 
19 messages has been excluded from this view by a project administrator.

Showing results of 397

<< < 1 .. 9 10 11 12 13 .. 16 > >> (Page 11 of 16)
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 によって変換されたページ (->オリジナル) /