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

Showing 12 results of 12

From: Laurent D. <lau...@gm...> - 2009年10月16日 21:38:21
Hello,
I'm investigating a way to make a sort of imshow that is scrolling from
right to left.
My idea is to copy in a blit buffer from (1,0) to (xmax,ymax).
Blit it @(0,0) (xmax-1,ymax)
And then draw a cmap'ed line @x=xmax.
 
So here are my question:
 
How to draw a line that use a cmap=jet (for example)?
I've taken a look at Line2D but it has no cmap argument. The only thing I've
found is drawing a line with only one color.
 
Any idea appreciated!
 
Cheers,
Laurent
From: Laurent D. <LDu...@ma...> - 2009年10月16日 21:37:53
Hello,
I'm investigating a way to make a sort of imshow that is scrolling from
right to left.
My idea is to copy in a blit buffer from (1,0) to (xmax,ymax).
Blit it @(0,0) (xmax-1,ymax)
And then draw a cmap'ed line @x=xmax.
 
So here are my question:
 
How to draw a line that use a cmap=jet (for example)?
I've taken a look at Line2D but it has no cmap argument. The only thing
I've found is drawing a line with only one color...
 
Any idea appreciated!
 
Cheers,
Laurent
 
 
From: Pierre GM <pgm...@gm...> - 2009年10月16日 19:59:41
On Oct 16, 2009, at 2:59 PM, Ryan May wrote:
> On Wed, Oct 14, 2009 at 3:59 PM, John Hunter <jd...@gm...> 
> wrote:
>> I don't have a strong opinion on this -- making it more customizable
>> is a good thing -- this came up at scipy as well, where I contributed
>> a patch to make the AutoDateFormatter a little more customizable by
>> exposing a scaled dictionary mapping the scale to a format string. 
>> As
>> long as the extension to the AutoDateLocator preserves the core
>> functionality, I say have at it.
>
> Here's a patch that implements the ideas I have. To the best of my
> ability, it preserves the same behavior as before, it just opens it up
> to configuration by the user instead of being hard-coded. It adds:
>
> 1) Configuring the minimum number of ticks, which determines whether
> to do yearly, monthly, etc. ticking
>
> 2) Configuring the maximum number of ticks, which is used to select
> what interval of ticking to use. This is actually
> done on a per-frequency basis. This helps to keep in line with
> previous behavior and is useful for keeping tick spacing in line with
> what the label would be for a given frequency. The user can also
> simply pass an integer that
> gives the maximum for all frequencies.
>
> 3) A dictionary of intervals corresponding to each frequency. This
> keeps the previous functionality of appropriate intervals for each
> frequency, but also opens it up to user configuration.
>
> 4) Optional ticking on multiples of the interval. Previously, if you
> were ticking with, say, 10 minute intervals, and the range happened to
> start at 33 minutes, you'd get ticks at 33, 43, 53, etc. With this
> flag set, the ticks instead end up at 40, 50, 0, 10, etc.
>
> I'd appreciate anyone looking this over for any glaring problems
> before I check this in. I've done my best to preserve old
> functionality, though I'm still working on getting the unit tests to
> run here. It also passes my own testing here when I fiddle with the
> new knobs that have been exposed. My one question is: how important
> is keeping API compatibility? The constructor tries to follow the
> convention of the rest of the module (tz is last or nearly so), but
> this breaks compatibility (where tz was the only argument). Also, to
> me, it would be nice to tick multiples of the interval by default.
>
> Thoughts?
Have you checked scikits.timeseries.lib.plotlib ? We provide some 
functions that adapt the ticks to the frequency of you base series, 
but also according to the range of the axes. For example, if you work 
with a 100-y daily timeseries, you'll have major ticks every 5 years 
if you plot the whole series, every month if you plot or zoom on one 
year only, etc.
it may be worthwhile to give it a try. I'd be happy to help adapting 
our code to remove the dependency on scikits.timeseries if needed...
From: Laurent D. <LDu...@ma...> - 2009年10月16日 19:21:47
Bug reported:
https://sourceforge.net/tracker/index.php?func=detail&aid=2880692&group_id=80706&atid=560720
Does anybody where I could dig a little to try to correct it?
It a really needed feature for me, so if I could help...
Cheers,
Laurent
> -----Message d'origine-----
> De : Jae-Joon Lee [mailto:lee...@gm...]
> Envoyé : jeudi 15 octobre 2009 05:23
> À : Laurent Dufrechou
> Cc : mat...@li...
> Objet : Re: [Matplotlib-users] Little issue with blitting technique
> 
> On Tue, Oct 13, 2009 at 1:02 PM, Laurent Dufrechou
> <LDu...@ma...> wrote:
> > Hello,
> >
> > I've tested so far with wx and QT4 backend.
> > The two are buggy.
> > Easy way to reproduce the bug (another way I mean)
> >
> > ax = p.subplot(212)
> > ax2 = p.subplot(211)
> >
> 
> On mac with wxgtk, it works fine.
> Maybe this is an windows only issue.
> 
> > and the two backends got the same error.
> 
> Since nobody steped in, and I don't use windows, can you file a bug
> report.
> 
> http://sourceforge.net/tracker/?atid=560720&group_id=80706&func=browse
> 
> Please provide a short, complete example that reproduces the bug. Also
> the error message you get.
> 
> -JJ
> 
> 
> >
> > Note that I'm under windows. I'll try under linux tonight just to
> check.
> > I'll also try gtk backend as you suggest.
> >
> > Update in next email :)
> >
> >> -----Message d'origine-----
> >> De : Jae-Joon Lee [mailto:lee...@gm...]
> >> Envoyé : mardi 13 octobre 2009 18:36
> >> À : Laurent Dufrechou
> >> Cc : mat...@li...
> >> Objet : Re: [Matplotlib-users] Little issue with blitting technique
> >>
> >> I haven't tested it with qt4, but with gtk, add_axes DOES work.
> >>
> >> So, can you try other backends and see if they work?
> >>
> >> And, I believe that add_subplot -> add_axes is a only change you
> made?
> >>
> >> Unless the problem is persistent among other backends, I hope other
> >> developers who use qt4 backend step in and help.
> >>
> >> Regards,
> >>
> >> -JJ
> >>
> >>
> >> On Thu, Oct 8, 2009 at 11:30 AM, Laurent Dufrechou
> >> <LDu...@ma...> wrote:
> >> > Hello,
> >> >
> >> >
> >> >
> >> > I’ve just discovered blitting technique to improve performances.
> >> >
> >> > I’m using this example
> >> >
> >>
> http://matplotlib.sourceforge.net/examples/animation/animation_blit_qt4
> >> .html
> >> >
> >> >
> >> >
> >> > I encounter an issue if instead of using subplot I use add_axes
> >> method to
> >> > hand define where I want my plot.
> >> >
> >> > In this case blitting is no more working like if restore_region
> was
> >> not
> >> > restoring context...
> >> >
> >> >
> >> >
> >> > def __init__(self):
> >> >
> >> >     FigureCanvas.__init__(self, Figure())
> >> >
> >> >
> >> >
> >> >     #self.ax = self.figure.add_subplot(111)
> >> >
> >> >     self.ax = self.figure.add_axes([0.1,0.1,0.8,0.2])
> >> >
> >> >
> >> >
> >> > Any idea why in this case the example given is not working?
> >> >
> >> >
> >> >
> >> > Cheers,
> >> >
> >> > Laurent
> >> >
> >> > ------------------------------------------------------------------
> ---
> >> ---------
> >> > Come build with us! The BlackBerry(R) Developer Conference in SF,
> CA
> >> > is the only developer event you need to attend this year.
> Jumpstart
> >> your
> >> > developing skills, take BlackBerry mobile applications to market
> and
> >> stay
> >> > ahead of the curve. Join us from November 9 - 12, 2009. Register
> now!
> >> > http://p.sf.net/sfu/devconference
> >> > _______________________________________________
> >> > Matplotlib-users mailing list
> >> > Mat...@li...
> >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >> >
> >> >
> >
From: Ryan M. <rm...@gm...> - 2009年10月16日 18:27:04
On Fri, Oct 16, 2009 at 12:23 PM, Michael Waters <mjw...@um...> wrote:
> I am making regular Cartesian coordinate graphs with linear scales on
> the axis. I would really like to have automatic subticks to make reading
> data easier. Is there an easy way to do this?
Yes, you just need to set a locator for the minor ticks, which is set
to NullLocator by default.
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
plt.plot([1,2,3])
ax = plt.gca()
ax.xaxis.set_minor_locator(MaxNLocator(nbins=30, steps=[1, 2, 5, 10]))
plt.show()
You might also want to look at:
http://matplotlib.sourceforge.net/examples/pylab_examples/major_minor_demo1.html?highlight=codex%20minor
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Michael W. <mjw...@um...> - 2009年10月16日 17:23:37
I am making regular Cartesian coordinate graphs with linear scales on 
the axis. I would really like to have automatic subticks to make reading 
data easier. Is there an easy way to do this?
Thanks
-mike w.
From: Darren D. <dsd...@gm...> - 2009年10月16日 13:57:51
On Thu, Oct 15, 2009 at 10:38 AM, Christian Meesters
<mee...@im...> wrote:
> Hi,
>
> I'd like to have all sub-fonts (labels, tick labels, text) sans-serif
> for a series of plots per default. However the appropriate settings
> in .matplotlibrc apparently don't work and this also does not work:
>
> import matplotlib as mpl
> mpl.rcParams['text.usetex'] = True
> mpl.rcParams['font.family'] = 'sans-serif'
> mpl.rcParams['font.sans-serif'] = 'Bitstream Vera Sans'
usetex uses latex's math mode for rendering ticklabels, and mathmode
is rendered in serif. We tried supporting sans-serif once, and it
turned out to be too complicated to cover all the corner cases. I
think there may be a latex package that can be loaded for sans-serif
math mode, but I don't remember what it is called. You could add that
package invocation to your text.latex.preamble, but please note that
text.latex.preamble is not officially supported (because it is so
flexible, we don't want to troubleshoot latex issues on this list.)
Darren
From: Axel G. <ag...@ba...> - 2009年10月16日 13:53:54
Attachments: test.py
Hi, I need to know why the attached code works in one case and takes 
forever to run in the other one.
I don't think I've done anything wrong and I tried everything that came 
to my mind now.
If you use "x1 = mu + sigma * np.random.randn(1000)" instead of "x1 = 
np.array([np.float64(val / 2.0) for val in x0], np.float64)"
Why doesn't this work if its the same array divided by 2 ?
Thanks,
Axel Gembe
From: Axel G. <ag...@ba...> - 2009年10月16日 13:53:53
Axel Gembe wrote:
> Hi, I need to know why the attached code works in one case and takes 
> forever to run in the other one.
> I don't think I've done anything wrong and I tried everything that 
> came to my mind now.
> If you use "x1 = mu + sigma * np.random.randn(1000)" instead of "x1 = 
> np.array([np.float64(val / 2.0) for val in x0], np.float64)"
> Why doesn't this work if its the same array divided by 2 ?
>
> Thanks,
>
> Axel Gembe
>
OK, actually I didn't construct x1 from x1 but from x0 in the code.
The problem only happens when both arrays have the same length, content 
does not matter.
Axel Gembe
Seems that the following lines did the trick with matplotlib 0.91.2
 xy_pixel = self.a3.transData.xy_tup((x3,y3))
 x1, y1 = self.a1.transData.inverse_xy_tup(xy_pixel)
Thanks
2009年10月16日 LB <bra...@gm...>
> It would be very fine to me, but unfortunately, I have to use matplotlib
> 0.91.2.
> Is there a way to adapt this to the old transform API ?
>
> Thanks
>
> --
> LB
>
It would be very fine to me, but unfortunately, I have to use matplotlib
0.91.2.
Is there a way to adapt this to the old transform API ?
Thanks
-- 
LB
From: <fra...@li...> - 2009年10月16日 09:24:24
Hi to all,
I'm trying to make a contour plot from the beginning, I mean from a 
3 column data file X,Y,Z, but I don't know how to do it without, e.g., origin 
and I want to use and to learn better matplotlib.
what's the first thing to do?
I imagine something like gridding data, but I've done a lot of attempts 
obtaining just a lot of error output.
which is the way to grid with matplolib?
after the grid, I have to use the contour(Z). In each case I've tried, also 
with the example of the matplotlib, It complains about some missing libraries 
of numpy (numpy.ma): I tried to install from scratch...
I surfed the net, I 
found something but I'm a newbie both in matplolib and in python, so I'd be 
very happy if someone of you could help me from the beginning.
Thanks a lot in 
advance
Francesco
p.s.
my O.S.
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION="Ubuntu 8.04.3 
LTS"
python -V
Python 2.5.2

Showing 12 results of 12

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