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






Showing results of 428

<< < 1 .. 3 4 5 6 7 .. 18 > >> (Page 5 of 18)
From: Jae-Joon L. <lee...@gm...> - 2010年10月25日 02:05:48
On Mon, Oct 25, 2010 at 3:14 AM, Nikolaus Rath <Nik...@ra...> wrote:
> I would like to create subplots with different sizes using the object
> oriented API. However, it seems that the subplot2grid() method exists
> only in pyplot, but not as a Figure instance method. Am I looking in the
> wrong place? How do I use subplot2grid with an existing Figure object?
>
http://matplotlib.sourceforge.net/users/gridspec.html#gridspec-and-subplotspec
You can use gridspec instances w/ the add_subplot method of figures.
gs = gridspec.GridSpec(2, 2)
ax = fig.add_subplot(gs[0, 0])
Regards,
-JJ
From: Jae-Joon L. <lee...@gm...> - 2010年10月25日 02:01:12
On Sat, Oct 23, 2010 at 5:25 AM, Jonathan Slavin
<js...@cf...> wrote:
> Is there some way to get minor tick marks on plots by default? I can
> do:
> plt.minorticks_on()
> easily enough, but it seems that there is no setting I can put in my
> matplotlibrc file that will give me them by default. Is that right?
Yes, unfortunately.
I just opened a new feature request ticket on this.
https://sourceforge.net/tracker/?func=detail&aid=3094489&group_id=80706&atid=560723
Regards,
-JJ
>
> Jon
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
> 10ドル million total in prizes - 4ドルM cash, 500 devices, nearly 6ドルM in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2010年10月25日 01:47:36
On Sat, Oct 23, 2010 at 1:30 AM, Gökhan Sever <gok...@gm...> wrote:
> By the way, from the linked construct, changing width and height of
> the rectangle doesn't have any affect.
>
This is an expected behavior. Legend handles only respect a subset of
parent's properties. For example, for lines, the lengths of the legend
handles are not associated with the lengths of the original lines.
While it would be better if one can customize such properties, such
functionality is not currently implemented.
Regards,
-JJ
From: Richard D. M. <rdm...@gm...> - 2010年10月25日 00:50:06
I have Python 2.6.4 on my 64-bit Vista computer, with matplotlib
installed. How can I find what version of matplotlib it is?
Thanks,
Dick Moores
From: Benjamin R. <ben...@ou...> - 2010年10月25日 00:15:37
On Mon, Oct 18, 2010 at 8:52 AM, Luis Quesada <l.q...@4c...> wrote:
> Dear all,
>
> Is there a way of avoiding the overlap between the text of the labels
> and the text of the ticks? This is what I am getting:
>
> http://4c.ucc.ie/~lquesada/tmp/surface.pdf<http://4c.ucc.ie/%7Elquesada/tmp/surface.pdf>
>
> Currently I am only doing this:
>
> ax.set_xlabel('Distance',fontsize=16)
> ax.set_ylabel('Size',fontsize=16)
> ax.set_zlabel('Cost',fontsize=16)
>
> Is it also possible to give an orientation to the labels? It would be
> nicer if they are oriented parallel to the axis..
> Thanks in advance for your advice!
> Cheers,
> Luis
>
>
Luis,
This is a problem with matplotlib, even in 2d space. It becomes even more
difficult to deal with in 3d projections. One thing that works in 2d space
is to specify the 'x' or 'y' value of the label. I have never tried this in
3d though, and I don't know what to do for the zlabel. Anyway, try this for
a spin:
ax.set_xlabel('Distance', fontsize=16, y=0.05)
ax.set_ylabel('Size', fontsize=16, x=0.05)
ax.set_zlabel('Cost', fontsize=16)
If it seems to have an effect, then you can tweak the numbers accordingly to
your liking.
As for having the text have a particular rotation orientation, I am not
aware of any feature to be able to properly control that. If we could ever
get an OpenGL backend (one can dream, can't he?), then I can see it being
possible, but not now in our current framework.
Ben Root
From: Ted K. <ted...@gm...> - 2010年10月24日 22:02:09
Is it possible to insert an image in subplots? If it is, could some examples
and possible documentation links be provided.
Thx
Ted
From: Nikolaus R. <Nik...@ra...> - 2010年10月24日 18:14:46
Hello,
I would like to create subplots with different sizes using the object
oriented API. However, it seems that the subplot2grid() method exists
only in pyplot, but not as a Figure instance method. Am I looking in the
wrong place? How do I use subplot2grid with an existing Figure object?
Thanks,
 -Nikolaus
-- 
 »Time flies like an arrow, fruit flies like a Banana.«
 PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
From: Friedrich R. <fri...@gm...> - 2010年10月24日 14:46:18
Just got a little bit of spare time and looked up some words and
remembered what I wrote you.
I just want to clarify:
1) Not YOU are buggin us/me. Just the subject is keeping us writing
emails to bugged users.
2) I used this word (to bug) in the wrong sense. I looked it up now
and it was not what I intended. I meant it as a derivative from "the
bug", which is indeed a nice pun as I recognise from this.
Sorry if you're feeling a bit offended because of this, I guess I was
not in good mood,
Friedrich
2010年10月20日 Friedrich Romstedt <fri...@gm...>:
> 2010年10月20日 James Battat <jb...@mi...>:
>> Hi,
>> I'm having trouble with my built-from-source installation of matplotlib on
>> Snow Leopard (I also tried installing from the .dmg file, but that install
>> failed -- see below for details).
>
> *SIGH* *SIGH*
>
> YEAH, this keeps bugging us.
>
> Please do a search in Gmane (http:/gmane.org, search for
> matplotlib-users ...) for Mac OS X 10.6 or Snow Leopard and from
> source or compilation or whatever you feel like.
>
> You'll find a bunch of messages, many of them quite long, but be sure:
> It's solvable!
>
> I'll write it up somewhen and put it to the webpage if the developers
> allow me for. So many ASAP thingys currently ...
>
> Anyway, don't be frustrated by the many details, and start with the
> *recent* messages, and believe them more than the old ones. In the
> end, when you got a complete and non-conflicting image, compile again.
> You'll also need to compile the libpng and libfreetype2 I believe.
> Try to avoid or use as last rescue make.osx, it'll install old libs in
> your /usr/local namespace!
>
> Please apologise me, I'm getting tired of explaining it again and
> again, sorry again, good success with your studies,
> Friedrich
>
> Don't hesitate to ask questions but I cannot explain it from the very
> beginning, it'll also be wasting of storage :-)
>
> Second: The dmg installer requires python.org Python, not Apple one.
> The Apple one is said to be "whacky", but I don't know any details.
> Just use python.org MacPython, where mpl dmg installer is compiled
> against and should work from the very beginning. Compile if you need
> svn bleeding-edge.
>
> Third: The installer *might* still have the bug of wrong rights for
> some images used in the toolbar, so if you find those, don't be
> surprised. It's some missing read right in POSIX. But it might be
> fixed now, though then I missed it.
>
>> I downloaded:
>>  matplotlib-1.0.0.tar.gz
>> and then built and installed:
>>> tar xvzf matplotlib-1.0.0.tar.gz
>>> cd matplotlib-1.0.0
>>> python setup.py build
>>> python setup.py install
>> Then tried using pylab:
>>> cd
>>> python
>> Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
>> [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import pylab
>> Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>>  File "/Library/Python/2.6/site-packages/pylab.py", line 1, in <module>
>>   from matplotlib.pylab import *
>>  File "/Library/Python/2.6/site-packages/matplotlib/pylab.py", line 216, in
>> <module>
>>   from matplotlib import mpl # pulls in most modules
>>  File "/Library/Python/2.6/site-packages/matplotlib/mpl.py", line 2, in
>> <module>
>>   from matplotlib import axis
>>  File "/Library/Python/2.6/site-packages/matplotlib/axis.py", line 10, in
>> <module>
>>   import matplotlib.font_manager as font_manager
>>  File "/Library/Python/2.6/site-packages/matplotlib/font_manager.py", line
>> 52, in <module>
>>   from matplotlib import ft2font
>> ImportError: dlopen(/Library/Python/2.6/site-packages/matplotlib/ft2font.so,
>> 2): Symbol not found: _FT_Attach_File
>>  Referenced from: /Library/Python/2.6/site-packages/matplotlib/ft2font.so
>>  Expected in: flat namespace
>> in /Library/Python/2.6/site-packages/matplotlib/ft2font.so
>> I've seen both of these problems listed elsewhere, but no solution posted:
>>  http://www.mailinglistarchive.com/html/mat...@li.../2010-09/msg00091.html
>> Any help is greatly appreciated.
>> Here's information on my environment:
>>
>> Mac OS X 10.6.4
>>> uname -a
>> Darwin My-MacBook-Pro.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23
>> 18:28:53 PDT 2010; root:xnu-1504年7月4日~1/RELEASE_I386 i386
>> I was building from source because I was not able to install from the DMG
>> installer (matplotlib-1.0.0-python.org-py2.6-macosx10.4.dmg). When I tried
>> the .dmg installer, I got the following message:
>>  matplotlib 1.0.0-r0 can't be installed on this disk.
>>  matplotlib requires System Python 2.6 to install
>> Thanks for your help,
>> James
>
From: Ryan d. <da...@ni...> - 2010年10月23日 19:16:34
Here's a problem that's been driving me nuts, and I finally reduced it 
to a small self-contained script which can be found at 
http://gist.github.com/642538. The issue is that the pick_event does 
not always provide the correct index into the plotted data.
In case this script only bugs out on my machine, let me describe the 
problem. The callback should highlight whatever point is clicked. This 
happens correctly with no problems when clicking on 9 out of the 10 
points in the figure. But clicking the indicated point on the left-hand 
side (x[9], y[9]) also causes the indicated point on the top right 
(x[6], y[6]) to be highlighted as well.
Frustratingly, it seems that the numbers themselves are important for 
reproducing this bug! Specifically, x[9]+=0.01 does not "fix" the bug . 
. . but x[9] += 0.1 makes the callback work correctly (i.e. only the 
clicked point is highlighted). I'm guessing this is some sort of 
tolerance issue somewhere, but I can't find it.
possibly-relevant info:
matplotlib 1.0.0
numpy 1.3.0
Ubuntu 10.04 64bit
thanks,
-ryan
From: Friedrich R. <fri...@gm...> - 2010年10月23日 13:30:48
2010年10月22日 ny <nik...@gm...>:
> Hi,
> I am trying to install matplotlib on Mac Os 10.6.x without any success.
> I am on Snow Leopard w/ g++ --version i686-apple-darwin10-g++-4.2.1 (GCC)
> 4.2.1
When it's not very urgent I'd like to ask you to wait until next week,
I'll write a detailed instruction how to *successfully* compile mpl on
10.6.
Atm I'm busy with other things, you may want to search the archives
here so long: http://dir.gmane.org/gmane.comp.python.matplotlib.general.
I'm really sorry, please be a bit patient,
Friedrich
P.S.: Great that the numpy rc1 works, I was involved in building it,
this is the reason for my lack of time atm ...
From: David C. <dl...@ha...> - 2010年10月23日 04:55:41
Would others find it useful to have most/all of the artist.Artist 
subclasses updated to use the new (weak-ref) cbook.CallbookRegistry 
callbacks?
I'm working on a tool to tweak matplotlib figure styles/colors, etc, 
and I find it very useful to selectively enable "auto-updating" in 
my own toolkit such that the figure is updated on each change that 
I make. Although I'm able to do this in my own toolkit's wrapper 
layer, I would rather do it within matplotlib itself.
My thoughts are that at the least, I'd want parents to be able to 
subscribe to signals from children, and possibly vice-versa. Then 
at the top, have the Figure optionally add it's draw() method as 
a callback to it's child axes/whatever instances. 
I'll probably start working on some patches for own use anyway, 
but if there's interest, I'll keep them polished/tested and 
submit them for review.
From: Jonathan S. <js...@cf...> - 2010年10月22日 20:25:42
Is there some way to get minor tick marks on plots by default? I can
do:
plt.minorticks_on()
easily enough, but it seems that there is no setting I can put in my
matplotlibrc file that will give me them by default. Is that right?
Jon
From: Ryan M. <rm...@gm...> - 2010年10月22日 18:40:07
On Fri, Oct 22, 2010 at 11:31 AM, Maarten Sneep <maa...@kn...> wrote:
> On Fri, 2010年10月22日 at 11:12 -0500, Ryan May wrote:
>> On Fri, Oct 22, 2010 at 9:40 AM, Christopher Fonnesbeck
>>
>> > If there are only 7 possible values of the data, which are
>> evenly-spaced, it should probably not go in and create more than 6
>> bins as the default behavior. I know I can specify bins by hand, but
>> when automated it would be nice to have a more sensible default.
>>
>> It just defaults to creating 10 bins (which is identical to
>> numpy.histogram, which is what does the work under the hood.) If you
>> know how many bins you want, you can just do:
>>
>> hist(x, bins=6)
>>
>> This gives (for your example) the behavior you seem to want. I don't
>> know of any way that would sensibly choose a number of bins
>> automatically, but I'd consider a patch that proves me wrong. :)
>
> I'm moving on from IDL. From that background I used the Coyote library
> quite a bit, and there I found:
>
>  binsize = (3.5 * numpy.std(data)) / len(data)**(0.3333)
>
> (from http://www.dfanning.com/programs/histoplot.pro known as Scott's
> Choice of bin size for histograms).
Thanks for that. This actually led me here:
http://en.wikipedia.org/wiki/Histogram which gives a bunch of
different ways to estimate the number of bins/binsize. It might be
worth looking at one of these in general. However, ironically enough,
these wouldn't actually give the original poster the desired
results--the binsizes would lead to lots of bins, many of which would
be empty due to the integer data. In fact, it seems that all of these
methods are going to break down due to integer data. I guess you could
take the ceiling of the calculated binsize...anyone have an opinion on
whether calculating binsize/nbins would be a step forward over leaving
the default (of 10) and letting the user calculate if they like?
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: ny <nik...@gm...> - 2010年10月22日 17:33:06
Hi,
I am trying to install matplotlib on Mac Os 10.6.x without any success.
I am on *Snow Leopard w/ g++ --version i686-apple-darwin10-g++-4.2.1 (GCC)
4.2.1*
I am following the steps described below:
http://sites.google.com/site/michaelsafyan/setup-guide/mac-os-x-10-6-snow-leopard
see *Python_Setup**.*
**So, I install *Python 2.6.6 *since NumPy and SciPy and do not comply with
newer Python 2.7.x releases.
I test *NumPy 1.5.1rc1 and SciPy 0.8.0* and the configuration is OK for both
(I get only a few failures
after using *python -c 'import numpy; numpy.test()' & python -c 'import
scipy; scipy.test()'*
respectively).
When I am trying to install *matplotlib 1.0.0,* I get the following
warnings
*/usr/include/AvailabilityMacros.h:108:14: *
*warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4
is invalid.*
*
*
but it compiles. However, when I test matplotlib 1.0.0 with a trivial module
*>>> import demo_axes_divider.py*
*
*
I get
*
*
*traceback (most recent call last):*
* File "<stdin>", line 1, in <module>*
* File "demo_axes_divider.py", line 1, in <module>*
* import matplotlib.pyplot as plt*
* File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/pyplot.py",
line 23, in <module>*
* from matplotlib.figure import Figure, figaspect*
* File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/figure.py",
line 18, in <module>*
* from axes import Axes, SubplotBase, subplot_class_factory*
* File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py",
line 14, in <module>*
* import matplotlib.axis as maxis*
* File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py",
line 10, in <module>*
* import matplotlib.font_manager as font_manager*
* File
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py",
line 52, in <module>*
* from matplotlib import ft2font*
*ImportError:
dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so,
2):
 Symbol not found: _FT_Attach_File*
* Referenced from:
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/ft2font.so
*
* Expected in: dynamic lookup*
It turns out that *Freetype2 *feature is a required dependency for
matplotlib.
I install FontForge via macports (
http://openfontlibrary.org/wiki/How_to_install_FontForge)
so that Freetype2 is enabled.
Now I clean-up and re-install everything from scratch as mentioned here
http://www.mail-archive.com/mat...@li.../msg17448.html,
but the problem persists (also that user does not seem to have resolved the
issue).
So, any hints on what's wrong?
Many thanks!
N
From: Stan W. <sta...@nr...> - 2010年10月22日 17:27:53
> From: Ruggero [mailto:giu...@gm...] 
> Sent: Thursday, October 21, 2010 17:59
> 
> I want to merge axes from f1 and f2 in a unique axes (withou splitting
> the figure). For example if f1 produces a line and f2 produces another
> line I want to see two lines in the same plot at the end.
If you can modify the functions slightly, perhaps having an optional axes
parameter would accomplish what you want:
 def f1(axes=None):
 if axes is None:
 axes = plt.figure().add_subplot(1, 1, 1)
 # Now plot into the axes
 # Likewise for f2
 # Plot separately
 f1()
 f2()
 # Plot together
 axes = plt.figure().add_subplot(1, 1, 1)
 f1(axes=axes)
 f2(axes=axes)
From: Alan G I. <ai...@am...> - 2010年10月22日 17:24:55
On 10/22/2010 12:39 PM, Stan West wrote:
> markerline.set_zorder(markerline.get_zorder() + 0.1)
Nice idea.
Thanks,
Alan
From: Maarten S. <maa...@kn...> - 2010年10月22日 17:06:43
On Fri, 2010年10月22日 at 11:12 -0500, Ryan May wrote:
> On Fri, Oct 22, 2010 at 9:40 AM, Christopher Fonnesbeck
>
> > If there are only 7 possible values of the data, which are
> evenly-spaced, it should probably not go in and create more than 6
> bins as the default behavior. I know I can specify bins by hand, but
> when automated it would be nice to have a more sensible default.
> 
> It just defaults to creating 10 bins (which is identical to
> numpy.histogram, which is what does the work under the hood.) If you
> know how many bins you want, you can just do:
> 
> hist(x, bins=6)
> 
> This gives (for your example) the behavior you seem to want. I don't
> know of any way that would sensibly choose a number of bins
> automatically, but I'd consider a patch that proves me wrong. :)
I'm moving on from IDL. From that background I used the Coyote library
quite a bit, and there I found:
 binsize = (3.5 * numpy.std(data)) / len(data)**(0.3333)
(from http://www.dfanning.com/programs/histoplot.pro known as Scott's
Choice of bin size for histograms).
>From the binsize and the range of the data, you then figure out an axis
for the histogram).
Maarten
-- 
KNMI, De Bilt
T: 030 2206 747
E: Maa...@kn...
Room B 2.42
From: Stan W. <sta...@nr...> - 2010年10月22日 16:41:07
> From: Alan G Isaac [mailto:ai...@am...] 
> Sent: Thursday, October 14, 2010 19:12
> 
> ax.stem(x, y, '-.') draws the stem second,
> so that it is visible on top of the dot.
> 
> Is this intentional?
> (I think it looks better with the dot on top.)
> How to reverse?
I would usually place the dot on top, too. The stacking is determined by the
order of the plot commands in the stem method, but you could modify the zorder
[1] of the objects after the fact to order them as you like:
 markerline, stemlines, baseline = axes.stem(x, y, '-.')
 markerline.set_zorder(markerline.get_zorder() + 0.1)
[1] http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html
From: Gökhan S. <gok...@gm...> - 2010年10月22日 16:30:46
On Fri, Oct 22, 2010 at 6:26 AM, Jae-Joon Lee <lee...@gm...> wrote:
> On Thu, Oct 21, 2010 at 4:31 AM, Gökhan Sever <gok...@gm...> wrote:
>> How could I change the appearance of the legend symbol in this case?
>> It auto-uses a patch object (rectangle in this case).
>> I would like to get a straight line instead.
>
> You may use proxy artists.
>
> http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist
>
> Regards,
>
> -JJ
>
Thanks for the suggestion JJ.
I have actually changed my initial approach. Now I am just using
colored text to create pseudo-legends, like shown below:
ax1.text(0.40, 0.8, "Cloud-base", fontsize=14, transform=ax1.transAxes)
ax1.text(0.40, 0.7, "BallVario", fontsize=14, color='b',
transform=ax1.transAxes)
ax1.text(0.40, 0.6, "AIMMS", fontsize=14, color='g', transform=ax1.transAxes)
By the way, from the linked construct, changing width and height of
the rectangle doesn't have any affect.
p = Rectangle((0, 0), 1, 1, fc="r")
legend([p], ["Red Rectangle"])
p = Rectangle((0, 0), 10.0, 2.0, fc="r")
plt.legend([p], ["Red Rectangle"])
or making trying a smaller rectangle:
p = Rectangle((0, 0), 0.2, 1, fc="r")
plt.figure(); plt.legend([p], ["Red Rectangle"])
-- 
Gökhan
From: Stan W. <sta...@nr...> - 2010年10月22日 16:24:41
> From: Brian J. Soher [mailto:bs...@br...] 
> Sent: Thursday, October 14, 2010 10:27
> 
> I'm using matplotlib 0.98.5.2, wxPython version 2.8-msw-unicode, on 
> Windows XP Professional x64 at work (and 32bit at home). At work I 
> have a plain old Dell 2 button mouse with a scroll wheel which you 
> can scroll or click as a middle mouse button. At home I have an 
> equivalent mouse from Logitec. Both mice exhibit useful 
> functionality for the "middle button" in browsers. And I did install 
> the latest Logitec drivers at home and specifically set the scroll 
> click to have the functionality of a middle mouse button.
> 
> In all cases, home or work, I failed to detect a middle mouse button 
> press or release event.
> 
> I've attached an example program and copied the text below.
> 
> If anyone could please check to see if this is happening for them, or 
> has any idea how to fix this, I'd very much appreciate it.
Hi, Brian. Your code reports left, middle, and right button events for me
with the same wx version but with matplotlib 1.0.0 on Windows 7 Pro x64. Do
you have the option of trying a more recent matplotlib?
From: Robert K. <rob...@gm...> - 2010年10月22日 16:20:18
On 10/22/10 6:28 AM, Matthew Matic wrote:
>
> I'm trying to get a delaunay triangulation of a set of points on the surface
> of the torus. I'm using matplotlib.delaunay, but it seems to only give the
> triangulation for a flat surface. Is there any way to tell it to take the
> periodic boundary conditions into account, or alter the points I input such
> that matplotlib.delaunay interprets them as being on the surface of the
> torus.
Having said that, assuming your points are reasonably dense, then you can simply 
repeat your points 9 (or 25) times in a tiled grid, then pull out the center. 
That's probably close enough. There's some bookkeeping left as an exercise for 
the reader, but it's nothing unreasonable.
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: Robert K. <rob...@gm...> - 2010年10月22日 16:14:05
On 10/22/10 6:28 AM, Matthew Matic wrote:
>
> I'm trying to get a delaunay triangulation of a set of points on the surface
> of the torus. I'm using matplotlib.delaunay, but it seems to only give the
> triangulation for a flat surface. Is there any way to tell it to take the
> periodic boundary conditions into account, or alter the points I input such
> that matplotlib.delaunay interprets them as being on the surface of the
> torus.
No, there isn't.
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco
From: Ryan M. <rm...@gm...> - 2010年10月22日 16:12:45
On Fri, Oct 22, 2010 at 9:40 AM, Christopher Fonnesbeck
<sta...@me...> wrote:
> On Oct 22, 2010, at 9:13 AM, Ryan May wrote:
>>
>> On Fri, Oct 22, 2010 at 8:47 AM, Christopher Fonnesbeck
>> <sta...@me...> wrote:
>>> I notice that when the number of bins in a histogram is sparse, the spacing between the bins can be irregular. For example:
>>>
>>> http://cl.ly/7e0ad7039873d5446365
>>> http://cl.ly/c7cb20b567722928ac3c
>>>
>>> Is there a way of normalizing this, and better, can the default behavior result in something more consistent (i.e. publication-quality)?
>>
>> That looks like some bizarre rounding/truncation or something like it.
>> Can you post an example (can just use made up data) that reproduces
>> this? I've not seen this before, so I sense it's due to the specific
>> data types you're passing in.
>
> Here is a very simple example. The data are just a list of integers:
>
> http://dl.dropbox.com/u/233041/histexample.py
>
> and it results in an odd choice of intervals.
>
> (array([863, 775,  0, 271,  0, 67, 23,  0,  0,  1]),
> array([ 0. , 0.6, 1.2, 1.8, 2.4, 3. , 3.6, 4.2, 4.8, 5.4, 6. ]),
> <a list of 10 Patch objects>)
>
> If there are only 7 possible values of the data, which are evenly-spaced, it should probably not go in and create more than 6 bins as the default behavior. I know I can specify bins by hand, but when automated it would be nice to have a more sensible default.
It just defaults to creating 10 bins (which is identical to
numpy.histogram, which is what does the work under the hood.) If you
know how many bins you want, you can just do:
hist(x, bins=6)
This gives (for your example) the behavior you seem to want. I don't
know of any way that would sensibly choose a number of bins
automatically, but I'd consider a patch that proves me wrong. :)
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Gökhan S. <gok...@gm...> - 2010年10月22日 15:14:14
On Fri, Oct 22, 2010 at 1:47 AM, Dmitry Vinokurov <df...@gm...> wrote:
> Hello,
>
> When I plot graph with values 10^5 and more at y axis, the labels are
> too long and run out of the picture borders. So I get "600000" instead
> of "1600000" at y axis or something like this. Tried to use
> ====
> majorFormatter = ticker.FormatStrFormatter('%e')
> ax.yaxis.set_major_formatter(majorFormatter)
> ====
> but it became even worse -- "00e+00", "00e+05", "00e+06", i.e. first
> digits run out of picture border or I see only part of digit.
>
> Is it possible to make matplotlib automatically change picture size due
> to it's content? Or maybe there is some other way to solve my problem?
>
> Thanks.
Simply you can log scale your axes for such big ranges. Other
alternative would be shifting your subplot to left using figure
subplots_adjust function. Both Wx and Qt4 backends provide graphical
access to this function on navigation toolbar, so you can first
experiment to make the visual fit your need (If you use WX backend
actually you can see the numeric values to use in subplots_adjust
function).
You can also follow this thread:
http://old.nabble.com/scientific-notation-in-ticklabels-for-linear-plot-td29993489.html
to make fancier adjustments to tick labels.
-- 
Gökhan
From: Lorenzo I. <lor...@gm...> - 2010年10月22日 14:56:37
Dear All,
Please consider the snippet at the end of the email.
Admittedly, I am still quite cumbersome with the matplotlib pipeline
(I am a bit unsure about how to manipulate objects and their
properties).
The snippet below produces two plots. I have some questions
(1) for both plots: how do I add some text to the plot(possibly in
latex) in a specified position and fine-tune its properties (size,
bold etc...)?
(2) Last generated plot: I would like to have arrows like in the
previous plot, just rotated by 90 degrees so that they hit the red
areas at the north and south poles. However, this does not look
possible right now without shortening the arrows (there is not enough
vertical space; somehow the whole aspect ratio of the plot+boundary is
not 1). Any suggestions about how to fix this?
Many thanks
Lorenzo
####################################################################################33
 #!/usr/bin/env python
"""
See pcolor_demo2 for a much faster way of generating pcolor plots
"""
from __future__ import division
from pylab import *
def func3(x,y):
 return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2)
def func4(x,y):
 theta=arcsin(y)
 return cos(theta)
def func5(x,y):
 return abs(sin(y))
def func6(x,y):
 return abs(cos(y))
# make these smaller to increase the resolution
dx, dy = 0.05, 0.05
# x = arange(-1.0, 1.0, dx)
# y = arange(-1.0, 1.0, dy)
x = arange(-pi/2., pi/2., dx)
y = arange(-pi/2., pi/2., dy)
X,Y = meshgrid(x, y)
Z = func6(X, Y)
# print "Z is, ", Z
ini=pi/2.+0.5
ax = subplot(111)
ax.axis('off')
im = imshow(Z,cmap=cm.jet, extent=(-pi/2., pi/2., -pi/2., pi/2.))
im.set_interpolation('bilinear')
im.set_clip_path(Circle((0,0),pi/2., transform=ax.transData))
annotate("", xy=(-pi/2., 0), xytext=(-ini, 0), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., .2), xytext=(-ini, .2), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., -.2), xytext=(-ini, -.2), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., .4), xytext=(-ini, .4), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., -.4), xytext=(-ini, -.4), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., .6), xytext=(-ini, .6), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., -.6), xytext=(-ini, -.6), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., .8), xytext=(-ini, .8), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., -.8), xytext=(-ini, -.8), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., 1), xytext=(-ini, 1), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., -1), xytext=(-ini, -1), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., 1.2), xytext=(-ini, 1.2), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., -1.2), xytext=(-ini, -1.2), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., 1.4), xytext=(-ini, 1.4), arrowprops=dict(fc="g"))
annotate("", xy=(-pi/2., -1.4), xytext=(-ini, -1.4), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., 0), xytext=(ini, 0), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., .2), xytext=(ini, .2), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., -.2), xytext=(ini, -.2), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., .4), xytext=(ini, .4), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., -.4), xytext=(ini, -.4), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., .6), xytext=(ini, .6), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., -.6), xytext=(ini, -.6), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., .8), xytext=(ini, .8), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., -.8), xytext=(ini, -.8), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., 1), xytext=(ini, 1), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., -1), xytext=(ini, -1), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., 1.2), xytext=(ini, 1.2), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., -1.2), xytext=(ini, -1.2), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., 1.4), xytext=(ini, 1.4), arrowprops=dict(fc="g"))
annotate("", xy=(pi/2., -1.4), xytext=(ini, -1.4), arrowprops=dict(fc="g"))
savefig("first-plot.pdf")
clf()
Z = func5(X, Y)
ax = subplot(111,aspect='equal')
ax.axis('off')
im = imshow(Z,cmap=cm.jet, extent=(-pi/2., pi/2., -pi/2., pi/2.))
im.set_interpolation('bilinear')
im.set_clip_path(Circle((0,0),pi/2., transform=ax.transData))
annotate("", xy=(pi/2., 0), xytext=(ini, 0), arrowprops=dict(fc="g"))
annotate("", xy=(0., -1.6), xytext=(ini, 0), arrowprops=dict(fc="g"))
savefig("second-plot.pdf")
clf()
7 messages has been excluded from this view by a project administrator.

Showing results of 428

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