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



Showing results of 397

<< < 1 .. 4 5 6 7 8 .. 16 > >> (Page 6 of 16)
From: Hana S. <ha...@cs...> - 2010年06月19日 06:00:46
# otool -L 
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so:
 /Library/Frameworks/Tcl.framework/Versions/8.4/Tcl (compatibility 
version 8.4.0, current version 8.4.19)
 /Library/Frameworks/Tk.framework/Versions/8.4/Tk (compatibility 
version 8.4.0, current version 8.4.19)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 88.3.10)
I needed to modify the path in the second command, since matplotlib was 
installed into /Library/Python/2.6/site-packages. Could that be the 
issue? Anyway, here is the output:
# otool -L /Library/Python/2.6/site-packages/matplotlib/backends/_tkagg.so
/Library/Python/2.6/site-packages/matplotlib/backends/_tkagg.so:
 /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current 
version 7.9.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 125.0.1)
 /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 
1.2.3)
 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl 
(compatibility version 8.5.0, current version 8.5.7)
 /System/Library/Frameworks/Tk.framework/Versions/8.5/Tk 
(compatibility version 8.5.0, current version 8.5.7)
I see there are some compatibility issues. What would be the best way to 
deal with it?
Thanks,
Hana
On 6/18/10 2:07 PM, Friedrich Romstedt wrote:
> 2010年6月18日 Hana Sevcikova<ha...@cs...>:
> 
>> I installed python-2.6.5-macosx10.3-2010年03月24日.dmg from python.org. (Sorry,
>> I should have mentioned that before.)
>> 
> Hmm, could you please run:
>
> otool -L /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so
> otool -L /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/_tkagg.so
>
> and post the output (copy to clipboard with | pbcopy)
>
> Friedrich
> 
From: Friedrich R. <fri...@gm...> - 2010年06月18日 21:07:41
2010年6月18日 Hana Sevcikova <ha...@cs...>:
> I installed python-2.6.5-macosx10.3-2010年03月24日.dmg from python.org. (Sorry,
> I should have mentioned that before.)
Hmm, could you please run:
otool -L /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_tkinter.so
otool -L /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/_tkagg.so
and post the output (copy to clipboard with | pbcopy)
Friedrich
From: R. P. S. <R.S...@um...> - 2010年06月18日 20:53:39
Has anyone created installation package for matplotlib 0.99.3 that is 
compatible with MAC OS 10.5 and Python 2.6? One one on the download 
site for MAC OS 10.6 doesn't work on my system (presumably because I'm 
still working with Leopard because everything else is up to date).
-- 
R. Padraic Springuel
Research Assistant
Department of Physics and Astronomy
University of Maine
Bennett 309
Office Hours: By Appointment Only
From: Hana S. <ha...@cs...> - 2010年06月18日 20:16:39
I installed python-2.6.5-macosx10.3-2010年03月24日.dmg from python.org. 
(Sorry, I should have mentioned that before.)
Hana
On 6/18/10 7:11 AM, Friedrich Romstedt wrote:
> 2010年6月17日 Hana Sevcikova<ha...@cs...>:
> 
>> I installed matplotlib-0.99.3-py2.6-macosx10.6.dmg on MacOS X 10.6.3,
>> python 2.6.5. But I get an error when running the histogram example from
>> http://matplotlib.sourceforge.net/examples/api/histogram_demo.html
>> 
> Have you compiled Python yourself? I'm asking because Python 2.6.5
> from Python.org is maybe linked against another Tcl/Tk than it links
> to when you compile yourself. (I guess the matplotlib._tkagg module
> does some patchy things.)
>
> Friedrich
> 
From: Eric F. <ef...@ha...> - 2010年06月18日 18:21:59
On 06/18/2010 07:31 AM, Ryan May wrote:
> On Thu, Jun 17, 2010 at 11:39 AM, Bill Eaton<ee...@ae...> wrote:
>> I'm struggling to figure out how to format my data so that I can use dates
>> as x-data.
> <SNIP>
>> I tried to import my own data. It looks like
>> 2005年03月04日,0.923115796
>> 2005年03月05日,0.915828724
>> 2005年03月06日,0.442521474
>> 2005年03月07日,0.997096213
>> 2005年03月08日,0.867752118
Try matplotlib's mlab.csv2rec. It has a lot of magic built-in, 
including automatic date recognition.
Eric
>> And to import, I use recarray
>> myarray = np.loadtxt(fullfile, dtype=[('date', '|O4'), ('ydata',
>> 'float')], delimiter = ',')
>> rx = myarray.view(np.recarray)
>>
>> Data imports fine. But when I go to plot, I get the following error
>> ValueError: setting an array element with a sequence.
>> WARNING: Failure executing file:<bogus.py>
>
> You need to give np.loadtxt a converter so that it converts that first
> column of strings into datetime objects:
>
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib import dates
> from datetime import datetime
> from StringIO import StringIO
>
> s='''
> 2005年03月04日,0.923115796
> 2005年03月05日,0.915828724
> 2005年03月06日,0.442521474
> 2005年03月07日,0.997096213
> 2005年03月08日,0.867752118'''
>
> dateparser = lambda s: datetime.strptime(s, '%Y-%m-%d')
> dt = np.dtype([('date', np.object),('ydata', np.float)])
> d = np.loadtxt(StringIO(s), dtype=dt, converters={0:dateparser}, delimiter=',')
> plt.plot(d['date'], d['ydata'])
> plt.gca().xaxis.set_major_locator(dates.DayLocator())
> plt.gca().xaxis.set_major_formatter(dates.DateFormatter('%Y/%m/%d'))
> plt.show()
>
> Personally, I find it much easier to work with python datetime objects
> than any other form. You can
>
> Ryan
>
From: Ryan M. <rm...@gm...> - 2010年06月18日 17:31:51
On Thu, Jun 17, 2010 at 11:39 AM, Bill Eaton <ee...@ae...> wrote:
> I'm struggling to figure out how to format my data so that I can use dates
> as x-data.
<SNIP>
> I tried to import my own data. It looks like
>  2005年03月04日,0.923115796
>  2005年03月05日,0.915828724
>  2005年03月06日,0.442521474
>  2005年03月07日,0.997096213
>  2005年03月08日,0.867752118
> And to import, I use recarray
> myarray = np.loadtxt(fullfile, dtype=[('date', '|O4'), ('ydata',
> 'float')], delimiter = ',')
> rx = myarray.view(np.recarray)
>
> Data imports fine. But when I go to plot, I get the following error
> ValueError: setting an array element with a sequence.
> WARNING: Failure executing file: <bogus.py>
You need to give np.loadtxt a converter so that it converts that first
column of strings into datetime objects:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import dates
from datetime import datetime
from StringIO import StringIO
s='''
 2005年03月04日,0.923115796
 2005年03月05日,0.915828724
 2005年03月06日,0.442521474
 2005年03月07日,0.997096213
 2005年03月08日,0.867752118'''
dateparser = lambda s: datetime.strptime(s, '%Y-%m-%d')
dt = np.dtype([('date', np.object),('ydata', np.float)])
d = np.loadtxt(StringIO(s), dtype=dt, converters={0:dateparser}, delimiter=',')
plt.plot(d['date'], d['ydata'])
plt.gca().xaxis.set_major_locator(dates.DayLocator())
plt.gca().xaxis.set_major_formatter(dates.DateFormatter('%Y/%m/%d'))
plt.show()
Personally, I find it much easier to work with python datetime objects
than any other form. You can
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Bill E. <ee...@ae...> - 2010年06月18日 16:36:05
I came up with a partial solution for my problem. I found an example from
Sandro Tosi (http://www.packtpub.com/article/advanced-matplotlib-part2. I
think I may have to buy his book.) using datutil.parser. I'm not sure why a
straight numpy.load doesn't work.
Code was:
 > I tried to import my own data. It looks like 
 > 2005年03月04日,0.923115796
 > 2005年03月05日,0.915828724
 > 2005年03月06日,0.442521474
 > 2005年03月07日,0.997096213
 > 2005年03月08日,0.867752118
 > And to import, I use recarray
 > myarray = np.loadtxt(fullfile, dtype=[('date', '|O4'), ('ydata',
 > 'float')], delimiter = ',')
 > rx = myarray.view(np.recarray)
 > 
 > Data imports fine. But when I go to plot, I get the following error
 > ValueError: setting an array element with a sequence.
 > WARNING: Failure executing file: <bogus.py>
If I modify to:
 import datutil
 myarray = np.loadtxt(fullfile, dtype=[('datestring', '|S22'), ('ydata',
'float')], delimiter = ',')
 dates = [dateutil.parser.parse(s) for s in myarray['datestring']]
Now I can plot with
 plt.plot(dates, myarray['ydata']
Bill Eaton
From: Friedrich R. <fri...@gm...> - 2010年06月18日 14:11:43
2010年6月17日 Hana Sevcikova <ha...@cs...>:
> I installed matplotlib-0.99.3-py2.6-macosx10.6.dmg on MacOS X 10.6.3,
> python 2.6.5. But I get an error when running the histogram example from
> http://matplotlib.sourceforge.net/examples/api/histogram_demo.html
Have you compiled Python yourself? I'm asking because Python 2.6.5
from Python.org is maybe linked against another Tcl/Tk than it links
to when you compile yourself. (I guess the matplotlib._tkagg module
does some patchy things.)
Friedrich
From: Friedrich R. <fri...@gm...> - 2010年06月18日 12:52:38
2010年6月15日 Eliot Glairon <ej...@ya...>:
> class simpleapp_tk(Tkinter.Tk):#initialize
>  def __init__(self,parent):
>    Tkinter.Tk.__init__(self,parent)
>    self.grid()
It sounds a bit odd to me to attemt to .grid() a Tk instance ... The
Tkinter.Tk() instance is the toplevel application window. You do not
have to grid it.
Also, I don't know what the *parent* argument means to to
Tkinter.Tk.__init__(). Try to leave the parent argument alone, and
try to remove the .grid().
Friedrich
From: Friedrich R. <fri...@gm...> - 2010年06月18日 12:43:54
2010年6月16日 Michael Droettboom <md...@st...>:
> pcolor runs directly on polar plots just fine. No need to convert polar to
> cartesian outside of matplotlib.
It's true, but at the expense of pretty much time, since the arcs must
be rendered properly. If your data is dense enough in r and phi, a
handmade conversion would probably gain much speedup. Of course you
loose then also the nice polar diagram axes ... I tried this once in
polar with pixel-dense data (in a 400x400 px figure) and it takes
really forever.
I don't know if the output of the fast versions of pcolor is properly
rendered in polar axes?
Friedrich
From: Darren D. <dsd...@gm...> - 2010年06月18日 11:50:14
On Thu, Jun 17, 2010 at 11:04 PM, David Smith <dav...@gm...> wrote:
> I have been developing an application using PyQt ant Matplotlib and encountered
> a problem with the mouse cursor shape being incorrect. I found a work-around
> that seems to work, but I think this is a bug and the fix needs to go into the
> Matplotlib code base. Here are details.
>
> My application has a central widget used fo r a Matplotlib Figure.
> Additionally there is a menu bar, button bar and two dock panels with
> controls for the plot. I see the following behavior for the cursor:
>
> * On start up, the cursor acts normally on startup provided
> the mouse cursor is not inside the figure widget on start-up.
>
> * Mouse pointer shapes are set by Windows (in this case VISTA)
> and change shape according to location. For example, touching
> the application window's border results in the arrow pointer
> changing shape to a double-headed arrow indicating the border
> can be dragged to adjust the size of the window.
>
> * Once the mouse pointer touches the Matplotlib figure widget
> in any way, the mouse pointer will cease to show the double-arrow
> shape on the window borders - the pointer remains an arrowhead.
> You can still resize the window and the cursor does change to
> a double-arrow when you press the left button.
>
> My workaround for this was to add the following lines of code in my
> application:
>
>    def onleave(self):
>      QtGui.QApplication.restoreOverrideCursor()
>
>    self.fig.canvas.mpl_connect('figure_leave_event', onleave)
>
> I guessed these lines by studying the matplotlib code. Probably they
> need to go somewhere inside the Matplotlib class definitions.
>
> I hope this helps developers to correct this problem. My application
> code is medium-large and I didn't try to build a smaller example. The
> mysterious 3-line workaround solves my problem for the moment.
> Perhaps it will help another PyQt and Matplotlib user and perhaps
> urge developers to fix the problem in the Matplotlib core.
Now that you mention it, I have seen similar behavior. Thanks for the
report, I'll look into it.
Darren
From: sathish k. <flo...@gm...> - 2010年06月18日 04:34:09
Thanks Mr.David,
I too developing an application using PyQt and Matplotlib. Though I may not
use cursor for my application, It will keeps me the aware of the things.
With Thanks
Sathishkumar
On Fri, Jun 18, 2010 at 8:34 AM, David Smith <dav...@gm...>wrote:
> I have been developing an application using PyQt ant Matplotlib and
> encountered
> a problem with the mouse cursor shape being incorrect. I found a
> work-around
> that seems to work, but I think this is a bug and the fix needs to go into
> the
> Matplotlib code base. Here are details.
>
> My application has a central widget used fo r a Matplotlib Figure.
> Additionally there is a menu bar, button bar and two dock panels with
> controls for the plot. I see the following behavior for the cursor:
>
> * On start up, the cursor acts normally on startup provided
> the mouse cursor is not inside the figure widget on start-up.
>
> * Mouse pointer shapes are set by Windows (in this case VISTA)
> and change shape according to location. For example, touching
> the application window's border results in the arrow pointer
> changing shape to a double-headed arrow indicating the border
> can be dragged to adjust the size of the window.
>
> * Once the mouse pointer touches the Matplotlib figure widget
> in any way, the mouse pointer will cease to show the double-arrow
> shape on the window borders - the pointer remains an arrowhead.
> You can still resize the window and the cursor does change to
> a double-arrow when you press the left button.
>
> My workaround for this was to add the following lines of code in my
> application:
>
> def onleave(self):
> QtGui.QApplication.restoreOverrideCursor()
>
> self.fig.canvas.mpl_connect('figure_leave_event', onleave)
>
> I guessed these lines by studying the matplotlib code. Probably they
> need to go somewhere inside the Matplotlib class definitions.
>
> I hope this helps developers to correct this problem. My application
> code is medium-large and I didn't try to build a smaller example. The
> mysterious 3-line workaround solves my problem for the moment.
> Perhaps it will help another PyQt and Matplotlib user and perhaps
> urge developers to fix the problem in the Matplotlib core.
>
> David Smith
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: David S. <dav...@gm...> - 2010年06月18日 03:04:39
I have been developing an application using PyQt ant Matplotlib and encountered
a problem with the mouse cursor shape being incorrect. I found a work-around
that seems to work, but I think this is a bug and the fix needs to go into the
Matplotlib code base. Here are details.
My application has a central widget used fo r a Matplotlib Figure.
 Additionally there is a menu bar, button bar and two dock panels with
 controls for the plot. I see the following behavior for the cursor:
* On start up, the cursor acts normally on startup provided
 the mouse cursor is not inside the figure widget on start-up.
* Mouse pointer shapes are set by Windows (in this case VISTA)
 and change shape according to location. For example, touching
 the application window's border results in the arrow pointer
 changing shape to a double-headed arrow indicating the border
 can be dragged to adjust the size of the window.
* Once the mouse pointer touches the Matplotlib figure widget
 in any way, the mouse pointer will cease to show the double-arrow
 shape on the window borders - the pointer remains an arrowhead.
 You can still resize the window and the cursor does change to
 a double-arrow when you press the left button.
My workaround for this was to add the following lines of code in my
application:
 def onleave(self):
 QtGui.QApplication.restoreOverrideCursor()
 self.fig.canvas.mpl_connect('figure_leave_event', onleave)
I guessed these lines by studying the matplotlib code. Probably they
need to go somewhere inside the Matplotlib class definitions.
I hope this helps developers to correct this problem. My application
code is medium-large and I didn't try to build a smaller example. The
mysterious 3-line workaround solves my problem for the moment.
Perhaps it will help another PyQt and Matplotlib user and perhaps
urge developers to fix the problem in the Matplotlib core.
David Smith
From: Bill E. <ee...@ae...> - 2010年06月18日 00:31:46
I'm struggling to figure out how to format my data so that I can use dates
as x-data. 
I've tried the pylab examples and they execute beautifully on my Windoze and
Linux boxes. But when I try to plot data on my own, it doesn't work. 
Using api example date_demo.py as a starting point. This appears to be stock
price for Google from 2004 to 2008. Here are some clues:
 In [7]: q = np.load(datafile)
 In [8]: q
 Out[7]:
rec.array([ (datetime.date(2004, 8, 19), 100.0, 104.06, 95.959999999999994,
100.
34, 22351900L, 100.34),
 (datetime.date(2004, 8, 20), 101.01000000000001, 109.08, 100.5,
108.31, 1
1428600L, 108.31),
 (datetime.date(2004, 8, 23), 110.75, 113.48, 109.05,
109.40000000000001,
9137200L, 109.40000000000001),
 ...,
 (datetime.date(2008, 10, 10), 313.16000000000003, 341.88999999999999,
310
.30000000000001, 332.0, 10597800L, 332.0),
 (datetime.date(2008, 10, 13), 355.79000000000002, 381.94999999999999,
345
.75, 381.01999999999998, 8905500L, 381.01999999999998),
 (datetime.date(2008, 10, 14), 393.52999999999997, 394.5, 357.0,
362.70999
999999998, 7784800L, 362.70999999999998)],
 dtype=[('date', '|O4'), ('', '|V4'), ('open', '<f8'), ('high', '<f8'),
('l
ow', '<f8'), ('close', '<f8'), ('volume', '<i8'), ('adj_close', '<f8')])
 In [9]: r = q.view(np.recarray)
 In [10]: r.date
 Out[10]: array([2004年08月19日, 2004年08月20日, 2004年08月23日, ..., 
 2008年10月10日, 2008年10月13日, 2008年10月14日], dtype=object)
So it appears that the dtype of the date column is '|O4'
I tried to import my own data. It looks like 
 2005年03月04日,0.923115796
 2005年03月05日,0.915828724
 2005年03月06日,0.442521474
 2005年03月07日,0.997096213
 2005年03月08日,0.867752118
And to import, I use recarray
 myarray = np.loadtxt(fullfile, dtype=[('date', '|O4'), ('ydata',
'float')], delimiter = ',')
 rx = myarray.view(np.recarray)
Data imports fine. But when I go to plot, I get the following error
 ValueError: setting an array element with a sequence.
 WARNING: Failure executing file: <bogus.py>
This makes me think I don't quite have everything formatted correctly. Any
ideas?
Bill Eaton
From: Eamon C. <eam...@gm...> - 2010年06月17日 23:49:18
On Wed, Jun 16, 2010 at 4:06 PM, Malte Dik <mal...@we...> wrote:
> Hi,
>
> Eamon Caddigan <eam...@gm...>
>> The reason my initial attempts failed was because I (erroneously)
>> assumed that the default axis spanned (0, 0), (1, 1). Now I that I
>> know better, I can place an axis for each image in the right place and
>> everything looks fine.
>>
>> However, I'm still interested in knowing how to query the pixel size
>> of the figure, so I can translate normalized axis coordinates to pixel
>> coordinates.
>
> http://matplotlib.sourceforge.net/users/transforms_tutorial.html
>
> Maybe something along the lines
> ax.transAxes.transform((0, 0)) - ax.transAxes.transform((1, 1))
transAxes.transform() was exactly what I was looking for. Thanks!
-Eamon
From: Eric F. <ef...@ha...> - 2010年06月17日 17:53:41
On 06/17/2010 07:35 AM, Ryan May wrote:
> On Thu, Jun 17, 2010 at 11:39 AM, Benjamin Root<ben...@ou...> wrote:
>> Try "ax.set_xticks([])", I think that works for 2D plots.
>
> Nope, labels disappear.
>
> Jeff, try this:
>
> ax.xaxis.set_ticks_position('none')
>
> Ryan
>
In [1]:plot([1,2])
Out[1]:[<matplotlib.lines.Line2D object at 0x3e11510>]
In [2]:ax = gca()
In [3]:for t in ax.xaxis.get_ticklines(): t.set_visible(False)
 ...:
In [4]:draw()
From: Eric F. <ef...@ha...> - 2010年06月17日 17:50:22
On 06/17/2010 05:52 AM, Ryan May wrote:
> On Thu, Jun 17, 2010 at 10:52 AM, Andreas Hilboll<li...@hi...> wrote:
>> Hi there,
>>
>> I just noticed today that when I call hist() on a masked_array, also those
>> values which are masked out are displayed (with their fill_value). Is that
>> really the desired behaviour?
>>
>> I'm working in an environment where we're mostly using masked_array, but
>> also sometimes the 'normal' ndarray. So I would need to do something like
>>
>> try:
>> data = data.compressed()
>> except:
>> pass
>> hist(data)
>>
>> all the time ... Is there any easier solution?
>
> Unfortunately, these lines in Axes.hist():
>
> # TODO: support masked arrays;
> x = np.asarray(x)
>
> say it all. I think changing to asanyarray() should work (I'm not sure
> what, if anything, this would break), but there's no way for you to
> get this behavior without editing your local copy of axes.py.
It takes considerably more than that. Nothing terribly difficult, but 
more than a couple lines.
Eric
>
> Ryan
>
From: Ryan M. <rm...@gm...> - 2010年06月17日 17:35:48
On Thu, Jun 17, 2010 at 11:39 AM, Benjamin Root <ben...@ou...> wrote:
> Try "ax.set_xticks([])", I think that works for 2D plots.
Nope, labels disappear.
Jeff, try this:
ax.xaxis.set_ticks_position('none')
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Jonathan S. <js...@cf...> - 2010年06月17日 17:25:11
I've been using Axes3D to make plots and I like the output very much --
with the one exception being the faintness of the 3-D grid that is put
in the background. The light gray used is quite difficult to see. Is
there some way to specify the color of the grid and/or background? I'd
be satisfied with having the grid lines darker. I've been looking
through the axes3d.py file under mpl_toolkits/mplot3d but haven't
figured it out yet.
By the way, anyone looking to specify an initial non-default orientation
for the grid, I discovered that you can do this when instantiating your
Axes3D object this way:
ax = Axes3D(fig,elev=e,azim=a)
where e and a are the elevation about the x-axis and azimuthal rotation
about the z-axis (both in degrees). 0 azimuthal rotation has the y-z
plane in the plane of the screen; azim. rotation is defined as clockwise
as viewed from above.
From: Benjamin R. <ben...@ou...> - 2010年06月17日 16:39:31
Try "ax.set_xticks([])", I think that works for 2D plots.
Ben Root
On Thu, Jun 17, 2010 at 11:22 AM, Jeff Perry <je...@gm...> wrote:
> can someone tell me how to turn off the tick marks on my plot?
>
> i tried this
>
> [line.set_marker('None') for line in ax.get_xticklines()]
>
> but this turns off the labels too. i don't want to turn off the
> labels, just the tick marks.
>
> someone also suggested this
>
> ax.xaxis.set_major_locator(pylab.NullLocator())
>
> but it also turns off the labels
>
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit. See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jeff P. <je...@gm...> - 2010年06月17日 16:22:52
can someone tell me how to turn off the tick marks on my plot?
i tried this
 [line.set_marker('None') for line in ax.get_xticklines()]
but this turns off the labels too. i don't want to turn off the
labels, just the tick marks.
someone also suggested this
 ax.xaxis.set_major_locator(pylab.NullLocator())
but it also turns off the labels
From: Ryan M. <rm...@gm...> - 2010年06月17日 15:56:26
On Thu, Jun 17, 2010 at 10:52 AM, Andreas Hilboll <li...@hi...> wrote:
> Hi there,
>
> I just noticed today that when I call hist() on a masked_array, also those
> values which are masked out are displayed (with their fill_value). Is that
> really the desired behaviour?
>
> I'm working in an environment where we're mostly using masked_array, but
> also sometimes the 'normal' ndarray. So I would need to do something like
>
> try:
> data = data.compressed()
> except:
> pass
> hist(data)
>
> all the time ... Is there any easier solution?
Unfortunately, these lines in Axes.hist():
 # TODO: support masked arrays;
 x = np.asarray(x)
say it all. I think changing to asanyarray() should work (I'm not sure
what, if anything, this would break), but there's no way for you to
get this behavior without editing your local copy of axes.py.
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Jae-Joon L. <lee...@gm...> - 2010年06月17日 15:52:53
>
> The following gets it done, however:
>
> cb.ax.artists.remove(cb.outline)
>
or
 cb.outline.remove()
-JJ
From: Andreas H. <li...@hi...> - 2010年06月17日 15:45:09
Hi there,
I just noticed today that when I call hist() on a masked_array, also those
values which are masked out are displayed (with their fill_value). Is that
really the desired behaviour?
I'm working in an environment where we're mostly using masked_array, but
also sometimes the 'normal' ndarray. So I would need to do something like
try:
 data = data.compressed()
except:
 pass
hist(data)
all the time ... Is there any easier solution?
Cheers,
Andreas.
From: Ryan M. <rm...@gm...> - 2010年06月17日 15:42:43
On Thu, Jun 17, 2010 at 10:29 AM, Jeff Perry <je...@gm...> wrote:
> can someone tell me how to turn off the frame on the colorbar?
>
> i tried this
>
> ...
> cb=plt.colorbar()
> plt.axes(cb.ax)
> plt.box(on=False)
There's no function or parameter to control this at the moment
unfortunately (I've marked this as a TODO, but I don't see a quick way
to add it at the moment).
The following gets it done, however:
cb.ax.artists.remove(cb.outline)
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
19 messages has been excluded from this view by a project administrator.

Showing results of 397

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