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

Showing 8 results of 8

From: Michael D. <md...@st...> - 2013年11月21日 22:44:36
When you use |--home|, distutils assumes you are referring to a home 
directory in which you have a tree of libraries in |lib|lib64| living 
there, so it appends |lib64/python| to the given path:
|> python setup.py install --home=/foo
running install
Checking .pth file supportin /foo/lib64/python/
error: can't create or remove files in install directory|
So the issue is not that your PYTHONPATH doesn't contain 
|/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1| 
(which it does) but that it doesn't contain 
|/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1/lib/python|.
With matplotlib 1.2.1, we used raw distutils and not setuptools, which 
does the same thing without the strict check. And that does allow users 
to shoot themselves in the foot, since the check is in fact right when 
it says things won't work:
|> git checkout v1.2.1
> mkdir ~/foo
> python setup.py install --home=~/foo
...
> PYTHONPATH=~/foo python
Python2.7.5 (default, Oct8 2013,12:19:40)
[GCC4.8.1 20130603 (Red Hat4.8.1-1)] on linux2
Type"help","copyright","credits" or "license" for more information.
>>>import matplotlib
Traceback (most recent call last):
 File"<stdin>", line1,in <module>
ImportError: No module named matplotlib|
I think what you really want to use is |--install-lib|, which will 
install the matplotlib library directly inside of the given path, which 
(if it's also on the `PYTHONPATH`) it will work.
Mike
On 11/21/2013 04:58 PM, Russell E. Owen wrote:
> I'm trying to install matplotlib from source in a specified location on
> a RedHat Enterprice Linux Server 6.4 box. The installation fails
> claiming that the installation directory is not on the PYTHONPATH, but
> that's wrong. See the appended log.
>
> Any idea how to get this to work? Matplotlib 1.2.1 installs just fine
> this way, but unfortunately I can't use it because I need horizontal
> histograms (a known bug that was fixed after 1.2.1).
>
> If I have to go all the way back to maplotlib 1.1.1 then does anyone
> know how old numpy has to be? I had hoped to use 1.8.0.
>
> -- Russell
>
> python setup.py install
> --home=/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1
> python setup.py ...
>
> and your PYTHONPATH environment variable currently contains:
>
> 
> '/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/lssteups/6.2.0.0+1/python:
> /lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/sconsUtils/6.2.0.0+1/python
> :/lsst/home/rowen/local/lib/python:/lsst/DC3/stacks/gcc445-RH6/28nov2011/
> eups/1.2.32/python:/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external
> /numpy/1.8.0+1/lib/python:/lsst/home/rowen/code/sandbox/Linux64/external/
> matplotlib/1.3.1+1'
>
> Here are some of your options for correcting the problem:
>
> * You can choose a different installation directory, i.e., one that is
> on PYTHONPATH or supports .pth files
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
 _
|\/|o _|_ _. _ | | \.__ __|__|_|_ _ _ ._ _
| ||(_| |(_|(/_| |_/|(_)(/_|_ |_|_)(_)(_)| | |
http://www.droettboom.com
From: Russell E. O. <ro...@uw...> - 2013年11月21日 21:58:31
I'm trying to install matplotlib from source in a specified location on 
a RedHat Enterprice Linux Server 6.4 box. The installation fails 
claiming that the installation directory is not on the PYTHONPATH, but 
that's wrong. See the appended log.
Any idea how to get this to work? Matplotlib 1.2.1 installs just fine 
this way, but unfortunately I can't use it because I need horizontal 
histograms (a known bug that was fixed after 1.2.1).
If I have to go all the way back to maplotlib 1.1.1 then does anyone 
know how old numpy has to be? I had hoped to use 1.8.0.
-- Russell
python setup.py install 
--home=/lsst/home/rowen/code/sandbox/Linux64/external/matplotlib/1.3.1+1
python setup.py ...
and your PYTHONPATH environment variable currently contains:
 
'/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/lssteups/6.2.0.0+1/python:
/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/sconsUtils/6.2.0.0+1/python
:/lsst/home/rowen/local/lib/python:/lsst/DC3/stacks/gcc445-RH6/28nov2011/
eups/1.2.32/python:/lsst/DC3/stacks/gcc445-RH6/28nov2011/Linux64/external
/numpy/1.8.0+1/lib/python:/lsst/home/rowen/code/sandbox/Linux64/external/
matplotlib/1.3.1+1'
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
 on PYTHONPATH or supports .pth files
From: Eric F. <ef...@ha...> - 2013年11月21日 19:40:39
On 2013年11月21日 8:45 AM, Eric Larson wrote:
> Hey Luis,
>
> I think in general the application of normalizations in DFT / FFT (or
> even the continuous transforms, for that matter) can vary from
> implementation to another, in terms of whether they're applied during
> the forward transform, inverse transform, or half on each. That sounds
> like what you're running into here. MATLAB and other packages (FFTW, and
> apparently whatever matplotlib uses internally for FFTs) tend to
> normalize during the inverse transform, so you would need to put the
> normalization in yourself to see Parseval's theorem work out, which is
> essentially what you're showing.
>
It is not a matter of how the FFT is normalized, but rather of whether 
one is calculating a power spectrum, or power spectral density (psd).
For example, see:
http://pubman.mpdl.mpg.de/pubman/item/escidoc:152164:1/component/escidoc:152163/395068.pdf
> To my mind, this isn't a bug, so much as something users should be made
> aware of so they understand the issues at stake. It would be good to add
> a note to the PSD computation about these normalization issues, assuming
> one doesn't already exist. I have not contributed to matplotlib before,
> but I'm happy to take a stab at this if people think it would be
> helpful. My guess is that matplotlib won't be changed to include the
> suggested normalization by default (but maybe it could be added as an
> option?) because this would break backward-compatibility for users that
> have taken this factor into account in their own code.
I think the mpl psd is consistent with other psd implementations and 
with the definition of the psd.
Eric
>
> Eric
>
>
>
> On Thu, Nov 21, 2013 at 10:30 AM, Luis Miguel García-Cuevas González
> <lui...@gm... <mailto:lui...@gm...>> wrote:
>
> Hello!
>
> I have a doubt about the way matplotlib computes (and plots) a psd.
> I have
> the following example code (I've imported pylab for convenience here):
>
> from pylab import *
>
> A = 10. ** (10. / 20.) / sqrt(2.) * 2. # This amplitude should
> give 10 dB
> frequency = 5.
> sampling_frequency = 1000.
> t_max = 12.
> t = arange(0., t_max, 1. / sampling_frequency)
> x = A * cos(2. * pi * frequency * t)
>
> Pxx, freqs = mlab.psd(x, Fs=sampling_frequency, NFFT=len(x),
> window=mlab.window_none)
>
> dB_actual = 20. * log10(rms_flat(x)) # dB_actual = 10., as expected
> dB_psd = 10. * log10(Pxx.max()) # dB_psd = 20.791812460476248
>
>
> As I understand, this should not happen this way. dB_psd should be
> equal to
> 10, as dB_actual. I can get it to compute the correct value with this:
>
> Pxx, freqs = mlab.psd(x / sqrt(t_max), Fs=sampling_frequency,
> NFFT=len(x),
> window=mlab.window_none)
>
> (i.e., dividing the variable by the square root of the time). Is
> this really
> the expected behavior or this is a bug?
>
> If it does matter, I'm using using matplotlib 1.3.1.
>
> Thanks for your help!
>
> --
> Luis Miguel García-Cuevas González
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and
> game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign
> up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> <mailto:Mat...@li...>
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Eric L. <lar...@gm...> - 2013年11月21日 18:46:19
Hey Luis,
I think in general the application of normalizations in DFT / FFT (or even
the continuous transforms, for that matter) can vary from implementation to
another, in terms of whether they're applied during the forward transform,
inverse transform, or half on each. That sounds like what you're running
into here. MATLAB and other packages (FFTW, and apparently whatever
matplotlib uses internally for FFTs) tend to normalize during the inverse
transform, so you would need to put the normalization in yourself to see
Parseval's theorem work out, which is essentially what you're showing.
To my mind, this isn't a bug, so much as something users should be made
aware of so they understand the issues at stake. It would be good to add a
note to the PSD computation about these normalization issues, assuming one
doesn't already exist. I have not contributed to matplotlib before, but I'm
happy to take a stab at this if people think it would be helpful. My guess
is that matplotlib won't be changed to include the suggested normalization
by default (but maybe it could be added as an option?) because this would
break backward-compatibility for users that have taken this factor into
account in their own code.
Eric
On Thu, Nov 21, 2013 at 10:30 AM, Luis Miguel García-Cuevas González <
lui...@gm...> wrote:
> Hello!
>
> I have a doubt about the way matplotlib computes (and plots) a psd. I have
> the following example code (I've imported pylab for convenience here):
>
> from pylab import *
>
> A = 10. ** (10. / 20.) / sqrt(2.) * 2. # This amplitude should give 10 dB
> frequency = 5.
> sampling_frequency = 1000.
> t_max = 12.
> t = arange(0., t_max, 1. / sampling_frequency)
> x = A * cos(2. * pi * frequency * t)
>
> Pxx, freqs = mlab.psd(x, Fs=sampling_frequency, NFFT=len(x),
> window=mlab.window_none)
>
> dB_actual = 20. * log10(rms_flat(x)) # dB_actual = 10., as expected
> dB_psd = 10. * log10(Pxx.max()) # dB_psd = 20.791812460476248
>
>
> As I understand, this should not happen this way. dB_psd should be equal
> to
> 10, as dB_actual. I can get it to compute the correct value with this:
>
> Pxx, freqs = mlab.psd(x / sqrt(t_max), Fs=sampling_frequency,
> NFFT=len(x),
> window=mlab.window_none)
>
> (i.e., dividing the variable by the square root of the time). Is this
> really
> the expected behavior or this is a bug?
>
> If it does matter, I'm using using matplotlib 1.3.1.
>
> Thanks for your help!
>
> --
> Luis Miguel García-Cuevas González
>
>
> ------------------------------------------------------------------------------
> Shape the Mobile Experience: Free Subscription
> Software experts and developers: Be at the forefront of tech innovation.
> Intel(R) Software Adrenaline delivers strategic insight and game-changing
> conversations that shape the rapidly evolving mobile landscape. Sign up
> now.
> http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Luis M. García-C. G. <lui...@gm...> - 2013年11月21日 18:30:37
Attachments: signature.asc
Hello!
I have a doubt about the way matplotlib computes (and plots) a psd. I have 
the following example code (I've imported pylab for convenience here):
 from pylab import *
 A = 10. ** (10. / 20.) / sqrt(2.) * 2. # This amplitude should give 10 dB
 frequency = 5.
 sampling_frequency = 1000.
 t_max = 12.
 t = arange(0., t_max, 1. / sampling_frequency)
 x = A * cos(2. * pi * frequency * t)
 Pxx, freqs = mlab.psd(x, Fs=sampling_frequency, NFFT=len(x),
 window=mlab.window_none)
 dB_actual = 20. * log10(rms_flat(x)) # dB_actual = 10., as expected
 dB_psd = 10. * log10(Pxx.max()) # dB_psd = 20.791812460476248
As I understand, this should not happen this way. dB_psd should be equal to 
10, as dB_actual. I can get it to compute the correct value with this:
 Pxx, freqs = mlab.psd(x / sqrt(t_max), Fs=sampling_frequency, NFFT=len(x),
 window=mlab.window_none)
(i.e., dividing the variable by the square root of the time). Is this really 
the expected behavior or this is a bug?
If it does matter, I'm using using matplotlib 1.3.1.
Thanks for your help!
-- 
Luis Miguel García-Cuevas González
From: Eric89GXL <lar...@gm...> - 2013年11月21日 17:53:04
Hello,
I have some some matplotlib code that we use for interactive plotting, and I
want to do non-interactive unit testing. This means I need to emulate
keypresses and mouse clicks. 
It is simple enough to do keypress unit testing by using:
fig.canvas.key_press_event('down')
This for example allows us to test that pressing "down" in a figure window
elicits the appropriate behavior.
However, I am having difficulty testing mouse clicks. We have behaviors
where users can click within an axis (e.g., fix.axes[1]) to elicit some
behavior. I have tried the following:
fig.canvas.button_press_event(0.5, 0.5, 1)
But within the event handler (which generally has structure
_mouse_click(event, params)), the "event" object does not have the
"event.inaxes" field populated correctly (it is always "None") despite my
emulated click @ (0.5, 0.5) sitting within one of the axes in the figure.
Does anyone know how to emulate either of these types of clicks?
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/Emulating-keypress-and-mouse-clicks-tp42534.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Gavin C. <why...@gm...> - 2013年11月21日 13:34:11
Hi,
I've been using the two chart types shown here:
https://github.com/whythawk/whiqicharts for a few years and finally got
round to sharing them.
I'm interested in presenting multiple, and multiple-dimension, time-series
data in ways that are easy to see, repeatable and printable. The comet
charts, for example, are a static version of Hans Rosling's Gapminder moving
bubble charts.
This is my first ever attempt at Github / open source release so would
appreciate the feedback. Originally these were embedded in Django views
hence any fruity use of the Artist.
Regards
Gavin
>--------------------<
Gavin Chait is a data engineer and development economist at Whythawk.
uk.linkedin.com/in/gavinchait | twitter.com/GavinChait | www.whythawk.com
From: David K. <da...@da...> - 2013年11月21日 00:28:53
 Hello !
I would like to have some hints about the matplotlib usage, especially
the PGF/tikz backend.
I use a latex document, and almost only tikz figures.
I have a couple of problems with the matplotlib package.
The first is the preemptive behaviour of the matplotlib package over the
used fonts. I would like the text to be let "as it", without adding
stuff like \sffamily\ttffont, and so on.
For example, if I write "$L^2$" as a legend axis, I want this text to be
let "as it", without any modification by the pgf backend.
A second point, is that I would like to not use the
\begin{pgffigure}\end{pgffigure}, the \makeatletter and fancy stuff like
that. I want to take care myself of the latex code. Is it possible ?
Finally, Would it be possible to specify the size of the graphic
somewhere ? The documentation is rather vague about it.
Thank you for help.

Showing 8 results of 8

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 によって変換されたページ (->オリジナル) /