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
(28) |
2
(11) |
3
(15) |
4
(11) |
5
(13) |
6
(33) |
7
(13) |
8
(9) |
9
(2) |
10
(9) |
11
(27) |
12
(5) |
13
(10) |
14
(6) |
15
(9) |
16
(4) |
17
(2) |
18
(19) |
19
(11) |
20
(9) |
21
(16) |
22
(16) |
23
(5) |
24
(2) |
25
(8) |
26
(2) |
27
(11) |
28
(10) |
29
(5) |
30
(1) |
31
(2) |
|
|
|
|
|
|
On Mon, Aug 11, 2008 at 8:31 AM, Jeff Whitaker <js...@fa...> wrote: > Have you checked out the pylab examples? For me, they are the best way > to learn how to use matplotlib effectively. In particular: johnh@flag:examples> find . -name "*.py"|xargs grep -il colorbar ./animation/dynamic_image_wxagg2.py ./tests/backend_driver.py ./pylab_examples/multi_image.py ./pylab_examples/contourf_demo.py ./pylab_examples/contourf_log.py ./pylab_examples/subplots_adjust.py ./pylab_examples/contour_image.py ./pylab_examples/contour_demo.py ./pylab_examples/pcolor_demo.py ./pylab_examples/image_masked.py ./pylab_examples/poormans_contour.py ./pylab_examples/hexbin_demo.py ./pylab_examples/line_collection2.py ./pylab_examples/pcolor_log.py ./pylab_examples/scatter_demo2.py ./pylab_examples/griddata_demo.py ./pylab_examples/hexbin_demo2.py ./api/colorbar_only.py ./api/patch_collection.py
stuartornum wrote: > Jeff, > > That worked perfectly ! Thank you. > > One more question... how would I change the colour scheme of the colorbar()? > > Thanks again > Stuart: Use the cmap argument to specify a color map. Have you checked out the pylab examples? For me, they are the best way to learn how to use matplotlib effectively. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328
Jeff, That worked perfectly ! Thank you. One more question... how would I change the colour scheme of the colorbar()? Thanks again -- View this message in context: http://www.nabble.com/colorbar%28%29-fix-limit-on-Heat-map-tp18923300p18925645.html Sent from the matplotlib - users mailing list archive at Nabble.com.
stuartornum wrote: > Hi All, > > You may remember from my previous post I was having problems plotting a > heatmap, however Pete came through for me and made it work. > > Anyway, I have almost finished what I want to do. The only issue is fixing > the colorbar() range limit. > > Sometimes the my values are 0.01 to 0.2 for example, and other times there > 0.01 to 0.99. > > So what happens it the colorbar() automagically adjusts the gradient > according to my values, however I do not want it to do that, I want the > graph to be consistantly 0 - 1 (blue - red). > > I have tried things like colorbar(0,1), however no luck. > > If you could let me know how to fix the range, I would be very grateful. > > Regards > Stuart: Use the vmin/vmax keyword arguments if your are using imshow or pcolor/pcolormesh. If you are using contourf, just specify the contour levels to span the range 0-1 (i.e. clevs=linspace(-1,1,15)). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328
Hi All, You may remember from my previous post I was having problems plotting a heatmap, however Pete came through for me and made it work. Anyway, I have almost finished what I want to do. The only issue is fixing the colorbar() range limit. Sometimes the my values are 0.01 to 0.2 for example, and other times there 0.01 to 0.99. So what happens it the colorbar() automagically adjusts the gradient according to my values, however I do not want it to do that, I want the graph to be consistantly 0 - 1 (blue - red). I have tried things like colorbar(0,1), however no luck. If you could let me know how to fix the range, I would be very grateful. Regards -- View this message in context: http://www.nabble.com/colorbar%28%29-fix-limit-on-Heat-map-tp18923300p18923300.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi! I'm being dense here and I'm hoping some one can help me out. I had 0.91.1 from http://www.pythonmac.org/packages/py25-fat/index.html I went to install the shiny new version of matplotlib (0.98.3) on my mac using the .egg from sourceforge. I assumed that the .egg is a binary version of matplotlib, but the installer started to download a source tarball from sourceforge. It then failed because I don't have a bunch of libraries like png etc. I then tried with the --no-deps option on easy_install and it timed out. Well, I wanted to see how badly my install was borked and I ran ipython, imported matplotlib and checked the version and the date. In [3]: matplotlib.__version__ Out[3]: '0.98.3' In [4]: matplotlib.__date__ Out[4]: '$Date: 2008年07月31日 15:08:08 -0400 (2008年7月31日) $' eh? It installed? Then I ran some of my scripts and it turns out those work fine too! I've been trying to understand: 1. Why the .egg would need to compile from source 2. Why the .egg works properly even though dependencies were missing and the compile failed Yours in astonishment -kg
Just a note to say I like the new webpage layout and design! :) -kg
On Sun, Aug 10, 2008 at 8:06 AM, Boris Barbour <ba...@en...> wrote: > > Hi, > > I have lots of data acquired via analogue to digital conversion. The data is > consequently represented as integers (often 16 bit resolution). To obtain the > correct signal and plot it, these data must of course be multiplied by a > floating point scale factor. This seems potentially wasteful of resources > (time and memory), especially as I would prefer to keep the original data > untouched. > > It occurs to me that a more efficient plotting method would be to plot the > original data but scale the axes by the appropriate factor. In that way a > simple numpy array view could be passed to plot. Does a method for doing this > exist? I think I can do it in a rather convoluted way by plotting the > original data and then superimposing empty axes at the adjusted scale. > However, I haven't yet tested this and I'm a bit skeptical about the overhead > of two plots. Another possibility might be the units mechanism, but according > to the documentation that is discouraged, and it might be awkward to > implement. The easiest way is to define a custom formatter -- this is responsible for taking your numeric data and converting it to strings for the tick labels and navigation toolbar coordinate reporting. Eg import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as ticker t = np.arange(1000)*0.01 s = (np.random.rand(1000)*4096).astype(int) # this controls the formatting of the tick labels class VoltFormatter(ticker.Formatter): """ take input and convert to +/- 5V 0->-5, 2048->0, 4096->5 """ def __call__(self, x, pos=None): return '%1.2f'%(5*(x-2048)/4096.) formatter = VoltFormatter() fig = plt.figure() ax = fig.add_subplot(111) ax.plot(t, s) ax.yaxis.set_major_formatter(formatter) plt.show() One problem with this solution is that the tick choices are poor, since the tick locator doesn't know where to put multiple of volts. To solve this, you can write your own locator, eg as described in the user's guide, to place ticks on multiples of the integer scale. But as Eric notes, mpl will be converting your data under the hoods to doubles anyway, so you won't be getting any space and cpu savings
Boris Barbour wrote: > Hi, > > I have lots of data acquired via analogue to digital conversion. The data is > consequently represented as integers (often 16 bit resolution). To obtain the > correct signal and plot it, these data must of course be multiplied by a > floating point scale factor. This seems potentially wasteful of resources > (time and memory), especially as I would prefer to keep the original data > untouched. I don't understand this last clause; scaling your original integer data prior to plotting does not in any way inhibit your storage and use of that original integer data. > > It occurs to me that a more efficient plotting method would be to plot the > original data but scale the axes by the appropriate factor. In that way a > simple numpy array view could be passed to plot. Does a method for doing this > exist? I think I can do it in a rather convoluted way by plotting the > original data and then superimposing empty axes at the adjusted scale. > However, I haven't yet tested this and I'm a bit skeptical about the overhead > of two plots. Another possibility might be the units mechanism, but according > to the documentation that is discouraged, and it might be awkward to > implement. > > If the possibility doesn't exist, I wonder whether it might be feasible - and > not too difficult - to add to the axis methods? One could add a scale > parameter with a default value of 1 that should not affect existing code. For ordinary plots in matplotlib the data will be converted to double precision anyway, and the time required for you to do your own scaling and conversion is utterly negligible compared to the total plotting time. I don't think it will make any difference in memory usage, either. Matplotlib uses asarray(), so there will not be a copy if the input is already a double precision array. It sounds like you may be thinking about optimizations in the wrong place. Are you actually running up against speed or memory problems? Eric
On Sun, Aug 10, 2008 at 7:29 AM, Charlie Moad > Can you search your system and see if you have that dll installed somewhere. > Most likely you will. If you find it, go to the command prompt and change > to the directory where the dll is. Then run this command: > Regsvr32 msvcp71.dll Thanks for the suggestion. I didn't have msvcp71.dll on my system, so I went here to download it: http://www.driverskit.com/dll/msvcp71.dll/2371.html Once I placed it in the python directory, C:\Python25 (next to the msvcr71.dll), it worked fine. Perhaps the matplotlib installer for 64-bit Vista/Windows 2008 (if there ever is one) should include this file (or check for it)? Thanks again for the help! > - Charlie Adam -- "Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu
What is surprising is that this is the library Python uses, so it must be located at c:\pythonXXX. This path should be in the PATH variable. So the system finds the library, but not python ?? Matthieu 2008年8月10日 Adam Getchell <ada...@gm...>: > Just installed matplotlib, it doesn't plot the basic plot.py: > > from pylab import * > plot([1,2,3]) > show() > > Here's the results: > > C:\Projects\Python>python simple-plot.py --verbose-helpful > $HOME=X:\ > CONFIGDIR=X:\.matplotlib > matplotlib data path C:\Python25\lib\site-packages\matplotlib\mpl-data > loaded rc file C:\Python25\lib\site-packages\matplotlib\mpl-data\matplotlibrc > matplotlib version 0.98.3 > verbose.level helpful > interactive is False > units is False > platform is win32 > > I also get a popup window with this text: > > "This application has failed to start because MSVCP71.dll was not found. > Re-installing the application may fix this problem." > > As far as I can tell, this is a Visual C++ library from .NET 2003. > > My laptop is running Windows 2008 (64-bit) with the .NET 3.0 framework. > > I have already removed site-packages/matplotlib and reinstalled, with > the same results. > > Let me know if I should be reporting anything else not listed on: > > http://matplotlib.sourceforge.net/faq.html > > Thanks! > > Adam > -- > "Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- French PhD student Website : http://matthieu-brucher.developpez.com/ Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn : http://www.linkedin.com/in/matthieubrucher
Can you search your system and see if you have that dll installed somewhere. Most likely you will. If you find it, go to the command prompt and change to the directory where the dll is. Then run this command: Regsvr32 msvcp71.dll (I don't know if your 64-bit machine uses the command Regsvr64, so try that too) - Charlie On Sun, Aug 10, 2008 at 2:50 AM, Adam Getchell <ada...@gm...>wrote: > Just installed matplotlib, it doesn't plot the basic plot.py: > > from pylab import * > plot([1,2,3]) > show() > > Here's the results: > > C:\Projects\Python>python simple-plot.py --verbose-helpful > $HOME=X:\ > CONFIGDIR=X:\.matplotlib > matplotlib data path C:\Python25\lib\site-packages\matplotlib\mpl-data > loaded rc file > C:\Python25\lib\site-packages\matplotlib\mpl-data\matplotlibrc > matplotlib version 0.98.3 > verbose.level helpful > interactive is False > units is False > platform is win32 > > I also get a popup window with this text: > > "This application has failed to start because MSVCP71.dll was not found. > Re-installing the application may fix this problem." > > As far as I can tell, this is a Visual C++ library from .NET 2003. > > My laptop is running Windows 2008 (64-bit) with the .NET 3.0 framework. > > I have already removed site-packages/matplotlib and reinstalled, with > the same results. > > Let me know if I should be reporting anything else not listed on: > > http://matplotlib.sourceforge.net/faq.html > > Thanks! > > Adam > -- > "Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi, I have lots of data acquired via analogue to digital conversion. The data is consequently represented as integers (often 16 bit resolution). To obtain the correct signal and plot it, these data must of course be multiplied by a floating point scale factor. This seems potentially wasteful of resources (time and memory), especially as I would prefer to keep the original data untouched. It occurs to me that a more efficient plotting method would be to plot the original data but scale the axes by the appropriate factor. In that way a simple numpy array view could be passed to plot. Does a method for doing this exist? I think I can do it in a rather convoluted way by plotting the original data and then superimposing empty axes at the adjusted scale. However, I haven't yet tested this and I'm a bit skeptical about the overhead of two plots. Another possibility might be the units mechanism, but according to the documentation that is discouraged, and it might be awkward to implement. If the possibility doesn't exist, I wonder whether it might be feasible - and not too difficult - to add to the axis methods? One could add a scale parameter with a default value of 1 that should not affect existing code. Boris
Just installed matplotlib, it doesn't plot the basic plot.py: from pylab import * plot([1,2,3]) show() Here's the results: C:\Projects\Python>python simple-plot.py --verbose-helpful $HOME=X:\ CONFIGDIR=X:\.matplotlib matplotlib data path C:\Python25\lib\site-packages\matplotlib\mpl-data loaded rc file C:\Python25\lib\site-packages\matplotlib\mpl-data\matplotlibrc matplotlib version 0.98.3 verbose.level helpful interactive is False units is False platform is win32 I also get a popup window with this text: "This application has failed to start because MSVCP71.dll was not found. Re-installing the application may fix this problem." As far as I can tell, this is a Visual C++ library from .NET 2003. My laptop is running Windows 2008 (64-bit) with the .NET 3.0 framework. I have already removed site-packages/matplotlib and reinstalled, with the same results. Let me know if I should be reporting anything else not listed on: http://matplotlib.sourceforge.net/faq.html Thanks! Adam -- "Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu
On 8 Aug 2008, at 8:42 PM, Michael McNeil Forbes wrote: > While revisiting some old plotting code, I ran across the following > change in behaviour that seems to be buggy. > > from pylab import * > ion() > clf() > x = linspace(0,1,10) > plot(x,x**2,'r') > a = gcf().add_axes([0.5,0.6,0.3,0.3]) > a.set_axis_bgcolor(None) > draw() > > The inset axes appear blue, whereas before this used to make the > axes transparent (no background). > > This changed between r5047 and r5048. (I have not had a chance to > look at the code yet.) What is the intended way to allow for > "transparent" inset axes? Okay, looking at the changes I figured this out: a.set_axis_bgcolor('none') Michael.
While revisiting some old plotting code, I ran across the following change in behaviour that seems to be buggy. from pylab import * ion() clf() x = linspace(0,1,10) plot(x,x**2,'r') a = gcf().add_axes([0.5,0.6,0.3,0.3]) a.set_axis_bgcolor(None) draw() The inset axes appear blue, whereas before this used to make the axes transparent (no background). This changed between r5047 and r5048. (I have not had a chance to look at the code yet.) What is the intended way to allow for "transparent" inset axes? Thanks, Michael.
Richard Lawrence wrote: > I decided to try building Python myself using --prefix=$HOME, Did you do that because you want to mess around with 2.6? You might want to try building it as a more OS-X is way, I think that required a flag something like "enable-frameworks" or something like that. > which gave > me a nice clean interpreter whose default sys.path is completely > separate from any of the Apple stuff. The python.org binary is completely independent too. In fact, you don't need --prefix=$HOME to make it independent either, I think it goes in usr/local be default, or into Library/Frameworks if you enable the Framework build. > Numpy and matplotlib build > against it with no trouble. Hooray! Cool, I didn't expect them to be 2.6 compatible! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
I think what you are asking for is interpolation. You have a set of (x,y) data, and you want to find a new y-value corresponding to a given x-value. Take a look at scipy.interpolate.interp1d import numpy import scipy import scipy.interpolate # Set up fake "data". x= numpy.arange(10) y = numpy.sin(x) # Set up an interpolate object. interp_func = scipy.interpolate.interp1d(x, y) # Find the intepolated value of y, given x=3.5. ynew = interp_func(3.5) print ynew Hope that helps, Roban On Fri, Aug 8, 2008 at 2:14 PM, Kazansky, Stella (SKAZANSK) <SKA...@ar...> wrote: > > Hello, everyone, > I am creating a plot based on several (x,y) value pairs (it constitutes some > fuel burn envelope). > > Then I have to draw a line parallel to X axis with a given value of X that > would start at my plot, which means I have to find a value of Y on my plot > > that corresponds to a given X. Or an intersection of my plot and the line > parallel to X axis. > > I couldn't find a way to do it. > If somebody can help I' really appreciate it. > > Thanks > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hello, everyone, I am creating a plot based on several (x,y) value pairs (it constitutes some fuel burn envelope). Then I have to draw a line parallel to X axis with a given value of X that would start at my plot, which means I have to find a value of Y on my plot that corresponds to a given X. Or an intersection of my plot and the line parallel to X axis. I couldn't find a way to do it. If somebody can help I' really appreciate it. Thanks
stuartornum wrote: > Also what does rand(3,3) actually produce? is it a list, dict, im not really > sure. Since you are using Python, you can just ask it: >>> import numpy as np >>> help(np.random.rand) Help on built-in function rand: rand(...) Return an array of the given dimensions which is initialized to random numbers from a uniform distribution in the range [0,1). rand(d0, d1, ..., dn) -> random values Note: This is a convenience function. If you want an interface that takes a tuple as the first argument use numpy.random.random_sample(shape_tuple). >>> np.random.rand(2,3) array([[ 0.309125 , 0.68037706, 0.59229101], [ 0.20640643, 0.33197814, 0.20436687]]) hth, Alan Isaac
AH HA! Pete, you are a life saver! Thank you so much for all your help ! -- View this message in context: http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18888931.html Sent from the matplotlib - users mailing list archive at Nabble.com.
try this: list = numpy.array([0.66877509, 0.58785363, 0.32387598, 0.16877509, 0.48785363, 0.22387598, 0.96877509, 0.18785363, 0.52387598]) Pete 2008年8月8日 stuartornum <st...@mu...> > > Thanks again Pete for your help. > > I have numpy imported, and here is what my code looks like: > > ############################ > import matplotlib > import numpy > from numpy import * > from pylab import * > > list = [0.66877509, 0.58785363, 0.32387598, 0.16877509, 0.48785363, > 0.22387598, 0.96877509, 0.18785363, 0.52387598] > newlist = list.reshape(3,3) > > pcolormesh(newlist) > colorbar() > savefig('colour.png') > > ############################ > > However I get the error: > > Traceback (most recent call last): > File "colour.py", line 24, in <module> > newlist = list.reshape(3,3) > AttributeError: 'list' object has no attribute 'reshape' > ############################ > > Just to note I get no error when numpy in imported. > > Thank you. > -- >
Thanks again Pete for your help. I have numpy imported, and here is what my code looks like: ############################ import matplotlib import numpy from numpy import * from pylab import * list = [0.66877509, 0.58785363, 0.32387598, 0.16877509, 0.48785363, 0.22387598, 0.96877509, 0.18785363, 0.52387598] newlist = list.reshape(3,3) pcolormesh(newlist) colorbar() savefig('colour.png') ############################ However I get the error: Traceback (most recent call last): File "colour.py", line 24, in <module> newlist = list.reshape(3,3) AttributeError: 'list' object has no attribute 'reshape' ############################ Just to note I get no error when numpy in imported. Thank you. -- View this message in context: http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18888817.html Sent from the matplotlib - users mailing list archive at Nabble.com.
rand() produces a numpy array, so long as numpy is imported into the namespace. I was simply using the random numbers as example data. In your case you would take your 1x100 vector of heat data and re-shape it to a 10x10 array. data=data.reshape(10,10) Pete 2008年8月8日 stuartornum <st...@mu...> > > Hi Pete / All, > > Thank you for the help so far, really appreciate it. > > I have managed to plot the graph above using the code you gave me: > > ################### > > z=rand(3,3) > pcolormesh(z) > colorbar() > savefig('colour.png') > > ################### > > However, I am trying to find out what rand() actually does..? Apparently I > shouldn't use it unless a specific C library is required...? > > Also what does rand(3,3) actually produce? is it a list, dict, im not > really > sure. > > if I print rand(3,3) I get this: > > [[ 0.66877509 0.58785363 0.32387598] > [ 0.30220588 0.39593143 0.82576463] > [ 0.41322716 0.49939853 0.99874519]] > > Which looks like a list but without commas, also how would I address a grid > position.. say.. (2,3) and plot a value to that? > > Thank you > -- > View this message in context: > http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18887443.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi Pete / All, Thank you for the help so far, really appreciate it. I have managed to plot the graph above using the code you gave me: ################### z=rand(3,3) pcolormesh(z) colorbar() savefig('colour.png') ################### However, I am trying to find out what rand() actually does..? Apparently I shouldn't use it unless a specific C library is required...? Also what does rand(3,3) actually produce? is it a list, dict, im not really sure. if I print rand(3,3) I get this: [[ 0.66877509 0.58785363 0.32387598] [ 0.30220588 0.39593143 0.82576463] [ 0.41322716 0.49939853 0.99874519]] Which looks like a list but without commas, also how would I address a grid position.. say.. (2,3) and plot a value to that? Thank you -- View this message in context: http://www.nabble.com/Contour-Contourf-Plot-Heatmap---Grid---Multiple-Items-tp18872991p18887443.html Sent from the matplotlib - users mailing list archive at Nabble.com.