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



Showing 9 results of 9

From: Jae-Joon L. <lee...@gm...> - 2009年09月08日 18:14:10
On Tue, Sep 8, 2009 at 11:51 AM, Yann
Goudard<mat...@al...> wrote:
> Hi,
>
> I have the same behaviour with LocatableAxes. HostAxes, ParasiteAxes and
> LocatableAxes depend on 'mpl_toolkits.axes_grid.axislines.Axes'. It must
> be the matter origin.
Yes, and this was because I forgot to implement some necessary methods.
This is now fixed in the svn trunk. So if you can,please give it a try.
> This another example should draw a grid but does not:
>
> import wx
> from wx import Frame
> from matplotlib.backends.backend_wxagg import FigureFrameWxAgg,
> FigureCanvasWxAgg
> from matplotlib.figure import Figure
> from mpl_toolkits.axes_grid.axes_divider import LocatableAxes
>
> fig = Figure((1, 1), 50)
> axes = LocatableAxes(fig, [0, 0, 1, 1])
> # axes.toggle_axisline(False)
> axes.grid(True)
> fig.add_axes(axes)
>
> app = wx.PySimpleApp()
> my_viewer = FigureFrameWxAgg(-1, fig)
> my_viewer.Show()
> app.MainLoop()
>
> If you uncomment axes.toggle_axisline(False), it works cause it uses
> normal 'matplolib.axes.Axes' behaviour. It is not a matter for common
> use but if you need 'AxesZero', this trick does not work.
What the toggle_axisline does is simply to make the xaxis and yaxis
(which are responsible for drawing ticks, ticklabels, etc in the
mainline mpl) visible again, and make axis["bottom"] and etc
invisible.
One workaround is to make xaxis and yaxis visible but pnly to draw the
gridlines. Something like below.
ax.toggle_axisline(True)
ax.grid(True)
ax.gridlines.set_visible(False) # this is just to make the code not to
draw gridlines twice in future release of mpl.
ax.xaxis.set_visible(True)
ax.yaxis.set_visible(True)
for t in ax.xaxis.majorTicks + ax.yaxis.majorTicks:
 t.gridOn = True
 t.tick1On = False
 t.tick2On = False
 t.label1On = False
 t.label2On = False
Let me know if this does not work, or there is a case that this cannot be used.
Regards,
-JJ
>
> Yann
>
>
> On 09/07/2009 10:37 PM, Andreas Fromm wrote:
>> thanks Sebastian,
>>
>> you are right, your code works here too. But i don't get it work in my
>> multi y-axes plot from the matplotlib examples
>> (http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes.html).
>> Even with linear plots, i get no gridlines.
>>
>> Any idea, whats wrong here?
>>
>> minimal code example:
>> #######################
>> import matplotlib.pyplot as plt
>> from mpl_toolkits.axes_grid.parasite_axes import HostAxes, ParasiteAxes
>>
>> fig = plt.figure(1)
>> fig.clf()
>> #plt.grid(True)
>> host = HostAxes(fig, [0.15, 0.1, 0.65, 0.8])
>> fig.add_axes(host)
>>
>> host.plot([0, 10, 100], [0, 10, 100], label='host')
>>
>> host.grid(True) #?
>> host.yaxis.grid(True) #?
>>
>> host.yaxis.set_scale('log') #?
>>
>> plt.draw()
>> plt.show()
>> #######################
>>
>> Greets,
>> Andreas
>>
>>
>> Sebastian Busch schrieb:
>>
>>> from matplotlib.pyplot import *
>>>
>>> plot([1,10,100],[1,10,100])
>>> grid()
>>>
>>> yscale('log')
>>> xscale('log')
>>>
>>> works here.
>>>
>>> best,
>>> sebastian.
>>>
>>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>> trial. Simplify your report design, integration and deployment - and focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now. http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Watson, N. <nwa...@un...> - 2009年09月08日 17:41:17
Hi,
 
I am running Windows Vista 64-bit and have installed matplotlib from http://sourceforge.net/projects/matplotlib/ via the "Download Now!". I currently have Numpy version 1.3.0 installed in the same location as matplotlib (C:\Python26\Lib\site-packages\). I have tried importing matplotlib, for example import matplotlib.pyplot like in the documented examples and unfortunately this does not work for me. I have searched in site-packages, and elsewhere, for files/directories on my computer named matplotlit or pyplot and found no hits. I have even reinstalled matplot lib and still have the same problems. Has anyone else experienced this problem? 
 
 
-Nathan 
From: Yann G. <mat...@al...> - 2009年09月08日 16:51:57
Hi,
I have the same behaviour with LocatableAxes. HostAxes, ParasiteAxes and 
LocatableAxes depend on 'mpl_toolkits.axes_grid.axislines.Axes'. It must 
be the matter origin.
This another example should draw a grid but does not:
import wx
from wx import Frame
from matplotlib.backends.backend_wxagg import FigureFrameWxAgg, 
FigureCanvasWxAgg
from matplotlib.figure import Figure
from mpl_toolkits.axes_grid.axes_divider import LocatableAxes
fig = Figure((1, 1), 50)
axes = LocatableAxes(fig, [0, 0, 1, 1])
# axes.toggle_axisline(False)
axes.grid(True)
fig.add_axes(axes)
app = wx.PySimpleApp()
my_viewer = FigureFrameWxAgg(-1, fig)
my_viewer.Show()
app.MainLoop()
If you uncomment axes.toggle_axisline(False), it works cause it uses 
normal 'matplolib.axes.Axes' behaviour. It is not a matter for common 
use but if you need 'AxesZero', this trick does not work.
Yann
On 09/07/2009 10:37 PM, Andreas Fromm wrote:
> thanks Sebastian,
>
> you are right, your code works here too. But i don't get it work in my
> multi y-axes plot from the matplotlib examples
> (http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes.html).
> Even with linear plots, i get no gridlines.
>
> Any idea, whats wrong here?
>
> minimal code example:
> #######################
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.parasite_axes import HostAxes, ParasiteAxes
>
> fig = plt.figure(1)
> fig.clf()
> #plt.grid(True)
> host = HostAxes(fig, [0.15, 0.1, 0.65, 0.8])
> fig.add_axes(host)
>
> host.plot([0, 10, 100], [0, 10, 100], label='host')
>
> host.grid(True) #?
> host.yaxis.grid(True) #?
>
> host.yaxis.set_scale('log') #?
>
> plt.draw()
> plt.show()
> #######################
>
> Greets,
> Andreas
>
>
> Sebastian Busch schrieb:
> 
>> from matplotlib.pyplot import *
>>
>> plot([1,10,100],[1,10,100])
>> grid()
>>
>> yscale('log')
>> xscale('log')
>>
>> works here.
>>
>> best,
>> sebastian.
>>
>> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Giuseppe A. <giu...@gm...> - 2009年09月08日 16:18:18
Hi list,
I have some files with data stored in columns:
x1   y1   z1
x2   y2   z2
x3   y3   z3
x4   y4   z4
x5   y5   z5
.......
and I need to make a contour plot of this data using matplotlib. The
problem is that contour plot functions usually handle a different kind
of input:
X=[[x1,x2,x3,x4,x5,x6],
[x1,x2,x3,x4,x5,x6],
[x1,x2,x3,x4,x5,x6],...
Y=[[y1,y1,y1,y1,y1,y1],
[y2,y2,y2,y2,y2,y2],
[y3,y3,y3,y3,y3,y3],.....
Z=[[z1,z2,z3,z4,z5,z6],
[z7,z8,zz9,z10,z11,z12],....
I usually load data using 3 lists: x, y and z; I wonder if there is
any function which is able to take these 3 lists and return the right
input for matplotlib functions.
cheers
g
From: Jae-Joon L. <lee...@gm...> - 2009年09月08日 15:50:06
This is a bug in the axes_grid toolkit. As a matter of fact, gridlines
in rectlinear coordinate are not implemented yet.
Unfortunately, I don't see any easy workarounds.
You may use mpl's original axis artists, but some of the functionality
of axes_grid toolkit may be lost.
 host.toggle_axisline(False)
 host.yaxis.set_ticks_position("left")
 host.yaxis.grid()
 host.set_yscale("log")
With new spine support in mpl, I think a similar plot can be drawn
without using axes_grid toolkit.
Regards,
-JJ
On Mon, Sep 7, 2009 at 4:37 PM, Andreas Fromm<an...@gm...> wrote:
> thanks Sebastian,
>
> you are right, your code works here too. But i don't get it work in my
> multi y-axes plot from the matplotlib examples
> (http://matplotlib.sourceforge.net/examples/axes_grid/demo_parasite_axes.html).
> Even with linear plots, i get no gridlines.
>
> Any idea, whats wrong here?
>
> minimal code example:
> #######################
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid.parasite_axes import HostAxes, ParasiteAxes
>
> fig = plt.figure(1)
> fig.clf()
> #plt.grid(True)
> host = HostAxes(fig, [0.15, 0.1, 0.65, 0.8])
> fig.add_axes(host)
>
> host.plot([0, 10, 100], [0, 10, 100], label='host')
>
> host.grid(True) #?
> host.yaxis.grid(True) #?
>
> host.yaxis.set_scale('log') #?
>
> plt.draw()
> plt.show()
> #######################
>
> Greets,
> Andreas
>
>
> Sebastian Busch schrieb:
>> from matplotlib.pyplot import *
>>
>> plot([1,10,100],[1,10,100])
>> grid()
>>
>> yscale('log')
>> xscale('log')
>>
>> works here.
>>
>> best,
>> sebastian.
>>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Gökhan S. <gok...@gm...> - 2009年09月08日 15:15:45
On Tue, Sep 8, 2009 at 7:45 AM, Armando Serrano Lombillo <ars...@gm...
> wrote:
> Hello, I'm finding it a little difficult to make a plot with dates:
>
> I have an array with 2 columns. The first one is seconds since a certain
> date (let's say 8th September, 8:00am). The second one is the variable I
> want to plot. The series spans several months so I want to have the major
> ticks be months (and have the name of the month printed below) and the minor
> ticks be days. I'm sure this is very easy to plot but I don't know how to,
> any help?
>
> Armando.
>
Hello,
You can experiment with the following lines to re-arrange your ticks.
current_axis = gca()
current_axis.xaxis.set_major_formatter()
Similarly set_minor_formatter for x and y axes.
See these links too
http://matplotlib.sourceforge.net/api/dates_api.html
http://matplotlib.sourceforge.net/examples/api/date_index_formatter.html
-- 
Gökhan
From: Michael D. <md...@st...> - 2009年09月08日 12:49:31
I just went in and changed the default file downloads back to correct 
values, but alas, it appears to have no effect. There is some hints in 
the (many) related SF bugs that there may be a delay associated with 
these settings, so I will check back again at the end of the day.
Mike
On 09/04/2009 05:46 AM, Fabrice Silva wrote:
> Le jeudi 03 septembre 2009 à 20:16 -0500, John Hunter a écrit :
> 
>> On Thu, Sep 3, 2009 at 8:04 PM, Alan G Isaac<ala...@gm...> wrote:
>> 
>>> The default download from the Matplotlib page
>>> link to http://sourceforge.net/projects/matplotlib/
>>> which once again highlights basemap. (I think
>>> this was fixed at one point.)
>>> 
>> I'm not seeng this, nor am I seeing basemap settings in the File
>> Manager which would trigger this. Of course, the default download is
>> platform specific, which may be why I am not seeing this, so please
>> give us as much info as possible about your platform (mainly the OS)
>>
>> When I click on the green download button at
>> http://sourceforge.net/projects/matplotlib using mac OSX 10.5, I get
>> redirected to the mpl 0.99 OSX download::
>>
>> https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99/matplotlib-0.99.0-py2.5-macosx10.5.dmg/download
>> 
> Strangely, the green button points to
> http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-0.99/matplotlib-0.99.0-py2.5-macosx-10.3-i386.egg/download
> when I browse on a linux (debian) machine with epiphany (which uses
> gecko, the firefox engine). Why macosx ?
>
> 
From: Armando S. L. <ars...@gm...> - 2009年09月08日 12:45:23
Hello, I'm finding it a little difficult to make a plot with dates:
I have an array with 2 columns. The first one is seconds since a certain
date (let's say 8th September, 8:00am). The second one is the variable I
want to plot. The series spans several months so I want to have the major
ticks be months (and have the name of the month printed below) and the minor
ticks be days. I'm sure this is very easy to plot but I don't know how to,
any help?
Armando.
From: David H. <dav...@gm...> - 2009年09月08日 02:23:12
Arthur,
I wrote the date2index function and I think what you are seeing is a bug
that I fixed a couple of months ago. By using the latest version of
netcdf4-python, not only should this bug disappear, but you'll also find
that date2index now supports different selection methods: 'exact', 'before',
'after', 'nearest', that should help with your use case.
If this does not fix the problem you are seeing, I'd appreciate having a
copy of the file and code to reproduce the problem and find a solution.
HTH,
David Huard
On Mon, Sep 7, 2009 at 9:27 AM, Arthur M. Greene <am...@ir...>wrote:
> Hi All,
>
> The problem is not with fetching the data slice itself, but finding the
> correct indices to specify, particularly with the time dimension. The
> below examples refer to a remote dataset that I can open and slice using
> indices, as in
>
> slice = remoteobj.variables['tas'][:120,20:40,30:50].
>
> However, I have problems when trying to use the syntax in plotsst.py or
> pnganim.py (from the examples) to find time indices:
>
> In [107]: from datetime import datetime as dt
> In [108]: date0 = dt(1951,1,1,0)
> In [110]: print date0
> 1951年01月01日 00:00:00
>
> In [125]: timedata = remoteobj.variables['time']
> In [126]: nt0 = date2index(date0,timedata)
> ---------------------------------------------------------------------------
> AssertionError Traceback (most recent call last)
>
> /home/amg/work/nhmm/<ipython console> in <module>()
>
>
> /usr/local/cdat/trunk/lib/python2.5/site-packages/mpl_toolkits/basemap/__init__.pyc
>
> in date2index(dates, nctime, calendar)
> 3924 Returns an index or a sequence of indices.
> 3925 """
> -> 3926 return netcdftime.date2index(dates, nctime, calendar=None)
> 3927
> 3928 def maskoceans(lonsin,latsin,datain,inlands=False):
>
>
> /usr/local/cdat/trunk/lib/python2.5/site-packages/mpl_toolkits/basemap/netcdftime.pyc
>
> in date2index(dates, nctime, calendar)
> 986
> 987 # Perform check again.
> --> 988 _check_index(index, dates, nctime, calendar)
> 989
> 990 # convert numpy scalars or single element arrays to python
> ints.
>
>
> /usr/local/cdat/trunk/lib/python2.5/site-packages/mpl_toolkits/basemap/netcdftime.pyc
>
> in _check_index(indices, dates, nctime, calendar)
> 941 for n,i in enumerate(indices):
> 942 t[n] = nctime[i]
> --> 943 assert numpy.all( num2date(t, nctime.units, calendar) == dates)
> 944
> 945
>
> AssertionError:
>
> ---------------------------------------------------------
>
> It turns out that date0 corresponds best to index 1080:
>
> In [139]: remoteobj.variables['time'][1080]
> Out[139]: 32865.5
>
> In [141]: num2date(32865.5,timedata.units,timedata.calendar)
> Out[141]: 1951年01月16日 12:00:00
>
> This isn't the _exact_ date and time I had specified, but
>
> In [142]: date0 = dt(1951,01,16,12,00,00)
> In [143]: print date0
> 1951年01月16日 12:00:00
>
> In [144]: date2index(date0,timedata,timedata.calendar)
>
> produces the same AssertionError. Where is the problem?
>
> What I would _like_ to do is to issue a simple call using coordinates
> rather than the indices, of the form:
>
> slice = variable[date0:date1,[plev],lat0:lat1,lon0:lon1],
>
> or similar, preferably without writing a whole module just to find the
> correct indices. I need to fetch similar slices from a group of models,
> having time axes that may each be defined slightly differently --
> different calendars, time point set at a different day of the month,
> etc. (It's monthly data and I'm specifying only monthly bounds, even
> though the calendar may be defined as "days since 1860...") I need to
> automate the process so I get back the correct slab regardless.
>
> Suggestions appreciated!
>
> Thx,
>
> Arthur
>
>
> *^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*
> Arthur M. Greene, Ph.D.
> The International Research Institute for Climate and Society (IRI)
> The Earth Institute, Columbia University, Lamont Campus
>
> amg at iri dot columbia dot edu | http://iri.columbia.edu
> *^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*^*~*
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

Showing 9 results of 9

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