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

Showing results of 509

<< < 1 .. 12 13 14 15 16 .. 21 > >> (Page 14 of 21)
From: Eli B. <eb...@gm...> - 2009年07月11日 14:55:41
Thanks John,
A kwarg fillstyle with options 'full|top|bottom|left|right' for any marker
is certainly better than what i have done.
I just did not have an idea how to program this kwarg.
Further, I can't see an easy way of generalizing the half-filling of
markers.
is there a better way than just programming each half-filled marker
separately ?
Perhaps if you can give me some hints, I can try to do the rest of the work.
Eli
On Sat, Jul 11, 2009 at 4:28 PM, John Hunter <jd...@gm...> wrote:
> On Sat, Jul 11, 2009 at 3:43 AM, Eli Brosh<eb...@gm...> wrote:
> > Hello,
> > A few weeks earlier I was asking whether it is possible to plot
> half-filled
> > markers in matplotlib.
> > As I got no answers I tried to do it myself.
> > There are several ways to do it. For example, I considered following the
> > example in
> > http://matplotlib.sourceforge.net/examples/api/scatter_piecharts.html
> > but with the approach described there I could not reproduce the custom
> > marker in the legend.
> >
> > The approach that did work was to modify the lines.py file in the
> matplotlib
> > folder.
> > My version of the file is attached with several new markers added.
> >
> > The implementation is not very elegant but half-filled markers are quite
> > useful when plotting lots of data.
> >
> > Does anyone have a better idea for the implementation of half-filled
> markers
> > in matplotlib ?
>
> This looks interesting, and the functionality is certainly nice, but
> it looks like a brute force hammer approach when a scapel might be
> preferable, For example, what if we introduce a new kwarg fillstyle
> with options 'full|top|bottom|left|right' so *any* marker could be
> half filled. This would result in both less code and more
> functionality. If you are interested in tackling this, I'd be happy
> to consider a patch. Please see
>
> http://matplotlib.sourceforge.net/faq/howto_faq.html#submit-a-patch
>
> JDH
>
From: Jae-Joon L. <lee...@gm...> - 2009年07月11日 14:42:39
The number of points in scatter plot has other keyword argument
(scatterpoints). This is true for svn version, but I'm not quite sure
if it is also true for 0.98.5.2.
Anyhow, the documentation still needs to be updated.
Regards,
-JJ
On Sat, Jul 11, 2009 at 9:46 AM, John Hunter<jd...@gm...> wrote:
> On Mon, Jul 6, 2009 at 6:06 AM, Oliver Tomic<oli...@no...> wrote:
>> Hi,
>>
>> Windows XP
>> Python 2.5.2
>> matplotlib 0.98.5.2
>>
>> I try to use numpoints for a legend my plot, but without luck. I always end
>> up having three points in the legend despite setting numpoints=1 (see below
>> towards the end of the code).
>> Things work nicely though in a much simpler script.
>>
>> Help is greatly appreciated.
>
> When posting an example, it helps if we can run it:-) In this case,
> we would need your data files
>
> assC = np.loadtxt('Apples_flowerFlavour_assC_corrPlot.txt')
> all = np.loadtxt('Apples_flowerFlavour_allAssessors_corrPlot.txt')
>
> JDH
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: John H. <jd...@gm...> - 2009年07月11日 13:46:52
On Mon, Jul 6, 2009 at 6:06 AM, Oliver Tomic<oli...@no...> wrote:
> Hi,
>
> Windows XP
> Python 2.5.2
> matplotlib 0.98.5.2
>
> I try to use numpoints for a legend my plot, but without luck. I always end
> up having three points in the legend despite setting numpoints=1 (see below
> towards the end of the code).
> Things work nicely though in a much simpler script.
>
> Help is greatly appreciated.
When posting an example, it helps if we can run it:-) In this case,
we would need your data files
assC = np.loadtxt('Apples_flowerFlavour_assC_corrPlot.txt')
all = np.loadtxt('Apples_flowerFlavour_allAssessors_corrPlot.txt')
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:45:37
On Mon, Jul 6, 2009 at 9:35 PM, Christoph Gohlke<cg...@uc...> wrote:
> Hi Steve,
>
> matplotlib-0.98.5.3.win32-py2.6.exe was compiled without support for GTK.
>
> If you don't mind trying, I have a build of the matplotlib trunk
> available on my homepage that has GTK support enabled:
>
> http://www.lfd.uci.edu/~gohlke/#pythonlibs
>
> It should work with the PyGTK 2.12 Windows binaries from
> http://www.pygtk.org/downloads.html.
>
> SVG support seems broken: the window.set_icon_from_file() function in
> backend_gtk.py will raise an exception, not recognizing SVG files. The
> PNG icon works.
>
Christoph: could you look into a patch that uses png for the icon for win32/gtk?
Thanks,
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:43:49
On Mon, Jul 6, 2009 at 5:45 PM, Michael Cohen<mc...@ca...> wrote:
> Hi all,
> I am trying to produce a weighted histogram.
> The help text for "hist" here:
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.hist
> has a mention of adding weights, but it is not noted in the command line
> section where this should appear.
>
> Calling:
> hist(data,20,data_weights)
>
> gives the error:
>  File
> "/usr/local/python-2.5.2/lib/python2.5/site-packages/matplotlib/pyplot.py",
> line 1868, in hist
>   ret = gca().hist(*args, **kwargs)
>  File
> "/usr/local/python-2.5.2/lib/python2.5/site-packages/matplotlib/axes.py",
> line 6236, in hist
>   normed=bool(normed), new=True)
>  File
> "/usr/local/python-2.5.2/lib/python2.5/site-packages/numpy/lib/function_base.py",
> line 353, in histogram
>   mn, mx = range
> ValueError: too many values to unpack
>
> Calling:
> hist(data,20,weights=data_weights)
>
> gives the error:
>  File
> "/usr/local/python-2.5.2/lib/python2.5/site-packages/matplotlib/pyplot.py",
> line 1868, in hist
>   ret = gca().hist(*args, **kwargs)
>  File
> "/usr/local/python-2.5.2/lib/python2.5/site-packages/matplotlib/axes.py",
> line 6371, in hist
>   p.update(kwargs)
>  File
> "/usr/local/python-2.5.2/lib/python2.5/site-packages/matplotlib/artist.py",
> line 453, in update
>   raise AttributeError('Unknown property %s'%k)
> AttributeError: Unknown property weights
>
> There's no indication in the help text of where or how to insert the
> weights array.
The weights kwarg is not yet in the official release, only in svn. See
 http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
The site docs and examples generally track svn, so sometimes you see
features that are not out yet. We will try and get a release out
soon....
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:38:00
On Tue, Jul 7, 2009 at 1:26 PM, Nicolas Bigaouette<nbi...@gm...> wrote:
> Hi,
>
> I compiled matplotlib svn revision 7246 yesterday to try the 3D stuff.
>
> From mpl's website, an example for 3D bar plotting is shown[1]. I just don't
> understand the axes. From the code, shouldn't X values go from 0 to 20,
> instead of 0 to 400 000 like shown on the graph? Where does these values for
> the X and Z axes comes from (in the graph)?
>
> I'm trying my own 3D bar plot, with similar "weird" results.
>
> Could it be a bug?
>
> Thanx a lot.
>
> [1] http://matplotlib.sourceforge.net/examples/mplot3d/bars3d_demo.html
This certainly looks like a bug, and I can replicate it on my end.
Reinier, can you take a look?
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:35:23
On Tue, Jul 7, 2009 at 4:06 PM, Joseph Smidt<jos...@gm...> wrote:
> I have several plots where the scientific notation exponential
> overflows to the top of the plot like this:
> http://matplotlib.sourceforge.net/examples/pylab_examples/plotfile_demo.html.
>
> Is there any way to add units to this? So that, if I wanted, the
> units would show up in the overflow as: 1e8 m^3 , for meters cubed?
>
> Also, is there an easy way to add units to the numbers on the x or y
> axis in general? Thanks.
You can use a custom formatter, eg::
 from matplotlib.ticker import FormatStrFormatter
 ax.xaxis.set_major_formatter(r'$%.4fm^3'$) # using mathtext for the
m^3 exponent
See
 http://matplotlib.sourceforge.net/api/ticker_api.html#matplotlib.ticker.FormatStrFormatter
and some code examples
 http://matplotlib.sourceforge.net/search.html?q=codex+Formatter
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:35:01
On Thu, Jul 9, 2009 at 9:44 AM, Johann Cohen-Tanugi<co...@lp...> wrote:
> Hello, how can I center axis tick labels, so that the labels ends up at
> the center between 2 ticks.
>
There is no support for this, though you can left or right align a
label with a single tick::
 for label in ax.xaxis.get_xticklabels():
 label.set_horizontalalignment('right')
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:28:58
On Sat, Jul 11, 2009 at 3:43 AM, Eli Brosh<eb...@gm...> wrote:
> Hello,
> A few weeks earlier I was asking whether it is possible to plot half-filled
> markers in matplotlib.
> As I got no answers I tried to do it myself.
> There are several ways to do it. For example, I considered following the
> example in
> http://matplotlib.sourceforge.net/examples/api/scatter_piecharts.html
> but with the approach described there I could not reproduce the custom
> marker in the legend.
>
> The approach that did work was to modify the lines.py file in the matplotlib
> folder.
> My version of the file is attached with several new markers added.
>
> The implementation is not very elegant but half-filled markers are quite
> useful when plotting lots of data.
>
> Does anyone have a better idea for the implementation of half-filled markers
> in matplotlib ?
This looks interesting, and the functionality is certainly nice, but
it looks like a brute force hammer approach when a scapel might be
preferable, For example, what if we introduce a new kwarg fillstyle
with options 'full|top|bottom|left|right' so *any* marker could be
half filled. This would result in both less code and more
functionality. If you are interested in tackling this, I'd be happy
to consider a patch. Please see
 http://matplotlib.sourceforge.net/faq/howto_faq.html#submit-a-patch
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:24:32
2009年2月23日 Gregor Skrt <gre...@gm...>:
>  1.  Where can I find a good tutorial or set of examples for
>   embeding matplotlib in Tkinter ?
>  2. Problem: I created a simple test with Tkinter. First I plot my
>   graph on __init__ (it works ok). Then I want to clear graph and
>   plot on the same canvas with different parameters. The thing is
>   that plot shows up only when I resize my window. Any idea what
>   could I be doing wrong ? I was trying draw method but it doasn't
>   work...
>
Have you seen the embedding_in_tk*.py examples at
http://matplotlib.sourceforge.net/examples/user_interfaces/index.html
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:22:52
On Tue, Jul 7, 2009 at 9:53 AM, Voichek<vo...@gm...> wrote:
>
> Hi everyone,
>
> I just installed matplotlib (after suffering from Numpy, Scipy, Atlas,
> Lapack...), and I have this weird problem.
>
> When I plot the first time I have no problem, the plot comes out just fine
> and the plot window is interactive.
> After I close the plotting window and try to plot again I can see the graph
> but the plot window doesn't response (not interactive).
>
> When I import pylab I get this warning:
>>>> import pylab
>
> Warning (from warnings module):
> File
> "/home/yoavv/ActivePython-2.6_64/lib/python2.6/site-packages/pytz/tzinfo.py",
> line 5
>  from sets import Set
> DeprecationWarning: the sets module is deprecated
>>>> pylab.plot(range(100))
> [<matplotlib.lines.Line2D object at 0x2b921d0>]
>>>> p = _
>>>> pylab.show()
>
>>>> pylab.plot(range(200))
> [<matplotlib.lines.Line2D object at 0x3113510>]
>
> - Here no response.
>
> I am using:
> - ActivePython-2.6
> - matplotlib 0.98.5.3
>
> I would appreciate any help,
Take a look at
http://matplotlib.sourceforge.net/users/shell.html
After you have digested the ideas there and make sure your interactive
and backend settings are proper for ActivePython, feel free to get
back to us with more questions. Be sure to read the links
"Customizing matplotlib" and "What is a backend" referred to from the
page above.
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:19:45
On Mon, Jul 6, 2009 at 10:35 AM, jcm52<joe...@gm...> wrote:
>
> Perhaps this is a new feature since you sent this request, but I just came
> across
>
> pylab.suptitle('my super title')
>
> Seems to work fairly well, but the font sizes don't appear to behave as well
> as I'd like.
Just pass in the fontsize kwarg:
 pylab.suptitle('my super title', fontsize=14)
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:18:51
On Tue, Jul 7, 2009 at 6:41 PM, Doug Penner<dar...@gm...> wrote:
> so instead of doing
>
>  plt.savefig("some/location.png")
>
>  return HttpResponse("<html><body><img src='some/location.png'
> /></body></html>")
>
> I could do
>
>  return HttpResponse(plt.image_render('image/png'), mimetype="image/png")
>
> and not have to worry about deleting the image later (there are LOT that
> get generated)
You can save directly to a file handle (eg sys.stdout) so you need not
go to a PNG file. Alternatively, you can write to a StringIO object.
See the examples at
 http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-in-a-web-application-server
And if you would be willing to complete the FAQ stub for Django
 http://matplotlib.sourceforge.net/faq/howto_faq.html#matplotlib-with-django
That would be much appreciated. See
 http://matplotlib.sourceforge.net/faq/howto_faq.html#how-to-contribute-docs
Thanks,
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:15:37
On Sat, Jul 11, 2009 at 6:06 AM, Eli Brosh<eb...@gm...> wrote:
> Hello,
> I encountered a problem when trying to draw a legend outside the axes.
> For some reason, when the legend is placed outside the axes, the markers are
> not drawn near the labels.
>
> I attach two scripts and two corresponding figures.
> the only differences between the scripts is the location of the legend.
> When the legend is placed inside the axes, everything is OK.
> However, when the legend is outside the markers are gone.
>
> Is this a bug ?
> Is there a way around it ?
I am not seeing this problem in mpl svn (what version are you using).
perhaps you can upgrade to svn?
http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
JDH
From: John H. <jd...@gm...> - 2009年07月11日 13:10:25
On Fri, Jul 10, 2009 at 5:46 AM, Pau<vim...@go...> wrote:
> Hello,
>
> are there some relative/absolute limits in the plotting area?
>
> I would like to set some text (labels) in the plot automatically, so
> that I do not need to recalculate everytime where they should go.
>
> I mean some kind of absolute X0, Y0, X1, Y1 , so that I know where to
> place the labels in text in the plot area without having to look at
> the particular values of the particular plot I am dealing with, in a
> series of very similar plots.
Specify the coordinates using the axes transform -- (0,0) is bottom
left and (1,1) is top right
 ax = fig.add_subplot(111)
 ax.text(0.1, 0.9, 'this is a test', transform=ax.transAxes)
See also the "annotate" command, which takes a variety of different
coordinate systems: data, axes, figure..
 http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.annotate
 http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo.html
 http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo2.html
JDH
On Thu, Jul 9, 2009 at 4:13 PM, W.P. McNeill<bi...@gm...> wrote:
> I am trying to install matplot on an OS X (10.5.7) Intel MacBook. I
> cannot build the matplot lib extensions. I get the following error:
>
> ....
> g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk
> -bundle -undefined dynamic_lookup
> build/temp.macosx-10.3-i386-2.5/src/ft2font.o
> build/temp.macosx-10.3-i386-2.5/src/mplutils.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
> build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o -L/sw/lib
> -L/sw/lib/freetype219/lib -L/usr/local/lib -L/usr/lib -L/sw/lib
> -L/usr/X11R6/lib -lfreetype -lz -lstdc++ -lm -o
> build/lib.macosx-10.3-i386-2.5/matplotlib/ft2font.so
> -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices
> ld warning: in /sw/lib/libfreetype.dylib, file is not of required architecture
> ld: in /sw/lib/libiconv.2.dylib, file is not of required architecture
> for architecture ppc
> collect2: ld returned 1 exit status
> lipo: can't open input file:
> /var/folders/xW/xW61KykkHgSaGc2vPwOTCk+++TI/-Tmp-//ccGEBvWb.out (No
> such file or directory)
> error: command 'g++' failed with exit status 1
It looks like there is an incompatibility with the freetype supplied
in /sw (probably fink supplied). Perhaps it is not configured as a
universal binary.
You can build mpl from svn the way we do when we make a release, which
will automatically fetch and build the dependencies correctly. First
see,
 http://matplotlib.sourceforge.net/faq/installing_faq.html#which-python-for-osx
then grab a copy of mpl from svn
 http://matplotlib.sourceforge.net/faq/installing_faq.html#install-svn
and cd into the releases/osx directory and follow the instructions in
the README there.
JDH
From: John H. <jd...@gm...> - 2009年07月11日 12:59:12
On Thu, Jul 9, 2009 at 5:56 PM, Joseph Smidt<jos...@gm...> wrote:
> Thank you! That did it. I thought I read the webpage you sent 10
> times, but didn't even notice. Thanks.
>
> On Thu, Jul 9, 2009 at 3:38 PM, Chaitanya Krishna<ic...@gm...> wrote:
>> Hi,
>>
>> legend.draw_frame(False) should do the trick. Check out
>> http://matplotlib.sourceforge.net/api/artist_api.html?highlight=draw_frame#matplotlib.legend.Legend.draw_frame
I often set the alpha on the frame so it is translucent, which in some
cases is preferable to turning the frame off entirely::
 leg = ax.legend(fancybox=True)
 leg.get_frame().set_alpha(0.5)
JDH
From: John H. <jd...@gm...> - 2009年07月11日 12:52:35
On Wed, Jul 8, 2009 at 3:49 PM, T J<tj...@gm...> wrote:
> Are matplotlib backends pluggable? That is, can package X provide an
> experimental backend and tell matplotlib to use it? If so, how?
Yes, just point to your backend with the syntax:
matplotlibrc::
 backend : module://mybackend where mybackend is a module in your PYTHONPATH
or in code::
 import matplotlib
 matplotlib.use('module://mybackend')
JDH
2009年7月5日 s.s C <rot...@gm...>:
> when i ploted column data from an ASCII space delimited file :
>
> import matplotlib.pyplot as plt
> plt.plotfile('data.txt',cols=(0,1), delimiter=' ')
Works fine for me -- perhaps you can attach your file rather than
paste your data and let us know your platform details. Could be a
unix/dos line ending problem or a unicode problem. Not really sure
but it might help to see the raw data.
JDH
From: John H. <jd...@gm...> - 2009年07月11日 11:47:41
On Fri, Jul 10, 2009 at 3:09 PM, Michael Lerner<mgl...@gm...> wrote:
> Hi,
>
> I was looking at the autocorrelation of a time series recently and it was
> useful to scale the x-axis (i.e. multiply lags by the timestep of my actual
> data). It's a trivial change, but it might be useful for others. Here's a
> standalone version of axes.acorr:
>
I'd be happy to consider a patch to acorr/xcorr ro add a new kwarg,
but is should be submitted as an svn patch which also includes
documentation. I don't think we need to add a new function to support
this, just enhance the existing ones. See
 http://matplotlib.sourceforge.net/faq/howto_faq.html#submit-a-patch
Thanks,
JDH
> def scaledacorr(x, stepsize=1, normed=False, detrend=mlab.detrend_none,
>         usevlines=False, maxlags=None, **kwargs):
>
Hello,
I encountered a problem when trying to draw a legend outside the axes.
For some reason, when the legend is placed outside the axes, the markers are
not drawn near the labels.
I attach two scripts and two corresponding figures.
the only differences between the scripts is the location of the legend.
When the legend is placed inside the axes, everything is OK.
However, when the legend is outside the markers are gone.
Is this a bug ?
Is there a way around it ?
Thanks,
Eli
From: Eli B. <eb...@gm...> - 2009年07月11日 08:43:16
Hello,
A few weeks earlier I was asking whether it is possible to plot half-filled
markers in matplotlib.
As I got no answers I tried to do it myself.
There are several ways to do it. For example, I considered following the
example in
http://matplotlib.sourceforge.net/examples/api/scatter_piecharts.html
but with the approach described there I could not reproduce the custom
marker in the legend.
The approach that did work was to modify the lines.py file in the matplotlib
folder.
My version of the file is attached with several new markers added.
The implementation is not very elegant but half-filled markers are quite
useful when plotting lots of data.
Does anyone have a better idea for the implementation of half-filled markers
in matplotlib ?
Eli
On Fri, Jun 12, 2009 at 8:55 PM, Eli Brosh <eb...@gm...> wrote:
> Hello,
> Is there a way to plot half-filled markers in matplotlib ?
>
> For example, I would like to use a circle marker, lower half filled in
> black while the upper half is white.
>
> Thanks,
> Eli
>
From: Robin <ro...@gm...> - 2009年07月11日 07:32:54
On Sat, Jul 11, 2009 at 4:43 AM, Michiel de Hoon<mjl...@ya...> wrote:
>
> The /usr/X11R6/lib is included because it is listed in setupext.py under basedir['darwin']. Could you try and remove /usr/X11R6/lib from basedir['darwin'] in setupext.py to see if everything still compiles and links (both the Mac OS X backend and other backends)? At least, I don't see any libraries that needs to be linked from /usr/X11R6/lib. Compilation and linking without /usr/X11R6/lib works for me, but it'd be nice if you could double-check this on your system before I submit a patch to the matplotlib developers.
>
> --Michiel.
Hi,
Yes taking that out it seems to build fine. I dont have the
dependencies for gtk and qt backends (they seemed too much of a pain
to sort out on os x), but wx, tk seem to build fine.
Thanks,
Robin
>
> --- On Fri, 7/10/09, Robin <ro...@gm...> wrote:
>
>> From: Robin <ro...@gm...>
>> Subject: Re: [Matplotlib-users] current svn fails to build on mac
>> To: "Michiel de Hoon" <mjl...@ya...>
>> Cc: mat...@li...
>> Date: Friday, July 10, 2009, 6:59 AM
>> On Fri, Jul 10, 2009 at 11:45 AM,
>> Michiel de Hoon<mjl...@ya...>
>> wrote:
>> >
>> > It's probably the -L/usr/X11R6/lib that is causing a
>> problem. Can you try linking without it?
>> >
>>
>> Yes, that's it... running the command by hand without that
>> stops the error:
>>
>> robin-mbp-3:matplotlib robince$ g++ -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined
>> dynamic_lookup
>> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
>> build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
>> build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o
>> build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
>> build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
>> build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o
>> build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o
>> -L/usr/local/lib
>> -L/usr/lib -L/usr/X11R6/lib -lstdc++ -lm -o
>> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
>> -framework Cocoa
>> ld: cycle in dylib re-exports with
>> /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libGL.dylib
>> collect2: ld returned 1 exit status
>>
>> robin-mbp-3:matplotlib robince$ g++ -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined
>> dynamic_lookup
>> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
>> build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
>> build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o
>> build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
>> build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
>> build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o
>> build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o
>> -L/usr/local/lib
>> -L/usr/lib -lstdc++ -lm -o
>> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
>> -framework Cocoa
>> robin-mbp-3:matplotlib robince$
>>
>> Cheers
>>
>> Robin
>>
>> > --Michiel.
>> >
>> > --- On Fri, 7/10/09, Robin <ro...@gm...>
>> wrote:
>> >
>> >> From: Robin <ro...@gm...>
>> >> Subject: Re: [Matplotlib-users] current svn fails
>> to build on mac
>> >> To: "Michiel de Hoon" <mjl...@ya...>
>> >> Cc: mat...@li...
>> >> Date: Friday, July 10, 2009, 4:03 AM
>> >> On Fri, Jul 10, 2009 at 1:33 AM,
>> >> Michiel de Hoon<mjl...@ya...>
>> >> wrote:
>> >> > Can you verify that matplotlib 0.98.5.3 still
>> compiles
>> >> correctly?
>> >> > If it does, we can compare the linker flags
>> used for
>> >> 0.98.5.3 and the svn version to find the problem.
>> >>
>> >> Yes - just removed build dirs and did both from
>> scratch.
>> >> 0.98.5.3 - fine, full build log:
>> >> http://www.robince.net/robince/mpl/build-0.98.5.3.log
>> >> svn7250 - fails, full build log:
>> >> http://www.robince.net/robince/mpl/build-svn7250.log
>> >>
>> >> The relevant sections of the logs (I think) are:
>> >>
>> >> Release
>> >> -----------
>> >> building 'matplotlib.backends._macosx' extension
>> >>
>> >> gcc -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk
>> >> -fno-strict-aliasing -Wno-long-double
>> -no-cpp-precomp
>> >> -mno-fused-madd
>> >> -fno-common -dynamic -DNDEBUG -g -O3
>> >>
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> >>
>> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
>> >> -c src/_macosx.m -o
>> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
>> >>
>> >> gcc -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk -g
>> >> -bundle
>> >> -undefined dynamic_lookup
>> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o -o
>> >>
>> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
>> >> -framework Cocoa
>> >>
>> >> SVN
>> >> ------
>> >> building 'matplotlib.backends._macosx' extension
>> >>
>> >> gcc -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk
>> >> -fno-strict-aliasing -Wno-long-double
>> -no-cpp-precomp
>> >> -mno-fused-madd
>> >> -fno-common -dynamic -DNDEBUG -g -O3
>> >> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> >>
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> >> -I/usr/local/include -I/usr/include
>> -I/usr/X11R6/include
>> >> -I.
>> >>
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> >> -Isrc -Iagg24/include -I.
>> >>
>> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
>> >> -c src/_macosx.m -o
>> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
>> >>
>> >> g++ -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk -g
>> >> -bundle
>> >> -undefined dynamic_lookup
>> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
>> >>
>> build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
>> >>
>> build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o
>> >> build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
>> >>
>> build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
>> >>
>> build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o
>> >>
>> build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o
>> >> -L/usr/local/lib
>> >> -L/usr/lib -L/usr/X11R6/lib -lstdc++ -lm -o
>> >>
>> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
>> >> -framework Cocoa
>> >>
>> >> ld: cycle in dylib re-exports with
>> >>
>> /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libGL.dylib
>> >> collect2: ld returned 1 exit status
>> >> error: command 'g++' failed with exit status 1
>> >>
>> >>
>> >> Obviously lots of differences but I've no idea
>> what would
>> >> be causing it.
>> >>
>> >> Cheers
>> >>
>> >> Robin
>> >>
>> >
>> >
>> >
>> >
>>
>
>
>
>
From: Michiel de H. <mjl...@ya...> - 2009年07月11日 03:43:50
The /usr/X11R6/lib is included because it is listed in setupext.py under basedir['darwin']. Could you try and remove /usr/X11R6/lib from basedir['darwin'] in setupext.py to see if everything still compiles and links (both the Mac OS X backend and other backends)? At least, I don't see any libraries that needs to be linked from /usr/X11R6/lib. Compilation and linking without /usr/X11R6/lib works for me, but it'd be nice if you could double-check this on your system before I submit a patch to the matplotlib developers.
--Michiel.
--- On Fri, 7/10/09, Robin <ro...@gm...> wrote:
> From: Robin <ro...@gm...>
> Subject: Re: [Matplotlib-users] current svn fails to build on mac
> To: "Michiel de Hoon" <mjl...@ya...>
> Cc: mat...@li...
> Date: Friday, July 10, 2009, 6:59 AM
> On Fri, Jul 10, 2009 at 11:45 AM,
> Michiel de Hoon<mjl...@ya...>
> wrote:
> >
> > It's probably the -L/usr/X11R6/lib that is causing a
> problem. Can you try linking without it?
> >
> 
> Yes, that's it... running the command by hand without that
> stops the error:
> 
> robin-mbp-3:matplotlib robince$ g++ -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined
> dynamic_lookup
> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
> build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
> build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o
> build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o
> -L/usr/local/lib
> -L/usr/lib -L/usr/X11R6/lib -lstdc++ -lm -o
> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
> -framework Cocoa
> ld: cycle in dylib re-exports with
> /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libGL.dylib
> collect2: ld returned 1 exit status
> 
> robin-mbp-3:matplotlib robince$ g++ -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined
> dynamic_lookup
> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o
> build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
> build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
> build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o
> build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o
> -L/usr/local/lib
> -L/usr/lib -lstdc++ -lm -o
> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
> -framework Cocoa
> robin-mbp-3:matplotlib robince$
> 
> Cheers
> 
> Robin
> 
> > --Michiel.
> >
> > --- On Fri, 7/10/09, Robin <ro...@gm...>
> wrote:
> >
> >> From: Robin <ro...@gm...>
> >> Subject: Re: [Matplotlib-users] current svn fails
> to build on mac
> >> To: "Michiel de Hoon" <mjl...@ya...>
> >> Cc: mat...@li...
> >> Date: Friday, July 10, 2009, 4:03 AM
> >> On Fri, Jul 10, 2009 at 1:33 AM,
> >> Michiel de Hoon<mjl...@ya...>
> >> wrote:
> >> > Can you verify that matplotlib 0.98.5.3 still
> compiles
> >> correctly?
> >> > If it does, we can compare the linker flags
> used for
> >> 0.98.5.3 and the svn version to find the problem.
> >>
> >> Yes - just removed build dirs and did both from
> scratch.
> >> 0.98.5.3 - fine, full build log:
> >> http://www.robince.net/robince/mpl/build-0.98.5.3.log
> >> svn7250 - fails, full build log:
> >> http://www.robince.net/robince/mpl/build-svn7250.log
> >>
> >> The relevant sections of the logs (I think) are:
> >>
> >> Release
> >> -----------
> >> building 'matplotlib.backends._macosx' extension
> >>
> >> gcc -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk
> >> -fno-strict-aliasing -Wno-long-double
> -no-cpp-precomp
> >> -mno-fused-madd
> >> -fno-common -dynamic -DNDEBUG -g -O3
> >>
> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
> >>
> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
> >> -c src/_macosx.m -o
> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
> >>
> >> gcc -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk -g
> >> -bundle
> >> -undefined dynamic_lookup
> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o -o
> >>
> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
> >> -framework Cocoa
> >>
> >> SVN
> >> ------
> >> building 'matplotlib.backends._macosx' extension
> >>
> >> gcc -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk
> >> -fno-strict-aliasing -Wno-long-double
> -no-cpp-precomp
> >> -mno-fused-madd
> >> -fno-common -dynamic -DNDEBUG -g -O3
> >> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
> >>
> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
> >> -I/usr/local/include -I/usr/include
> -I/usr/X11R6/include
> >> -I.
> >>
> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
> >> -Isrc -Iagg24/include -I.
> >>
> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
> >> -c src/_macosx.m -o
> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
> >>
> >> g++ -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk -g
> >> -bundle
> >> -undefined dynamic_lookup
> >> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
> >>
> build/temp.macosx-10.3-i386-2.5/CXX/cxx_extensions.o
> >>
> build/temp.macosx-10.3-i386-2.5/CXX/cxxextensions.o
> >> build/temp.macosx-10.3-i386-2.5/CXX/cxxsupport.o
> >>
> build/temp.macosx-10.3-i386-2.5/CXX/IndirectPythonInterface.o
> >>
> build/temp.macosx-10.3-i386-2.5/src/agg_py_transforms.o
> >>
> build/temp.macosx-10.3-i386-2.5/src/path_cleanup.o
> >> -L/usr/local/lib
> >> -L/usr/lib -L/usr/X11R6/lib -lstdc++ -lm -o
> >>
> build/lib.macosx-10.3-i386-2.5/matplotlib/backends/_macosx.so
> >> -framework Cocoa
> >>
> >> ld: cycle in dylib re-exports with
> >>
> /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/lib/libGL.dylib
> >> collect2: ld returned 1 exit status
> >> error: command 'g++' failed with exit status 1
> >>
> >>
> >> Obviously lots of differences but I've no idea
> what would
> >> be causing it.
> >>
> >> Cheers
> >>
> >> Robin
> >>
> >
> >
> >
> >
> 
 
From: Michael L. <mgl...@gm...> - 2009年07月10日 20:18:16
Hi,
I was looking at the autocorrelation of a time series recently and it was
useful to scale the x-axis (i.e. multiply lags by the timestep of my actual
data). It's a trivial change, but it might be useful for others. Here's a
standalone version of axes.acorr:
def scaledacorr(x, stepsize=1, normed=False, detrend=mlab.detrend_none,
 usevlines=False, maxlags=None, **kwargs):
 import numpy as np
 x = detrend(np.asarray(x))
 Nx = len(x)
 y = x
 c = np.correlate(x, y, mode=2)
 if normed: c/= np.sqrt(np.dot(x,x) * np.dot(y,y))
 if maxlags is None: maxlags = Nx - 1
 if maxlags >= Nx or maxlags < 1:
 raise ValueError('maglags must be None or strictly '
 'positive < %d'%Nx)
 lags = np.arange(-maxlags,maxlags+1) * stepsize
 c = c[Nx-1-maxlags:Nx+maxlags]
 if usevlines:
 a = vlines(lags, [0], c, **kwargs)
 b = axhline(**kwargs)
 else:
 kwargs.setdefault('marker', 'o')
 kwargs.setdefault('linestyle', 'None')
 a, = plot(lags, c, **kwargs)
 b = None
 return lags, c, a, b
-- 
Michael Lerner, Ph.D.
IRTA Postdoctoral Fellow
Laboratory of Computational Biology NIH/NHLBI
5635 Fishers Lane, Room T909, MSC 9314
Rockville, MD 20852 (UPS/FedEx/Reality)
Bethesda MD 20892-9314 (USPS)
9 messages has been excluded from this view by a project administrator.

Showing results of 509

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