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}
(151) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 


1
(9) 
2
(8) 
3
(6) 
4
(5) 
5
(10) 
6
(1) 
7

8
(5) 
9
(3) 
10
(12) 
11
(24) 
12
(28) 
13
(16) 
14
(3) 
15
(10) 
16
(17) 
17
(19) 
18
(10) 
19
(20) 
20
(7) 
21
(11) 
22
(7) 
23
(5) 
24
(4) 
25
(11) 
26
(19) 
27
(1) 
28
(1) 
29
(13) 
30
(7) 
31
(22) 



From: Benjamin Root <ben.root@ou...>  20110830 03:33:10

On Mon, Aug 29, 2011 at 10:26 PM, Trevor J Christensen < trevor@...> wrote: > I have a number of questions, but I'll start with one. Consider the > following code: > > import matplotlib as mpl > import matplotlib.pyplot as plt > import numpy as np > x = np.arange(1, 6) > plt.plot(x, x*1.5) > plt.show() > s = raw_input('Enter anything to continue:') > plt.show() > print 'The end' > > Question: The first plt.show() launches an interactive window. Control > returns to the script upon its close. The second plt.show() does nothing > that I can see. Why? > > Ubuntu 11.04, Python 2.7.1, Matplotlib 0.99.3 > That is because closing the figure destroys that object. If you want full interactive mode, I suggest updating to v1.0.1 (or the upcoming v1.1.0 release) and use plt.ion(). The show() will trigger the figures to appear, but control immediately returns to the script. Interactivity in earlier versions of mpl is a bit more hitormiss, so you can try it out first before updating. Also note that multiple calls to plt.show() in earlier versions are not recommended, but are allowed in v1.0 and up. I hope this helps, Ben Root 
From: Trevor J Christensen <trevor@jc...>  20110830 03:26:41

I have a number of questions, but I'll start with one. Consider the following code: import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np x = np.arange(1, 6) plt.plot(x, x*1.5) plt.show() s = raw_input('Enter anything to continue:') plt.show() print 'The end' Question: The first plt.show() launches an interactive window. Control returns to the script upon its close. The second plt.show() does nothing that I can see. Why? Ubuntu 11.04, Python 2.7.1, Matplotlib 0.99.3 
From: Benjamin Root <ben.root@ou...>  20110830 02:12:21

How about Numpy's loadtxt()? Genfromtext is more of a specialty function. Ben Root On Monday, August 29, 2011, Alexa Villaume <alexa7890@...> wrote: > Hi there, > I have a 2d array that I'd like to contour. The plot isn't turning out right and I think it's because the array isn't be read in correctly. > It's a 25x41 array that is in a text file. I have tried using genfromtxt and the asciitable module to read the data in and neither gives the correct output. > Does anyone know of any command either specific for reading in 2d arrays or is able to handle 2d arrays? > Thanks, > Alexa 
From: Alexa Villaume <alexa7890@gm...>  20110830 01:31:42

Hi there, I have a 2d array that I'd like to contour. The plot isn't turning out right and I think it's because the array isn't be read in correctly. It's a 25x41 array that is in a text file. I have tried using genfromtxt and the asciitable module to read the data in and neither gives the correct output. Does anyone know of any command either specific for reading in 2d arrays or is able to handle 2d arrays? Thanks, Alexa 
From: Benjamin Root <ben.root@ou...>  20110829 21:30:10

On Sun, Aug 28, 2011 at 3:03 PM, Bruce Ford <bruce@...>wrote: > Getting a strange result trying to divide two 3d arrays. I am getting > a matrix of NaNs regardless of how I divide and I can't determine why. > > #opened a NetCDF file using pythonnetcdf4 > > var1 = nc_file.variables['var1'] ###shape = [31,181,360] with a > values ranging from 0  243 and NO NaNs in the array, dtype float32 > var2 = nc_file.variables['var2'] ###shape = [31,181,360] with a > values ranging from 0  4 (mostly zeros) and NO NaNs in the array, > dtype float32 > > np.seterr(all='ignore') #in case problem has something do to with > dividing by zero > > var1/var2 ###gives array of NaNs with shape of 31,181,360 > > #doing the division one slice at a time doesn't help... > for x in range(1,var1.shape[0]): > var[x,:,:] = var1[x,:,:]/var2[x,:,:] ###gives array of > NaNs with shape of 31,181,360 > > var = np.divide(var1,var2) ###gives array of NaNs with shape of 31,181,360 > > > print "<p>where max: " + np.where(var1 == np.max(var1)) #prints > (array([28]), array([79]), array([182])) > print var1[28,79,182] #print 545 > print var2[28,79,182] ##prints 6 > > #so there are values in this location that should not result in an > NaN. Instead I get an entire array of NaNs > > What am I missing? > > Bruce > > Just to be sure, what might appear to be all NaNs is not really. To find out for sure, do this: print np.any(np.isfinite(var1/var2)) If it is True, then the array is not full of NaNs and Infs, if False, then that would be odd. When you print an array to the screen, it will often only print part of the array. Furthermore, the author of the post that you link to in your other email misses some important facts about representation of numbers in computers. The reason 0 / 0 (integers) did not return a NaN or 2 / 0 return an Inf is that integers can not represent those values. Only floating point numbers can. Furthermore, there is an important difference between Inf and NaN. It is merely out of convenience that nan_to_num() would convert the Infs into the largest (or smallest for Inf) floating point number. Other functions designed for NaN (such as nansum(), nanmax(), etc) do not treat Infs in this manner. Ben Root 
From: John Hunter <jdh2358@gm...>  20110829 20:13:04

On Mon, Aug 29, 2011 at 2:56 PM, Mark Bakker <markbak@...> wrote: > Hello List, > > Does anybody know of any plans to include support for the new datetime64 > data type in numpy? If this is the new numpy standard for doing dates and > times, it would be great if it would work with plot_date, for example. > > Just wondering (but boy, would I do a little dance when all this datetime > stuff is fully operational and integrated), Should be fairly straightforward to write a converter. Just follow the example of DateConverter in matplotlib.dates :https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/dates.py: class DateConverter(units.ConversionInterface): """ Converter for datetime.date and datetime.datetime data, or for date/time data represented as it would be converted by :func:`date2num`. The 'unit' tag for such data is None or a tzinfo instance. """ @staticmethod def axisinfo(unit, axis): """ Return the :class:`~matplotlib.units.AxisInfo` for *unit*. *unit* is a tzinfo instance or None. The *axis* argument is required but not used. """ tz = unit majloc = AutoDateLocator(tz=tz) majfmt = AutoDateFormatter(majloc, tz=tz) datemin = datetime.date(2000, 1, 1) datemax = datetime.date(2010, 1, 1) return units.AxisInfo( majloc=majloc, majfmt=majfmt, label='', default_limits=(datemin, datemax)) @staticmethod def convert(value, unit, axis): """ If *value* is not already a number or sequence of numbers, convert it with :func:`date2num`. The *unit* and *axis* arguments are not used. """ if units.ConversionInterface.is_numlike(value): return value return date2num(value) @staticmethod def default_units(x, axis): 'Return the tzinfo instance of *x* or of its first element, or None' try: x = x[0] except (TypeError, IndexError): pass try: return x.tzinfo except AttributeError: pass return None units.registry[datetime.date] = DateConverter() units.registry[datetime.datetime] = DateConverter() 
From: Mark Bakker <markbak@gm...>  20110829 19:56:12

Hello List, Does anybody know of any plans to include support for the new datetime64 data type in numpy? If this is the new numpy standard for doing dates and times, it would be great if it would work with plot_date, for example. Just wondering (but boy, would I do a little dance when all this datetime stuff is fully operational and integrated), Mark 
From: Eric Firing <efiring@ha...>  20110829 18:04:14

On 08/29/2011 07:40 AM, Benjamin Root wrote: > > > On Mon, Aug 29, 2011 at 12:30 PM, Eric Firing <efiring@... > <mailto:efiring@...>> wrote: > > On 08/29/2011 05:44 AM, Benjamin Root wrote: > > On Mon, Aug 29, 2011 at 9:59 AM, James McMurray > <jamesmcm03@... <mailto:jamesmcm03@...> > > <mailto:jamesmcm03@... <mailto:jamesmcm03@...>>> wrote: > > > > Okay, so using cm.set_over() and set_under works, but is > there any > > way of adding the set colors to the edges of the colorbar? > > > > > > > > This example should do what you want: > > > > http://matplotlib.sourceforge.net/examples/api/colorbar_only.html > > Also > http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html. > > Note that "extend=both" is the relevant kwarg. With contourf, the kwarg > goes in the contourf call, and colorbar automatically gets it from the > ContourSet. With other types of color mappable plot, the kwarg needs to > be given directly to the colorbar call. > > Eric > > > Crap! Is that why my colorbars from my pcolors (or was it pcolormesh?) > never worked right? I have been making colorbars directly for a while > now because I couldn't figure out why those colorbars didn't work right. > > I think I will file a feature request to fix this inconsistency. > Probably will be a bit involved to fix it, though. It's not entirely an inconsistency. The logic is this: extend='both' (or whatever) directly affects the levels used in contourf; there is nothing similar in imshow or pcolor*. Adding the extend kwarg to them would simply be putting it in place for later use by colorbar. Eric > > Ben Root > > > >  > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emcvnxdev2dev > > > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Benjamin Root <ben.root@ou...>  20110829 17:41:04

On Mon, Aug 29, 2011 at 12:30 PM, Eric Firing <efiring@...> wrote: > On 08/29/2011 05:44 AM, Benjamin Root wrote: > > On Mon, Aug 29, 2011 at 9:59 AM, James McMurray <jamesmcm03@... > > <mailto:jamesmcm03@...>> wrote: > > > > Okay, so using cm.set_over() and set_under works, but is there any > > way of adding the set colors to the edges of the colorbar? > > > > > > > > This example should do what you want: > > > > http://matplotlib.sourceforge.net/examples/api/colorbar_only.html > > Also > > http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html > . > > Note that "extend=both" is the relevant kwarg. With contourf, the kwarg > goes in the contourf call, and colorbar automatically gets it from the > ContourSet. With other types of color mappable plot, the kwarg needs to > be given directly to the colorbar call. > > Eric > > Crap! Is that why my colorbars from my pcolors (or was it pcolormesh?) never worked right? I have been making colorbars directly for a while now because I couldn't figure out why those colorbars didn't work right. I think I will file a feature request to fix this inconsistency. Probably will be a bit involved to fix it, though. Ben Root 
From: Eric Firing <efiring@ha...>  20110829 17:30:46

On 08/29/2011 05:44 AM, Benjamin Root wrote: > On Mon, Aug 29, 2011 at 9:59 AM, James McMurray <jamesmcm03@... > <mailto:jamesmcm03@...>> wrote: > > Okay, so using cm.set_over() and set_under works, but is there any > way of adding the set colors to the edges of the colorbar? > > > > This example should do what you want: > > http://matplotlib.sourceforge.net/examples/api/colorbar_only.html Also http://matplotlib.sourceforge.net/examples/pylab_examples/contourf_demo.html. Note that "extend=both" is the relevant kwarg. With contourf, the kwarg goes in the contourf call, and colorbar automatically gets it from the ContourSet. With other types of color mappable plot, the kwarg needs to be given directly to the colorbar call. Eric > > I hope that helps! > Ben Root > > > >  > EMC VNX: the world's simplest storage, starting under $10K > The only unified storage solution that offers unified management > Up to 160% more powerful than alternatives and 25% more efficient. > Guaranteed. http://p.sf.net/sfu/emcvnxdev2dev > > > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Bruce Ford <bruce@cl...>  20110829 16:10:41

Closing the loop...I found the difficulty and applied this: var = np.nan_to_num(np.divide(var1,var2)) See this page: http://psaffrey.wordpress.com/2010/07/30/numpyandnanagain/  Bruce W. Ford Clear Science, Inc. bruce@... On Sun, Aug 28, 2011 at 4:03 PM, Bruce Ford <bruce@...> wrote: > Getting a strange result trying to divide two 3d arrays. I am getting > a matrix of NaNs regardless of how I divide and I can't determine why. > > #opened a NetCDF file using pythonnetcdf4 > > var1 = nc_file.variables['var1'] ###shape = [31,181,360] with a > values ranging from 0  243 and NO NaNs in the array, dtype float32 > var2 = nc_file.variables['var2'] ###shape = [31,181,360] with a > values ranging from 0  4 (mostly zeros) and NO NaNs in the array, > dtype float32 > > np.seterr(all='ignore') #in case problem has something do to with > dividing by zero > > var1/var2 ###gives array of NaNs with shape of 31,181,360 > > #doing the division one slice at a time doesn't help... > for x in range(1,var1.shape[0]): > var[x,:,:] = var1[x,:,:]/var2[x,:,:] ###gives array of > NaNs with shape of 31,181,360 > > var = np.divide(var1,var2) ###gives array of NaNs with shape of 31,181,360 > > > print "<p>where max: " + np.where(var1 == np.max(var1)) #prints > (array([28]), array([79]), array([182])) > print var1[28,79,182] #print 545 > print var2[28,79,182] ##prints 6 > > #so there are values in this location that should not result in an > NaN. Instead I get an entire array of NaNs > > What am I missing? > > Bruce > >  > Bruce W. Ford > Clear Science, Inc. > bruce@... > 
From: Benjamin Root <ben.root@ou...>  20110829 15:44:58

On Mon, Aug 29, 2011 at 9:59 AM, James McMurray <jamesmcm03@...>wrote: > Okay, so using cm.set_over() and set_under works, but is there any way of > adding the set colors to the edges of the colorbar? > > > This example should do what you want: http://matplotlib.sourceforge.net/examples/api/colorbar_only.html I hope that helps! Ben Root 
From: James McMurray <jamesmcm03@gm...>  20110829 14:59:24

Okay, so using cm.set_over() and set_under works, but is there any way of adding the set colors to the edges of the colorbar? On 29 August 2011 15:47, James McMurray <jamesmcm03@...> wrote: > Hi, > > Is it possible to color values outside the colorbar limits in a different > color than the colorbar itself. So for example, an otherwise greyscale plot > could have the values outside the upperlimit in blue and those below the > lower limit in red, so that these points are not confused with the > legitimate data points (as they can be when they are just more black and > white points as default). > > Thanks, > James McMurray > 
From: mdekauwe <mdekauwe@gm...>  20110829 13:59:34

Can you describe what you want to do? So you now want a histogram? surfcast23 wrote: > > Sorry everyone I totally missed something very important. What I need to > do is first bin the masses(which I don't know how to do). > > Chelonian wrote: >> >> On Thu, Aug 25, 2011 at 10:01 PM, surfcast23 <surfcast23@...> >> wrote: >>> >>> Hi, >>> >>> there is only one column. so I want a plot of y and x. With y taking >>> values running from 0 to n or 7 in my example and x as the average of >>> the >>> values that are contained in the rows in my example it was 5.57. >> >> It seems to me that, as described, you want a plot that in which all >> the bars are the same height (or width if it is a sideways bar chart), >> in this case, 5.57. That makes no sense. >> >> What information is this plot is intended to provide the viewer? >> >>  >> EMC VNX: the world's simplest storage, starting under $10K >> The only unified storage solution that offers unified management >> Up to 160% more powerful than alternatives and 25% more efficient. >> Guaranteed. http://p.sf.net/sfu/emcvnxdev2dev >> _______________________________________________ >> Matplotlibusers mailing list >> Matplotlibusers@... >> https://lists.sourceforge.net/lists/listinfo/matplotlibusers >> >> > >  View this message in context: http://old.nabble.com/HowdoyouPlotdatageneratedbyapythonscripttp32328822p32357095.html Sent from the matplotlib  users mailing list archive at Nabble.com. 
From: James McMurray <jamesmcm03@gm...>  20110829 13:47:49

Hi, Is it possible to color values outside the colorbar limits in a different color than the colorbar itself. So for example, an otherwise greyscale plot could have the values outside the upperlimit in blue and those below the lower limit in red, so that these points are not confused with the legitimate data points (as they can be when they are just more black and white points as default). Thanks, James McMurray 
From: Samuel Teixeira Santos <arcanosam@gm...>  20110829 12:28:10

Eu gostaria de adicionálo à minha rede profissional no LinkedIn. Samuel Teixeira Samuel Teixeira Santos Analista B na Embrapa Cerrados Brasília e redondezas, Brasil Confirme que você conhece Samuel Teixeira Santos: https://www.linkedin.com/e/b7qixrgrxfc2g94q/isd/4010246358/ylaRjg6e/  Você está recebendo convites de conexão por email. Clique aqui para parar de recebêlos: http://www.linkedin.com/e/b7qixrgrxfc2g94q/_dML4GcZf32F5VO_wzm4ASVf0JrnPVOObO4eeHsZV8OPkmQwLeZN8i/goo/matplotlibusers%40lists%2Esourceforge%2Enet/20061/I1381245525_1/ (c) 2011 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043  EUA. 
From: galorencom <galoren.com@gm...>  20110829 11:29:43

Hello I have an animation which shows 3D diffusion I added color bar at the side during the animation the colors changing but the scale at the colorbar of the graph stay asame. please help with that soon as you can! Thanks! Gal:working:  View this message in context: http://old.nabble.com/Refreshcolorbarin3Dgraphanimationtp32356118p32356118.html Sent from the matplotlib  users mailing list archive at Nabble.com. 
From: Bruce Ford <bruce@cl...>  20110828 20:04:09

Getting a strange result trying to divide two 3d arrays. I am getting a matrix of NaNs regardless of how I divide and I can't determine why. #opened a NetCDF file using pythonnetcdf4 var1 = nc_file.variables['var1'] ###shape = [31,181,360] with a values ranging from 0  243 and NO NaNs in the array, dtype float32 var2 = nc_file.variables['var2'] ###shape = [31,181,360] with a values ranging from 0  4 (mostly zeros) and NO NaNs in the array, dtype float32 np.seterr(all='ignore') #in case problem has something do to with dividing by zero var1/var2 ###gives array of NaNs with shape of 31,181,360 #doing the division one slice at a time doesn't help... for x in range(1,var1.shape[0]): var[x,:,:] = var1[x,:,:]/var2[x,:,:] ###gives array of NaNs with shape of 31,181,360 var = np.divide(var1,var2) ###gives array of NaNs with shape of 31,181,360 print "<p>where max: " + np.where(var1 == np.max(var1)) #prints (array([28]), array([79]), array([182])) print var1[28,79,182] #print 545 print var2[28,79,182] ##prints 6 #so there are values in this location that should not result in an NaN. Instead I get an entire array of NaNs What am I missing? Bruce  Bruce W. Ford Clear Science, Inc. bruce@... 
From: Niels Langager Ellegaard <niels.ellegaard@gm...>  20110827 12:19:17

Dear matplotlib Gurus If I run the script below then I end up creating a graph where some of the grid lines are missing. The problem disappear if I remove the call to ax.axis("equal") or the calls to set_smart_bounds(True). I already found a different way to solve my problem, but I thought that this bugreport might be useful to you. Kind regards Niels #!/usr/bin/env python import numpy as np imporot matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator fig = plt.figure(1, frameon=False,) ax = fig.add_subplot(1,1,1) #If you remove these two line the problem disappears ax.spines['left'].set_smart_bounds(True) ax.spines['bottom'].set_smart_bounds(True) #Grid ax.xaxis.set_major_locator(MultipleLocator(0.2)) ax.xaxis.set_minor_locator(MultipleLocator(0.1)) ax.yaxis.set_major_locator(MultipleLocator(0.2)) ax.yaxis.set_minor_locator(MultipleLocator(0.1)) ax.xaxis.grid(True,'minor') ax.yaxis.grid(True,'minor') ax.xaxis.grid(True,'major',linewidth=2) ax.yaxis.grid(True,'major',linewidth=2) #If you remove this line the problem disappears ax.axis("equal") #The graph phi=np.arange(0,np.pi,0.1) ax.plot(np.cos(phi),np.sin(phi)) #Save fig.savefig('unit_circle.png', dpi=200) 
From: Stan West <stan.west@nr...>  20110826 21:14:09

From: ben.v.root@... [mailto:ben.v.root@...] On Behalf Of Benjamin Root Sent: Friday, August 26, 2011 13:11 Actually, that might be useful. The current solution I have is to use the core contouring function in mpl to generate paths, but they doesn't seem to guarantee either clockwise or counterclockwise traversals. Does graham scan guarantee something like that? I need to calculate outwardfacing normal vectors. The points would be traversed in radial order from P's vantage, as if a radar sweep numbered each point as it passed by. I suppose that if the points form a convex polygon, then that traversal order is the same one that would result from anywhere in the interior, and it would be unambiguously clockwise or counterclockwise depending on the sort order. (You might have to handle the case in which P and two or more other points are colinear by breaking the tie in the sort appropriately.) If the points form a concave polygonthat is, if one or more points lie inside the convex hull of the pointsthen I suppose you would need additional constraints or information to choose where those points should fall in the traversal order. I'm glad the method might help. 
From: Benjamin Root <ben.root@ou...>  20110826 17:11:01

On Friday, August 26, 2011, Stan West <stan.west@...> wrote: > From: Benjamin Root [mailto:ben.root@...] > Sent: Friday, August 19, 2011 13:43 > > I have an arbitrary list of coordinates that I know represent the boundary of a polygon. Is there some sort of function from the contouring or path codes that would allow me to pass in that list and get back the resorted list with the path codes with it? > > Hi, Ben. Is it the order of the points around the polygon that is unknown, and is it unambiguous because the polygon is known to be convex? If so, I believe you could use part of the Graham scan [1] convex hull algorithm. The function you need would find the point P with the lowest Y coordinate, then sort the remaining points by the cosine of the angle they and P make with the X axis. After that, the list comprising P and the sorted points would need the path codes. > > If the polygon is concave but the order is somehow clear (e.g., a radial progression about the average coordinate), you might be able to adapt the method. I hope I understood your problem correctly and that this helps. > > [1] http://en.wikipedia.org/wiki/Graham_scan Actually, that might be useful. The current solution I have is to use the core contouring function in mpl to generate paths, but they doesn't seem to guarantee either clockwise or counterclockwise traversals. Does graham scan guarantee something like that? I need to calculate outwardfacing normal vectors. Ben Root 
From: Stan West <stan.west@nr...>  20110826 17:00:19

From: Benjamin Root [mailto:ben.root@...] Sent: Friday, August 19, 2011 13:43 I have an arbitrary list of coordinates that I know represent the boundary of a polygon. Is there some sort of function from the contouring or path codes that would allow me to pass in that list and get back the resorted list with the path codes with it? Hi, Ben. Is it the order of the points around the polygon that is unknown, and is it unambiguous because the polygon is known to be convex? If so, I believe you could use part of the Graham scan [1] convex hull algorithm. The function you need would find the point P with the lowest Y coordinate, then sort the remaining points by the cosine of the angle they and P make with the X axis. After that, the list comprising P and the sorted points would need the path codes. If the polygon is concave but the order is somehow clear (e.g., a radial progression about the average coordinate), you might be able to adapt the method. I hope I understood your problem correctly and that this helps. [1] http://en.wikipedia.org/wiki/Graham_scan 
From: Jouni K. Seppänen <jks@ik...>  20110826 16:37:34

Michael Droettboom <mdroe@...> writes: > The other approach is used when "text.usetex" is True. It calls out > to a real "tex" interpreter and then interprets the DVI it produces to > convert it into a form the matplotlib backends can use. Since I > didn't write this code, I'm not as familiar with the details. There are actually at least three mechanisms used by text.usetex: (1) The Postscript backend uses psfrag. The Postscript file has placeholders for LaTeX text, and the file is processed with LaTeX and dvips to replace these placeholders with typeset text. (2) The Agg backend puts each piece of TeX text into a separate file (which you can find in ~/.matplotlib/tex.cache), processes it with LaTeX into dvi and with dvipng into png, reads in the png files and overlays them onto the image. (That's at least what I imagine it does; I have not looked at the code.) (3) The pdf backend uses the dviread module (written originally by me). The various pieces of text are written into different tex files, just as with the Agg backend, then processed with LaTeX into dvi files, which in turn are translated by dviread into sequences of (x, y, font, character) tuples. The dviread module reads the pdftex.map configuration file, which maps the TeX font names into Postscript fonts, which are embedded in the output PDF file, and the characters are placed at the coordinates specified in the dvi file. The dvipng approach avoids dealing with fonts, but the output is a bitmap. With psfrag you can only get Postscript output (which is nontrivial to parse), but it includes scalable fonts. The dviread approach gets you both scalable fonts and the information of where each character is, but you will have to deal with the fonts yourself. In PDF output this is relatively easy, since we can piggyback on the pdftex.map configuration file, which conveniently points to font files that can be embedded in PDF.  Jouni K. Seppänen http://www.iki.fi/jks 
From: Sebastian Berg <sebastian@si...>  20110826 16:36:35

Hi, On Fri, 20110826 at 06:09 0700, a.sam wrote: > I have a problem with changing the ticklabels text. In fact I am aware of the > method which is explained by the matplotlib help center. But I need more > flexibility with ticklabels text. You could set the formatter yourself instead of manipulating strings or setting the ticklabels by hand. IE: my_formatter = matplotlib.ticker.FormatStrFormatter('a%s') #etc... see http://matplotlib.sourceforge.net/api/ticker_api.html a = plt.gca() a.xaxis.set_major_formatter(my_formatter) plt.draw() Regards, Sebastian > For example, I want to add an "a" before every tick label of the xaxis. So I > wrote the following sample code: > # > from pylab import * > # > t = arange(0.0, 100.0, 0.1) > s = sin(0.1*pi*t)*exp(t*0.01) > # > ax = subplot(111) > plot(t,s) > # > for label1 in ax.xaxis.get_majorticklabels(): > label1.set_weight('bold') > label1._text="a"+label1._text > # > show() > # > It seems to me that `` label1._text="a"+label1._text ' ' should do this > job, but it does nothing. The only way I found was using something like > this: > > ax.xaxis.set_ticklabels(('a0','a20','a40','a60','a80','a100')) > > which I would rather not to use, because there are lots of graphs in my > project and I do not want to this process manually. So, my question is which > property or method would set (and also get) the ticklabel text? > > Thanks is advance 
From: Benjamin Root <ben.root@ou...>  20110826 16:13:58

On Friday, August 26, 2011, a.sam <a.samii@...> wrote: > > I have a problem with changing the ticklabels text. In fact I am aware of the > method which is explained by the matplotlib help center. But I need more > flexibility with ticklabels text. > For example, I want to add an "a" before every tick label of the xaxis. So I > wrote the following sample code: > # > from pylab import * > # > t = arange(0.0, 100.0, 0.1) > s = sin(0.1*pi*t)*exp(t*0.01) > # > ax = subplot(111) > plot(t,s) > # > for label1 in ax.xaxis.get_majorticklabels(): > label1.set_weight('bold') > label1._text="a"+label1._text > # > show() > # > It seems to me that `` label1._text="a"+label1._text ' ' should do this > job, but it does nothing. The only way I found was using something like > this: > > ax.xaxis.set_ticklabels(('a0','a20','a40','a60','a80','a100')) > > which I would rather not to use, because there are lots of graphs in my > project and I do not want to this process manually. So, my question is which > property or method would set (and also get) the ticklabel text? > > Thanks is advance Why not use get_ticklabels() to get the list of strings, modify that, and call set_ticklabels() with the modified list? Ben Root 