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
(27) |
2
(15) |
3
(2) |
|
4
(4) |
5
(5) |
6
(9) |
7
(15) |
8
(24) |
9
(19) |
10
(7) |
|
11
(13) |
12
(26) |
13
(27) |
14
(17) |
15
(14) |
16
(12) |
17
(9) |
|
18
(12) |
19
(17) |
20
(19) |
21
(5) |
22
(5) |
23
(7) |
24
(4) |
|
25
(1) |
26
(9) |
27
(20) |
28
(5) |
29
(10) |
30
(12) |
31
(6) |
|
From: Goyo <goy...@gm...> - 2012-03-15 20:10:23
|
El día 15 de marzo de 2012 05:14, questions anon <que...@gm...> escribió: > I think my error is from the np.genfromtxt because I just checked the size > of my data and it appears in 1D rather than 2D. This is unsurprising since your file has just one row of data. I overlooked that because the weird error message drove all my attention to it. You can reshape the resulting array to (691, 886). Still that error message should not be there in any case. >> I don't really understand what np.logical_or is or how to use it? >> I have tried just calling it at the beginning of the script np.logical_or computes the logical out of two boolean arrays. It's called internally by countourf and that's triggering the exception: AttributeError: logical_or Which makes no sense at all because: 1. np is expected to be an alias for numpy and numpy *does* have an attribute called logical_or. 2. In case np didn't have an attribute called logical_or (for whatever reason) it would cause an exception but the error message should be something like "AttributeError: 'module' object has no attribute 'logical_or'". You where asked to call np.logical_or at the beginning of the script in order to know if it triggers the exception in that context. >> [...] but I still end up with the same error. So the call at the beginning didn't trigger the error? Regards Goyo |
|
From: Benjamin R. <ben...@ou...> - 2012-03-15 17:59:29
|
On Thu, Mar 15, 2012 at 12:31 PM, Thøger Rivera-Thorsen < tho...@gm...> wrote: > Hello people, > > I am trying to do a surface plot of some data, with some line plots > marking some lines of special interest - see attachment. > > It would be really nice if the surface plot would hide the lines that are > "behind" the surface, but every single line piece is clearly visible, which > makes the picture a good deal more messy than I'd like it to be. Is this a > bug, and/or is there a way to fix it? > This is a common problem and is partly addressed here in the mplot3d FAQ: http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/faq.html#my-3d-plot-doesn-t-look-right-at-certain-viewing-angles For your particular situation, the surface plot is represented by a single "z" value (z in the viewing coordinates, not the graph coordinates). Depending on how your lines are being done, the group of lines may each be represented by their own z values or there is a single z-value for all of the lines (again, depending on how you are plotting). For your kind of scene, there are some work-arounds. Specifically, I might try modifying the surface object itself. It is pretty much just a PolyCollection. You can get/set the edgecolors, specifically modifying the elements that correspond to the lines you want to color. Note that it is a bit tricky in that you have to also modify the collection's "_edgecolors3d" attribute as it is what stores the original colors (the colors that are displayed gets shaded with user-interaction, so we have to store the original colors there). I hope this rambling makes some sense. Let me know if you have questions. Ben Root |
|
From: Thøger Rivera-T. <tho...@gm...> - 2012-03-15 17:31:24
|
Hello people, I am trying to do a surface plot of some data, with some line plots marking some lines of special interest - see attachment. It would be really nice if the surface plot would hide the lines that are "behind" the surface, but every single line piece is clearly visible, which makes the picture a good deal more messy than I'd like it to be. Is this a bug, and/or is there a way to fix it? |
|
From: Tony Yu <ts...@gm...> - 2012-03-15 14:59:00
|
On Thu, Mar 15, 2012 at 6:01 AM, kususe <ku...@in...> wrote:
>
> Hi folks,
> I'd like to remove the black border which is created when I save the image,
> letting just the white background and the graph.
> Is there a solution??
> Thanks,
> K.
> --
Matplotlib provides a function that *almost* does this: `plt.axis('off')`
or `ax.set_axis_off()`, but these functions clear the white background as
well (along with the ticks, spines, and axis labels).
The following snippet clears only the spines and ticks:
ax.xaxis.set_ticks([])
ax.yaxis.set_ticks([])
for spine in ax.spines.itervalues():
spine.set_visible(False)
I've wrapped this up into a utility function:
https://github.com/tonysyu/mpltools/blob/master/mpltools/layout.py
-Tony
|
|
From: Kevin H. <kmh...@nc...> - 2012-03-15 14:56:52
|
Hullo matplotlib list, I've discovered (with pleasure!) that matplotlib has recently learned how to create Sankey diagrams. Thank you Kevin and Yannick! One of my less-technically inclined fellow graduate students is searching for his toolset of choice for generating these suckers, and is currently looking at Stan. As I'm an open-source advocate I'd love to be able to say, "you can do this with X", where X in this case is clearly matplotlib. Specifically, I've not heavily used matplotlib before, and from the given examples I see on matplotlib.sf.net, I'm not clear on exactly the capabilities of this recently-added code. What my fellow grad student has opined would be nice for his uses would be boxes that are built into the flows, rather than just used as labels. Something like: "Page Load" http://modernl.com/images/diagrams/web-traffic-sankey-diagram.png "Input", "Gas Turbine", "HRSG", "Waste", "BP Turbine", "Output" http://www.bucknell.edu/images/Depts/Facilities/sankeythumb.jpg Is this currently possible, /without/ manually adjusting the graphic? Thanks! Kevin |
|
From: Thøger Rivera-T. <tho...@gm...> - 2012-03-15 13:33:00
|
Hello list;
I have some data that I would like to display a bit like it is done in
this example:
http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#d-plots-in-3d
Only, instead of the line plot in the z=0 plane, I would like to
represent my data as a pcolormesh (and instead of the scatter I would
like to do a line plot of the levels at chosen y-values, bu that is not
the problem now).
However, when I try to do a ax.pcolormesh() - which should be inherited
- it creates the object just fine, but when I write 'draw()', I get the
error message:
AttributeError: 'QuadMesh' object has no attribute
'do_3d_projection'
Is there a different way to obtain what I wanbt - that is, an image plot
with customizeable coordinate axes, in a given plane (here z=0) of the
Axes3D?
Cheers;
Emil
|
|
From: Thoeger E. J. Rivera-T. <th...@as...> - 2012-03-15 12:20:23
|
Hello list; I have some data that I would like to display a bit like it is done in this example: http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#d-plots-in-3d Only, instead of the line plot in the z=0 plane, I would like to represent my data as a pcolormesh (and instead of the scatter I would like to do a line plot of the levels at chosen y-values, bu that is not the problem now). However, when I try to do a ax.pcolormesh() - which should be inherited - it creates the object just fine, but when I write 'draw()', I get the error message: AttributeError: 'QuadMesh' object has no attribute 'do_3d_projection' Is there a different way to obtain what I wanbt - that is, an image plot with customizeable coordinate axes, in a given plane (here z=0) of the Axes3D? Cheers; Emil |
|
From: Thøger Rivera-T. <tho...@gm...> - 2012-03-15 11:54:09
|
Hello list; I have some data that I would like to display a bit like it is done in this example: http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#d-plots-in-3d Only, instead of the line plot in the z=0 plane, I would like to represent my data as a pcolormesh (and instead of the scatter I would like to do a line plot of the levels at chosen y-values, bu that is not the problem now). However, when I try to do a ax.pcolormesh() - which should be inherited - it creates the object just fine, but when I write 'draw()', I get the error message: AttributeError: 'QuadMesh' object has no attribute 'do_3d_projection' Is there a different way to obtain what I wanbt - that is, an image plot with customizeable coordinate axes, in a given plane (here z=0) of the Axes3D? Cheers; Emil |
|
From: Friedrich R. <fri...@gm...> - 2012-03-15 11:31:12
|
Hi, Am 14. November 2011 15:04 schrieb Friedrich Romstedt <fri...@gm...>: > 2011/11/14 Michael Droettboom <md...@st...>: >> Thanks for all the time you've devoted to this. It does look like possibly >> some kind of compiler bug. The font loads and renders fine on Linux, for >> what it's worth (just as a data point). >> >> To confirm this theory: if you move NISC1803.ttf somewhere temporary, delete >> ~/.matplotlibrc/fontList.cache and then import matplotlib, do you get the >> crash? That at least confirms that loading this font file triggers the bug >> (wherever the bug may be). Test with matplotlib 1.1.0 or git master so we >> have a sense of the current behavior. > > Hi Mike, > > the following fonts on my system are offending: > > /Library/Fonts/NISC18030.ttf > /Library/Fonts/AppleMyungjo.ttf > /Library/Fonts/Gungseouche.ttf > > With these fonts made unfindable by matplotlib (:file:`*.ttf_`) it > exits cleanly. > > I will provide with a patch to matplotlib for an rc setting > "fonts.bus-error : ...", e.g. ``fonts.bus-error : NISC18030.ttf, > AppleMyungjo.ttf, Gungseouche.ttf`` in the next days. I just took the time to recompile the whole thingy, including supporting libraries. I used: – libfreetype-2.4.9 – matplotlib-1.1.0 – MACOSX_DEPLOYMENT_TARGET=10.5 – The files noted in the citation above are in place (i.e., accessible as .ttf files) My theory was that a compiler error triggers the error with the font files in question. Because recompiling ft2font.so with a different MACOSX_DEPLOYMENT_TARGET made the crash disappear I supposed that ft2font would trigger that compiler error. It needed to be a compiler error because that environment variable was the only change that made the crash disappear. Now it is the question if with more recent software that error still persists. I have found that this is not the case. I recompiled with the libraries noted above (all compiled from source), and I can successfully import matplotlib.figure. This import previously provoked the crash. So I believe that either I was wrong in some respect, or the more recent software toolchain no longer provokes the crash, because its code changed. Since it works just flawlessly on my system now, I see little need to implement the mechanism for excluding font files from being loaded – if it is not needed I will not code it. Friedrich P.S.: Of course I moved the font cache before, so that it is recreated when importing matplotlib.figure for the first time. P.P.S.: One more difference is that the current Python is not a framework Python anymore, but a regular Python. > It was clear from the beginning (well, from the point I got a handle > on it), that loading the font makes the 2009 matplotlib crash. The > only question unanswered is where the codepath is that triggers this > compiler bug (I think the compiler but hypothesis is not disproven and > works well atm). If the code path is in ft2font.cpp, we could (you > could) reformulate ft2font.cpp in an equivalent way with the exception > that it is not equivalent in crashing. You might want to augment > ft2font.cpp by printf() or something to see if the crash appears > inside a call to libfreetype or if all those calls return cleanly. > > To my understanding, since recompiling ft2font.so without > MACOSX_DEPLOYMENT_TARGET different from 10.6 helps, ft2font.cpp should > be the culprit resp. victim. The only alternative I'm seeing would be > that it has to to do with the load mechanism of the dylib, but I deem > this rather unlikely. Well, unlikely is not the best word in this > context, since all this things here were pretty unlikely. > > If the codepath is in libfreetype this would be an issue for their list. ... > > Friedrich |
|
From: Sebastian B. <seb...@si...> - 2012-03-15 10:59:13
|
Hey, last weekend I wrote a hook which can track figure creation. Basically it takes care of creating the new figure and wraps it to track all changes to it. Its a hack, and the code is not cleaned up or tested much, but I like to do scripts that I run with many parameters to create plots and it works well to allow me to open the figures in a way that I can zoom, etc. and would allow editing (a bit) later on too. So while I doubt the approach can be made something serious, and there are probably things that don't work (right now 3D Axis can be done with a bit extra but mouse zooming does not work inside a 3D Axis, though I think its likely not difficult to change), I thought I would put it online because I am not aware of any way to save matplotlib figures: https://github.com/seberg/haunter-for-matplotlib-figures Maybe someone finds it useful or interesting :) Regards, Sebastian Berg |
|
From: kususe <ku...@in...> - 2012-03-15 10:02:07
|
Hi folks, I'd like to remove the black border which is created when I save the image, letting just the white background and the graph. Is there a solution?? Thanks, K. -- View this message in context: http://old.nabble.com/How-to-remove-the-black-border-in-a-Matplotlib-figure-tp33508568p33508568.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: kususe <ku...@in...> - 2012-03-15 08:06:50
|
On Wed, Mar 14, 2012 at 2:38 PM, kususe <ku...@in...> wrote: > > I got an error using the first subplot function because I have to specify > 3 > parameters. > If i do it, I get that "AxesSubplot' object is not iterable" > I coded using 3 subplot functions, getting the same error. > > Thanks > K. > > Note that I wrote `subplots` with an "s", which is a different command than `subplot`. (You're really having problems with "s"s today :) BTW, would you mind interleaving or bottom-posting replies<http://en.wikipedia.org/wiki/Posting_style#Placement_of_replies>. It's a bit easier to follow the conversation that way. -Tony Yes, for sure I coded: fig, axes = plt.subplot(3,1,1) ax1, ax2, ax3 = axes p1, = ax1.plot(self.data0,self.data1) .... plt.subplot(3,1,2) p2, = ax2.plot(self.data0,self.data2) ....... plt.subplot(3,1,3) p3, = ax3.plot(self.data0,self.data4) ........ for ax in axes: ax.set_xticks([]) but I got the error which said you. -- View this message in context: http://old.nabble.com/How-to-remove-x-axis-in-a-subplotted-graph-tp33500598p33507959.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: questions a. <que...@gm...> - 2012-03-15 04:14:20
|
I think my error is from the np.genfromtxt because I just checked the size
of my data and it appears in 1D rather than 2D.
if I try taking out 'skip_header' I end up with this error:
Traceback (most recent call last):
File "d:\BoMdata\plotrainfall.py", line 63, in <module>
f=np.genfromtxt(inputfile, dtype=None, names=True)
File "C:\Python27\lib\site-packages\numpy\lib\npyio.py", line 1560, in
genfromtxt
raise ValueError(errmsg)
ValueError: Some errors were detected !
Line #7 (got 886 columns instead of 2)
Line #8 (got 886 columns instead of 2)
Line #9 (got 886 columns instead of 2)
Line #10 (got 886 columns instead of 2)
Line #11 (got 886 columns instead of 2)
Line #12 (got 886 columns instead of 2)
Line #13 (got 886 columns instead of 2)
my data as opened in notepad looks like:
ncols 886
nrows 691
xllcorner 111.975
yllcorner -44.525
cellsize 0.05
NODATA_value -9999
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
how do I skip those first few rows but still end up with a 2D array?
On Thu, Mar 15, 2012 at 12:16 PM, questions anon
<que...@gm...>wrote:
> I don't really understand what np.logical_or is or how to use it?
> I have tried just calling it at the beginning of the script but I still
> end up with the same error.
>
>
> On Thu, Mar 15, 2012 at 10:59 AM, Pierre GM <pgm...@gm...> wrote:
>
>> That's your whole log? You're sure you're not redefining np in the
>> background, via a variable or another module?
>> Have you tried to call np.logical_or at the very beginning of your
>> script, or in a brand new environment (after importing numpy as np)?
>> It's definitely not a matplotlib pb, but where is it coming on your side,
>> that's the question...
>> On Mar 14, 2012 11:35 PM, "questions anon" <que...@gm...>
>> wrote:
>>
>>> Thanks for responding. It is 'sort of' good to know that it can't be
>>> explained as I just thought it was my incompetency!
>>> I tried the np rather than N but that made no differences.
>>> thanks again
>>>
>>>
>>> On Thu, Mar 15, 2012 at 7:48 AM, Benjamin Root <ben...@ou...> wrote:
>>>
>>>>
>>>>
>>>> On Tue, Mar 13, 2012 at 4:23 PM, questions anon <
>>>> que...@gm...> wrote:
>>>>
>>>>> also I have tried running it on a different computer and the same
>>>>> error occurred
>>>>>
>>>>>
>>>>> On Wed, Mar 14, 2012 at 8:22 AM, questions anon <
>>>>> que...@gm...> wrote:
>>>>>
>>>>>> thanks for looking into this Goyo.
>>>>>> The complete code:
>>>>>>
>>>>>>
>>>>>> import numpy as N
>>>>>> import matplotlib.pyplot as plt
>>>>>> from numpy import ma as MA
>>>>>> from mpl_toolkits.basemap import Basemap
>>>>>> import os
>>>>>>
>>>>>> shapefile="E:/GIS_layers/DSE_REGIONS"
>>>>>> inputfile=r"d:/BoMdata/r19000117.txt"
>>>>>> outputfolder=r"d:/BoMdata/outputfolder"
>>>>>>
>>>>>> f=N.genfromtxt(inputfile, skip_header=6, dtype=float, names=True)
>>>>>> print f[0:5]
>>>>>>
>>>>>>
>>>>>> map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9,
>>>>>>
>>>>>> llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i')
>>>>>> map.drawcoastlines()
>>>>>> map.drawstates()
>>>>>> map.readshapefile(shapefile, 'DSE_REGIONS')
>>>>>>
>>>>>> xi=N.linspace(111.975, 156.275, 886)
>>>>>> yi=N.linspace(-44.525, -9.975, 691)
>>>>>> x,y=map(*N.meshgrid(xi,yi))
>>>>>> plt.title('rainfall')
>>>>>> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
>>>>>> l,b,w,h =0.1,0.1,0.8,0.8
>>>>>> cax = plt.axes([l+w+0.025, b, 0.025, h])
>>>>>> plt.colorbar(CS,cax=cax, drawedges=True)
>>>>>> plt.savefig((os.path.join(outputfolder, 'rainfall.png')))
>>>>>> plt.show()
>>>>>> plt.close()
>>>>>>
>>>>>>
>>>>>> and the complete error:
>>>>>>
>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>> File "d:/BoMdata/plotrainfall_v2.py", line 23, in <module>
>>>>>>
>>>>>> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
>>>>>> File
>>>>>> "C:\Python27\lib\site-packages\mpl_toolkits\basemap\__init__.py", line
>>>>>> 3072, in contourf
>>>>>>
>>>>>> np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
>>>>>> AttributeError: logical_or
>>>>>>
>>>>>> Any feedback/ideas will be greatly appreciated.
>>>>>>
>>>>>>
>>>>>>
>>>> Your error is very strange and it just simply should not be happening.
>>>> On a completely wild guess, could you try replacing "import numpy as N"
>>>> with "import numpy as np" and replace all instances of "N" with "np"?
>>>>
>>>> Ben Root
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Virtualization & Cloud Management Using Capacity Planning
>>> Cloud computing makes use of virtualization - but cloud computing
>>> also focuses on allowing computing to be delivered as a service.
>>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>
|
|
From: Will G. <wil...@gm...> - 2012-03-14 23:38:22
|
Not sure if this is a bug or a feature, but
xlabel (and ylabel) doesn't honour the rcParams['font.size']
parameters.
To see this:
x = linspace(0,10)
y = x**2
plot(x,y)
xlabel("x, m")
ylabel(r'y^2, m^2")
rcParams['font.size'] = 20
ylabel(r'y$^{2}$, m')
this is different to
ylabel(r'y$^{2}$, m', fontsize=rcParams['font.size'])
So, xlabel behaviours similarly; the fontsize parameter is
honoured, but the default parameter, as set with rcParams['font.size']
is not.
I would call this a bug, not a feature.
Other info, as requested by the troubleshooting FAQ...
will@jalfrezi:~$ uname -a
Linux jalfrezi 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:50:54 UTC
2012 i686 i686 i386 GNU/Linux
(but also seen in Windows XP)
matplotlib version 1.0.1
matplotlib obtained from the enthought python distribution
Thanks,
W
--
Will Grainger
wil...@gm...
|
|
From: questions a. <que...@gm...> - 2012-03-14 22:34:42
|
Thanks for responding. It is 'sort of' good to know that it can't be
explained as I just thought it was my incompetency!
I tried the np rather than N but that made no differences.
thanks again
On Thu, Mar 15, 2012 at 7:48 AM, Benjamin Root <ben...@ou...> wrote:
>
>
> On Tue, Mar 13, 2012 at 4:23 PM, questions anon <que...@gm...>wrote:
>
>> also I have tried running it on a different computer and the same error
>> occurred
>>
>>
>> On Wed, Mar 14, 2012 at 8:22 AM, questions anon <que...@gm...
>> > wrote:
>>
>>> thanks for looking into this Goyo.
>>> The complete code:
>>>
>>>
>>> import numpy as N
>>> import matplotlib.pyplot as plt
>>> from numpy import ma as MA
>>> from mpl_toolkits.basemap import Basemap
>>> import os
>>>
>>> shapefile="E:/GIS_layers/DSE_REGIONS"
>>> inputfile=r"d:/BoMdata/r19000117.txt"
>>> outputfolder=r"d:/BoMdata/outputfolder"
>>>
>>> f=N.genfromtxt(inputfile, skip_header=6, dtype=float, names=True)
>>> print f[0:5]
>>>
>>>
>>> map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9,
>>>
>>> llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i')
>>> map.drawcoastlines()
>>> map.drawstates()
>>> map.readshapefile(shapefile, 'DSE_REGIONS')
>>>
>>> xi=N.linspace(111.975, 156.275, 886)
>>> yi=N.linspace(-44.525, -9.975, 691)
>>> x,y=map(*N.meshgrid(xi,yi))
>>> plt.title('rainfall')
>>> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
>>> l,b,w,h =0.1,0.1,0.8,0.8
>>> cax = plt.axes([l+w+0.025, b, 0.025, h])
>>> plt.colorbar(CS,cax=cax, drawedges=True)
>>> plt.savefig((os.path.join(outputfolder, 'rainfall.png')))
>>> plt.show()
>>> plt.close()
>>>
>>>
>>> and the complete error:
>>>
>>>
>>> Traceback (most recent call last):
>>> File "d:/BoMdata/plotrainfall_v2.py", line 23, in <module>
>>>
>>> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
>>> File "C:\Python27\lib\site-packages\mpl_toolkits\basemap\__init__.py",
>>> line 3072, in contourf
>>>
>>> np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
>>> AttributeError: logical_or
>>>
>>> Any feedback/ideas will be greatly appreciated.
>>>
>>>
>>>
> Your error is very strange and it just simply should not be happening. On
> a completely wild guess, could you try replacing "import numpy as N" with
> "import numpy as np" and replace all instances of "N" with "np"?
>
> Ben Root
>
>
|
|
From: Benjamin R. <ben...@ou...> - 2012-03-14 20:56:02
|
Michael, Sorry for not getting back to you sooner. Your email got a little buried in my inbox. From your build log, most of the dependencies for the backends are not available. Surprisingly, not even Tkinter. Could you take a look at this page and see if automatically installing dependencies help you out? (Note, if you built numpy from source, and other packages from source, then you will have to manually determine which dependencies you are missing and install). http://matplotlib.sourceforge.net/faq/installing_faq.html#source-install-from-git Cheers! Ben Root |
|
From: Benjamin R. <ben...@ou...> - 2012-03-14 20:48:54
|
On Tue, Mar 13, 2012 at 4:23 PM, questions anon <que...@gm...>wrote:
> also I have tried running it on a different computer and the same error
> occurred
>
>
> On Wed, Mar 14, 2012 at 8:22 AM, questions anon <que...@gm...>wrote:
>
>> thanks for looking into this Goyo.
>> The complete code:
>>
>>
>> import numpy as N
>> import matplotlib.pyplot as plt
>> from numpy import ma as MA
>> from mpl_toolkits.basemap import Basemap
>> import os
>>
>> shapefile="E:/GIS_layers/DSE_REGIONS"
>> inputfile=r"d:/BoMdata/r19000117.txt"
>> outputfolder=r"d:/BoMdata/outputfolder"
>>
>> f=N.genfromtxt(inputfile, skip_header=6, dtype=float, names=True)
>> print f[0:5]
>>
>>
>> map = Basemap(projection='merc',llcrnrlat=-45,urcrnrlat=-9,
>> llcrnrlon=111.975,urcrnrlon=156.525,lat_ts=0,resolution='i')
>> map.drawcoastlines()
>> map.drawstates()
>> map.readshapefile(shapefile, 'DSE_REGIONS')
>>
>> xi=N.linspace(111.975, 156.275, 886)
>> yi=N.linspace(-44.525, -9.975, 691)
>> x,y=map(*N.meshgrid(xi,yi))
>> plt.title('rainfall')
>> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
>> l,b,w,h =0.1,0.1,0.8,0.8
>> cax = plt.axes([l+w+0.025, b, 0.025, h])
>> plt.colorbar(CS,cax=cax, drawedges=True)
>> plt.savefig((os.path.join(outputfolder, 'rainfall.png')))
>> plt.show()
>> plt.close()
>>
>>
>> and the complete error:
>>
>>
>> Traceback (most recent call last):
>> File "d:/BoMdata/plotrainfall_v2.py", line 23, in <module>
>>
>> CS = map.contourf(x,y, f, 15,cmap=plt.cm.jet)
>> File "C:\Python27\lib\site-packages\mpl_toolkits\basemap\__init__.py",
>> line 3072, in contourf
>> np.logical_or(outsidemask,np.logical_or(ma.getmaskarray(data),xymask))
>> AttributeError: logical_or
>>
>> Any feedback/ideas will be greatly appreciated.
>>
>>
>>
Your error is very strange and it just simply should not be happening. On
a completely wild guess, could you try replacing "import numpy as N" with
"import numpy as np" and replace all instances of "N" with "np"?
Ben Root
|
|
From: Tony Yu <ts...@gm...> - 2012-03-14 18:45:57
|
On Wed, Mar 14, 2012 at 2:38 PM, kususe <ku...@in...> wrote: > > I got an error using the first subplot function because I have to specify 3 > parameters. > If i do it, I get that "AxesSubplot' object is not iterable" > I coded using 3 subplot functions, getting the same error. > > Thanks > K. > > Note that I wrote `subplots` with an "s", which is a different command than `subplot`. (You're really having problems with "s"s today :) BTW, would you mind interleaving or bottom-posting replies<http://en.wikipedia.org/wiki/Posting_style#Placement_of_replies>. It's a bit easier to follow the conversation that way. -Tony > > Tony Yu-3 wrote: > > > > On Wed, Mar 14, 2012 at 1:41 PM, kususe <ku...@in...> wrote: > > > >> > >> Thanks, it works. > >> But if the graph is just one in a figure. > >> > >> I created various graph and I wanna remove all ticks in all of X axis. > >> I coded: > >> > >> plt.subplot(3,1,1) > >> p1, = plt.plot(self.data0,self.data1) > >> ..... > >> plt.subplot(3,1,2) > >> p2, = plt.plot(self.data0,self.data2) > >> ..... > >> plt.subplot(3,1,3) > >> p3, = plt.plot(self.data0,self.data4) > >> ..... > >> > >> how can I work the problem out? > >> > > > > I would do the following (`subplots` requires mpl 1.0, I think): > > > > fig, axes = plt.subplots(ncols=3) > > ax1, ax2, ax3 = axes > > ax1.plot(x, y1) > > ... > > ax2.plot(x, y2) > > ... > > ax3.plot(x, y3) > > ... > > for ax in axes:\ > > ax.set_xticks([]) > > ... > > > > > > Cheers, > > -Tony > > > > Thanks in advance > >> K. > >> > >> > >> Tony Yu-3 wrote: > >> > > >> > On Wed, Mar 14, 2012 at 5:44 AM, kususe <ku...@in...> wrote: > >> > > >> >> > >> >> Hi folks, > >> >> I have a graph got using the subplot command. > >> >> I'd like to remove all ticks in X axis in all of graph. > >> >> > >> >> I used: plt.setp(plt.gca(),'XtickLabel',[]) > >> >> > >> >> but I get that: > >> >> > >> >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 1169, > >> in > >> >> setp > >> >> func = getattr(o,funcName) > >> >> AttributeError: 'AxesSubplot' object has no attribute > 'set_xticklabel' > >> >> > >> >> Suggestions? > >> >> Thanks in advance > >> >> K > >> >> > >> >> > >> > You're missing an "s"; i.e. "xticklabels". Also, the more conventional > >> > pattern is to call the axes method, i.e.: > >> > > >> > >>> ax = plt.gca() > >> > >>> ax.set_xticklabels([]) > >> > > >> > or, if want to remove both labels and the tick-lines > >> > > >> > >>> ax.set_xticks([]) > >> > > >> > Best, > >> > -Tony > >> > > >> > |
|
From: kususe <ku...@in...> - 2012-03-14 18:38:36
|
I got an error using the first subplot function because I have to specify 3 parameters. If i do it, I get that "AxesSubplot' object is not iterable" I coded using 3 subplot functions, getting the same error. Thanks K. Tony Yu-3 wrote: > > On Wed, Mar 14, 2012 at 1:41 PM, kususe <ku...@in...> wrote: > >> >> Thanks, it works. >> But if the graph is just one in a figure. >> >> I created various graph and I wanna remove all ticks in all of X axis. >> I coded: >> >> plt.subplot(3,1,1) >> p1, = plt.plot(self.data0,self.data1) >> ..... >> plt.subplot(3,1,2) >> p2, = plt.plot(self.data0,self.data2) >> ..... >> plt.subplot(3,1,3) >> p3, = plt.plot(self.data0,self.data4) >> ..... >> >> how can I work the problem out? >> > > I would do the following (`subplots` requires mpl 1.0, I think): > > fig, axes = plt.subplots(ncols=3) > ax1, ax2, ax3 = axes > ax1.plot(x, y1) > ... > ax2.plot(x, y2) > ... > ax3.plot(x, y3) > ... > for ax in axes:\ > ax.set_xticks([]) > ... > > > Cheers, > -Tony > > Thanks in advance >> K. >> >> >> Tony Yu-3 wrote: >> > >> > On Wed, Mar 14, 2012 at 5:44 AM, kususe <ku...@in...> wrote: >> > >> >> >> >> Hi folks, >> >> I have a graph got using the subplot command. >> >> I'd like to remove all ticks in X axis in all of graph. >> >> >> >> I used: plt.setp(plt.gca(),'XtickLabel',[]) >> >> >> >> but I get that: >> >> >> >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 1169, >> in >> >> setp >> >> func = getattr(o,funcName) >> >> AttributeError: 'AxesSubplot' object has no attribute 'set_xticklabel' >> >> >> >> Suggestions? >> >> Thanks in advance >> >> K >> >> >> >> >> > You're missing an "s"; i.e. "xticklabels". Also, the more conventional >> > pattern is to call the axes method, i.e.: >> > >> > >>> ax = plt.gca() >> > >>> ax.set_xticklabels([]) >> > >> > or, if want to remove both labels and the tick-lines >> > >> > >>> ax.set_xticks([]) >> > >> > Best, >> > -Tony >> > >> > >> ------------------------------------------------------------------------------ >> > Virtualization & Cloud Management Using Capacity Planning >> > Cloud computing makes use of virtualization - but cloud computing >> > also focuses on allowing computing to be delivered as a service. >> > http://www.accelacomm.com/jaw/sfnl/114/51521223/ >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Mat...@li... >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > >> > >> -- >> View this message in context: >> http://old.nabble.com/How-to-remove-x-axis-in-a-subplotted-graph-tp33500598p33504036.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> >> ------------------------------------------------------------------------------ >> Virtualization & Cloud Management Using Capacity Planning >> Cloud computing makes use of virtualization - but cloud computing >> also focuses on allowing computing to be delivered as a service. >> http://www.accelacomm.com/jaw/sfnl/114/51521223/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/How-to-remove-x-axis-in-a-subplotted-graph-tp33500598p33504472.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Aman T. <ama...@gm...> - 2012-03-14 18:36:19
|
On Wed, Mar 14, 2012 at 2:16 PM, Aman Thakral <ama...@gm...>wrote: > I recently upgrade to Python 2.7 (I used EPD Free for the install which > comes with matplotlib 1.1.0) and I'm getting the following error when I try > to plot dates. I've tried a few different backends, but they all seem to > give the same error. I had no issues using Python 2.6 up to now. I think > this may have to do with the new requirement in Python 2.7 that if you > passed a float to a function that was defined as an int, it now raises a > TypeError (instead of a DeprecationWarning). > > Traceback (most recent call last): > File "C:\Python27\lib\site-packages\matplotlib\backends\backend_wx.py", > line 1289, in _onLeftButtonDown > FigureCanvasBase.button_press_event(self, x, y, 1, guiEvent=evt) > File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line > 1632, in button_press_event > self.callbacks.process(s, mouseevent) > File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 256, in > process > proxy(*args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 189, in > __call__ > return mtd(*args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line > 1522, in pick > self.figure.pick(mouseevent) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 332, in > pick > a.pick(mouseevent) > File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 3038, in > pick > martist.Artist.pick(self,args[0]) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 332, in > pick > a.pick(mouseevent) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 321, in > pick > self.figure.canvas.pick_event(mouseevent, self, **prop) > File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line > 1598, in pick_event > self.callbacks.process(s, event) > File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 256, in > process > proxy(*args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 189, in > __call__ > return mtd(*args, **kwargs) > File "C:\src\QC_DUAL\src\QC_DUAL\databrowser.py", line 284, in onpick > self.fig.canvas.draw() > File > "C:\Python27\lib\site-packages\matplotlib\backends\backend_wxagg.py", line > 59, in draw > FigureCanvasAgg.draw(self) > File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py", > line 401, in draw > self.figure.draw(self.renderer) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 884, in > draw > func(*args) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1983, in > draw > a.draw(renderer) > File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in > draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 1036, in > draw > ticks_to_draw = self._update_ticks(renderer) > File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 926, in > _update_ticks > tick_tups = [ t for t in self.iter_ticks()] > File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 873, in > iter_ticks > majorLocs = self.major.locator() > File "C:\Python27\lib\site-packages\matplotlib\dates.py", line 594, in > __call__ > dates = self.rule.between(dmin, dmax, True) > File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 207, in > between > for i in gen: > File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 451, in > _iter > dayset, start, end = getdayset(year, month, day) > File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 797, in > ddayset > i = datetime.date(year, month, day).toordinal()-self.yearordinal > TypeError: integer argument expected, got float > Ok, so I managed to track this down. Apparently I was using a float instead of an int in the interval argument of the HourLocator. I think casting to the interval argument to int in the dates.HourLocator class would be a good idea so users not familiar with the nuance won't have to deal with this headache. |
|
From: Aman T. <ama...@gm...> - 2012-03-14 18:16:53
|
I recently upgrade to Python 2.7 (I used EPD Free for the install which
comes with matplotlib 1.1.0) and I'm getting the following error when I try
to plot dates. I've tried a few different backends, but they all seem to
give the same error. I had no issues using Python 2.6 up to now. I think
this may have to do with the new requirement in Python 2.7 that if you
passed a float to a function that was defined as an int, it now raises a
TypeError (instead of a DeprecationWarning).
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_wx.py",
line 1289, in _onLeftButtonDown
FigureCanvasBase.button_press_event(self, x, y, 1, guiEvent=evt)
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line
1632, in button_press_event
self.callbacks.process(s, mouseevent)
File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 256, in
process
proxy(*args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 189, in
__call__
return mtd(*args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line
1522, in pick
self.figure.pick(mouseevent)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 332, in
pick
a.pick(mouseevent)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 3038, in
pick
martist.Artist.pick(self,args[0])
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 332, in
pick
a.pick(mouseevent)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 321, in
pick
self.figure.canvas.pick_event(mouseevent, self, **prop)
File "C:\Python27\lib\site-packages\matplotlib\backend_bases.py", line
1598, in pick_event
self.callbacks.process(s, event)
File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 256, in
process
proxy(*args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\cbook.py", line 189, in
__call__
return mtd(*args, **kwargs)
File "C:\src\QC_DUAL\src\QC_DUAL\databrowser.py", line 284, in onpick
self.fig.canvas.draw()
File
"C:\Python27\lib\site-packages\matplotlib\backends\backend_wxagg.py", line
59, in draw
FigureCanvasAgg.draw(self)
File "C:\Python27\lib\site-packages\matplotlib\backends\backend_agg.py",
line 401, in draw
self.figure.draw(self.renderer)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 884, in
draw
func(*args)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\axes.py", line 1983, in
draw
a.draw(renderer)
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
draw(artist, renderer, *args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 1036, in
draw
ticks_to_draw = self._update_ticks(renderer)
File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 926, in
_update_ticks
tick_tups = [ t for t in self.iter_ticks()]
File "C:\Python27\lib\site-packages\matplotlib\axis.py", line 873, in
iter_ticks
majorLocs = self.major.locator()
File "C:\Python27\lib\site-packages\matplotlib\dates.py", line 594, in
__call__
dates = self.rule.between(dmin, dmax, True)
File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 207, in
between
for i in gen:
File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 451, in _iter
dayset, start, end = getdayset(year, month, day)
File "C:\Python27\lib\site-packages\dateutil\rrule.py", line 797, in
ddayset
i = datetime.date(year, month, day).toordinal()-self.yearordinal
TypeError: integer argument expected, got float
|
|
From: Tony Yu <ts...@gm...> - 2012-03-14 18:15:10
|
On Wed, Mar 14, 2012 at 1:41 PM, kususe <ku...@in...> wrote:
>
> Thanks, it works.
> But if the graph is just one in a figure.
>
> I created various graph and I wanna remove all ticks in all of X axis.
> I coded:
>
> plt.subplot(3,1,1)
> p1, = plt.plot(self.data0,self.data1)
> .....
> plt.subplot(3,1,2)
> p2, = plt.plot(self.data0,self.data2)
> .....
> plt.subplot(3,1,3)
> p3, = plt.plot(self.data0,self.data4)
> .....
>
> how can I work the problem out?
>
I would do the following (`subplots` requires mpl 1.0, I think):
fig, axes = plt.subplots(ncols=3)
ax1, ax2, ax3 = axes
ax1.plot(x, y1)
...
ax2.plot(x, y2)
...
ax3.plot(x, y3)
...
for ax in axes:\
ax.set_xticks([])
...
Cheers,
-Tony
Thanks in advance
> K.
>
>
> Tony Yu-3 wrote:
> >
> > On Wed, Mar 14, 2012 at 5:44 AM, kususe <ku...@in...> wrote:
> >
> >>
> >> Hi folks,
> >> I have a graph got using the subplot command.
> >> I'd like to remove all ticks in X axis in all of graph.
> >>
> >> I used: plt.setp(plt.gca(),'XtickLabel',[])
> >>
> >> but I get that:
> >>
> >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 1169, in
> >> setp
> >> func = getattr(o,funcName)
> >> AttributeError: 'AxesSubplot' object has no attribute 'set_xticklabel'
> >>
> >> Suggestions?
> >> Thanks in advance
> >> K
> >>
> >>
> > You're missing an "s"; i.e. "xticklabels". Also, the more conventional
> > pattern is to call the axes method, i.e.:
> >
> > >>> ax = plt.gca()
> > >>> ax.set_xticklabels([])
> >
> > or, if want to remove both labels and the tick-lines
> >
> > >>> ax.set_xticks([])
> >
> > Best,
> > -Tony
> >
> >
> ------------------------------------------------------------------------------
> > Virtualization & Cloud Management Using Capacity Planning
> > Cloud computing makes use of virtualization - but cloud computing
> > also focuses on allowing computing to be delivered as a service.
> > http://www.accelacomm.com/jaw/sfnl/114/51521223/
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
> --
> View this message in context:
> http://old.nabble.com/How-to-remove-x-axis-in-a-subplotted-graph-tp33500598p33504036.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: kususe <ku...@in...> - 2012-03-14 17:41:49
|
Thanks, it works.
But if the graph is just one in a figure.
I created various graph and I wanna remove all ticks in all of X axis.
I coded:
plt.subplot(3,1,1)
p1, = plt.plot(self.data0,self.data1)
.....
plt.subplot(3,1,2)
p2, = plt.plot(self.data0,self.data2)
.....
plt.subplot(3,1,3)
p3, = plt.plot(self.data0,self.data4)
.....
how can I work the problem out?
Thanks in advance
K.
Tony Yu-3 wrote:
>
> On Wed, Mar 14, 2012 at 5:44 AM, kususe <ku...@in...> wrote:
>
>>
>> Hi folks,
>> I have a graph got using the subplot command.
>> I'd like to remove all ticks in X axis in all of graph.
>>
>> I used: plt.setp(plt.gca(),'XtickLabel',[])
>>
>> but I get that:
>>
>> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 1169, in
>> setp
>> func = getattr(o,funcName)
>> AttributeError: 'AxesSubplot' object has no attribute 'set_xticklabel'
>>
>> Suggestions?
>> Thanks in advance
>> K
>>
>>
> You're missing an "s"; i.e. "xticklabels". Also, the more conventional
> pattern is to call the axes method, i.e.:
>
> >>> ax = plt.gca()
> >>> ax.set_xticklabels([])
>
> or, if want to remove both labels and the tick-lines
>
> >>> ax.set_xticks([])
>
> Best,
> -Tony
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
View this message in context: http://old.nabble.com/How-to-remove-x-axis-in-a-subplotted-graph-tp33500598p33504036.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Zoltán V. <zv...@gm...> - 2012-03-14 14:33:41
|
You could download the examples from http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/, and that should solve your problem once and for all. Cheers, Zoltán > > > On Wed, Mar 14, 2012 at 9:58 AM, Jonathan Slavin > <js...@cf... <mailto:js...@cf...>> wrote: > > Hi, > > Recently on several occasions I have gotten the response "Too many > requests, please try again later." when trying to go to a matplotlib > webpage. Have others experienced this also? Is this a problem with > sourceforge? I'm wondering what could be done about this. It's very > annoying when, for example, you want to see the source code for some > useful example and you have to try back several times to get to the > page. > > Jon > -- > __________________________________________________ > > > No insights here, just confirmation: I've also gotten this error > message a few times over the last few weeks. > > -Tony > > |
|
From: Tony Yu <ts...@gm...> - 2012-03-14 14:15:14
|
On Wed, Mar 14, 2012 at 9:58 AM, Jonathan Slavin <js...@cf...>wrote: > Hi, > > Recently on several occasions I have gotten the response "Too many > requests, please try again later." when trying to go to a matplotlib > webpage. Have others experienced this also? Is this a problem with > sourceforge? I'm wondering what could be done about this. It's very > annoying when, for example, you want to see the source code for some > useful example and you have to try back several times to get to the > page. > > Jon > -- > __________________________________________________ > > No insights here, just confirmation: I've also gotten this error message a few times over the last few weeks. -Tony |