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
(20) |
2
(16) |
3
(9) |
4
(12) |
5
(14) |
6
(22) |
7
(17) |
8
(33) |
9
(26) |
10
(32) |
11
(47) |
12
(26) |
13
(7) |
14
(24) |
15
(44) |
16
(42) |
17
(22) |
18
(31) |
19
(8) |
20
(4) |
21
(15) |
22
(27) |
23
(41) |
24
(33) |
25
(31) |
26
(24) |
27
(10) |
28
(20) |
|
|
|
|
|
|
Can anyone help? Michael On 2/1/2010 9:04 PM, Michael Cohen wrote: > Hi all, > One of the most persistent problems I have with matplotlib is finding > out which kwargs and args are available for some commands. > For instance, I am looking at manipulating axis ticks and labels in > mplot3d, so I went to the mplot3d api page, and looked for useful > commands and found: > > set_xlabel(xlabel, fontdict=None, **kwargs)¶ > Set xlabel. > > set_xlim3d(*args, **kwargs)¶ > Set 3D x limits. > > However, there is no information that I can find about "args" and > "kwargs" that I can use to figure out how to make my changes. > > For the record, I want to be able to change the size of the font, the # > and values of the tick marks, and to move the axis labels to one or the > other end of the axis they are labelling. > > Cheers > Michael > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I am trying to extend the bar3d API to include linewidth and linecolor parameters. I got it about halfway working and I would like a pointer on how to finish the job. These are the relevant lines of my test script I used to plot the attached images. ... ax.bar3d(xpos, ypos, zpos, dx, dy, dz) ax.bar3d(xpos[:4], ypos[:4], zpos[:4], dx[:4], dy[:4], dz[:4], linewidth=10, edgecolor='r') ... As you can see, it works from certain angles, but not others. I am wondering if some 3d patches or 3d polys get created somewhere else that I need to modify. Or maybe this is more Z order issues. Or maybe a normal issue. What I did was simply add linewidth and linecolor parameters to the definition of Axes3D.bar3d(). Then I simply pass them into: art3d.Poly3DCollection() near the end of bar3d(). Thanks, -Ben
See Subject. I'm looking at an example whose last line is Show(). I see nothing on the graphic that will allow me to exit. If I select the x in the upper right, it dies badly. -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
I have a bunch of (x,y) points that relate to an ordered path of a meteor; however, when plotted they may no become ordered. For example, (0,0), (2,2), (1,1), (3,4) ... Point 2 jumps backwards. I'd like to connect the points with a line, or better, a line with an arrow indicating direction, so when someone looks at the plot, they can see how uneven the path is and any possible wild jumps in the direction. For example, (0,0), (0.5, 11), (1,1), (2,2) ... Can this be dome? -- My life in two words. "Interrupted Projects." -- WTW (quote originator)
I'm using autoscale_view for the y axis, but find with a marker size > about 10, it will autoscale the graphs such that some markers are bisected by the edges of the frame. I already have it set to: self.subplot.autoscale_view(tight=False, scalex=False, scaley=True) so I'd basically like "tight" here to be "even less tight". For example, for a graph of time in minutes along the y axis, I'd like the bottom of the graph to actually be a bit below zero to catch events that are 0.5 min, etc., without them being half-buried under the edge of the graph. Can autoscale_view be altered a bit to allow for a more generous view? Thanks, Che
I completely understand how hard z sorting can be. However, I think the orthogonal planes that compose the parallel boxes is a pretty constrained problem that does not require a general solution. I might be able to lend a hand if I had some pointers where to get started in the mplot3d library. Thanks, -Ben -----Original Message----- From: Reinier Heeres [mailto:re...@he...] Sent: Wednesday, February 03, 2010 6:10 PM To: Ben Axelrod; pie...@bn...; ben...@ou... Cc: mat...@li... Subject: Re: [Matplotlib-users] re ndering bug in bar3d Hi, Unfortunately z-sorting the polygons is a really hard problem. Or in fact, in the way it is currently implemented, an unsolvable problem. Please remember that mplot3d is not a full-blown 3d engine. Fixing this would require either a z-buffer or things such as BSP trees, which I do not think are feasible to implement. However, I do believe that there might be a small bug lurking somewhere or some other slight improvements to be made. I'll try to look into it after my 2 week holiday. Regards, Reinier On Thu, Jan 28, 2010 at 8:42 PM, baxelrod <bax...@co...> wrote: > > I am also seeing this behavior and it is unfortunately holding my > project back. > > I have seen it with python 2.6 on Debian Linux and Windows XP. I have > seen it in version 0.99.1 and the latest SVN tree (as of yesterday). > > I want to highlight a portion of each 3d bar with another color. This > image shows what I want to do: > http://old.nabble.com/file/p27358778/bar3d-1.png > (http://www.benaxelrod.com/temp/bar3d-1.png) > > But rotating the view leads to rendering issues: > http://old.nabble.com/file/p27358778/bar3d-2.png > (http://www.benaxelrod.com/temp/bar3d-2.png) > > http://old.nabble.com/file/p27358778/bar3d-3.png > (http://www.benaxelrod.com/temp/bar3d-3.png) > > In this example, the bars are drawn next to each other. Here is the > source code to generate the images: > > # code adapted from: hist3d_demo.py > from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as > plt import numpy as np > > fig = plt.figure() > ax = Axes3D(fig) > x, y = np.random.rand(2, 100) * 4 > hist, xedges, yedges = np.histogram2d(x, y, bins=4) > > elements = (len(xedges) - 1) * (len(yedges) - 1) xpos, ypos = > np.meshgrid(xedges[:-1]+0.25, yedges[:-1]+0.25) > > xpos = xpos.flatten() > ypos = ypos.flatten() > zpos = np.zeros(elements) > > dx = 0.5 * np.ones_like(zpos) > dy = dx.copy() > dz = hist.flatten() > > dx = dx*0.5 > xpos = xpos - dx > > ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b') ax.bar3d(xpos+dx, > ypos, zpos, dx, dy, dz, color='r') > > ax.set_xlabel('X') > ax.set_ylabel('Y') > ax.set_zlabel('Z') > > plt.show() > #end code > > I also tried to overlap the bars, but the result was even worse > because from certain angles one of the colors was not visible at all. > > I thought that the issue might be due to calling bar3d muliple times. > So I tried passing in an array of collors to bar3d with no luck. It > seems that bar3d only takes a single color. Is this planned to be > fixed so that > bar3d() can take a color array just like bar()? > > Also note that even very simple examples demonstrate the bug. For example: > http://old.nabble.com/file/p27358778/bar3d-4.png > (http://www.benaxelrod.com/temp/bar3d-4.png) > > http://old.nabble.com/file/p27358778/bar3d-5.png > (http://www.benaxelrod.com/temp/bar3d-5.png) > > Thanks, > -Ben > > > pierre-yves.debrito wrote: >> >> Hi, >> I am currently using this version : matplotlib-0.99.1.win32-py2.6.exe >> When I draw several Axes3D.bar3d in the same figure, as in this >> example, the faces are not drawn in the correct order. >> Did I do something wrong or is it a rendering bug? >> Is there a workaround? >> >> Thanks >> Pierre-Yves de Brito >> >> >> >> >> >> from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as >> plt from numpy import array, arange >> >> >> contrib=[[0.18263,0.19098,0.16815,0.16295,0.09372,0.10505,0.15934], >> [0.00769,0.01315,0.01668,0.01645,0.03536,0.03493,0.00599], >> [0.47109,0.43646,0.43171,0.41794,0.14761,0.09472,0.21969], >> [0.25633,0.28820,0.34066,0.37184,0.68048,0.72773,0.57749], >> [0.06492,0.05539,0.03205,0.02151,0.03357,0.02411,0.01512]] >> >> print contrib[0] >> N = 7 >> ind = arange(N) # the x locations for the groups width = 0.1 >> # the width of the bars: can also be len(x) sequence >> >> >> I = array([1,1,1,1,1,1,1]) >> >> fig = plt.figure() >> ax = Axes3D(fig) >> >> for i in range(1,7): >> ax.bar3d(ind[i], 0, 0, 0.1, 0.1, contrib[0][i], color='b') >> ax.bar3d(array(ind[i])+0.15, 0, 0, 0.1, 0.1, contrib[1][i], color='r' >> ) >> ax.bar3d(array(ind[i])+2*0.15, 0, 0, 0.1, 0.1, contrib[2][i], >> color= >> 'g') >> ax.bar3d(array(ind[i])+3*0.15, 0, 0, 0.1, 0.1, contrib[3][i], >> color= >> 'c') >> ax.bar3d(array(ind[i])+4*0.15, 0, 0, 0.1, 0.1, contrib[4][i], >> color= >> 'm') >> >> plt.show() >> >> >> >> >> This message and any attachments (the "message") is intended solely >> for the addressees and is confidential. >> If you receive this message in error, please delete it and >> immediately notify the sender. Any use not in accord with its >> purpose, any dissemination or disclosure, either whole or partial, is >> prohibited except formal approval. The internet can not guarantee the >> integrity of this message. >> BNP PARIBAS (and its subsidiaries) shall (will) not therefore be >> liable for the message if modified. >> Do not print this message unless it is necessary, consider the >> environment. >> >> --------------------------------------------- >> >> Ce message et toutes les pieces jointes (ci-apres le >> "message") sont etablis a l'intention exclusive de ses destinataires >> et sont confidentiels. Si vous recevez ce message par erreur, merci >> de le detruire et d'en avertir immediatement l'expediteur. Toute >> utilisation de ce message non conforme a sa destination, toute >> diffusion ou toute publication, totale ou partielle, est interdite, >> sauf autorisation expresse. L'internet ne permettant pas d'assurer >> l'integrite de ce message, BNP PARIBAS (et ses >> filiales) decline(nt) toute responsabilite au titre de ce message, >> dans l'hypothese ou il aurait ete modifie. >> N'imprimez ce message que si necessaire, pensez a l'environnement. >> >> >> >> --------------------------------------------------------------------- >> --------- Let Crystal Reports handle the reporting - Free Crystal >> Reports 2008 30-Day trial. Simplify your report design, integration >> and deployment - and focus on what you do best, core application >> coding. Discover what's new with Crystal Reports now. >> http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- > View this message in context: > http://old.nabble.com/rendering-bug-in-bar3d-tp26413625p27358778.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ---------------------------------------------------------------------- > -------- The Planet: dedicated and managed hosting, cloud storage, > colocation Stay online with enterprise data centers and the best > network in the business Choose flexible plans and management services > without long-term contracts Personal 24x7 support from experience > hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Reinier Heeres Tel: +31 6 10852639
Hi, Unfortunately z-sorting the polygons is a really hard problem. Or in fact, in the way it is currently implemented, an unsolvable problem. Please remember that mplot3d is not a full-blown 3d engine. Fixing this would require either a z-buffer or things such as BSP trees, which I do not think are feasible to implement. However, I do believe that there might be a small bug lurking somewhere or some other slight improvements to be made. I'll try to look into it after my 2 week holiday. Regards, Reinier On Thu, Jan 28, 2010 at 8:42 PM, baxelrod <bax...@co...> wrote: > > I am also seeing this behavior and it is unfortunately holding my project > back. > > I have seen it with python 2.6 on Debian Linux and Windows XP. I have seen > it in version 0.99.1 and the latest SVN tree (as of yesterday). > > I want to highlight a portion of each 3d bar with another color. This image > shows what I want to do: > http://old.nabble.com/file/p27358778/bar3d-1.png > (http://www.benaxelrod.com/temp/bar3d-1.png) > > But rotating the view leads to rendering issues: > http://old.nabble.com/file/p27358778/bar3d-2.png > (http://www.benaxelrod.com/temp/bar3d-2.png) > > http://old.nabble.com/file/p27358778/bar3d-3.png > (http://www.benaxelrod.com/temp/bar3d-3.png) > > In this example, the bars are drawn next to each other. Here is the source > code to generate the images: > > # code adapted from: hist3d_demo.py > from mpl_toolkits.mplot3d import Axes3D > import matplotlib.pyplot as plt > import numpy as np > > fig = plt.figure() > ax = Axes3D(fig) > x, y = np.random.rand(2, 100) * 4 > hist, xedges, yedges = np.histogram2d(x, y, bins=4) > > elements = (len(xedges) - 1) * (len(yedges) - 1) > xpos, ypos = np.meshgrid(xedges[:-1]+0.25, yedges[:-1]+0.25) > > xpos = xpos.flatten() > ypos = ypos.flatten() > zpos = np.zeros(elements) > > dx = 0.5 * np.ones_like(zpos) > dy = dx.copy() > dz = hist.flatten() > > dx = dx*0.5 > xpos = xpos - dx > > ax.bar3d(xpos, ypos, zpos, dx, dy, dz, color='b') > ax.bar3d(xpos+dx, ypos, zpos, dx, dy, dz, color='r') > > ax.set_xlabel('X') > ax.set_ylabel('Y') > ax.set_zlabel('Z') > > plt.show() > #end code > > I also tried to overlap the bars, but the result was even worse because from > certain angles one of the colors was not visible at all. > > I thought that the issue might be due to calling bar3d muliple times. So I > tried passing in an array of collors to bar3d with no luck. It seems that > bar3d only takes a single color. Is this planned to be fixed so that > bar3d() can take a color array just like bar()? > > Also note that even very simple examples demonstrate the bug. For example: > http://old.nabble.com/file/p27358778/bar3d-4.png > (http://www.benaxelrod.com/temp/bar3d-4.png) > > http://old.nabble.com/file/p27358778/bar3d-5.png > (http://www.benaxelrod.com/temp/bar3d-5.png) > > Thanks, > -Ben > > > pierre-yves.debrito wrote: >> >> Hi, >> I am currently using this version : matplotlib-0.99.1.win32-py2.6.exe >> When I draw several Axes3D.bar3d in the same figure, as in this example, >> the faces are not drawn in the correct order. >> Did I do something wrong or is it a rendering bug? >> Is there a workaround? >> >> Thanks >> Pierre-Yves de Brito >> >> >> >> >> >> from mpl_toolkits.mplot3d import Axes3D >> import matplotlib.pyplot as plt >> from numpy import array, arange >> >> >> contrib=[[0.18263,0.19098,0.16815,0.16295,0.09372,0.10505,0.15934], >> [0.00769,0.01315,0.01668,0.01645,0.03536,0.03493,0.00599], >> [0.47109,0.43646,0.43171,0.41794,0.14761,0.09472,0.21969], >> [0.25633,0.28820,0.34066,0.37184,0.68048,0.72773,0.57749], >> [0.06492,0.05539,0.03205,0.02151,0.03357,0.02411,0.01512]] >> >> print contrib[0] >> N = 7 >> ind = arange(N) # the x locations for the groups >> width = 0.1 # the width of the bars: can also be len(x) sequence >> >> >> I = array([1,1,1,1,1,1,1]) >> >> fig = plt.figure() >> ax = Axes3D(fig) >> >> for i in range(1,7): >> ax.bar3d(ind[i], 0, 0, 0.1, 0.1, contrib[0][i], color='b') >> ax.bar3d(array(ind[i])+0.15, 0, 0, 0.1, 0.1, contrib[1][i], color='r' >> ) >> ax.bar3d(array(ind[i])+2*0.15, 0, 0, 0.1, 0.1, contrib[2][i], color= >> 'g') >> ax.bar3d(array(ind[i])+3*0.15, 0, 0, 0.1, 0.1, contrib[3][i], color= >> 'c') >> ax.bar3d(array(ind[i])+4*0.15, 0, 0, 0.1, 0.1, contrib[4][i], color= >> 'm') >> >> plt.show() >> >> >> >> >> This message and any attachments (the "message") is >> intended solely for the addressees and is confidential. >> If you receive this message in error, please delete it and >> immediately notify the sender. Any use not in accord with >> its purpose, any dissemination or disclosure, either whole >> or partial, is prohibited except formal approval. The internet >> can not guarantee the integrity of this message. >> BNP PARIBAS (and its subsidiaries) shall (will) not >> therefore be liable for the message if modified. >> Do not print this message unless it is necessary, >> consider the environment. >> >> --------------------------------------------- >> >> Ce message et toutes les pieces jointes (ci-apres le >> "message") sont etablis a l'intention exclusive de ses >> destinataires et sont confidentiels. Si vous recevez ce >> message par erreur, merci de le detruire et d'en avertir >> immediatement l'expediteur. Toute utilisation de ce >> message non conforme a sa destination, toute diffusion >> ou toute publication, totale ou partielle, est interdite, sauf >> autorisation expresse. L'internet ne permettant pas >> d'assurer l'integrite de ce message, BNP PARIBAS (et ses >> filiales) decline(nt) toute responsabilite au titre de ce >> message, dans l'hypothese ou il aurait ete modifie. >> N'imprimez ce message que si necessaire, >> pensez a l'environnement. >> >> >> >> ------------------------------------------------------------------------------ >> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 >> 30-Day >> trial. Simplify your report design, integration and deployment - and focus >> on >> what you do best, core application coding. Discover what's new with >> Crystal Reports now. http://p.sf.net/sfu/bobj-july >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- > View this message in context: http://old.nabble.com/rendering-bug-in-bar3d-tp26413625p27358778.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Reinier Heeres Tel: +31 6 10852639
Sebastian, Thanks, your hint worked. On Wed, Feb 3, 2010 at 1:54 PM, Sebastian Busch <web...@th...> wrote: > Joseph Smidt wrote: >> Hello, >> >> I'm trying to make a simple plot that doesn't use scientific >> notation for the x axis ... >> Is there way to use this >> ScalarFormatter some how? ... > > does this help? > > from pylab import * > a = arange(1600) > plot(a,a) > xscale('log') > from matplotlib.ticker import ScalarFormatter > ax = gca().xaxis > ax.set_major_formatter(ScalarFormatter()) > > > best, > sebastian. > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- ------------------------------------------------------------------------ Joseph Smidt <jos...@gm...> Physics and Astronomy 4129 Frederick Reines Hall Irvine, CA 92697-4575 Office: 949-824-3269
Joseph Smidt wrote: > Hello, > > I'm trying to make a simple plot that doesn't use scientific > notation for the x axis ... > Is there way to use this > ScalarFormatter some how? ... does this help? from pylab import * a = arange(1600) plot(a,a) xscale('log') from matplotlib.ticker import ScalarFormatter ax = gca().xaxis ax.set_major_formatter(ScalarFormatter()) best, sebastian.
Hello, I'm trying to make a simple plot that doesn't use scientific notation for the x axis since the axise only goes from 1 to 1600. I tried using ticklabel_format like this: from pylab import * l, cltt = loadtxt('ABF_20_20.dat',unpack=True) semilogx(l, cltt) xlim(1,1600) ax = gca() ax.ticklabel_format(style='plain',axis='x') show() I get this error "This method only works with the ScalarFormatter". which seems to be the error refered to in the documentation. However, I'm not sure how to fix the problem? Is there way to use this ScalarFormatter some how? Did I code it wrong? If anyone knows how to get the xaxis to not display scientific notation this would be helpful. Thanks. Joseph Smidt -- ------------------------------------------------------------------------ Joseph Smidt <jos...@gm...> Physics and Astronomy 4129 Frederick Reines Hall Irvine, CA 92697-4575 Office: 949-824-3269
1/02/10 @ 16:15 (-0500), thus spake Jae-Joon Lee: > See if the example below works. > > plot([1,2,3], label="test") > a=legend() > > import matplotlib.offsetbox as offsetbox > txt=offsetbox.TextArea("Test 2") > box = a._legend_box > box.get_children().append(txt) > box.set_figure(box.figure) > > For more control of legend, see the link below. > > http://abitofpythonabitofastronomy.blogspot.com/2010/01/customized-legend.html Thanks Jae-Joon. Your solution has worked like a charm. > Regards, > > -JJ > > > On Sun, Jan 31, 2010 at 11:59 AM, Ernest Adrogué <ead...@gm...> wrote: > > Hi, > > > > I would like to add some text relative to the legend, > > let's say below it, and I don't know how to get the legend > > coordinates so I can pass them to the text() method. > > > > Does anyone know how to do it? > > > > Alternatively, if there was a way to add text inside the > > legend itself, it would also do the trick. > > > > Thank you in advance. > > > > Ernest > > > > > > ------------------------------------------------------------------------------ > > The Planet: dedicated and managed hosting, cloud storage, colocation > > Stay online with enterprise data centers and the best network in the business > > Choose flexible plans and management services without long-term contracts > > Personal 24x7 support from experience hosting pros just a phone call away. > > http://p.sf.net/sfu/theplanet-com > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
On Wed, Feb 3, 2010 at 5:32 AM, Luis P. Guerra <lui...@gm...> wrote: > Hi, > > I am newbie using Matplotlib. I have to do an interactive application and > before that, I am trying some tests to familiarize myself with the library. > > I am plotting some 2d data together with 2 buttons. When one of the buttons > is pressed, only a few points should be remain in the plot, and when the > other button is pressed, all the initial points should be appear again. My > problem is that when I press the first button, the points which sould be > remain, change the colour (because I specify this), but the rest of the > points also remain. How can I repaint again the plot to get what I want? W/o a complete free standing example that we can run, it is difficult to see exactly what your problem is. If you post one, we can help you more easily. To answer some of your specific questions and point you to some solutions * to cause a full figure redraw, do fig.canvas.draw(). You can repaint portions of the canvase or selected artists using the animation techniques described at http://www.scipy.org/Cookbook/Matplotlib/Animations and http://matplotlib.sourceforge.net/users/event_handling.html with examples at http://matplotlib.sourceforge.net/examples/animation/index.html * you can "remove" a line entirely if you don't want to plot it anymore using the techniques described at http://matplotlib.sourceforge.net/users/artists.html#artist-tutorial. You can also temporarily make any artist invisible by setting obj.set_visible(False) * you can also control which points in an array are plotted by setting a masked array, as in http://matplotlib.sourceforge.net/examples/pylab_examples/masked_demo.html Hope this helps, JDH
Hi, I am newbie using Matplotlib. I have to do an interactive application and before that, I am trying some tests to familiarize myself with the library. I am plotting some 2d data together with 2 buttons. When one of the buttons is pressed, only a few points should be remain in the plot, and when the other button is pressed, all the initial points should be appear again. My problem is that when I press the first button, the points which sould be remain, change the colour (because I specify this), but the rest of the points also remain. How can I repaint again the plot to get what I want? Thanks in advance Here is the code (except the class Datos since it is not relevant for the plotting): class eventos: def __init__(self,datos, fig): self._datos = datos self._figure = fig def pareto(self,event): tupla = self._datos.buscarDominados() sp=self._figure.add_subplot(111) sp.plot(tupla[0], tupla[1], 'o', color = 'yellow') def todos(self,event): sp=self._figure.add_subplot(111) sp.plot(self._datos.darX(), self._datos.darY(), 'o', color = 'blue') import datos import matplotlib.pyplot as plt from matplotlib.widgets import Button import eventos X = datos.datos() X.randomNums(100) fig = plt.figure() ax = fig.add_subplot(111) ax.plot(X.darX(), X.darY(), 'o') boton = eventos.eventos(X, fig) axbut = plt.axes([0.77, 0.02, 0.1, 0.05]) axbut2 = plt.axes([0.88, 0.02, 0.1, 0.05]) bpareto = Button(axbut, 'Pareto') bnormal = Button(axbut2, 'Todos') bpareto.on_clicked(boton.pareto) bnormal.on_clicked(boton.todos) plt.show()
I haven't really resolved the issue yet. Christoph mentioned the extension _TKAGG.PYD depends on TK84.DLL, TCL84.DLL, MSVCP71.DLL, and MSVCR71.DLL. Search to see if you miss any of the files. I found TK85 and TCL85 are installed instead. After installing ActiveTCL8.4 I don't see the error message upon importing matplotlib any more, but run into TCL error before plot shows up. Guess I need to try cleaning up TCL version issue. --- On Tue, 2/2/10, Jan Breeman <br...@xs...> wrote: From: Jan Breeman <br...@xs...> Subject: Re: [Matplotlib-users] problem with import pylab To: hu...@ya... Date: Tuesday, February 2, 2010, 3:57 AM Dear HL, I have exactly the same problem as you have, so I was wondering if you already have a fix? I tried adding: import matplotlib matplotlib.use('PS') just before import pylab and that solved the error message, but now I do not know where the plots are going to. A file I suppose. Kind regards, Jan Breeman email NLR: br...@nl... email home: br...@xs... NLR: +31 (0)20 511 3442 mobile: +31 (0)6 4409 2714
I am having segmentation faults when using any backend other than the WX and native mac versions. I saw that this mpl install page ( http://matplotlib.sourceforge.net/users/installing.html) says to do an svn co followed by an install using the custom make script that should go get the "blessed" versions of most of the dependancies for the backends. I follow the discription of how to use this make.osx file as best I could (see command and results below) but I get errors. I tried to change the OS version specific stuff in the make.osx file to fit my OS version as well: MACOSX_DEPLOYMENT_TARGET=10.4->10.5 OSX_SDK_VER=10.4u -> 10.5 but this does not help. the standard python setup.py build etc works but does not fix the segfault issues. Can anyone help me? Gus biggus@bs2-21-dhcp-218 16:07:48 ~/SourceCodeEtc/svnCheckOuts/matplotlib: PREFIX=/Users/biggus/dev make -f make.osx fetch deps mpl_install python2.6 -c 'import urllib; urllib.urlretrieve(" http://www.zlib.net/zlib-1.2.3.tar.gz", "zlib-1.2.3.tar.gz")' &&\ python2.6 -c 'import urllib; urllib.urlretrieve(" http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.40.tar.bz2", "libpng-1.2.40.tar.bz2")' &&\ python2.6 -c 'import urllib; urllib.urlretrieve(" http://download.savannah.gnu.org/releases/freetype/freetype-2.3.11.tar.bz2", "freetype-2.3.11.tar.bz2")' export PKG_CONFIG_PATH="/Users/biggus/dev/lib/pkgconfig" &&\ rm -rf zlib-1.2.3 &&\ tar xvfz zlib-1.2.3.tar.gz &&\ cd zlib-1.2.3 &&\ export MACOSX_DEPLOYMENT_TARGET=10.4 &&\ export CFLAGS=""-arch i386 -arch ppc -arch x86_64" -I/Users/biggus/dev/include -I/Users/biggus/dev/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" &&\ export LDFLAGS=""-arch i386 -arch ppc -arch x86_64" -L/Users/biggus/dev/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" &&\ ./configure --prefix=/Users/biggus/dev&&\ MACOSX_DEPLOYMENT_TARGET=10.4 CFLAGS=""-arch i386 -arch ppc -arch x86_64" -I/Users/biggus/dev/include -I/Users/biggus/dev/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk" LDFLAGS=""-arch i386 -arch ppc -arch x86_64" -L/Users/biggus/dev/lib -syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" make -j3 install&& \ unset MACOSX_DEPLOYMENT_TARGET zlib-1.2.3/ zlib-1.2.3/adler32.c zlib-1.2.3/algorithm.txt zlib-1.2.3/amiga/ zlib-1.2.3/amiga/Makefile.pup zlib-1.2.3/amiga/Makefile.sas zlib-1.2.3/as400/ zlib-1.2.3/as400/bndsrc zlib-1.2.3/as400/compile.clp zlib-1.2.3/as400/readme.txt zlib-1.2.3/as400/zlib.inc zlib-1.2.3/ChangeLog zlib-1.2.3/compress.c zlib-1.2.3/configure zlib-1.2.3/contrib/ zlib-1.2.3/contrib/ada/ zlib-1.2.3/contrib/ada/buffer_demo.adb zlib-1.2.3/contrib/ada/mtest.adb zlib-1.2.3/contrib/ada/read.adb zlib-1.2.3/contrib/ada/readme.txt zlib-1.2.3/contrib/ada/test.adb zlib-1.2.3/contrib/ada/zlib-streams.adb zlib-1.2.3/contrib/ada/zlib-streams.ads zlib-1.2.3/contrib/ada/zlib-thin.adb zlib-1.2.3/contrib/ada/zlib-thin.ads zlib-1.2.3/contrib/ada/zlib.adb zlib-1.2.3/contrib/ada/zlib.ads zlib-1.2.3/contrib/ada/zlib.gpr zlib-1.2.3/contrib/asm586/ zlib-1.2.3/contrib/asm586/match.S zlib-1.2.3/contrib/asm586/README.586 zlib-1.2.3/contrib/asm686/ zlib-1.2.3/contrib/asm686/match.S zlib-1.2.3/contrib/asm686/README.686 zlib-1.2.3/contrib/blast/ zlib-1.2.3/contrib/blast/blast.c zlib-1.2.3/contrib/blast/blast.h zlib-1.2.3/contrib/blast/Makefile zlib-1.2.3/contrib/blast/README zlib-1.2.3/contrib/blast/test.pk zlib-1.2.3/contrib/blast/test.txt zlib-1.2.3/contrib/delphi/ zlib-1.2.3/contrib/delphi/readme.txt zlib-1.2.3/contrib/delphi/ZLib.pas zlib-1.2.3/contrib/delphi/ZLibConst.pas zlib-1.2.3/contrib/delphi/zlibd32.mak zlib-1.2.3/contrib/dotzlib/ zlib-1.2.3/contrib/dotzlib/DotZLib/ zlib-1.2.3/contrib/dotzlib/DotZLib/AssemblyInfo.cs zlib-1.2.3/contrib/dotzlib/DotZLib/ChecksumImpl.cs zlib-1.2.3/contrib/dotzlib/DotZLib/CircularBuffer.cs zlib-1.2.3/contrib/dotzlib/DotZLib/CodecBase.cs zlib-1.2.3/contrib/dotzlib/DotZLib/Deflater.cs zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.cs zlib-1.2.3/contrib/dotzlib/DotZLib/DotZLib.csproj zlib-1.2.3/contrib/dotzlib/DotZLib/GZipStream.cs zlib-1.2.3/contrib/dotzlib/DotZLib/Inflater.cs zlib-1.2.3/contrib/dotzlib/DotZLib/UnitTests.cs zlib-1.2.3/contrib/dotzlib/DotZLib.build zlib-1.2.3/contrib/dotzlib/DotZLib.chm zlib-1.2.3/contrib/dotzlib/DotZLib.sln zlib-1.2.3/contrib/dotzlib/LICENSE_1_0.txt zlib-1.2.3/contrib/dotzlib/readme.txt zlib-1.2.3/contrib/infback9/ zlib-1.2.3/contrib/infback9/infback9.c zlib-1.2.3/contrib/infback9/infback9.h zlib-1.2.3/contrib/infback9/inffix9.h zlib-1.2.3/contrib/infback9/inflate9.h zlib-1.2.3/contrib/infback9/inftree9.c zlib-1.2.3/contrib/infback9/inftree9.h zlib-1.2.3/contrib/infback9/README zlib-1.2.3/contrib/inflate86/ zlib-1.2.3/contrib/inflate86/inffas86.c zlib-1.2.3/contrib/inflate86/inffast.S zlib-1.2.3/contrib/iostream/ zlib-1.2.3/contrib/iostream/test.cpp zlib-1.2.3/contrib/iostream/zfstream.cpp zlib-1.2.3/contrib/iostream/zfstream.h zlib-1.2.3/contrib/iostream2/ zlib-1.2.3/contrib/iostream2/zstream.h zlib-1.2.3/contrib/iostream2/zstream_test.cpp zlib-1.2.3/contrib/iostream3/ zlib-1.2.3/contrib/iostream3/README zlib-1.2.3/contrib/iostream3/test.cc zlib-1.2.3/contrib/iostream3/TODO zlib-1.2.3/contrib/iostream3/zfstream.cc zlib-1.2.3/contrib/iostream3/zfstream.h zlib-1.2.3/contrib/masm686/ zlib-1.2.3/contrib/masm686/match.asm zlib-1.2.3/contrib/masmx64/ zlib-1.2.3/contrib/masmx64/bld_ml64.bat zlib-1.2.3/contrib/masmx64/gvmat64.asm zlib-1.2.3/contrib/masmx64/gvmat64.obj zlib-1.2.3/contrib/masmx64/inffas8664.c zlib-1.2.3/contrib/masmx64/inffasx64.asm zlib-1.2.3/contrib/masmx64/inffasx64.obj zlib-1.2.3/contrib/masmx64/readme.txt zlib-1.2.3/contrib/masmx86/ zlib-1.2.3/contrib/masmx86/bld_ml32.bat zlib-1.2.3/contrib/masmx86/gvmat32.asm zlib-1.2.3/contrib/masmx86/gvmat32.obj zlib-1.2.3/contrib/masmx86/gvmat32c.c zlib-1.2.3/contrib/masmx86/inffas32.asm zlib-1.2.3/contrib/masmx86/inffas32.obj zlib-1.2.3/contrib/masmx86/mkasm.bat zlib-1.2.3/contrib/masmx86/readme.txt zlib-1.2.3/contrib/minizip/ zlib-1.2.3/contrib/minizip/ChangeLogUnzip zlib-1.2.3/contrib/minizip/crypt.h zlib-1.2.3/contrib/minizip/ioapi.c zlib-1.2.3/contrib/minizip/ioapi.h zlib-1.2.3/contrib/minizip/iowin32.c zlib-1.2.3/contrib/minizip/iowin32.h zlib-1.2.3/contrib/minizip/Makefile zlib-1.2.3/contrib/minizip/miniunz.c zlib-1.2.3/contrib/minizip/minizip.c zlib-1.2.3/contrib/minizip/mztools.c zlib-1.2.3/contrib/minizip/mztools.h zlib-1.2.3/contrib/minizip/unzip.c zlib-1.2.3/contrib/minizip/unzip.h zlib-1.2.3/contrib/minizip/zip.c zlib-1.2.3/contrib/minizip/zip.h zlib-1.2.3/contrib/pascal/ zlib-1.2.3/contrib/pascal/example.pas zlib-1.2.3/contrib/pascal/readme.txt zlib-1.2.3/contrib/pascal/zlibd32.mak zlib-1.2.3/contrib/pascal/zlibpas.pas zlib-1.2.3/contrib/puff/ zlib-1.2.3/contrib/puff/Makefile zlib-1.2.3/contrib/puff/puff.c zlib-1.2.3/contrib/puff/puff.h zlib-1.2.3/contrib/puff/README zlib-1.2.3/contrib/puff/zeros.raw zlib-1.2.3/contrib/README.contrib zlib-1.2.3/contrib/testzlib/ zlib-1.2.3/contrib/testzlib/testzlib.c zlib-1.2.3/contrib/testzlib/testzlib.txt zlib-1.2.3/contrib/untgz/ zlib-1.2.3/contrib/untgz/Makefile zlib-1.2.3/contrib/untgz/Makefile.msc zlib-1.2.3/contrib/untgz/untgz.c zlib-1.2.3/contrib/vstudio/ zlib-1.2.3/contrib/vstudio/readme.txt zlib-1.2.3/contrib/vstudio/vc7/ zlib-1.2.3/contrib/vstudio/vc7/miniunz.vcproj zlib-1.2.3/contrib/vstudio/vc7/minizip.vcproj zlib-1.2.3/contrib/vstudio/vc7/testzlib.vcproj zlib-1.2.3/contrib/vstudio/vc7/zlib.rc zlib-1.2.3/contrib/vstudio/vc7/zlibstat.vcproj zlib-1.2.3/contrib/vstudio/vc7/zlibvc.def zlib-1.2.3/contrib/vstudio/vc7/zlibvc.sln zlib-1.2.3/contrib/vstudio/vc7/zlibvc.vcproj zlib-1.2.3/contrib/vstudio/vc8/ zlib-1.2.3/contrib/vstudio/vc8/miniunz.vcproj zlib-1.2.3/contrib/vstudio/vc8/minizip.vcproj zlib-1.2.3/contrib/vstudio/vc8/testzlib.vcproj zlib-1.2.3/contrib/vstudio/vc8/testzlibdll.vcproj zlib-1.2.3/contrib/vstudio/vc8/zlib.rc zlib-1.2.3/contrib/vstudio/vc8/zlibstat.vcproj zlib-1.2.3/contrib/vstudio/vc8/zlibvc.def zlib-1.2.3/contrib/vstudio/vc8/zlibvc.sln zlib-1.2.3/contrib/vstudio/vc8/zlibvc.vcproj zlib-1.2.3/crc32.c zlib-1.2.3/crc32.h zlib-1.2.3/deflate.c zlib-1.2.3/deflate.h zlib-1.2.3/example.c zlib-1.2.3/examples/ zlib-1.2.3/examples/fitblk.c zlib-1.2.3/examples/gun.c zlib-1.2.3/examples/gzappend.c zlib-1.2.3/examples/gzjoin.c zlib-1.2.3/examples/gzlog.c zlib-1.2.3/examples/gzlog.h zlib-1.2.3/examples/README.examples zlib-1.2.3/examples/zlib_how.html zlib-1.2.3/examples/zpipe.c zlib-1.2.3/examples/zran.c zlib-1.2.3/FAQ zlib-1.2.3/gzio.c zlib-1.2.3/INDEX zlib-1.2.3/infback.c zlib-1.2.3/inffast.c zlib-1.2.3/inffast.h zlib-1.2.3/inffixed.h zlib-1.2.3/inflate.c zlib-1.2.3/inflate.h zlib-1.2.3/inftrees.c zlib-1.2.3/inftrees.h zlib-1.2.3/make_vms.com zlib-1.2.3/Makefile zlib-1.2.3/Makefile.in zlib-1.2.3/minigzip.c zlib-1.2.3/msdos/ zlib-1.2.3/msdos/Makefile.bor zlib-1.2.3/msdos/Makefile.dj2 zlib-1.2.3/msdos/Makefile.emx zlib-1.2.3/msdos/Makefile.msc zlib-1.2.3/msdos/Makefile.tc zlib-1.2.3/old/ zlib-1.2.3/old/descrip.mms zlib-1.2.3/old/Makefile.riscos zlib-1.2.3/old/os2/ zlib-1.2.3/old/os2/Makefile.os2 zlib-1.2.3/old/os2/zlib.def zlib-1.2.3/old/README zlib-1.2.3/old/visual-basic.txt zlib-1.2.3/old/zlib.html zlib-1.2.3/projects/ zlib-1.2.3/projects/README.projects zlib-1.2.3/projects/visualc6/ zlib-1.2.3/projects/visualc6/example.dsp zlib-1.2.3/projects/visualc6/minigzip.dsp zlib-1.2.3/projects/visualc6/README.txt zlib-1.2.3/projects/visualc6/zlib.dsp zlib-1.2.3/projects/visualc6/zlib.dsw zlib-1.2.3/qnx/ zlib-1.2.3/qnx/package.qpg zlib-1.2.3/README zlib-1.2.3/trees.c zlib-1.2.3/trees.h zlib-1.2.3/uncompr.c zlib-1.2.3/win32/ zlib-1.2.3/win32/DLL_FAQ.txt zlib-1.2.3/win32/Makefile.bor zlib-1.2.3/win32/Makefile.emx zlib-1.2.3/win32/Makefile.gcc zlib-1.2.3/win32/Makefile.msc zlib-1.2.3/win32/VisualC.txt zlib-1.2.3/win32/zlib.def zlib-1.2.3/win32/zlib1.rc zlib-1.2.3/zconf.h zlib-1.2.3/zconf.in.h zlib-1.2.3/zlib.3 zlib-1.2.3/zlib.h zlib-1.2.3/zutil.c zlib-1.2.3/zutil.h /bin/sh: line 0: export: `-arch': not a valid identifier /bin/sh: line 0: export: `-arch': not a valid identifier /bin/sh: line 0: export: `x86_64 -I/Users/biggus/dev/include -I/Users/biggus/dev/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk': not a valid identifier make: *** [zlib] Error 1 -- Experience is not what happens to a man; it is what a man does with what happens to him. - Aldous Huxley
Great. Just what I needed. I appreciate it. - James On Feb 2, 2010, at 1:56 PM, Eric Firing wrote: > James Conners wrote: >> Hi, >> >> I'm having some trouble producing a filled contour how I want it. >> >> Say I'm plotting data over the range [1.2, 20] using 15 level lines evenly spaced >> over that interval. I'd like the min of that interval to map to the min of the color spectrum (say "jet" so dark blue) >> and the max of that interval to map to the max of the spectrum (so red). It doesn't seem to work that way. >> When I do filled contours, sometimes the low values are mapped to black or dark gray and >> sometimes they're mapped to blue. >> >> I always want the endpoints of the spectrum to map to the endpoints of the plotted values. Can this be done? >> Any help is appreciated. Thanks. > > The root of the problem is a questionable choice I made in the > _process_colors method of ContourSet; I will investigate either changing > it, or making it an option. In the meantime, there is an easy > workaround: just use the set_clim method of the ContourSet, or the > pyplot.clim function. In ipython -pylab: > > z = rand(10,10) > cs = contourf(z) > cb = colorbar() > cs.set_clim(cs.layers.min(), cs.layers.max()) > draw() > > The idea behind the present default choice for clim within contourf is that > the range of colors covers values from the lowest contour level to the > highest; the color of a *layer* is then the color of the midpoint > between its bounding levels. This has some logic to it (and is more > consistent with pcolor and image color mapping), but I agree that it > probably makes more sense to use the full color range by default; most > often, this is likely to be what one wants, and for the exceptions one > can always use set_clim. > > Eric > >> >> - James >> >> >> ------------------------------------------------------------------------------ >> The Planet: dedicated and managed hosting, cloud storage, colocation >> Stay online with enterprise data centers and the best network in the business >> Choose flexible plans and management services without long-term contracts >> Personal 24x7 support from experience hosting pros just a phone call away. >> http://p.sf.net/sfu/theplanet-com >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
James Conners wrote: > Hi, > > I'm having some trouble producing a filled contour how I want it. > > Say I'm plotting data over the range [1.2, 20] using 15 level lines evenly spaced > over that interval. I'd like the min of that interval to map to the min of the color spectrum (say "jet" so dark blue) > and the max of that interval to map to the max of the spectrum (so red). It doesn't seem to work that way. > When I do filled contours, sometimes the low values are mapped to black or dark gray and > sometimes they're mapped to blue. > > I always want the endpoints of the spectrum to map to the endpoints of the plotted values. Can this be done? > Any help is appreciated. Thanks. The root of the problem is a questionable choice I made in the _process_colors method of ContourSet; I will investigate either changing it, or making it an option. In the meantime, there is an easy workaround: just use the set_clim method of the ContourSet, or the pyplot.clim function. In ipython -pylab: z = rand(10,10) cs = contourf(z) cb = colorbar() cs.set_clim(cs.layers.min(), cs.layers.max()) draw() The idea behind the present default choice for clim within contourf is that the range of colors covers values from the lowest contour level to the highest; the color of a *layer* is then the color of the midpoint between its bounding levels. This has some logic to it (and is more consistent with pcolor and image color mapping), but I agree that it probably makes more sense to use the full color range by default; most often, this is likely to be what one wants, and for the exceptions one can always use set_clim. Eric > > - James > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi, I'm having some trouble producing a filled contour how I want it. Say I'm plotting data over the range [1.2, 20] using 15 level lines evenly spaced over that interval. I'd like the min of that interval to map to the min of the color spectrum (say "jet" so dark blue) and the max of that interval to map to the max of the spectrum (so red). It doesn't seem to work that way. When I do filled contours, sometimes the low values are mapped to black or dark gray and sometimes they're mapped to blue. I always want the endpoints of the spectrum to map to the endpoints of the plotted values. Can this be done? Any help is appreciated. Thanks. - James
I think I found a bug with in the Axes3D color support. When there are 3 or 4 points to plot, then the you cannot specify an array of rgba arrays for the colors of the points. I tested in matplotlib 0.99.1 and the latest code from SVN. Both exibit the bug. This simple code demonstrates the bug: #simple Axes3D example setting color and size of points import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt from numpy.random import rand fig = plt.figure() ax = Axes3D(fig) n = 3 # ERROR WHEN n = 3 or 4 !! xs = np.random.rand(n) ys = np.random.rand(n) zs = np.random.rand(n) ss = np.random.rand(n) * 1000 cs = rand(n, 4) ax.scatter(xs, ys, zs, s=ss, c=cs) ax.set_xlabel('X Label') ax.set_ylabel('Y Label') ax.set_zlabel('Z Label') plt.show() #end code This is the call trace for the bug: Exception in Tkinter callback Traceback (most recent call last): File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__ return self.func(*args) File "C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 212, in resize self.show() File "C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 215, in draw FigureCanvasAgg.draw(self) File "C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py", line314, in draw self.figure.draw(self.renderer) File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 46, in draw_wrapper draw(artist, renderer, *kl) File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 773, in draw for a in self.axes: a.draw(renderer) File "C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 150, in draw for col in self.collections] File "C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\art3d.py", line 290, in do_3d_projection self.set_facecolors(zalpha(self._facecolor3d, vzs)) File "C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\art3d.py", line 497, in zalpha colors = [(c[0], c[1], c[2], c[3] * s) for c, s in zip(colors, sats)] IndexError: index out of bounds Thanks, -Ben
Yannick Copin wrote: > Eric Firing wrote: >> Maybe I am misunderstanding, but the EllipseCollection in the example >> is panning and zooming as I expect. The shapes and orientations are >> staying the same while the scale expands and contracts with the x-axis. >> >> The problem is that the option you are looking for does not exist >> yet. I am not sure yet whether what you need is identical to an >> option I added to quiver (from which I partially derived >> EllipseCollection). I suspect it is. > > Thanks, I now understand better what is the main goal of > EllipseCollection: in a quiver-like use, you don't want indeed the > plotted ellipses to change size and/or orientation with scaling and > zooming. > >> Do you want width to scale with x and height to scale with y? And the >> angle to scale such that a 45-degree angle always corresponds to equal >> increments in x and in y, all in data units? > > Yes, in the context of error-ellipses, I would like to see my ellipses > scale with x and y, as they do when I plot them individually as Ellipse > patches (see example scripts, the blue ellipses are what I would like to > obtain using an EllipseCollection), something like "units='data'" in > EllipseCollection... I agree, this really is needed, and I will put it in ASAP. It may take a little while, though, so in the meantime you are stuck with the individual patches. Thanks for bringing it to my attention. Eric
Hi Jon, I'm sorry I didn't mean 0-1. I meant from 0 to 1. I have tried with values like 0.15, 0.55, 0.95 and 1. The polygons stay opaque with the same colour in all cases. Luc On 2010年02月02日, at 2:59 PM, John Hunter wrote: > On Tue, Feb 2, 2010 at 7:47 AM, Luc Gervais <luc...@gm...> wrote: >> Hello all, >> >> I am creating radar plots in matplolib and I cannot get transparent polygons. >> >> I have run the examples from the gallery: >> http://matplotlib.sourceforge.net/examples/api/radar_chart.html >> http://matplotlib.sourceforge.net/examples/pylab_examples/polar_bar.html >> >> The colours show differently on my computer and the polygons are opaque. I have changed >> ax.set_alpha(0-1) >> ax.fill(theta, d, facecolor=color, alpha=0-1) >> plt.Polygon(verts, closed=True, edgecolor='k', alpha=0-1) > > You are writing "0-1" which is -1 which is not a valid alpha value. > This should probably raise an exception, but apparently it doesn't. > Valid alphas are in the range 0 to 1 Try 0.1 rather than 0-1. Note > alpha is not supported in postscript output, but does work in raster > displays, PNG, PDF and SVG. > > JDH
On Tue, Feb 2, 2010 at 7:47 AM, Luc Gervais <luc...@gm...> wrote: > Hello all, > > I am creating radar plots in matplolib and I cannot get transparent polygons. > > I have run the examples from the gallery: > http://matplotlib.sourceforge.net/examples/api/radar_chart.html > http://matplotlib.sourceforge.net/examples/pylab_examples/polar_bar.html > > The colours show differently on my computer and the polygons are opaque. I have changed > ax.set_alpha(0-1) > ax.fill(theta, d, facecolor=color, alpha=0-1) > plt.Polygon(verts, closed=True, edgecolor='k', alpha=0-1) You are writing "0-1" which is -1 which is not a valid alpha value. This should probably raise an exception, but apparently it doesn't. Valid alphas are in the range 0 to 1 Try 0.1 rather than 0-1. Note alpha is not supported in postscript output, but does work in raster displays, PNG, PDF and SVG. JDH
Hello all, I am creating radar plots in matplolib and I cannot get transparent polygons. I have run the examples from the gallery: http://matplotlib.sourceforge.net/examples/api/radar_chart.html http://matplotlib.sourceforge.net/examples/pylab_examples/polar_bar.html The colours show differently on my computer and the polygons are opaque. I have changed ax.set_alpha(0-1) ax.fill(theta, d, facecolor=color, alpha=0-1) plt.Polygon(verts, closed=True, edgecolor='k', alpha=0-1) but the transparency doesn't change. I am running Enthough Python Distribution (EPD 5.0.0) on Mac OS X 10.6.2 Thanks for your help, Luc
set_position does not work with axes_grid toolkits. Try something like ax.LABELPAD = 0 However, note that this (and set_rotation) may not work with mpl_toolkits in future release of matplotlib as there has been some significant changes. Regards, -JJ ps. please use "reply to all", so that messages stay inside the list. On Mon, Feb 1, 2010 at 7:52 PM, Kim Cheung <ec...@gm...> wrote: > Mr. Lee, > > Thanks for the reply. > > The position call works with the first example but not the second: > > # Example 1 > import pylab > > data1=[1,2,3,4,5,6,7] > data2=[8,9,10,11,12,13,14] > dates=['01','02','03','04','05','06','07'] > > pylab.subplot(211) > pylab.plot(data1, label='Score 2005') > pylab.plot(data2, label='Num 2006') > pylab.setp(pylab.gca(), xticklabels=[]) > pylab.ylabel('Score 2') > pylab.title('Historical Statistics') > pylab.legend(loc='upper left') > > pylab.subplot(212) > pylab.plot(data1, label='Score 06') > pylab.plot(data2, label='Num 06') > pylab.xticks(pylab.arange(7),dates) > xlabels = pylab.gca().get_xticklabels() > ylabels = pylab.gca().get_yticklabels() > pylab.setp(xlabels, 'rotation', 90) > xlab=pylab.xlabel('Player') > pylab.setp(xlab, position=(0.2,0.1)) # <=== This line works > pylab.ylabel('Score 1') > pylab.legend(loc='upper left') > > pylab.show() > > But doesn't work in this example: > > # Example 2 > from mpl_toolkits.axes_grid.parasite_axes import SubplotHost > import matplotlib.pyplot as plt > > from matplotlib.ticker import MultipleLocator, FormatStrFormatter > > if 1: > figprops = dict(figsize=(8., 8. / 1.618), dpi=128) > # Figure properties > adjustprops = dict(left=0.08, bottom=0.12, right=0.79, top=0.96, > wspace=0.2, hspace=0.2) # Subplot properties > > fig = plt.figure(**figprops) > fig.subplots_adjust(**adjustprops) > # Tunes the subplot layout > > host = SubplotHost(fig, 111) > > p0, = host.plot([0, 1, 2], [0, 1, 2], label="Density") > ax=host.axis["left"] > plt.setp(ax.label, visible=True, text="Density", size=12, > color=p0.get_color()) > plt.setp(ax.major_ticklabels, rotation="vertical") > > plt.setp(ax.label, position=(0.2,0.1)) # This line has no effect. > > fig.add_axes(host) > > host.set_xlim(0, 2) > host.set_ylim(0, 2) > host.legend() > > plt.draw() > plt.show() > > > > Jae-Joon Lee wrote: >> >> Are you using the axes_grid toolkit? >> Standard matplotlib axis instance does not have "major_ticklabels" >> attribute, while axes_grid axis does. >> >> Please post a simple, but complete example that can be run and tested. >> Regards, >> >> -JJ >> >> >> On Sun, Jan 31, 2010 at 11:06 AM, <kc1...@ya...> >> wrote: >> >>> >>> BTW: I tried to use set_position to change the position of the axes label >>> as suggested by previous posting. No effect. >>> >>> ----- Original Message ---- >>> >>>>> >>>>> Hello, >>>>> >>>>> I am creating a plot with multiple y-axis (up to 6) and twinx >>>>> >>>> >>>> works pretty well. The problem is that there are too much wasted spaces >>>> used up >>>> by the axes. Since I have multiple axes, it cuts into the amount of >>>> space >>>> available for the plot area. I need to know how I can squeeze some >>>> spaces out of >>>> the standard axes. First thing I discovered was that I can rotate the >>>> tick >>>> labels to vertical by: >>>> >>>>> >>>>> plt.setp(ax.major_ticklabels, rotation="vertical") >>>>> >>>>> where ax is my y-axis. But then: >>>>> >>>>> (1) How to reduce the space between the tick and the axes label? >>>>> >>>>> First I tried to place the label on top but couldn't get that to work. >>>>> Then I >>>>> >>>> >>>> tried to change the position property of the axis label object and that >>>> have no >>>> effect. So, can somebody please tell me how I can do these 2 things? >>>> >>>>> >>>>> (2) How to avoid overlapping tick labels? >>>>> >>>>> With the way the standard x and y axis are drawn, after I do a vertical >>>>> rotate >>>>> >>>> >>>> of the y tick labels, the first y tick label overlaps with the last x >>>> tick label >>>> since they are both center aligned. Is there any way to change the >>>> alignment of >>>> only the first and last tick labels of an axes (while keeping the rest >>>> center >>>> aligned)? >>>> >>>>> >>>>> Thanks, >>>>> >>>>> >>>> >>>> >>> >>> -- >>> John Henry >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> The Planet: dedicated and managed hosting, cloud storage, colocation >>> Stay online with enterprise data centers and the best network in the >>> business >>> Choose flexible plans and management services without long-term contracts >>> Personal 24x7 support from experience hosting pros just a phone call >>> away. >>> http://p.sf.net/sfu/theplanet-com >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> >> > > > -- > Kim Cheung > >
On Mon, 2010年02月01日 at 15:23 -1000, Eric Firing wrote: > Alternatively, and more simply, why make the transparent regions in the > first place? > > cs = contourf(rand(10,10), [0.5, 0.7], colors=('b')) > > Here we specify a single pair of limits between which the color will be > blue. Well, that's embarrassing -- if I had read the documentation more carefully, I would have realized that the levels spec "V" means different things for "contour" and "contourf". Thank you again! :) Regards, Sourav