SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S





1
(8)
2
(2)
3
(1)
4
(2)
5
(15)
6
(12)
7
(10)
8
(2)
9
(5)
10
(5)
11
(8)
12
(12)
13
(26)
14
(10)
15
(11)
16
(2)
17
(3)
18
(19)
19
(25)
20
(11)
21
(8)
22
(8)
23
(2)
24
25
(8)
26
(4)
27
(2)
28
(5)
29
(3)
30
(5)

Showing results of 226

<< < 1 2 3 4 .. 10 > >> (Page 2 of 10)
From: Christoph G. <cw...@fa...> - 2012年06月25日 10:20:22
Dear matplotlib developers,
I prefer to use matplotlib in my scripts without its state-machine
wrapper and it works mostly nicely. One thing which is missing
currently is a standard way to display a bunch of figures using the
default backend. What I have to do now is:
from matplotlib.pyplot import figure, show
f = figure()
ax = f.add_subplot(1, 1, 1)
ax.plot(range(10))
f = figure()
ax = f.add_subplot(1, 1, 1)
ax.plot([x*x for x in range(10)])
show()
What I don't like about this approach is that figure() not only creates
a figure instance, but also a hidden reference to it somewhere in the
state machine and show uses these hidden references. I find this
inelegant.
What about adding a function "show_figures" to matplotlib (not to
matplotlib.pyplot but somewhere else) which would show all the figures
in a sequence using the default backend? Then the following would be
possible:
f1 = Figure()
ax = f1.add_subplot(1, 1, 1)
ax.plot(range(10))
f2 = Figure()
ax = f2.add_subplot(1, 1, 1)
ax.plot([x*x for x in range(10)])
show_figures([f1, f2])
or even:
show_figures([Figure().add_subplot(1,1,1).plot(range(10)),
 Figure().add_subplot(1,1,1).plot([x*x for x in range(10)])])
Hi folks,
sorry for the cross-post, but I expect all replies to this to happen off-list.
I'm in the process of writing an NSF grant that will partly include
IPython support, and along with Brian we will soon be doing more of
the same. In the past we haven't had the best of luck with the NFS,
hopefully this time it will be better. I think one mistake we've made
has been to have very little in the way of hard evidence of the value
(if any) that IPython provides to the scientific work of others and to
industry.
So I would greatly appreciate if you can contact me off-list (best at
Fer...@be...) with any info that I could use in a
typical NSF grant application. I'm not looking for marketing-type
testimonials nor letters of support (the NSF frowns on those), but
rather specific info, best if backed by journal citations, on how and
where IPython plays an important role in your research or industry
project (while the NSF is a science funding agency, it also has as
part of its mission the economic well-being of the US).
I'd also like to clarify that I'm not looking for quotes strictly of
personal use as an interactive shell, since I know in this community
most people do that. What I'm after are things like:
- a research project that builds on IPython in some capacity
- important results obtained with the IPython parallel machinery that
were better/easier/whatever than a classical approach with other tools
- uses of the notebook in education
- anything else along these lines you can think of, that goes beyond
pure personal shell use.
Thanks! Again, in the interest of keeping list noise down, please
reply directly to me: Fer...@be....
f
From: Alan G I. <ala...@gm...> - 2012年06月22日 19:48:32
On 6/21/2012 10:24 PM, Tony Yu wrote:
> Here's an example based off the horizontal bar charts in the gallery.
Pretty good, really!
More than just a starting point.
Thanks,
Alan
From: Benjamin R. <ben...@ou...> - 2012年06月22日 13:28:10
On Fri, Jun 22, 2012 at 8:55 AM, Michael Droettboom <md...@st...> wrote:
>
> On Thu, Jun 21, 2012 at 12:54 AM, Christopher Graves <
> chr...@gm...> wrote:
>
>>
>> Has anyone had a chance to take a look at this very annoying bug with
>> using AutoMinorLocator?
>>
>
>
> Ok, I proposed a simple bug fix at
> https://github.com/matplotlib/matplotlib/issues/807
> How does one go about submitting this to the matplotlib package?
>
> Submitting to a github issue (as you've done) certainly works, and one of
> the developers should get to it soon.
>
> We don't require it, but the next level of contribution would be to submit
> pull requests. This is described in the matplotlib developer docs here:
>
> http://matplotlib.sourceforge.net/devel/gitwash/index.html
>
> But if you're not a regular git user and that's too much overhead for a
> simple patch, I wouldn't worry about it.
>
> Mike
>
>
I submitted this PR: https://github.com/matplotlib/matplotlib/issues/807
The suggestion isn't a full solution, as I would rather see that the minor
ticks still gets drawn, but at least it doesn't crash anymore. Of course,
I am not entirely certain of the value of having the minor ticks disappear
and so this would just introduce "buggy" behavior, in a sense.
Ben Root
From: <DP...@ch...> - 2012年06月22日 13:08:15
I usually do something like:
y=np.array([60,80,120,180])
x = np.ones_like(y)*3
plt.plot(x, y,'+',markersize=8,mec='k')
David G. Parker
From: Benjamin Root <ben...@ou...>
To: Ulrich vor dem Esche <ulr...@go...>
Cc: mat...@li...
Date: 06/06/2012 12:15 PM
Subject: Re: [Matplotlib-users] scatter plot with constant x
On Tue, Jun 5, 2012 at 11:53 AM, Ulrich vor dem Esche <
ulr...@go...> wrote:
Hey! :o)
This should be simple, but i cant manage: I need to plot many dots with 
the same x, like
plt.plot([3,3,3,3],[60,80,120,180],'+',markersize=8,mec='k')
The array for x values is silly, especially since the number of y values 
may be rather large. Is there a way to enter a constant there?
Cheers to you all!
Ulli
No, but you can do this:
plt.plot([3] * 4, [60, 80, 120, 180], ...)
Does that help?
Ben Root
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Michael D. <md...@st...> - 2012年06月22日 12:55:29
> On Thu, Jun 21, 2012 at 12:54 AM, Christopher Graves 
> <chr...@gm... <mailto:chr...@gm...>> wrote:
>
>
> Has anyone had a chance to take a look at this very annoying bug
> with using AutoMinorLocator?
>
>
>
> Ok, I proposed a simple bug fix at 
> https://github.com/matplotlib/matplotlib/issues/807
> How does one go about submitting this to the matplotlib package?
Submitting to a github issue (as you've done) certainly works, and one 
of the developers should get to it soon.
We don't require it, but the next level of contribution would be to 
submit pull requests. This is described in the matplotlib developer 
docs here:
http://matplotlib.sourceforge.net/devel/gitwash/index.html
But if you're not a regular git user and that's too much overhead for a 
simple patch, I wouldn't worry about it.
Mike
From: Niels A. <aag...@gm...> - 2012年06月22日 11:04:12
Hi,
I have a problem with updating a figure within a loop. At each iteration I
wish to plot some data as fast as possible, however, only the final plot is
shown while the figure is empty while the looping takes place. Below I have
included a little script that illustrates the problem. Note that the
problem only is apparent when using windows (pythonxy) while it works fine
on my linux installation (kubuntu 12.04).
import numpy as np
import matplotlib.pyplot as plt
##Input
x = np.arange(120.0)*2*np.pi/120.0
x = np.resize(x, (100,120))
y = np.arange(100.0)*2*np.pi/100.0
y = np.resize(y, (120,100))
y = np.transpose(y)
z = np.sin(x) + np.cos(y)
fig,ax = plt.subplots()
im = ax.imshow(z)
fig.show()
for j in range(5000):
 x += np.pi/15
 y += np.pi/20
 z = np.sin(x) + np.cos(y)
 im.set_data(z)
 fig.canvas.draw()
plt.imshow(z)
plt.show()
Thanks for your help,
Niels
From: Tony Yu <ts...@gm...> - 2012年06月22日 02:25:13
On Thu, Jun 21, 2012 at 6:42 PM, Alan G Isaac <ala...@gm...> wrote:
> I never thought it would happen, but the
> Matplotlib Gallery has for once failed me:
> http://matplotlib.sourceforge.net/gallery.html
>
> I was looking for an example of creating a nice
> tornado chart:
>
> http://code.enthought.com/projects/chaco/docs/html/user_manual/tutorial_1.html
> http://www.tushar-mehta.com/excel/software/tornado/
> http://www.juiceanalytics.com/writing/recreating-ny-times-cancer-graph/
>
> A basic version will do, say along the lines of
> the Chaco example.
>
> Thanks for any leads,
> Alan Isaac
>
>
Hi Alan,
Here's an example based off the horizontal bar charts in the gallery. There
may be a better way to align the y-tick labels (the example manually tweaks
the x-offset), but I don't know how to do it off the top of my head.
Alternatively, you could put the ticks on the left and squish the space
between subplots (using `subplots_adjust(wspace=0)` but then you run into
the issue of overlapping x-tick labels.
Hope that helps,
-Tony
# tornado chart example
import numpy as np
import matplotlib.pyplot as plt
people = ('Tom', 'Dick', 'Harry', 'Slim', 'Jim')
num_people = len(people)
time_spent = np.random.uniform(low=5, high=100, size=num_people)
proficiency = np.abs(time_spent / 12. + np.random.normal(size=num_people))
pos = np.arange(num_people) + .5 # bars centered on the y axis
fig, (ax_left, ax_right) = plt.subplots(ncols=2)
ax_left.barh(pos, time_spent, align='center', facecolor='cornflowerblue')
ax_left.set_yticks([])
ax_left.set_xlabel('Hours spent')
ax_left.invert_xaxis()
ax_right.barh(pos, proficiency, align='center', facecolor='lemonchiffon')
ax_right.set_yticks(pos)
# x moves tick labels relative to left edge of axes in axes units
ax_right.set_yticklabels(people, ha='center', x=-0.08)
ax_right.set_xlabel('Proficiency')
plt.suptitle('Learning Python')
plt.show()
From: Andre' Walker-L. <wal...@gm...> - 2012年06月22日 02:19:04
Hi All,
Trying to tune alignment of xtick labels.
I have the following for my lables
===
import matlplotlib.pyplot as plt
x_dat = [1,2,3,4]
x_label = ['$\mathrm{nn}$' , '${}^2\mathrm{H}$', '${}^4\mathrm{He}$', '${}^4_{\Lambda\Lambda}\mathrm{He}$']
plt.xticks(x_dat,x_label)
===
you can see I have both superscripts and subscripts (and sometimes none) on these labels.
Try as I might, I can not figure out how to get these to align how I want (I have tried all the options from verticalalignment=option in the plt.xticks() command.
If LaTeX were rendering such fonts (in a TeX document), it would align the bottom of the characters, and then place the super and sub scripts accordingly.
It seems that matplotlib is creating a bounding box around each label, and then aligning according to the top, bottom or center of the corresponding bounding boxes.
Is there a way to get the alignment to work according to my above description (the LaTeX way)?
If it involves fine tuning the position of each label - could someone demonstrate a simple example of how to set the positions individually?
I am using the mathtext (there are issues I have had trying to get latex to work with my current set up, which I am still working on, but aren't sorted out yet).
Thanks,
Andre
From: Alan G I. <ala...@gm...> - 2012年06月21日 22:42:13
I never thought it would happen, but the
Matplotlib Gallery has for once failed me:
http://matplotlib.sourceforge.net/gallery.html
I was looking for an example of creating a nice
tornado chart:
http://code.enthought.com/projects/chaco/docs/html/user_manual/tutorial_1.html
http://www.tushar-mehta.com/excel/software/tornado/
http://www.juiceanalytics.com/writing/recreating-ny-times-cancer-graph/
A basic version will do, say along the lines of
the Chaco example.
Thanks for any leads,
Alan Isaac
From: Andre' Walker-L. <wal...@gm...> - 2012年06月21日 22:01:52
Hi Tony,
> Unfortunately, I think the preferred method is to create a proxy artist:
> 
> http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist
> 
> Basically, you draw a fake patch with the same parameters as your fill (see example below).
> 
> Hope that helps,
Yes, that helps. I also found another simple way using matplotlib.pyplot.bar()
===
import numpy as np
import matplotlib.pyplot as plt
x = np.array([1,2])
data = np.array([10,8])
err = np.array([2,1])
b1 = plt.bar(x-.2,2*err,0.4,color='b',bottom=data - err,alpha=0.3)
plt.legend([b1[0]], ['nice legend graphic'],shadow=True,fancybox=True,numpoints=1)
plt.axis([0,3,0,15])
plt.show()
===
Thanks,
Andre
From: Christopher G. <chr...@gm...> - 2012年06月21日 21:56:47
On Tue, Mar 27, 2012 at 3:31 AM, Mike Kaufman <mc...@gm...> wrote:
> On 3/26/12 12:49 PM, Christopher Graves wrote:
>
>> On Sun, Mar 11, 2012 at 2:32 PM, Christopher Graves
>> <chr...@gm... <mailto:chr...@gm...>> wrote:
>>
>
> Try this:
>>
>> from pylab import *
>> from matplotlib.ticker import AutoMinorLocator
>>
>> clf()
>> ax=subplot(111)
>> ax.autoscale(tight=True)
>> plot([1,2,4],[1,2,3])
>> ax.xaxis.set_minor_locator(__AutoMinorLocator(2))
>> ax.yaxis.set_minor_locator(__AutoMinorLocator(2))
>>
>> draw()
>>
>> M
>>
>> PS: I believe this is a fairly new feature...
>>
>>
>> Thanks! Great news that AutoMinorLocator has been added and
>> accomplishes this. Regarding the P.S. I can confirm that the feature
>> was not in matplotlib 1.0.1 - I had to update to 1.1.0 to use it.
>>
>> Best /Chris
>>
>>
>>
>> Hi Mike,
>>
>> A follow-up question... When using that, if one then tries to manually
>> use the zoom-box tool available with a matplotlib plot, if one draws too
>> small of a box (less than 2 major ticks in x or y dimension, based on
>> the following error message), it gives the following error and further
>> operations on the plot do not work.
>>
>> ValueError: Need at least two major ticks to find minor tick locations
>> ( File "/usr/lib/pymodules/python2.7/matplotlib/ticker.py", line 1528,
>> in __call__ )
>>
>> Any way to avoid this for now? (And ultimately, should this be made into
>> a bug fix request?)
>>
>
>
> Ok, I seem to remember seeing this error before, but I can't trip it now
> (with either 1.1.1rc or today's git checkout of 1.2.x). Do you have
> a short script that can reproduce this? For me, the zoom-box tool seems to
> be [correctly] setting the majortick locations as I zoom in, thus
> preventing this exception. I should note that I'm using the GTKAgg
> frontend. This may be the issue. A long time ago I was using the MacOSX
> frontend, and maybe this was when I was seeing it...
>
> Aside from that, this would be a bug.
>
> M
>
On Wed, Mar 28, 2012 at 10:50 PM, Christopher Graves <
chr...@gm...> wrote:
> Hi Mike,
>
> Ok I found the root cause. Here is a short script:
>
>
> from pylab import *
>
> from matplotlib.ticker import MultipleLocator, AutoMinorLocator
>
> plot([0,3],[0,2.2])
>
> ax = gca()
>
> ax.xaxis.set_major_locator(MultipleLocator(0.5))
>
> ax.xaxis.set_minor_locator(AutoMinorLocator(2))
>
> show()
>
>
> Once MultipleLocator has been called, the auto-reassigning of tick spacing
> when zooming (either with the zoom box or the cross and right-click drag)
> does not happen, and then AutoMinorLocator has the error because it has
> "majorstep = majorlocs[1] - majorlocs[0]" and majorlocs has less than 2
> elements when zoomed in that far. (GTKAgg vs others doesn't matter.)
>
> Seems like a bug. Is it the same in the newer mpl version you have?
> For my purposes, a different fix could work, because my reason to use
> MultipleLocator is only to make x and y major ticks have equal spacing, as
> follows:
>
> from pylab import *
>
> from matplotlib.ticker import MultipleLocator, AutoMinorLocator
>
> ax = subplot(111, aspect='equal')
>
> plot([0,3],[0,1.1])
>
> # Set the ticks to have the same interval on both x and y axes:
>
> x_major_tick_interval =
> abs(ax.xaxis.get_ticklocs()[0]-ax.xaxis.get_ticklocs()[1])
>
> ax.yaxis.set_major_locator(MultipleLocator(x_major_tick_interval))
>
> # 2 minor ticks per major tick:
>
> ax.yaxis.set_minor_locator(AutoMinorLocator(2))
>
> ax.xaxis.set_minor_locator(AutoMinorLocator(2))
>
> show()
>
>
> aspect='equal' is not necessary to bring out the error, it just
> illustrates the purpose of this. Is there another way to fix the x and y
> tick interval as equal? (And ideally even maintain the equal spacing when
> zooming.. As it is, they initially show as equal, but when zooming they can
> lose equal visible spacing while maintaining equal value intervals.)
>
>
> Best,
>
> Chris
>
On Thu, Mar 29, 2012 at 4:06 AM, Mike Kaufman <mc...@gm...> wrote:
> I can confirm this bug on yesterday's checkout. About equal spacing, I
> don't know offhand. A question to ask the list I think. If you could,
> please file as an issue on the github tracker. Include your code nugget
> that reproduces. Thanks.
>
> I don't have a lot of time at this moment, so hopefully somebody else
> looks at fixing it first.
>
> M
>
On Thu, Mar 29, 2012 at 11:53 AM, Christopher Graves <
chr...@gm...> wrote:
>
> Ok, bug is filed at https://github.com/matplotlib/matplotlib/issues/807
>
On Thu, Jun 21, 2012 at 12:54 AM, Christopher Graves <
chr...@gm...> wrote:
>
> Has anyone had a chance to take a look at this very annoying bug with
> using AutoMinorLocator?
>
Ok, I proposed a simple bug fix at
https://github.com/matplotlib/matplotlib/issues/807
How does one go about submitting this to the matplotlib package?
Best,
Chris
From: Nicolas <nic...@gm...> - 2012年06月21日 21:16:03
Hi all
FYI, the streamplot example does work with the dev. version of
matplotlib (that I pulled out from github, more specifically
matplotlib-matplotlib-v1.1.1-rc2-664-ga2d44d5.zip)
thanks
Nico
On 22 June 2012 02:51, <mat...@li...> wrote:
> Send Matplotlib-users mailing list submissions to
>    mat...@li...
>
> To subscribe or unsubscribe via the World Wide Web, visit
>    https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> or, via email, send a message with subject or body 'help' to
>    mat...@li...
>
> You can reach the person managing the list at
>    mat...@li...
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Matplotlib-users digest..."
>
>
> Today's Topics:
>
>  1. problem with streamplot method in basemap-1.0.3(4) (Nicolas)
>  2. Re: problem with streamplot method in   basemap-1.0.3(4)
>   (Benjamin Root)
>  3. Re: problem with streamplot method in   basemap-1.0.3(4) (Nicolas)
>  4. Re: problem with streamplot method in   basemap-1.0.3(4)
>   (Jeff Whitaker)
>  5. Can boxplot handle np.NaN? (Wouter Overmeire)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: 2012年6月21日 11:28:55 +1200
> From: Nicolas <nic...@gm...>
> Subject: [Matplotlib-users] problem with streamplot method in
>    basemap-1.0.3(4)
> To: mat...@li...
> Message-ID:
>    <CAJgfWuFpjRzeg-nR7exwwyH-QacmynxzLD-SQi+zMKZjk=zr...@ma...>
> Content-Type: text/plain; charset=windows-1252
>
> Hi all
>
> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>
> archives downloaded from
> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>
> My matplotlib version is 1.1.0 and I have checked that indeed the call
> to mpl_toolkits.basemap returns the correct version (I have installed
> successively 1.0.3 and then cleaned up and installed 1.0.4)
>
> the traceback is
>
> """
> Traceback (most recent call last):
> File "streamplot_demo.py", line 32, in <module>
> m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
> File "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
> line 3370, in streamplot
> ret = ax.streamplot(x,y,u,v,*args,**kwargs)
> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
> """
>
> the doc string for streamplot_demo.py (in the example folder of the
> basemap1.0.4 sources) states that it requires the vectorplot scikit,
> which I have installed but been unable to get working (complains about
> missing lic_internal module ...)
>
> what is confusing is that the entry for streamplot_demo in the README
> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
> streamplot method to visualize wind fields"
>
> Do I need to upgrade matplotlib to the development version ?
>
> thanks a lot in advance for any help on that one ...
>
> --
> -------------------------------------------------------------------------------------
> Dr. Nicolas Fauchereau
> Climate Scientist ? National Climate Centre
> National Institute of Water and Atmospheric Research (NIWA) Ltd.
> 41 Market Place
> Viaduct Precinct, Auckland
> NEW ZEALAND
> Tel: +64 (0)9 375 2053
> --------------------------------------------------------------------------------------
> "It is a mistake to think you can solve any major problems just with potatoes.".
> Douglas Adams.
>
>
>
> ------------------------------
>
> Message: 2
> Date: 2012年6月20日 19:37:04 -0400
> From: Benjamin Root <ben...@ou...>
> Subject: Re: [Matplotlib-users] problem with streamplot method in
>    basemap-1.0.3(4)
> To: Nicolas <nic...@gm...>
> Cc: "mat...@li..."
>    <mat...@li...>
> Message-ID:
>    <CANNq6FkQcqCHUCuR5n9wDhC4irDTq6if0BWbL+t-=4tP...@ma...>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On Wednesday, June 20, 2012, Nicolas wrote:
>
>> Hi all
>>
>> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
>> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>>
>> archives downloaded from
>>
>> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>>
>> My matplotlib version is 1.1.0 and I have checked that indeed the call
>> to mpl_toolkits.basemap returns the correct version (I have installed
>> successively 1.0.3 and then cleaned up and installed 1.0.4)
>>
>> the traceback is
>>
>> """
>> Traceback (most recent call last):
>> File "streamplot_demo.py", line 32, in <module>
>>
>> m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
>> File
>> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
>> line 3370, in streamplot
>> ret = ax.streamplot(x,y,u,v,*args,**kwargs)
>> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
>> """
>>
>> the doc string for streamplot_demo.py (in the example folder of the
>> basemap1.0.4 sources) states that it requires the vectorplot scikit,
>> which I have installed but been unable to get working (complains about
>> missing lic_internal module ...)
>>
>> what is confusing is that the entry for streamplot_demo in the README
>> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
>> streamplot method to visualize wind fields"
>>
>> Do I need to upgrade matplotlib to the development version ?
>
>
>
> Yes. Streamplot hasn't been officially released yet. Maybe Basemap should
> check for the function first?
>
> Ben Root
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 3
> Date: 2012年6月21日 11:50:48 +1200
> From: Nicolas <nic...@gm...>
> Subject: Re: [Matplotlib-users] problem with streamplot method in
>    basemap-1.0.3(4)
> To: Benjamin Root <ben...@ou...>
> Cc: "mat...@li..."
>    <mat...@li...>
> Message-ID:
>    <CAJ...@ma...>
> Content-Type: text/plain; charset=windows-1252
>
> Thanks Ben
>
> so streamplot "will" be part of a future stable release of matplotlib
> then ? one does not need the scikits.vectorplot installed ?
>
> I will try and pull the latest development version of matplotlib and
> install it (linux and mac os X), and then come back to the list to
> give some feedbacks
>
> cheers
>
> Nico
>
> On 21 June 2012 11:37, Benjamin Root <ben...@ou...> wrote:
>>
>>
>> On Wednesday, June 20, 2012, Nicolas wrote:
>>>
>>> Hi all
>>>
>>> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
>>> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>>>
>>> archives downloaded from
>>>
>>> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>>>
>>> My matplotlib version is 1.1.0 and I have checked that indeed the call
>>> to mpl_toolkits.basemap returns the correct version (I have installed
>>> successively 1.0.3 and then cleaned up and installed 1.0.4)
>>>
>>> the traceback is
>>>
>>> """
>>> Traceback (most recent call last):
>>> ?File "streamplot_demo.py", line 32, in <module>
>>>
>>> ?m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
>>> ?File
>>> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
>>> line 3370, in streamplot
>>> ?ret = ?ax.streamplot(x,y,u,v,*args,**kwargs)
>>> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
>>> """
>>>
>>> the doc string for streamplot_demo.py (in the example folder of the
>>> basemap1.0.4 sources) states that it requires the vectorplot scikit,
>>> which I have installed but been unable to get working (complains about
>>> missing lic_internal module ...)
>>>
>>> what is confusing is that the entry for streamplot_demo in the README
>>> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
>>> streamplot method to visualize wind fields"
>>>
>>> Do I need to upgrade matplotlib to the development version ?
>>
>>
>>
>> Yes. ?Streamplot hasn't been officially released yet. ?Maybe Basemap should
>> check for the function first?
>>
>> Ben Root
>
>
>
> --
> -------------------------------------------------------------------------------------
> Dr. Nicolas Fauchereau
> Climate Scientist ? National Climate Centre
> National Institute of Water and Atmospheric Research (NIWA) Ltd.
> 41 Market Place
> Viaduct Precinct, Auckland
> NEW ZEALAND
> Tel: +64 (0)9 375 2053
> --------------------------------------------------------------------------------------
> "It is a mistake to think you can solve any major problems just with potatoes.".
> Douglas Adams.
>
>
>
> ------------------------------
>
> Message: 4
> Date: 2012年6月20日 20:58:41 -0600
> From: Jeff Whitaker <js...@fa...>
> Subject: Re: [Matplotlib-users] problem with streamplot method in
>    basemap-1.0.3(4)
> To: mat...@li...
> Message-ID: <4FE...@fa...>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> On 6/20/12 5:50 PM, Nicolas wrote:
>> Thanks Ben
>>
>> so streamplot "will" be part of a future stable release of matplotlib
>> then ? one does not need the scikits.vectorplot installed ?
>
> No, it does not. That's an error created by copy and pasting code from
> lic_demo.py.  I should not have included that example in the release at
> all, since streamplot is not in the released version of matplotlib.
>
> -Jeff
>>
>> I will try and pull the latest development version of matplotlib and
>> install it (linux and mac os X), and then come back to the list to
>> give some feedbacks
>>
>> cheers
>>
>> Nico
>>
>> On 21 June 2012 11:37, Benjamin Root<ben...@ou...> wrote:
>>>
>>> On Wednesday, June 20, 2012, Nicolas wrote:
>>>> Hi all
>>>>
>>>> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
>>>> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>>>>
>>>> archives downloaded from
>>>>
>>>> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>>>>
>>>> My matplotlib version is 1.1.0 and I have checked that indeed the call
>>>> to mpl_toolkits.basemap returns the correct version (I have installed
>>>> successively 1.0.3 and then cleaned up and installed 1.0.4)
>>>>
>>>> the traceback is
>>>>
>>>> """
>>>> Traceback (most recent call last):
>>>>  File "streamplot_demo.py", line 32, in<module>
>>>>
>>>>  m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
>>>>  File
>>>> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
>>>> line 3370, in streamplot
>>>>  ret = ax.streamplot(x,y,u,v,*args,**kwargs)
>>>> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
>>>> """
>>>>
>>>> the doc string for streamplot_demo.py (in the example folder of the
>>>> basemap1.0.4 sources) states that it requires the vectorplot scikit,
>>>> which I have installed but been unable to get working (complains about
>>>> missing lic_internal module ...)
>>>>
>>>> what is confusing is that the entry for streamplot_demo in the README
>>>> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
>>>> streamplot method to visualize wind fields"
>>>>
>>>> Do I need to upgrade matplotlib to the development version ?
>>>
>>>
>>> Yes. Streamplot hasn't been officially released yet. Maybe Basemap should
>>> check for the function first?
>>>
>>> Ben Root
>>
>>
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: 2012年6月21日 16:51:35 +0200
> From: Wouter Overmeire <lo...@gm...>
> Subject: [Matplotlib-users] Can boxplot handle np.NaN?
> To: mat...@li...
> Message-ID:
>    <CAKS7gT6TkvK5EH3n1iQ1ps-+jP5PD38E+Ryna=iZD...@ma...>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>
> Is boxplot supposed to be able to handle nan?
> I assumed it would, but got some unexpected results when trying so.
> In the example below i try to create boxplot for three lists a,b,c holding
> samples from normal distribution. Both a and b hold nan, c not. As you can
> see in the attached screenshot only the boxplot for c looks ok.
>
> In [145]: matplotlib.__version__
> Out[145]: '1.1.0'
>
> In [146]: np.__version__
> Out[146]: '1.6.1'
>
> In [147]: a = [np.random.randn() if i % 5 == 0 else np.NaN for i in
> range(1000)]
>
> In [148]: b = [np.random.randn() if i < 500 else np.NaN for i in
> range(1000)]
>
> In [149]: c = np.random.randn(1000)
>
> In [150]: d = boxplot([a, b, c])
>
> In [151]: d['medians'][0].get_data()
> Out[151]: (array([ 0.85, 1.15]), array([ nan, nan]))
>
> In [152]: d['medians'][1].get_data()
> Out[152]: (array([ 1.85, 2.15]), array([ nan, nan]))
>
> In [153]: d['medians'][2].get_data()
> Out[153]: (array([ 2.85, 3.15]), array([ 0.01285423, 0.01285423]))
>
> Wouter
> -------------- next part --------------
> An HTML attachment was scrubbed...
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: boxplot_nan.png
> Type: image/png
> Size: 9648 bytes
> Desc: not available
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>
> ------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
> End of Matplotlib-users Digest, Vol 73, Issue 32
> ************************************************
-- 
-------------------------------------------------------------------------------------
Dr. Nicolas Fauchereau
Climate Scientist – National Climate Centre
National Institute of Water and Atmospheric Research (NIWA) Ltd.
41 Market Place
Viaduct Precinct, Auckland
NEW ZEALAND
Tel: +64 (0)9 375 2053
--------------------------------------------------------------------------------------
"It is a mistake to think you can solve any major problems just with potatoes.".
Douglas Adams.
From: Tony Yu <ts...@gm...> - 2012年06月21日 20:46:41
On Thu, Jun 21, 2012 at 4:09 PM, Andre' Walker-Loud <wal...@gm...>wrote:
> Hi All,
>
> Sometimes, instead of using data points with error bars, I instead use
> fill_between to create a little bar, with a band which I use alpha=.3 or so.
>
> I have tried unsuccessfully to find an easy way to create a legend label
> for this band - I am trying to have a similar band appear in my legend.
>
> I am not attached to fill_between if there is a similar way to create such
> a "little bar" to represent my data point.
>
>
> Thanks,
>
> Andre
> ----------------------------------------------------------
>
> Hi Andre,
Unfortunately, I think the preferred method is to create a proxy artist:
http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist
Basically, you draw a fake patch with the same parameters as your fill (see
example below).
Hope that helps,
-Tony
# example from
http://comments.gmane.org/gmane.comp.python.matplotlib.general/29476
def fill_between(x, y1, y2=0, ax=None, **kwargs):
 """Plot filled region between `y1` and `y2`.
 This function works exactly the same as matplotlib's fill_between,
except
 that it also plots a proxy artist (specifically, a rectangle of 0 size)
 so that it can be added it appears on a legend.
 """
 ax = ax if ax is not None else plt.gca()
 ax.fill_between(x, y1, y2, **kwargs)
 p = plt.Rectangle((0, 0), 0, 0, **kwargs)
 ax.add_patch(p)
 return p
From: Andre' Walker-L. <wal...@gm...> - 2012年06月21日 20:09:53
Hi All,
Sometimes, instead of using data points with error bars, I instead use fill_between to create a little bar, with a band which I use alpha=.3 or so.
I have tried unsuccessfully to find an easy way to create a legend label for this band - I am trying to have a similar band appear in my legend.
I am not attached to fill_between if there is a similar way to create such a "little bar" to represent my data point.
Thanks,
Andre
From: Jeff W. <js...@fa...> - 2012年06月21日 03:12:28
On 6/20/12 5:50 PM, Nicolas wrote:
> Thanks Ben
>
> so streamplot "will" be part of a future stable release of matplotlib
> then ? one does not need the scikits.vectorplot installed ?
No, it does not. That's an error created by copy and pasting code from 
lic_demo.py. I should not have included that example in the release at 
all, since streamplot is not in the released version of matplotlib.
-Jeff
>
> I will try and pull the latest development version of matplotlib and
> install it (linux and mac os X), and then come back to the list to
> give some feedbacks
>
> cheers
>
> Nico
>
> On 21 June 2012 11:37, Benjamin Root<ben...@ou...> wrote:
>>
>> On Wednesday, June 20, 2012, Nicolas wrote:
>>> Hi all
>>>
>>> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
>>> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>>>
>>> archives downloaded from
>>>
>>> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>>>
>>> My matplotlib version is 1.1.0 and I have checked that indeed the call
>>> to mpl_toolkits.basemap returns the correct version (I have installed
>>> successively 1.0.3 and then cleaned up and installed 1.0.4)
>>>
>>> the traceback is
>>>
>>> """
>>> Traceback (most recent call last):
>>> File "streamplot_demo.py", line 32, in<module>
>>>
>>> m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
>>> File
>>> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
>>> line 3370, in streamplot
>>> ret = ax.streamplot(x,y,u,v,*args,**kwargs)
>>> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
>>> """
>>>
>>> the doc string for streamplot_demo.py (in the example folder of the
>>> basemap1.0.4 sources) states that it requires the vectorplot scikit,
>>> which I have installed but been unable to get working (complains about
>>> missing lic_internal module ...)
>>>
>>> what is confusing is that the entry for streamplot_demo in the README
>>> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
>>> streamplot method to visualize wind fields"
>>>
>>> Do I need to upgrade matplotlib to the development version ?
>>
>>
>> Yes. Streamplot hasn't been officially released yet. Maybe Basemap should
>> check for the function first?
>>
>> Ben Root
>
>
From: Nicolas <nic...@gm...> - 2012年06月20日 23:50:55
Thanks Ben
so streamplot "will" be part of a future stable release of matplotlib
then ? one does not need the scikits.vectorplot installed ?
I will try and pull the latest development version of matplotlib and
install it (linux and mac os X), and then come back to the list to
give some feedbacks
cheers
Nico
On 21 June 2012 11:37, Benjamin Root <ben...@ou...> wrote:
>
>
> On Wednesday, June 20, 2012, Nicolas wrote:
>>
>> Hi all
>>
>> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
>> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>>
>> archives downloaded from
>>
>> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>>
>> My matplotlib version is 1.1.0 and I have checked that indeed the call
>> to mpl_toolkits.basemap returns the correct version (I have installed
>> successively 1.0.3 and then cleaned up and installed 1.0.4)
>>
>> the traceback is
>>
>> """
>> Traceback (most recent call last):
>> File "streamplot_demo.py", line 32, in <module>
>>
>> m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
>> File
>> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
>> line 3370, in streamplot
>> ret = ax.streamplot(x,y,u,v,*args,**kwargs)
>> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
>> """
>>
>> the doc string for streamplot_demo.py (in the example folder of the
>> basemap1.0.4 sources) states that it requires the vectorplot scikit,
>> which I have installed but been unable to get working (complains about
>> missing lic_internal module ...)
>>
>> what is confusing is that the entry for streamplot_demo in the README
>> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
>> streamplot method to visualize wind fields"
>>
>> Do I need to upgrade matplotlib to the development version ?
>
>
>
> Yes. Streamplot hasn't been officially released yet. Maybe Basemap should
> check for the function first?
>
> Ben Root
-- 
-------------------------------------------------------------------------------------
Dr. Nicolas Fauchereau
Climate Scientist – National Climate Centre
National Institute of Water and Atmospheric Research (NIWA) Ltd.
41 Market Place
Viaduct Precinct, Auckland
NEW ZEALAND
Tel: +64 (0)9 375 2053
--------------------------------------------------------------------------------------
"It is a mistake to think you can solve any major problems just with potatoes.".
Douglas Adams.
From: Benjamin R. <ben...@ou...> - 2012年06月20日 23:37:12
On Wednesday, June 20, 2012, Nicolas wrote:
> Hi all
>
> I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
> 7.3 (linux x86_64) running on a linux ubuntu 11.10.
>
> archives downloaded from
>
> http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
>
> My matplotlib version is 1.1.0 and I have checked that indeed the call
> to mpl_toolkits.basemap returns the correct version (I have installed
> successively 1.0.3 and then cleaned up and installed 1.0.4)
>
> the traceback is
>
> """
> Traceback (most recent call last):
> File "streamplot_demo.py", line 32, in <module>
>
> m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
> File
> "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
> line 3370, in streamplot
> ret = ax.streamplot(x,y,u,v,*args,**kwargs)
> AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
> """
>
> the doc string for streamplot_demo.py (in the example folder of the
> basemap1.0.4 sources) states that it requires the vectorplot scikit,
> which I have installed but been unable to get working (complains about
> missing lic_internal module ...)
>
> what is confusing is that the entry for streamplot_demo in the README
> (from basemap_1.0.4-examples) states that it "shows the new matplotlib
> streamplot method to visualize wind fields"
>
> Do I need to upgrade matplotlib to the development version ?
Yes. Streamplot hasn't been officially released yet. Maybe Basemap should
check for the function first?
Ben Root
From: Nicolas <nic...@gm...> - 2012年06月20日 23:29:02
Hi all
I have installed successively basemap 1.0.3 and 1.0.4 on top of my EPD
7.3 (linux x86_64) running on a linux ubuntu 11.10.
archives downloaded from
http://sourceforge.net/projects/matplotlib/files/matplotlib-toolkits/basemap-1.0.X/
My matplotlib version is 1.1.0 and I have checked that indeed the call
to mpl_toolkits.basemap returns the correct version (I have installed
successively 1.0.3 and then cleaned up and installed 1.0.4)
the traceback is
"""
Traceback (most recent call last):
 File "streamplot_demo.py", line 32, in <module>
 m.streamplot(x,y,udat,vdat,color=speed,linewidth=2,density=2,cmap=plt.cm.spectral)
 File "/home/nicolasf/epd/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py",
line 3370, in streamplot
 ret = ax.streamplot(x,y,u,v,*args,**kwargs)
AttributeError: 'AxesSubplot' object has no attribute 'streamplot'
"""
the doc string for streamplot_demo.py (in the example folder of the
basemap1.0.4 sources) states that it requires the vectorplot scikit,
which I have installed but been unable to get working (complains about
missing lic_internal module ...)
what is confusing is that the entry for streamplot_demo in the README
(from basemap_1.0.4-examples) states that it "shows the new matplotlib
streamplot method to visualize wind fields"
Do I need to upgrade matplotlib to the development version ?
thanks a lot in advance for any help on that one ...
-- 
-------------------------------------------------------------------------------------
Dr. Nicolas Fauchereau
Climate Scientist – National Climate Centre
National Institute of Water and Atmospheric Research (NIWA) Ltd.
41 Market Place
Viaduct Precinct, Auckland
NEW ZEALAND
Tel: +64 (0)9 375 2053
--------------------------------------------------------------------------------------
"It is a mistake to think you can solve any major problems just with potatoes.".
Douglas Adams.
From: Christopher G. <chr...@gm...> - 2012年06月20日 22:55:03
On Tue, Mar 27, 2012 at 3:31 AM, Mike Kaufman <mc...@gm...> wrote:
> On 3/26/12 12:49 PM, Christopher Graves wrote:
>
>> On Sun, Mar 11, 2012 at 2:32 PM, Christopher Graves
>> <chr...@gm... <mailto:chr...@gm...>> wrote:
>>
>
> Try this:
>>
>> from pylab import *
>> from matplotlib.ticker import AutoMinorLocator
>>
>> clf()
>> ax=subplot(111)
>> ax.autoscale(tight=True)
>> plot([1,2,4],[1,2,3])
>> ax.xaxis.set_minor_locator(__AutoMinorLocator(2))
>> ax.yaxis.set_minor_locator(__AutoMinorLocator(2))
>>
>> draw()
>>
>> M
>>
>> PS: I believe this is a fairly new feature...
>>
>>
>> Thanks! Great news that AutoMinorLocator has been added and
>> accomplishes this. Regarding the P.S. I can confirm that the feature
>> was not in matplotlib 1.0.1 - I had to update to 1.1.0 to use it.
>>
>> Best /Chris
>>
>>
>>
>> Hi Mike,
>>
>> A follow-up question... When using that, if one then tries to manually
>> use the zoom-box tool available with a matplotlib plot, if one draws too
>> small of a box (less than 2 major ticks in x or y dimension, based on
>> the following error message), it gives the following error and further
>> operations on the plot do not work.
>>
>> ValueError: Need at least two major ticks to find minor tick locations
>> ( File "/usr/lib/pymodules/python2.7/matplotlib/ticker.py", line 1528,
>> in __call__ )
>>
>> Any way to avoid this for now? (And ultimately, should this be made into
>> a bug fix request?)
>>
>
>
> Ok, I seem to remember seeing this error before, but I can't trip it now
> (with either 1.1.1rc or today's git checkout of 1.2.x). Do you have
> a short script that can reproduce this? For me, the zoom-box tool seems to
> be [correctly] setting the majortick locations as I zoom in, thus
> preventing this exception. I should note that I'm using the GTKAgg
> frontend. This may be the issue. A long time ago I was using the MacOSX
> frontend, and maybe this was when I was seeing it...
>
> Aside from that, this would be a bug.
>
> M
>
On Wed, Mar 28, 2012 at 10:50 PM, Christopher Graves <
chr...@gm...> wrote:
> Hi Mike,
>
> Ok I found the root cause. Here is a short script:
>
>
> from pylab import *
>
> from matplotlib.ticker import MultipleLocator, AutoMinorLocator
>
> plot([0,3],[0,2.2])
>
> ax = gca()
>
> ax.xaxis.set_major_locator(MultipleLocator(0.5))
>
> ax.xaxis.set_minor_locator(AutoMinorLocator(2))
>
> show()
>
>
> Once MultipleLocator has been called, the auto-reassigning of tick spacing
> when zooming (either with the zoom box or the cross and right-click drag)
> does not happen, and then AutoMinorLocator has the error because it has
> "majorstep = majorlocs[1] - majorlocs[0]" and majorlocs has less than 2
> elements when zoomed in that far. (GTKAgg vs others doesn't matter.)
>
> Seems like a bug. Is it the same in the newer mpl version you have?
> For my purposes, a different fix could work, because my reason to use
> MultipleLocator is only to make x and y major ticks have equal spacing, as
> follows:
>
> from pylab import *
>
> from matplotlib.ticker import MultipleLocator, AutoMinorLocator
>
> ax = subplot(111, aspect='equal')
>
> plot([0,3],[0,1.1])
>
> # Set the ticks to have the same interval on both x and y axes:
>
> x_major_tick_interval =
> abs(ax.xaxis.get_ticklocs()[0]-ax.xaxis.get_ticklocs()[1])
>
> ax.yaxis.set_major_locator(MultipleLocator(x_major_tick_interval))
>
> # 2 minor ticks per major tick:
>
> ax.yaxis.set_minor_locator(AutoMinorLocator(2))
>
> ax.xaxis.set_minor_locator(AutoMinorLocator(2))
>
> show()
>
>
> aspect='equal' is not necessary to bring out the error, it just
> illustrates the purpose of this. Is there another way to fix the x and y
> tick interval as equal? (And ideally even maintain the equal spacing when
> zooming.. As it is, they initially show as equal, but when zooming they can
> lose equal visible spacing while maintaining equal value intervals.)
>
>
> Best,
>
> Chris
>
On Thu, Mar 29, 2012 at 4:06 AM, Mike Kaufman <mc...@gm...> wrote:
> I can confirm this bug on yesterday's checkout. About equal spacing, I
> don't know offhand. A question to ask the list I think. If you could,
> please file as an issue on the github tracker. Include your code nugget
> that reproduces. Thanks.
>
> I don't have a lot of time at this moment, so hopefully somebody else
> looks at fixing it first.
>
> M
>
On Thu, Mar 29, 2012 at 11:53 AM, Christopher Graves <
chr...@gm...> wrote:
>
> Ok, bug is filed at https://github.com/matplotlib/matplotlib/issues/807
>
Has anyone had a chance to take a look at this very annoying bug with using
AutoMinorLocator?
Best,
Chris
From: <do...@ba...> - 2012年06月20日 21:29:06
Hello,
Would like to understand the "best" way to animate / move text on an wxAgg
frame. The following demo code adds text to a random location for each
button interrupt. How best to change this code so that the text is added
only once, and then efficiently move this text to a new random location
for each button interrupt (using perhaps blit, without recreating the
canvas??)? If this has been answered before, please point me to the
thread. Thank you, Doug.
Code...
class MyNavigationToolbar(NavigationToolbar2WxAgg):
 ON_CUSTOM = wx.NewId()
 def __init__(self, canvas):
 NavigationToolbar2WxAgg.__init__(self, canvas)
 self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'),
'Click me')
 wx.EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)
 def _on_custom(self, evt):
 ax = self.canvas.figure.axes[0]
 x,y = tuple(np.random.rand(2))
 rgb = tuple(np.random.rand(3))
 ax.text(x, y, 'You clicked me', transform=ax.transAxes, color=rgb)
 self.canvas.draw()
 evt.Skip()
.
.
.
toolbar = MyNavigationToolbar(canvas)
toolbar.Realize()
From: Michael D. <md...@st...> - 2012年06月20日 18:24:47
The postscript output of the Cairo backend supports transparency 
emulation, though it hasn't been tested in some time. Eric's suggestion 
(to output PDF and then convert to EPS) is also a reasonable one.
Mike
On 06/20/2012 10:38 AM, Francesco Montesano wrote:
> Dear list,
>
> it might be that this is not the best place to ask, but I guess that
> there are enough people with experience with colors.
>
> I think plots with nice colors and shaded areas are very nice, but for
> my publication I have to use eps files, that do not support
> transparency.
> The script below produce a figure like the one that I would like to
> make. If I save it as eps all the shaded areas are not transparent and
> the plot look ugly and unreadable.
>
> A way to emulate transparency that I've applied some time ago was to
> get the RGB value of the transparent color (with DigitalColor Meter on
> Mac) and to insert it by hand in fill_between, with a low value for
> the zorder option. The results was fine, but I don't like too much
> this approach, as any change in color or alpha value would require to
> go, get the new color, insert it and redo the figure.
>
> Is anyone aware of a way to obtain automatically a RGB color that on
> screen or printed looks similar to the corresponding RGBA?
>
> Thanks in advance,
> Francesco
>
> ********Sample code*********
>
> "plot with errors done with fill_between. Emulation of alpha in eps"
>
> import itertools as it
> import matplotlib.pyplot as plt
> import numpy as np
>
> col = it.cycle([ 'm', 'r', 'g', 'b', 'c', 'y', 'k', ])
> ls = it.cycle( [ '-', '--', '-.', ':' ][::-1])
>
> #figure
> fig = plt.figure()
> ax = fig.add_subplot(111)
>
> x= np.linspace(0.5,5,100)
> for i in range(3):
> c = col.next()
> l = ls.next()
> ax.plot( x, np.sin(x)**i, color=c, ls=l,
> label='$sin^{0}(x)$'.format(i), zorder=10+i )
> ax.fill_between( x, np.sin(x)**i + 1./x, np.sin(x)**i - 1./x,
> color=c, linestyle=l, alpha=0.5, zorder=i+1)
>
> ax.legend(frameon=False)
>
> plt.savefig("test_alpha.pdf")
> plt.savefig("test_alpha.eps")
> plt.show()
>
> exit()
> ********End sample code*********
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Eric F. <ef...@ha...> - 2012年06月20日 17:49:29
On 06/20/2012 04:38 AM, Francesco Montesano wrote:
> Dear list,
>
> it might be that this is not the best place to ask, but I guess that
> there are enough people with experience with colors.
>
> I think plots with nice colors and shaded areas are very nice, but for
> my publication I have to use eps files, that do not support
> transparency.
> The script below produce a figure like the one that I would like to
> make. If I save it as eps all the shaded areas are not transparent and
> the plot look ugly and unreadable.
>
> A way to emulate transparency that I've applied some time ago was to
> get the RGB value of the transparent color (with DigitalColor Meter on
> Mac) and to insert it by hand in fill_between, with a low value for
> the zorder option. The results was fine, but I don't like too much
> this approach, as any change in color or alpha value would require to
> go, get the new color, insert it and redo the figure.
>
> Is anyone aware of a way to obtain automatically a RGB color that on
> screen or printed looks similar to the corresponding RGBA?
>
> Thanks in advance,
> Francesco
Francesco,
Can't you achieve the same result more easily by saving as pdf and then 
using something like ghostscript to convert the pdf to eps?
Eric
From: Francesco M. <fra...@go...> - 2012年06月20日 14:39:27
Dear list,
it might be that this is not the best place to ask, but I guess that
there are enough people with experience with colors.
I think plots with nice colors and shaded areas are very nice, but for
my publication I have to use eps files, that do not support
transparency.
The script below produce a figure like the one that I would like to
make. If I save it as eps all the shaded areas are not transparent and
the plot look ugly and unreadable.
A way to emulate transparency that I've applied some time ago was to
get the RGB value of the transparent color (with DigitalColor Meter on
Mac) and to insert it by hand in fill_between, with a low value for
the zorder option. The results was fine, but I don't like too much
this approach, as any change in color or alpha value would require to
go, get the new color, insert it and redo the figure.
Is anyone aware of a way to obtain automatically a RGB color that on
screen or printed looks similar to the corresponding RGBA?
Thanks in advance,
Francesco
********Sample code*********
"plot with errors done with fill_between. Emulation of alpha in eps"
import itertools as it
import matplotlib.pyplot as plt
import numpy as np
col = it.cycle([ 'm', 'r', 'g', 'b', 'c', 'y', 'k', ])
ls = it.cycle( [ '-', '--', '-.', ':' ][::-1])
#figure
fig = plt.figure()
ax = fig.add_subplot(111)
x= np.linspace(0.5,5,100)
for i in range(3):
 c = col.next()
 l = ls.next()
 ax.plot( x, np.sin(x)**i, color=c, ls=l,
label='$sin^{0}(x)$'.format(i), zorder=10+i )
 ax.fill_between( x, np.sin(x)**i + 1./x, np.sin(x)**i - 1./x,
color=c, linestyle=l, alpha=0.5, zorder=i+1)
ax.legend(frameon=False)
plt.savefig("test_alpha.pdf")
plt.savefig("test_alpha.eps")
plt.show()
exit()
********End sample code*********
From: Benjamin R. <ben...@ou...> - 2012年06月20日 12:51:10
On Wed, Jun 20, 2012 at 6:12 AM, mogliii <mo...@gm...> wrote:
> Hi,
>
> on the computer where it does not work the backend is 'agg'. In a
> virtual machine, where it works, the backend shows 'TkAgg'
>
> Now on the machine it does not work I run the following:
>
> >>> import matplotlib
> >>> matplotlib.use('TkAgg')
> >>> import matplotlib.pyplot as plt
>
> ImportError: cannot import name _tkagg
>
>
> Works with 'QT4Agg' though. Where is the default config for matplotlib
> located so I can change to 'QT4Agg'?
>
> Many thanks so far. Plot window opened. But I don't want to set the
> backend everytime i run matplotlib.
>
>
Ah, this would mean that the Tk development files were not available (or in
a location to be found) when you built/installed matplotlib. When
libraries like these aren't found, matplotlib falls back to the Agg
backend, which can not display a window. To have QT4Agg as your default
backend, just edit your matplotlibrc file. You should see an entry for
"backend".
Cheers!
Ben Root
8 messages has been excluded from this view by a project administrator.

Showing results of 226

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