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
(8) |
2
(2) |
3
(1) |
4
(2) |
5
(15) |
6
(12) |
7
(10) |
8
(2) |
9
(5) |
10
(5) |
11
(8) |
12
(12) |
13
(26) |
14
(10) |
15
(11) |
16
(2) |
17
(3) |
18
(19) |
19
(25) |
20
(11) |
21
(8) |
22
(8) |
23
(2) |
24
|
25
(8) |
26
(4) |
27
(2) |
28
(5) |
29
(3) |
30
(5) |
Hi all, I regularly use matplotlib for plotting data relating to my personal finances. At the moment I'm converting Decimals to floats. Do I still have to do this? If yes, are there any plans to support Decimals? I've tried searching the latest PDF document, my apologies if I've missed anything, in which case could I have a pointer please. -- Cheers. Mark Lawrence.
Khary, On Sun, Jun 10, 2012 at 3:30 PM, surfcast23 <sur...@gm...> wrote: > > to matplotlib-use. > Hi, > > I have a data set that is composed of x,y,z coordinates of the center of > cells and counts of objects in each contained in cell. I am using the > following code to do a scatter plot of the counts per cell. > > > ax = fig.add_subplot(111, projection='3d') > ax.scatter(Xa, Ya, Za, zdir='z', s=C, c='b') > ax.set_xlabel('X Label') > ax.set_ylabel('Y Label') > ax.set_zlabel('Z Label') > plt.show() > > Where Xa, Ya, Za, are arrays containing the cell centers, and C is an array > of counts per cell. Below is a plot I did where the blue circles represent > the "size in points^2. It is a scalar or an array of the same length as x > and y."(Quote from docs). What I would like to do is have the plot show > the actual number of counts as points in the plot. Is such a thing > possible? > Thanks > > Best, > Khary > I think this example might be what you are looking for: http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/tutorial.html#text Cheers! Ben Root
Ananduri, On Fri, Jun 15, 2012 at 8:47 AM, ananduri <aru...@gm...> wrote: > > Hello, > > I have some minor questions regarding matplotlib. I'm using it to make a 3d > plot, displaying a surface, it's contour map, a line climbing the surface > and its projection onto the contour map. > > http://old.nabble.com/file/p34015720/landscape_draft.pnglandscape_draft.png > > As you can see, when the lines cross the contourf, they are somewhat > obscured. Before I made the contourf transparent, the lines were blocked, > even though they were above the contour plot when I viewed the picture from > a different angle. Can this be fixed? I want the lines to appear on top of > the contour plot. > > Unfortunately, no. Matplotlib was originally designed as a 2D layering renderer. The mplot3d toolkit tries to work within that framework, but in the end, each artist object has to be represented by a single 3rd dimension coordinate (the layer), and so when two artists share bounding box regions, physically incorrect results will happen. Please see this FAQ: http://matplotlib.sourceforge.net/mpl_toolkits/mplot3d/faq.html#my-3d-plot-doesn-t-look-right-at-certain-viewing-angles > Also, I am trying to extend the z axis to be lower. This is most of the > code > I'm using: > > fig=plt.figure(1) > ax=fig.gca(projection='3d') > > x=np.arange(0,2.5,.02) > y=np.arange(0,2.3,.02) > x,y=np.meshgrid(x,y) > > ax.plot_surface(x,y,Z(x,y),alpha=0.3) > > cset=ax.contourf(x,y,Z(x,y),zdir='z',offset=-2, > cmap=plt.cm.jet,levels=np.linspace(0,9,100),alpha=0.5) > > ax.set_xlabel('x') > ax.set_ylabel('y') > > ax.set_zlim(-2,8) #This is where I try to change the z axis limits. > > plt.show() > > I'm excluding the code which plots the lines. ax.set_zlim doesn't do > anything; why is this? > That would depend on which version of matplotlib you are using. The v1.1.x branch should have that working properly. Cheers! Ben Root
Hi there, I'm sorry to ask such a newbie question, but I'd like to format a custom box plot and although there are numerous examples on the web and tons of docstrings in matplotlib, I'm stuck somehow. My problems center around axes / spines. In detail, my problems are: 1) I want an y-axis on the left that spans from -0.6 to 1.1, ends in an arrow, has major ticks at 0 and 1 and minor ticks at [0.1...0.9] As far as I understand, there is no option to let spines end in an arrow head, so I have to draw the myself. I get the ticks to appear at the right positions and the y-range to be as desired - however, the spine line is not drawn over the full y-range, but only where there is data in the diagram. Also, I copied the arrow annotation code blindly from an older post on this list, but do not understand how I can adapt the arrow head to appear at a data position (instead of at the corner of the Axes area). One problem is, that I get ticks on the right although that spine was disabled. 2) I want some kind of x-axis at y==0, without ticks and without arrow Using some methods on the spines, I can disable the top spine and move the bottom spine to zero. However, as with the y-axis, I cannot control from where to where the line itself is drawn. As attachments, you'll find a hand sketch of what my graph should look like and matplotlib code that goes nearly all the way. I would be very happy about a hint on how to fix the problems left. Thanks an advance, Mark [cid:ed2...@ex...]
Hello, I have some minor questions regarding matplotlib. I'm using it to make a 3d plot, displaying a surface, it's contour map, a line climbing the surface and its projection onto the contour map. http://old.nabble.com/file/p34015720/landscape_draft.png landscape_draft.png As you can see, when the lines cross the contourf, they are somewhat obscured. Before I made the contourf transparent, the lines were blocked, even though they were above the contour plot when I viewed the picture from a different angle. Can this be fixed? I want the lines to appear on top of the contour plot. Also, I am trying to extend the z axis to be lower. This is most of the code I'm using: fig=plt.figure(1) ax=fig.gca(projection='3d') x=np.arange(0,2.5,.02) y=np.arange(0,2.3,.02) x,y=np.meshgrid(x,y) ax.plot_surface(x,y,Z(x,y),alpha=0.3) cset=ax.contourf(x,y,Z(x,y),zdir='z',offset=-2, cmap=plt.cm.jet,levels=np.linspace(0,9,100),alpha=0.5) ax.set_xlabel('x') ax.set_ylabel('y') ax.set_zlim(-2,8) #This is where I try to change the z axis limits. plt.show() I'm excluding the code which plots the lines. ax.set_zlim doesn't do anything; why is this? -- View this message in context: http://old.nabble.com/3d-contourf-and-ax.set-tp34015720p34015720.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Jeff: in the end, i decided to suspend this kind of approach to problem, but should give it a try in the future. thanks for suggestion. -Yasin 2012年6月14日 Jeff Whitaker <jef...@no...> > On 6/14/12 7:52 AM, Yasin Selçuk Berber wrote: > > I want to set a projection area larger than data's geographical coverage. > > But data must still be georeferenced correctly inside map region > and coastlines in projection area should still be visible outside data > area. > > right now, the data is always stretched inside whole projection area. > > trying to mimic with characters: > > > --right now-- > > ulcorner > _______________________ > | p r o j. a r e a | > | | > | w h o l e | > | d a t a | > | i s | > | s t r e t c h e d | > | | > -----------------------| lrcorner > > > --what i try to do-- > > ulcorner > _______________________ > | | > |__________ this | > | | is | > | this |projection | > | is | area | > | data | | > | | | > -----------------------| lrcorner > > > Code below certainly does not work and stretch data to full projection > region: > > ------------------------- > *code skipped* > > m = Basemap(projection='merc',llcrnrlat=37,urcrnrlat=42,\ > llcrnrlon=24,urcrnrlon=34,resolution='i') > > m.imshow(data, cmap=plt.cm.jet, interpolation='nearest') > > plt.show() > > *code skipped* > --------------------------- > > i fiddled with imshow's extent and clip_box keywords but since could not > get it work. and googling for a serious amount of time didnt help either. > Some posts on web mentioned bbox or set_autoscale_on related things but i > cant seem to get it. Any ideas ? > > thanks. > > > -- > Yasin Selçuk Berber > "Bismillah, her hayrın başıdır." > > > Yasin: If you use pcolor or contourf, you can specify the x,y (map > projection) coordinates of the data grid, and the data will be plotted on a > subset of the map projection region. imshow (which doesn't take x,y > coordinates) just fills the whole plotting region with an image. If you > want to use imshow, perhaps you could define an inset map (with no > coastlines drawn) inside your larger map, and plot the image on the inset > map. > > -Jeff > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > Meteorologist FAX : (303)497-6449 > NOAA/OAR/PSD R/PSD1 Email : Jef...@no... > 325 Broadway Office : Skaggs Research Cntr 1D-113 > Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg > > -- Yasin Selçuk Berber "Bismillah, her hayrın başıdır."
On 06/14/2012 02:39 PM, Peter Würtz wrote: > > > > Benjamin Root-2 wrote: >> >> On Wed, Jun 13, 2012 at 10:46 AM, Peter Würtz >> <pw...@go...>wrote: >> >>> import matplotlib >>> import pylab as p >>> >>> p.plot([1,2,3]) >>> p.xticks([1],["tick"]) >>> ax = p.gca() >>> fig = p.gcf() >>> >>> p.draw() >>> def print_texts(artist): >>> for t in artist.findobj(matplotlib.text.Text): >>> if t.get_visible() and t.get_text(): >>> print " %s @ %s" % (t.get_text(), t.get_position()) >>> >>> print "X-Axis" >>> print_texts(ax.xaxis) >> >> This is my output using v1.1.1-rc2 >> >> X-Axis >> tick @ (1.0, 0.0) >> tick @ (0.0, 1.0) >> >> Strange indeed. >> >> > > So, it is a bug then? Doesn't look like a feature to me :) The reason it is happening is that Tick is a complicated beast, and it always includes two Text objects, whether they are needed or not. Whether they are drawn is controlled by the attributes 'label1On' and 'label2On', not by the standard Artist.get_visible(). I don't see any reason offhand why it couldn't be modified to use get_visible(). Eric
On Thursday, June 14, 2012, Jonathan Hayward wrote: > http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html > > This is something I'd like to be able to produce, but for millions of > records, where the center will look like one undifferentiated mass of dark > blue. > > Is there a way to let something like that scale better to large sizes? For > instance, is it possible to have a point be one pixel and an RGBA color of > 00000001 (black color one notch away from complete transparency)? Or for > another approach, is it possible to say "I want the highest value to be the > darkest color, e.g. black and everything else to be greyscale against its > percentage of the maximum value? > > Other suggestions? > Have you taken a look at hexbin()? It is usually what I use for situations like this. Cheers! Ben Root >
Benjamin Root-2 wrote: > > On Wed, Jun 13, 2012 at 10:46 AM, Peter Würtz > <pw...@go...>wrote: > >> import matplotlib >> import pylab as p >> >> p.plot([1,2,3]) >> p.xticks([1],["tick"]) >> ax = p.gca() >> fig = p.gcf() >> >> p.draw() >> def print_texts(artist): >> for t in artist.findobj(matplotlib.text.Text): >> if t.get_visible() and t.get_text(): >> print " %s @ %s" % (t.get_text(), t.get_position()) >> >> print "X-Axis" >> print_texts(ax.xaxis) > > This is my output using v1.1.1-rc2 > > X-Axis > tick @ (1.0, 0.0) > tick @ (0.0, 1.0) > > Strange indeed. > > So, it is a bug then? Doesn't look like a feature to me :) -- View this message in context: http://old.nabble.com/Duplicate-Ticks-tp34005378p34015581.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Thursday, June 14, 2012, Daπid wrote: > First, this is another topic, so please, change the subject of the > message so it doesn't get messed up with others (and possible help > lost in the process). > > Now, you are indeed plotting one dot at the time and generating a > label for it. If you don't want that, you have to plot the whole list > at the time: > > > x=[rand() for i in xrange(10)] > y=[rand() for i in xrange(10)] > > scatter(x,y, label='points') > legend() > show() > > where the definition of x includes a list comprehension (equivalent at > "for i in xrange(10): x.append(rand())" ). > > On another topic, people are not usually fan of using from MODULEX > import *, as it can turn into poor code and name collisions. It is > nicer if you write "import pylab as plt", and refer to the functions > as plt.scatter and so on. > > > Regards. Point of style: in general, yes, but pylab was intended for that to help transition matlab users. Pylab really shouldn't be loaded as plt, because that is what pyplot is usually imported as. Of course, this is all just a matter of style and preference. Cheers ! Ben Root
First, this is another topic, so please, change the subject of the message so it doesn't get messed up with others (and possible help lost in the process). Now, you are indeed plotting one dot at the time and generating a label for it. If you don't want that, you have to plot the whole list at the time: x=[rand() for i in xrange(10)] y=[rand() for i in xrange(10)] scatter(x,y, label='points') legend() show() where the definition of x includes a list comprehension (equivalent at "for i in xrange(10): x.append(rand())" ). On another topic, people are not usually fan of using from MODULEX import *, as it can turn into poor code and name collisions. It is nicer if you write "import pylab as plt", and refer to the functions as plt.scatter and so on. Regards. On Wed, Jun 13, 2012 at 9:21 PM, Steven Boada <bo...@ph...> wrote: > List, > > I'm making a scatter plot using a for loop. Here's a simple example.. > > for i in range(10): > x=rand() > y=rand() > scatter(x,y,label='point') > > legend() > show() > > > When you do this, you get a legend entry for every single point. In this > case, I get 9 entries in my legend. > > Is there a way to only get a single entry? I have looked into creating > the legends by hand, but I'm not having much luck. Googling, only turned > up a single example of someone else with the same problem. > > Help me list, you're my only hope. > > Steven > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On 6/14/12 7:52 AM, Yasin Selçuk Berber wrote: > I want to set a projection area larger than data's geographical coverage. > But data must still be georeferenced correctly inside map region > and coastlines in projection area should still be visible outside data > area. > right now, the data is always stretched inside whole projection area. > trying to mimic with characters: > --right now-- > ulcorner > _______________________ > | p r o j. a r e a | > | | > | w h o l e | > | d a t a | > | i s | > | s t r e t c h e d | > | | > -----------------------| lrcorner > --what i try to do-- > ulcorner > _______________________ > | | > |__________ this | > | | is | > | this |projection | > | is | area | > | data | | > | | | > -----------------------| lrcorner > Code below certainly does not work and stretch data to full projection > region: > ------------------------- > *code skipped* > m = Basemap(projection='merc',llcrnrlat=37,urcrnrlat=42,\ > llcrnrlon=24,urcrnrlon=34,resolution='i') > m.imshow(data, cmap=plt.cm.jet, interpolation='nearest') > plt.show() > *code skipped* > --------------------------- > i fiddled with imshow's extent and clip_box keywords but since could > not get it work. and googling for a serious amount of time didnt help > either. > Some posts on web mentioned bbox or set_autoscale_on related things > but i cant seem to get it. Any ideas ? > thanks. > > > -- > Yasin Selçuk Berber > "Bismillah, her hayr?n bas,?d?r." Yasin: If you use pcolor or contourf, you can specify the x,y (map projection) coordinates of the data grid, and the data will be plotted on a subset of the map projection region. imshow (which doesn't take x,y coordinates) just fills the whole plotting region with an image. If you want to use imshow, perhaps you could define an inset map (with no coastlines drawn) inside your larger map, and plot the image on the inset map. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
On Tue, Jun 12, 2012 at 11:59 AM, Paul Hobson <pmh...@gm...> wrote: > On Mon, Jun 11, 2012 at 11:03 PM, Justin R <jus...@gm...> wrote: > > operating system Windows 7 > > matplotlib version : 1.1.0 > > obtained from sourceforge > > > > the class seems to generate the same Wt matrix for every input. The > > every element of the weight matrix is either +sqrt(1/2) or -sqrt(1/2). > > > > dat1 = 4*np.random.randn(200,1) + 2 > > dat2 = dat1*.25 + 1*np.random.randn(200,1) > > pcaObj1 = PCA(np.hstack((dat1,dat2))) > > print pcaObj1.Wt > > > > dat3 = 2*np.random.randn(200,1) + 2 > > dat4 = dat3*2 + 3*np.random.randn(200,1) > > pcaObj2 = PCA(np.hstack((dat1,dat2))) > > print pcaObj2.Wt > > > > The output Y seems to be correct, and the projection function works. > > only the Wt matrix seems to be messed up. Am I using this class > > incorrectly, or could this be a bug? > > thanks, > > Justin > > Justin, could you post a self-contained script that demonstrates the > issue? Where does this PCA function come from? > > In [1]: from pylab import * > > In [2]: PCA > --------------------------------------------------------------------------- > NameError Traceback (most recent call last) > C:\Users\phobson\<ipython-input-2-dcf6991f51c0> in <module>() > ----> 1 PCA > > NameError: name 'PCA' is not defined > > Paul, In case you never got an answer to this: PCA is in the mlab submodule, so if you do "from pylab import *", you would use mlab.PCA. (At least that's the case in matplotlib 1.1.0). Warren > -paul > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
http://matplotlib.sourceforge.net/examples/axes_grid/scatter_hist.html This is something I'd like to be able to produce, but for millions of records, where the center will look like one undifferentiated mass of dark blue. Is there a way to let something like that scale better to large sizes? For instance, is it possible to have a point be one pixel and an RGBA color of 00000001 (black color one notch away from complete transparency)? Or for another approach, is it possible to say "I want the highest value to be the darkest color, e.g. black and everything else to be greyscale against its percentage of the maximum value? Other suggestions? -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Jonathan Hayward, an Orthodox Christian author. *Amazon* <https://www.amazon.com/author/cjshayward> • Author Bio<http://jonathanscorner.com/author/> • *Email <chr...@gm...>* • Facebook<http://www.facebook.com/christos.jonathan.hayward> • Google Plus <http://jonathanscorner.com/plus> • *Kindle<http://stornge.com/amazon> * • LinkedIn <http://www.linkedin.com/in/jonathanhayward> • Twitter<http://twitter.com/JonathansCorner> • *Web <http://jonathanscorner.com/>* • What's New?<http://jonathanscorner.com/> I invite you to visit my "theology, literature, and other creative works" site. *See a random page! <http://random.jonathanscorner.com/>*
I want to set a projection area larger than data's geographical coverage. But data must still be georeferenced correctly inside map region and coastlines in projection area should still be visible outside data area. right now, the data is always stretched inside whole projection area. trying to mimic with characters: --right now-- ulcorner _______________________ | p r o j. a r e a | | | | w h o l e | | d a t a | | i s | | s t r e t c h e d | | | -----------------------| lrcorner --what i try to do-- ulcorner _______________________ | | |__________ this | | | is | | this |projection | | is | area | | data | | | | | -----------------------| lrcorner Code below certainly does not work and stretch data to full projection region: ------------------------- *code skipped* m = Basemap(projection='merc',llcrnrlat=37,urcrnrlat=42,\ llcrnrlon=24,urcrnrlon=34,resolution='i') m.imshow(data, cmap=plt.cm.jet, interpolation='nearest') plt.show() *code skipped* --------------------------- i fiddled with imshow's extent and clip_box keywords but since could not get it work. and googling for a serious amount of time didnt help either. Some posts on web mentioned bbox or set_autoscale_on related things but i cant seem to get it. Any ideas ? thanks. -- Yasin Selçuk Berber "Bismillah, her hayrın başıdır."
using axes.set_anchor will do the trick. chao wiswit wrote: > > Dear all, > > I think this is quite easy but I searched the internet and mailing list > and > not able to find an answer. > ax2 is an inset axes within the "ax" axes in figure "fig", which I make > following here > http://matplotlib.sourceforge.net/examples/pylab_examples/axes_demo.html > > but now my problem is that I cannot fix the ax2 the exact position I want, > it seems that draw() command change this: > > > In [352]: > > ax2.set_position([0.125,0.63,0.25,0.25]) > > ax2.set_position([0.125,0.63,0.25,0.25]) > > In [353]: > > ax2.get_position() > > ax2.get_position() > > Out[353]: > > Bbox(array([[ 0.125, 0.63 ], > [ 0.375, 0.88 ]])) > > In [354]: > > draw() > > draw() > > In [355]: > > ax2.get_position() > > ax2.get_position() > > Out[355]: > > Bbox(array([[ 0.15625, 0.63 ], > [ 0.34375, 0.88 ]])) > > > could anyone give any hints? thanks! > > > Chao > > > -- > *********************************************************************************** > Chao YUE > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) > UMR 1572 CEA-CNRS-UVSQ > Batiment 712 - Pe 119 > 91191 GIF Sur YVETTE Cedex > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > ************************************************************************************ > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/how-fix-axes-position-by-using-set_position-method--tp33982759p34011301.html Sent from the matplotlib - users mailing list archive at Nabble.com.
so, I didn't notice the axes.set_anchor method. This will do the trick. Chao wiswit wrote: > > Dear all, > > asking question in a good way is art and I am trying to do that :-). I > spent whole day trying to put an inset axes within another hosting axes > the > exact position I want. > and from here > http://old.nabble.com/Adding-custom-axes-within-a-subplot-td22159536.html > Jae-Joon > Lee <http://old.nabble.com/user/UserProfile.jtp?user=1141641> gave a good > answer using only four lines: > > Bbox = matplotlib.transforms.Bbox.from_bounds(.4, .1, .5, .3) > #numbers in fraction of hosting axes > trans = ax.transAxes + fig.transFigure.inverted() > l, b, w, h = matplotlib.transforms.TransformedBbox(Bbox, trans).bounds > axins = fig.add_axes([l, b, w, h]) > > It works fine. Now my question is I want inset axes to have 'equal' aspect > because I want 1:1 ratio plot. and I found that using > axins.set_aspect('equal') > will change the position of the inset axes. Then I tried to adjust the > width and height of inset axes with the hosting axes aspect ratio before I > draw it so that > I would expect they look already "aspect-equal" before I feed data to it. > > So my first question is, How can I get the axes aspect ratio, > axes.get_aspect() and axes._aspect both give only 'auto' but not > numerical > value. > (I assume it's height/width ratio in terms of figure fraction or it's > inverse?, I tried this but it doesn't work.) > > another side-question, I have a feeling that understanding transform is of > great value working with matplotlib. But I don't understand the > four lines above, and I can not find further information either in the > matplotlib document or online. Is there any source except having > dig into source code? thanks!!!!!!!! > > I make an example script below to show the problem (long but easy). I hope > someone could offer some help. :-) > > ###script showing the problem > fig=plt.figure() > #plot two subplot to have ax aspect far from 'equal' > ax=fig.add_subplot(211) > a=np.arange(0,2*np.pi,0.1) > ax.plot(a,np.sin(a)) > > def create_inset_axes(x0,y0,width,height): #the four numbers are > x0,y0,width,height > Bbox = matplotlib.transforms.Bbox.from_bounds(x0,y0,width,height) > trans = ax.transAxes + fig.transFigure.inverted() > l, b, w, h = matplotlib.transforms.TransformedBbox(Bbox, trans).bounds > return fig.add_axes([l, b, w, h]) > > def get_axes_aspect_ratio(ax): > box=ax.get_position() > ratio=(box.x1-box.x0)/(box.y1-box.y0) > return ratio > > axins=create_inset_axes(0.1,0.05,0.2,0.2) > axins.plot(np.arange(10),'ro') > ax.text(0.35,0.15,'no any adjustment',transform=ax.transAxes) > > axins=create_inset_axes(0.1, 0.3, 0.2, 0.2) > axins.plot(np.arange(10),'ro') > axins.set_aspect('equal') > ax.text(0.35,0.4,'explicitly set aspect as equal',transform=ax.transAxes) > > axins=create_inset_axes(0.1, 0.55, 0.2, 0.2*ratio) #adjust the height by > ax > axes width/height ratio > axins.plot(np.arange(10),'ro') > ax.text(0.35,0.7,'adjust with hosting axes width/length > ratio',transform=ax.transAxes) > > cheers, > > Chao > -- > *********************************************************************************** > Chao YUE > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) > UMR 1572 CEA-CNRS-UVSQ > Batiment 712 - Pe 119 > 91191 GIF Sur YVETTE Cedex > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > ************************************************************************************ > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/confusion-with-axes.set_ratio-tp34006883p34011256.html Sent from the matplotlib - users mailing list archive at Nabble.com.
If all your values are positive (and you are sure of it), you could use the SymmetricalLogScale It uses log scale for large values (both positive and negative), and linear for small ones. http://matplotlib.sourceforge.net/devel/add_new_projection.html I believe there is a way to do it without going symetrical (ie, only defined for positive values), but I am unable to find it. On Wed, Jun 13, 2012 at 7:31 PM, jonasr <jon...@we...> wrote: > > Hi, > > im actually trying to make a countour plot Z=f(X,Y) from two variables X,Y . > My Problem is that i have to use a logarithmic scale for the Z values. > If i plot the data with the logarithmic scale it gets pretty ugly, because i > have a lot of values which are zero, > which means on the log scale the value goes to -inf. > Here is an example what i mean > > http://www.imagebanana.com/view/qh1khpxp/example.png > > I acutally have no idea how to make the plot look better, > maybe somebody has an idea ? > > thank you > -- > View this message in context: http://old.nabble.com/logairthmic-contour-plot-tp34007155p34007155.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Wed, Jun 13, 2012 at 4:00 PM, Timothy Duly <tim...@gm...> wrote: > Hello, > > I am trying to make a simple pcolor plot with a datetime on the x-axis. I > am able to get a time label on the x-axis fine with a regular plot command, > but it doesn't appear to work if you use pcolor. This simple example below > shows that it does not work. Does anyone have any idea as to why a > datetime can't go on a pcolor plot? What is the best approach is to solve > the problem? > > Thanks, > Tim > > It doesn't work because we probably never had a request for it and therefore never tested that case. Testing it out with v1.1.1-rc2 shows that for pcolor(), first of all, it expects a numpy array for the input arrays (that should definitely be fixed) as opposed to a python array. Second, fixing that, there is an issue where the Path object in the pcolor object is expecting floating points for its vertices. If one uses pcolormesh instead, right off the bat, there is a problem where it attempts to make a 2-D version of the 1-D input array, but because the 2-D array was created with default dtype, it is expecting something compatible with a float type. Personally, I am not liking how pcolormesh is being inefficient with my input arrays and it should really be taking advantage of numpy broadcasting. Could you please file a bug report on github for this issue with your code example? Thanks! Ben Root
The gca().collections.set_label('label') works great. Admittedly, I'm not sure why it works. I'm not that great with the collections stuff. But thanks! S On 06/13/2012 03:22 PM, Mike Kaufman wrote: > On 6/13/12 4:06 PM, Steven Boada wrote: >> Well I am doing a lot more than this simple example shows. Point is that >> there are nine different points each with their own legend entry. >> >> I could put it all out of the for loops, but it is all already written, >> and I'd rather just fix the legend at the end than move sections of the >> code around. I'm willing to do it, if that is the only choice, but I >> wanted to ask before I commit my time. >> >> Wouldn't it be a good (smart) thing for the code to lump all the points >> with the same label together? This would be a great feature to be added IMO. > Assuming that you already have ten scatter plots, change the labels on > the ones you don't want in the legend to '_nolegend_' (see help(legend)) > > for i in range(10): > gca().collections[i].set_label('_nolegend_') > gca().collections[0].set_label('the one label I want') > legend() > draw() > > M > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Steven Boada Dept. Physics and Astronomy Texas A&M University bo...@ph...
On 6/13/12 4:06 PM, Steven Boada wrote: > > Well I am doing a lot more than this simple example shows. Point is that > there are nine different points each with their own legend entry. > > I could put it all out of the for loops, but it is all already written, > and I'd rather just fix the legend at the end than move sections of the > code around. I'm willing to do it, if that is the only choice, but I > wanted to ask before I commit my time. > > Wouldn't it be a good (smart) thing for the code to lump all the points > with the same label together? This would be a great feature to be added IMO. Assuming that you already have ten scatter plots, change the labels on the ones you don't want in the legend to '_nolegend_' (see help(legend)) for i in range(10): gca().collections[i].set_label('_nolegend_') gca().collections[0].set_label('the one label I want') legend() draw() M
2012年6月13日 Mike Kaufman <mc...@gm...>: > On 6/13/12 3:23 PM, Steven Boada wrote: >> Whoops, I forgot to change the subject. Sorry list. >> >> List, >> >> I'm making a scatter plot using a for loop. Here's a simple example.. >> >> for i in range(10): >> x=rand() >> y=rand() >> scatter(x,y,label='point') >> >> legend() >> show() >> >> >> When you do this, you get a legend entry for every single point. In this >> case, I get 9 entries in my legend. >> >> Is there a way to only get a single entry? Maybe you can adapt this to your use case: for i in range(10): x=rand() y=rand() collection = scatter(x,y,label='point') legend((collection,), ('Label',)) show() Goyo