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
(11) |
2
(24) |
3
(24) |
4
(31) |
5
(30) |
6
(27) |
7
(25) |
8
(8) |
9
(2) |
10
(12) |
11
(16) |
12
(33) |
13
(18) |
14
(17) |
15
(3) |
16
(7) |
17
(8) |
18
(22) |
19
(20) |
20
(25) |
21
(10) |
22
(17) |
23
(18) |
24
(23) |
25
(15) |
26
(19) |
27
(6) |
28
(7) |
29
(6) |
30
(1) |
31
(12) |
|
|
|
|
|
From: Florian L. <fle...@cn...> - 2009-08-17 17:42:22
|
Hi; I've got a rather simple question. I want to (color) fill a step plot below the line, but using the fill() function always creates regular plots, not step plots, and fillstyle doesn't work as I'd expect it to. How can I fill a step plot? Something like this: import matplotlib.pyplot as plt x = [0.0,0.5,0.66,0.75,1.0] y = [0.72,0.72,0.61,0.43,0.33] plt.step(x, y, fillstyle="bottom") # doesn't work how I imagine... plt.axis([0.0,1.0,0.0,1.0]) plt.show() What I want is that the area below the step-plot line is color-filled, but I seem to be unable to find a function for it. If I use plt.fill(), it creates a polygon plot and it does not allow to use the kwarg drawstyle="steps", so I get no further with this function either. I guess it's a simple problem, but I'm having a bit of a hard time wading though all the API, being completely new to matplotlib, so some help would be very welcome! --Florian **NOTA DE CONFIDENCIALIDAD** Este correo electrónico, y en su caso los ficheros adjuntos, pueden contener información protegida para el uso exclusivo de su destinatario. Se prohíbe la distribución, reproducción o cualquier otro tipo de transmisión por parte de otra persona que no sea el destinatario. Si usted recibe por error este correo, se ruega comunicarlo al remitente y borrar el mensaje recibido. **CONFIDENTIALITY NOTICE** This email communication and any attachments may contain confidential and privileged information for the sole use of the designated recipient named above. Distribution, reproduction or any other use of this transmission by any party other than the intended recipient is prohibited. If you are not the intended recipient please contact the sender and delete all copies. |
From: Werner F. B. <wer...@fr...> - 2009-08-17 16:21:02
|
Hi Chris, Christopher Barker wrote: > Werner F. Bruhin wrote: > >> I am trying to put together a wxPython frame using py.aui to show >> multiple matplotlib.figures/canvas. >> > > I'd recommend you take a look at wxMPL -- it's a nice way to embed MPL > in wx. > I'll have a look at this. > >> Would like that each figure takes x percentage of available screen >> estate. I.e. would like e.g. to have 2 rows with 3 columns of >> figures/statistics, i.e. 6 graphics. >> > > To be clear with the vocabulary -- in MPL, a "figure" would be one > wxWindow. In that you can put multiple "axes" which show the actual > plots (sometimes referred to as subplots). In this case, I'm not sure if > you want more than one MPL figure. > I am not sure yet if multiple axes/subplots is the way to go or to have multiple figures. I was leaning towards multiple figures, each a pane in AUI, to allow the user to size them how they want. > >> If the total screen estate is too small then there should be scrollbars >> per figure/canvas. >> > > If you want multiple figures, than this isn't really an MPL question. > You'd do that layout the same way you would with any other set of > wxWindows -- probably putting them all on a wxScrolledWindow, in Sizers, > and giving them a minimum size. > > With a single MPL Figure, it would be similar, put it on > wxScrolledWindows, with a minimum size set. > O.K. will play with this. In the mean time I found also some sample code from the matplotlib doc/gallery (great piece of documentation!!!!!). > >> Hopefully some samples code (in the example files which existed in >> 0.90.x) >> > Is this what you are looking for? > > http://matplotlib.sourceforge.net/examples/index.html > > in particular, you might want to look at the wx examples here: > > http://matplotlib.sourceforge.net/examples/user_interfaces/index.html > Yes, this is what I was looking for. Although it is a pity that these do not have the sample graph as is shown in the gallery - but looking at both I think I should find what I need. Thanks for the tips Werner |
From: Ole S. <ole...@gm...> - 2009-08-17 14:30:19
|
Hi, I want to show the same data on multiple plots. Is it possible to re-use the Line2D object for that? t.m., line = axes1.plot(xdata, ydata, ...) ... axes2.lines.append(line) Or is a Line2D bound to a certain axes instance? Best regards Ole |
From: Anth-Espin <aa...@uo...> - 2009-08-17 05:06:18
|
Hey guys, I'm very new to python and matplotlib (in fact all programing) and I've been trying to figure out a way to plot a series of data that's saved to a file. I'd like for there to be some delay when the plot refreshes too, so maybe like 1-2 seconds. The file looks something like this 1000 0 0 10 10 20 30 20 10 0 0 1000 10 10 20 30 10 10 10 10 0 0 1000 0 0 10 10 20 30 20 10 0 0 etc, but has 120 values, and obviously, the numbers after the 1000 is what i wish to plot. Playing around with matplotlib i found that it plots files that are written as 0 0 10 10 etc so my code incorporates a way to read one line, transpose it, and then plot it. but then i'd like some delay, and the plot is then refreshed with the next sequence of data, and this to go on until i run out of data. My code: import linecache import matplotlib.pyplot as plt import os i=3 while i < 7: g = linecache.getline('data.txt', i) g =g.replace(" ","\n") filename = "test.txt" file = open(filename, 'w') file.write(g) file.close() plt.plotfile("test.txt") plt.show() os.remove("test.txt") i = i+2 I know it must seem horribly inefficient, but when i run it, it doesn't update it, just opens more than one plot and plots each one (and usually crashes) Any advice would be fantastic. Thanks, Anthony -- View this message in context: http://www.nabble.com/Plot-updating-from-file-tp25001050p25001050.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Christopher B. <Chr...@no...> - 2009-08-16 19:29:37
|
Werner F. Bruhin wrote: > I am trying to put together a wxPython frame using py.aui to show > multiple matplotlib.figures/canvas. I'd recommend you take a look at wxMPL -- it's a nice way to embed MPL in wx. > Would like that each figure takes x percentage of available screen > estate. I.e. would like e.g. to have 2 rows with 3 columns of > figures/statistics, i.e. 6 graphics. To be clear with the vocabulary -- in MPL, a "figure" would be one wxWindow. In that you can put multiple "axes" which show the actual plots (sometimes referred to as subplots). In this case, I'm not sure if you want more than one MPL figure. > If the total screen estate is too small then there should be scrollbars > per figure/canvas. If you want multiple figures, than this isn't really an MPL question. You'd do that layout the same way you would with any other set of wxWindows -- probably putting them all on a wxScrolledWindow, in Sizers, and giving them a minimum size. With a single MPL Figure, it would be similar, put it on wxScrolledWindows, with a minimum size set. > Hopefully some samples code (in the example files which existed in > 0.90.x) Is this what you are looking for? http://matplotlib.sourceforge.net/examples/index.html in particular, you might want to look at the wx examples here: http://matplotlib.sourceforge.net/examples/user_interfaces/index.html -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception |
From: Christoph G. <cg...@uc...> - 2009-08-16 19:10:01
|
Hi Marc, I can not reproduce this crash on my Vista development computer or on a fresh installation of Windows XP, Python 2.5.4, Numpy 1.3, matplotlib 0.99, basemap 0.99.4 in a VM. All examples work (some depend on PIL). Can you run these commands without crash? python -c "import _geoslib" python -c "from mpl_toolkits.basemap import _geod" python -c "from mpl_toolkits.basemap import _proj" These basemap/geos C modules depend on MSVCR71.DLL and MSVCP71.DLL, which are not included in the basemap installer. Christoph |
From: Ryan M. <rm...@gm...> - 2009-08-16 14:27:37
|
On Sun, Aug 16, 2009 at 8:02 AM, Sebastian <bas...@gm...> wrote: > Hi all, > When I import pylab the locale settings are changed (I'm using > matplotlib 0.99.0): > > In [1]: import locale > > In [2]: print locale.localeconv() > {'mon_decimal_point': '', 'int_frac_digits': 127, 'p_sep_by_space': 127, > 'frac_digits': 127, 'thousands_sep': '', 'n_sign_posn': 127, > 'decimal_point': '.', 'int_curr_symbol': '', 'n_cs_precedes': 127, > 'p_sign_posn': 127, 'mon_thousands_sep': '', 'negative_sign': '', > 'currency_symbol': '', 'n_sep_by_space': 127, 'mon_grouping': [], > 'p_cs_precedes': 127, 'positive_sign': '', 'grouping': []} > > In [3]: import pylab > > In [4]: print locale.localeconv() > {'mon_decimal_point': ',', 'int_frac_digits': 2, 'p_sep_by_space': 1, > 'frac_digits': 2, 'thousands_sep': '', 'n_sign_posn': 1, > 'decimal_point': ',', 'int_curr_symbol': 'EUR ', 'n_cs_precedes': 1, > 'p_sign_posn': 1, 'mon_thousands_sep': ' ', 'negative_sign': '-', > 'currency_symbol': '\xe2\x82\xac', 'n_sep_by_space': 1, 'mon_grouping': > [3, 3, 0], 'p_cs_precedes': 1, 'positive_sign': '', 'grouping': []} > > > > Is this a bug or a feature? > > For me it broke some code in a c-extension which parses a file with > floating point numbers and didn't recognize them anymore:( What backend are you using? IIRC, gtk has been behind this in the past. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
From: Werner F. B. <wer...@fr...> - 2009-08-16 14:02:10
|
I am trying to put together a wxPython frame using py.aui to show multiple matplotlib.figures/canvas. Would like that each figure takes x percentage of available screen estate. I.e. would like e.g. to have 2 rows with 3 columns of figures/statistics, i.e. 6 graphics. If the total screen estate is too small then there should be scrollbars per figure/canvas. Hopefully some samples code (in the example files which existed in 0.90.x) can put me in the right direction, otherwise I will try to put together a stand alone sample (without access to my database) to show my problem. Werner |
From: Werner F. B. <wer...@fr...> - 2009-08-16 13:55:47
|
I am just starting to test 0.99 (having remained on 0.90.1 for some time now). I can't find the examples - can anyone point out were they are. Used the following to install: matplotlib-0.99.0.win32-py2.5-setup.exe Werner |
From: Sebastian <bas...@gm...> - 2009-08-16 13:02:22
|
Hi all, When I import pylab the locale settings are changed (I'm using matplotlib 0.99.0): In [1]: import locale In [2]: print locale.localeconv() {'mon_decimal_point': '', 'int_frac_digits': 127, 'p_sep_by_space': 127, 'frac_digits': 127, 'thousands_sep': '', 'n_sign_posn': 127, 'decimal_point': '.', 'int_curr_symbol': '', 'n_cs_precedes': 127, 'p_sign_posn': 127, 'mon_thousands_sep': '', 'negative_sign': '', 'currency_symbol': '', 'n_sep_by_space': 127, 'mon_grouping': [], 'p_cs_precedes': 127, 'positive_sign': '', 'grouping': []} In [3]: import pylab In [4]: print locale.localeconv() {'mon_decimal_point': ',', 'int_frac_digits': 2, 'p_sep_by_space': 1, 'frac_digits': 2, 'thousands_sep': '', 'n_sign_posn': 1, 'decimal_point': ',', 'int_curr_symbol': 'EUR ', 'n_cs_precedes': 1, 'p_sign_posn': 1, 'mon_thousands_sep': ' ', 'negative_sign': '-', 'currency_symbol': '\xe2\x82\xac', 'n_sep_by_space': 1, 'mon_grouping': [3, 3, 0], 'p_cs_precedes': 1, 'positive_sign': '', 'grouping': []} Is this a bug or a feature? For me it broke some code in a c-extension which parses a file with floating point numbers and didn't recognize them anymore:( Cheers, Sebastian |
From: marc d. <mde...@ya...> - 2009-08-16 06:52:40
|
I can run a demo basemap on my Vista PC using version 0.99.3 for py2.5. I upgraded to 0.99.4 because the great circle function would crash. But now nothing works. I brought it in to Microsoft C++ debugger: "unhandled exception in python.exe: 0xC0000005: Access Violation" Marc Desmarais Long Beach, CA, 90814 |
From: Nejc Š. <nej...@gm...> - 2009-08-15 22:39:59
|
I would like to make biplot for principal component analysis with data values scale on left and bottom and loadings values scale on right and top. If I try to do it like that: ax2 = ax1.twinx().twiny() I can plot data correctly (data on ax1 and loadings on ax2), but I have to turn y axis on ax2 off (ax2.yaxis.set_visible(False)) that I don't have double scale on the left and bottom scale is not the same as I set it with ax1.axis() anymore. Is there another way to do it? I would also like to change color of tick labels on upper and right scale (currently I can do it only with upper scale). Nejc |
From: <jas...@cr...> - 2009-08-15 02:05:26
|
Andrew Kelly wrote: > I am currently using the annotate() method for my data points and I > was curious if there is a way to center a line of text relative to a > line of text below it. I am currently using two annotate() function > calls in a row (I need the text to be different colors) but I need the > first one to act as a title for the second (i.e. so I want it centered > relative to the one below.) I have tried to use the length of the > second bit of text to center but I just cannot seem to do it. The > code looks sort of like this: > > import matplotlib.pyplot as plt > ....... > annotateTitle='Title' > annotateText='Blah, Blah, Blah' > plt.annotate(annotateTitle, xy=(1,1), xytext=(20,50), xycoords='data', > textcoords='offset points') > plt.annotate(annotateText, xy=(1,1), xytext=(20,20), xycoords='data', > textcoords='offset points', size='small', color='black') > In the example at the bottom of http://matplotlib.sourceforge.net/users/annotations.html you see an example where the horizontalalignment is specified. Can you just do something like the following? plt.annotate(annotateTitle, xy=(1,1), xytext=(20,50), xycoords='data', textcoords='offset points', horizontalalignment='center') plt.annotate(annotateText, xy=(1,1), xytext=(20,20), xycoords='data', textcoords='offset points', size='small', color='black', horizontalalignment='center') You also see examples of the alignment parameters at http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo.html#pylab-examples-annotation-demo Thanks, Jason |
From: P.R. <rom...@ho...> - 2009-08-15 00:39:56
|
Jeff, Ok, so this is what I was trying to achieve... c=['#6C9F7B','#783F68','#F4F4F2','#22F322','#F3F322','#0000F3'] mycm=mpl.colors.LinearSegmentedColormap.from_list('mycm',c) plt.imshow(rand(10,10),cmap=mycm,interpolation='nearest') colorbar() plt.show() That was the initial goal; being able to quickly create the cmap based on some basic colors. from there, I can optionally play with the mycm._segmentdata dictionary in order to fine-tune the color spread. ...the documentation on the 'LinearSegmentedColormap.from_list()' method is very brief, and there wasn't an example, so I didn't see it right away... Anyway, problem solved. Sorry for the confusion, & thanks again for the help P.Romero -----Original Message----- From: Jeff Whitaker [mailto:js...@fa...] Sent: 2009-08-14 6:35 PM To: P.R. Subject: Re: [Matplotlib-users] colormap creation P.R. wrote: > Jeff, > Thanks for pointing me to that example. > I was basically manually performing the same operations as those listed in > the example. > however, like I said before, its been slow going, since I have to manually > edit the ranges & adjust 'linear spread' of each color. > It's a trial & error process... > > Im clear on how the rgb dictionary works; > I guess my problem/question was more on how to automate some of the work > involved in creating the rgb dictionary. > > Example: > Supposing that I have a rough idea of what color sequence I want, > let's say, > > black > blue > yellow > red > purple > > ... yet Im not sure about the exact values or 'tones' of these colors... > (this is an arbitrary example, let's assume that a similar cmap doesn't > already exist in mpl) > > - I'd like to have an automatic method to easily create a preliminary, > 'rough draft' rgb dictionary based on the rgb values for my basic colors... > this way, I can quickly create a 'prototype' dictionary that I can then > modify & adjust to suit my needs. > > so, a 'colormap generator' that takes a set of rgb values as input, and > create the value ranges within the rgb dictionary automatically... > > Any ideas? > Nope, sorry. -Jeff > Thanks, > P.Romero > > -----Original Message----- > From: Jeff Whitaker [mailto:js...@fa...] > Sent: 2009-08-14 5:29 PM > To: P.R. > Cc: mat...@li... > Subject: Re: [Matplotlib-users] colormap creation > > P.R. wrote: > >> Can someone please recommend a (semi) automatic way to create the rgb >> dictionaries needed for colormap creation? >> Basically, I have a 'general' idea of how I want my colors ordered, but Im >> finding it difficult to create the smooth transitions by manually editing >> the rgb dictionary for my custom colormap...the trial & error process is >> tedious & not very accurate... >> >> How were the matplotlib colormaps created? >> Were they created manually or programmatically? >> Was it done using a random color selection? >> >> Please help, >> Thanks, >> P.Romero >> >> > > P.R.: If you haven't already, you should look at the custom_cmap.py > example. > > -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 |
From: Jeff W. <js...@fa...> - 2009-08-14 22:28:50
|
P.R. wrote: > Can someone please recommend a (semi) automatic way to create the rgb > dictionaries needed for colormap creation? > Basically, I have a 'general' idea of how I want my colors ordered, but Im > finding it difficult to create the smooth transitions by manually editing > the rgb dictionary for my custom colormap...the trial & error process is > tedious & not very accurate... > > How were the matplotlib colormaps created? > Were they created manually or programmatically? > Was it done using a random color selection? > > Please help, > Thanks, > P.Romero > P.R.: If you haven't already, you should look at the custom_cmap.py example. -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 |
From: P.R. <rom...@ho...> - 2009-08-14 21:53:26
|
Can someone please recommend a (semi) automatic way to create the rgb dictionaries needed for colormap creation? Basically, I have a 'general' idea of how I want my colors ordered, but Im finding it difficult to create the smooth transitions by manually editing the rgb dictionary for my custom colormap...the trial & error process is tedious & not very accurate... How were the matplotlib colormaps created? Were they created manually or programmatically? Was it done using a random color selection? Please help, Thanks, P.Romero |
From: P.R. <rom...@ho...> - 2009-08-14 18:06:10
|
Eric, Thanks, that worked... I have a separate question about colormaps... I'd also like to try creating my own custom colormap by modifying an existing cmap, inserting/removing colors by changing the values in the rgb dictionary... How do I retrieve the actual rgb dictionary associated with, say, cm.jet? Thanks, P.Romero -----Original Message----- From: Eric Firing [mailto:ef...@ha...] Sent: 2009-08-14 12:49 PM To: P.R. Cc: mat...@li... Subject: Re: [Matplotlib-users] mpl.colors.BoundaryNorm question Eric Firing wrote: It occurred to me after posting that imshow by default gives a misleading picture of the effect of the cmap and boundary norm. To get a clear picture, add the "interpolation='nearest'" kwarg to the imshow call. Eric > > import numpy as np > import matplotlib.pyplot as plt > import matplotlib.colors as mcolors > import matplotlib.cm as cm > > > boundaries = np.linspace(20, 30, 11) > colors = cm.spectral(np.linspace(0.3, 0.8, 10)) > cmap = mcolors.ListedColormap(colors) > norm = mcolors.BoundaryNorm(boundaries, cmap.N) > > z = 20 + np.random.rand(10,20)*10 > plt.imshow(z, cmap=cmap, norm=norm) > plt.colorbar() > plt.show() > |
From: Eric F. <ef...@ha...> - 2009-08-14 17:49:31
|
Eric Firing wrote: It occurred to me after posting that imshow by default gives a misleading picture of the effect of the cmap and boundary norm. To get a clear picture, add the "interpolation='nearest'" kwarg to the imshow call. Eric > > import numpy as np > import matplotlib.pyplot as plt > import matplotlib.colors as mcolors > import matplotlib.cm as cm > > > boundaries = np.linspace(20, 30, 11) > colors = cm.spectral(np.linspace(0.3, 0.8, 10)) > cmap = mcolors.ListedColormap(colors) > norm = mcolors.BoundaryNorm(boundaries, cmap.N) > > z = 20 + np.random.rand(10,20)*10 > plt.imshow(z, cmap=cmap, norm=norm) > plt.colorbar() > plt.show() > |
From: Alan G I. <ala...@gm...> - 2009-08-14 16:52:46
|
On 8/14/2009 11:54 AM Dan Klinglesmith apparently wrote: > I am writing a python script that is a continuous running script in which I want to update a weather data plot. [...] > I can make the plots but can not figure how to get past "show()". http://www.mail-archive.com/mat...@li.../msg12365.html Oddly this is not in the FAQ is the documentation points to a missing item: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.show Alan Isaac |
From: Dan K. <dkl...@mr...> - 2009-08-14 16:31:59
|
I am writing a python script that is a continuous running script in which I want to update a weather data plot. In other words I am collecting weather data (temperature, RH, winds, etc) on a regular basis and want to update a plot of the last 24 hours worth of data. I can make the plots but can not figure how to get past "show()". Suggestions? cheers, Dan Daniel A. Klinglesmith III Magdalena Ridge Observatory New Mexico Tech (575) 835-6802 |
From: Christophe D. <chr...@vh...> - 2009-08-14 15:48:31
|
Thanks JJ, this works fairly well. I was wondering if the following would also be possible: at start up, draw all the minute bars in an invisible background, and on each update only display a subset of the background. Regards, Christophe -----Original Message----- From: Jae-Joon Lee [mailto:lee...@gm...] Sent: 06 August 2009 17:01 To: Christophe Dupre Cc: matplotlib-users Subject: Re: [Matplotlib-users] 0.99.0-RC1 and the animation_blit_gtk2 example Christophe, Unfortunately, the background is always shifted by integer pixel. So, shift in data and shift in pixel have some offset and what you see is the accumulation of this offset. And you have to manage the pixel and and data coordinates in sync. For example, you may try to keep the original transform and calculate the pixel shift in this coordinate. This would work if you're not worried about the overflow. The attached example solve this with different approach. However, dx_data in this approach is not constant but fluctuate, although its mean value should be one minute. Regards, -JJ On Wed, Aug 5, 2009 at 7:48 AM, Christophe Dupre<chr...@vh...> wrote: > Hi JJ, > > Thanks for that. It works fairly well, but I've noticed that the graph content (the candlesticks) move slightly faster than the x axis. I've added a sleep(0.1) statement to slow things down, and we can see that at the start the first bar is displayed at around 13:15 but by the times is gets to the left, the same bar is then displayed at about 13:00. > > Do you have any suggestion on how to improve that? > > Apart from that, shifting the graph is quite fast. On my machine, I get a frame rate of 30 FPS if I redraw both X and Y axis. The rate goes much higher ( greater than 100 FPS) if I don't redraw the axis. > > Thanks, > > Christophe > > > -----Original Message----- > From: Jae-Joon Lee [mailto:lee...@gm...] > Sent: 05 August 2009 03:36 > To: Christophe Dupre > Cc: matplotlib-users > Subject: Re: [Matplotlib-users] 0.99.0-RC1 and the animation_blit_gtk2 > example > > On Tue, Aug 4, 2009 at 12:14 PM, Christophe > Dupre<chr...@vh...> wrote: >> Hello, >> >> >> >> I've been playing with the animation_blit_gtk2 example >> (http://matplotlib.sourceforge.net/examples/animation/animation_blit_ >> gtk2.html >> >> ) and the latest version of matplotlib version 0.99.0-RC1. >> >> I've modified the example so that it displays candlesticks moving >> towards the lelf. The example is attached if anybody is interested. >> >> >> >> >> >> In my example, I'm using 1 minute bars and therefore I would like to >> shift the graph by 1 minute instead of a few pixels. Is there a way >> to convert a time difference into pixels? >> > > The "get_dx_data" method coverts a pixel offset to a data offset. > So, what you need is just to invert it. > This requires some knowledge of transformation, but I guess the code > is rather self-explanatory. > > For example, something like below will work (sorry, I haven't > actually tested the code) > > def get_dx_pixel(self, dx_data): > tp = self.ax.transData.transform_point > x0, y0 = tp((0, 0)) > x1, y1 = tp((dx_data, 0)) > return (x1-x0) > > Regards, > > -JJ > >> >> >> Thanks, >> >> >> >> Christophe >> >> >> >> >> >> --------------------------------------------------------------------- >> --------- 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 >> >> > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 8.5.392 / Virus Database: 270.13.43/2281 - Release Date: > 08/04/09 05:57:00 > No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.44/2283 - Release Date: 08/05/09 18:23:00 |
From: Jouni K. S. <jk...@ik...> - 2009-08-14 14:20:36
|
per freem <per...@gm...> writes: > i am trying to install matplotlib-0.99 on a mac os x machine, with the > following python: > > Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13) > [GCC 4.0.1 (Apple Inc. build 5465)] on darwin I think that's the system Python (/usr/bin/python), while the installer package works with the framework Python (/usr/local/bin/python). See: http://matplotlib.sourceforge.net/faq/installing_faq.html#os-x-questions http://www.python.org/download/mac/ http://www.python.org/download/releases/2.5.4/ > i also cannot where the new version was installed. does anyone know > where the files for the new matplotlib should be? they are not in > /Library/Frameworks/Python2.5/ it seems. It should be in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages > if i do: > > locate matplotlib | grep 0.99 > > nothing comes up. i only see files related to the older matplotlib > when i do "locate matplotlib" in the shell. The locate database is only updated weekly (and that's assuming that you keep your Mac running in the early hours in which the update is run by default). Try sudo periodic weekly to update the database if you want locate to find recently created files. The update can take quite some time. > any ideas how i can install this? i wanted to try the .egg > installation with "easy_install" but when i do: > > easy_install matplotlib > > it matches to a 0.98 version of matplotlib, not 0.99. easy_install can be really bothersome. If you have an easy-install.pth file in your site-packages directory, edit it and remove references to the old version of matplotlib. -- Jouni K. Seppänen http://www.iki.fi/jks |
From: per f. <per...@gm...> - 2009-08-14 13:17:55
|
hi all, i am trying to install matplotlib-0.99 on a mac os x machine, with the following python: Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin using version 10.5.6 of mac os x. when i go to http://sourceforge.net/projects/matplotlib/ it prompts me to download matplotlib-0.99.0-py2.5-macosx10.5.dmg. when i download this installer and install it, it only lets me to install it in my mac harddrive (I don't see any option to change the installation location.) installation goes through smoothly and in the end i get the "installation successful" message. however, only the older version of matplotlib comes up when i do "import matplotlib". i also cannot where the new version was installed. does anyone know where the files for the new matplotlib should be? they are not in /Library/Frameworks/Python2.5/ it seems. if i do: locate matplotlib | grep 0.99 nothing comes up. i only see files related to the older matplotlib when i do "locate matplotlib" in the shell. any ideas how i can install this? i wanted to try the .egg installation with "easy_install" but when i do: easy_install matplotlib it matches to a 0.98 version of matplotlib, not 0.99. thanks for your help |
From: othererik <oth...@gm...> - 2009-08-14 13:08:35
|
Good day, I've hit an issue that may be a bug. In a previous version of matplotlib (.98.x) I had a picker set for lines plotted on two axes. This was working until I upgraded to version 0.99.0. Now the first axes's pick events never seem to fire even though they respond true if queried with pickable(). The second axes's pick events still fire. Using the example below, clicking on the left y's line will never print anything, but the sin from the right will if clicked. OS: Windows XP Pro Python: 2.6 matplotlib version: 0.99.0 -- installed using the python2.6 windows exe obtained from sourceforge Code to reproduce: import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111) t = np.arange(0.01, 10.0, 0.01) s1 = np.exp(t) ax1.plot(t, s1, 'b-', picker = 4.0) ax1.set_xlabel('time (s)') # Make the y-axis label and tick labels match the line color. ax1.set_ylabel('exp', color='b') for tl in ax1.get_yticklabels(): tl.set_color('b') ax2 = ax1.twinx() s2 = np.sin(2*np.pi*t) ax2.plot(t, s2, 'r.', picker = 4.0) ax2.set_ylabel('sin', color='r') for tl in ax2.get_yticklabels(): tl.set_color('r') def onpick(event): thisline = event.artist xdata = thisline.get_xdata() ydata = thisline.get_ydata() ind = event.ind print 'onpick points:', zip(xdata[ind], ydata[ind]) fig.canvas.mpl_connect('pick_event', onpick) plt.show() Thanks for a wonderful plotting package! -- View this message in context: http://www.nabble.com/onpick-on-a-2-y-plot-%28-via-twinx%28%29-%29-seems-to-only-allow-picking-of-second-axes%27s-artists-tp24971445p24971445.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric F. <ef...@ha...> - 2009-08-14 07:20:44
|
P.R. wrote: > Hi, > I'd like to generate a colormap index based on an array of levels & using an > existing colormap (Spectral). > However, Id like the cmap index to start at the 0.3 value of the Spectral > scale (orange/yellow area) instead of starting at the '0' scale value (red > area), and then continue until the 0.8 value area (green)...in essence, Id > like to do a 'slice' of a given colormap, using BoundaryNorm or some other > function, and using my levels array in order to break up the colormap. > > What would be the best way to get this done? > Can it be easily done using existing functions, or would I need to create my > own colormap? One way is to extract the colors you want from spectral, and use them with a boundary norm. Suppose you want 10 colors because you have 11 boundaries, and suppose they are in the range from 20 to 30: import numpy as np import matplotlib.pyplot as plt import matplotlib.colors as mcolors import matplotlib.cm as cm boundaries = np.linspace(20, 30, 11) colors = cm.spectral(np.linspace(0.3, 0.8, 10)) cmap = mcolors.ListedColormap(colors) norm = mcolors.BoundaryNorm(boundaries, cmap.N) z = 20 + np.random.rand(10,20)*10 plt.imshow(z, cmap=cmap, norm=norm) plt.colorbar() plt.show() So yes, you are creating your own colormap, but it is easy. Eric > > Please help, > > Thanks, > P.Romero > > > ------------------------------------------------------------------------------ > 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 |