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
|
From: Dominique O. <Dom...@po...> - 2005-01-18 19:38:40
|
(Sorry, sending this again to correct a typo -- i inverted small and large below) I have made several experiments; I have installed the latest matplotlib (with the 'contour' update) in both Win XP and SuSE Linux Pro 9.1. I made sure to uninstall everything pertaining to matplotlib before installing the latest version. In Windows, I use the pre-built distribution, and in Linux I compile it myself. The situation is this: - In Linux, some zigzagging lines appear when there are few points to interpolate. Eg, if i generate my grid from x = y = arange( -1, 1, delta ), zigzags would appear for LARGE values of delta (eg, delta = 0.2; ie too few values of x and/or y). However, it seems that those zigzags are a normal consequence of a large value of delta. For SMALLER deltas, the contours are beautiful. - In XP, the same as above happens. But I see additional lines that don't seem to represent anything meaningful. I made sure I was performing a clean install. Are there updates to other packages I should consider? Pygtk? This happened with both the TkAgg and GTKAgg backends. Perhaps I should try compiling matplotlib myself? If anyone is able to reproduce the problem, then it might indeed be a problem. If not, perhaps something is funny with my box. Thanks, Dominique |
From: Dominique O. <Dom...@po...> - 2005-01-18 19:35:36
|
I have made several experiments; I have installed the latest matplotlib (with the 'contour' update) in both Win XP and SuSE Linux Pro 9.1. I made sure to uninstall everything pertaining to matplotlib before installing the latest version. In Windows, I use the pre-built distribution, and in Linux I compile it myself. The situation is this: - In Linux, some zigzagging lines appear when there are few points to interpolate. Eg, if i generate my grid from x = y = arange( -1, 1, delta ), zigzags would appear for small values of delta. However, it seems that those zigzags are a normal consequence of a small value of delta. For larger deltas, the contours are beautiful. - In XP, the same as above happens. But I see additional lines that don't seem to represent anything meaningful. I made sure I was performing a clean install. Are there updates to other packages I should consider? Pygtk? This happened with both the TkAgg and GTKAgg backends. Perhaps I should try compiling matplotlib myself? If anyone is able to reproduce the problem, then it might indeed be a problem. If not, perhaps something is funny with my box. Thanks, Dominique |
From: Dominique O. <Dom...@po...> - 2005-01-18 19:17:02
|
Hello, I am a big consumer of contour plots and it is great that matplotlib now features them. I didn't find the 'colors' argument to contour() intuitive to use though, and I wonder whether contour() should accept a colormap instance, much as imshow, so we can also display a colorbar. Browsing through colors.py and cm.py it didn't appear clearly to me how all of that works. There is some info in the mailing list archives but I still didn't feel comfortable enough with such aspects of matplotlib to go ahead and modify contour(). Instead I wrote this simple class which returns a range of colors around the spectrum. There are as many colors as specified, and i use the same number as the number of levels in my contour plot. Perhaps this could be the default colors in contour()? I don't mean to be reinventing the wheel; if there is a simpler way to do this with colormap instances, i'd love to know how. =============== class mycolors: def __init__( self, nlevels ): jet6 = ( (0,0,1), (0,1,1), (0,1,0), (1,1,0), (1,0,0), (1,0,1) ) self._jet6 = jet6 if nlevels <= 6: jet = jet6[:nlevels] else: spectrum = linspace( 0, nlevels-1, 6 ) for i in range( 6 ): spectrum[i] = round( spectrum[i] ) # Initialize colors to black jet = [] for i in range( nlevels ): jet.append( (0,0,0) ) # Insert basic colors for i in range( 6 ): jet[ int( spectrum[i] ) ] = jet6[i] # Insert spectrum in each bin for i in range( 5 ): inthisbin = int( spectrum[i+1] - spectrum[i] - 1 ) eps = 1.0/(inthisbin + 1) tones = linspace( eps, 1 - eps, inthisbin ) thistone = [ jet6[i+1][0] - jet6[i][0], jet6[i+1][1] - jet6[i][1], jet6[i+1][2] - jet6[i][2] ] for j in range( inthisbin ): thiscolor = [ jet6[i][0] + thistone[0] * tones[j], jet6[i][1] + thistone[1] * tones[j], jet6[i][2] + thistone[2] * tones[j] ] jet[ int( spectrum[i] ) + j + 1 ] = tuple( thiscolor ) self.jet = jet self.nlevels = nlevels def get_colors( self ): return self.jet def get_levels( self ): return self.nlevels ================= Here is an example script where i use the same number of colors as levels: from pylab import * def rosenbrock(x,y): return 10*(y-x**2)**2 + (x-1)**2 x = y = arange( -2, 2, 0.1 ) X, Y = meshgrid( x, y ) Z = rosenbrock( X, Y ) nlevels = 30 cols = mycolors( nlevels ) contour( Z, x = X, y = Y, levels = nlevels, colors = cols.get_colors(), origin = 'lower' ) show() If this is useful to anyone, feel free to use it. Dominique |
From: Malte M. <Mal...@cs...> - 2005-01-18 04:51:17
|
Hi, I am trying to use mathtex expression for Molecule descriptions(in the legend) [in matplotlib-0.70.1 tkagg backend] The following mathtext expression throws an exception in the parser. plot(range(10)) title(r'$^{12}\rm{CO}$') # a CO molecule The following doesn't plot the superscript part of the mathtext in the legend: r'$\rm{CO}^{2}$ whereas this one does: r'$CO^{2}$' Can anyone reproduce this. PS: Excellent plotting package! No greater pleasure than giving pgplot the boot and replace it with something "modern". PPS: I think this ahs come up on the mailing list earlier, but I can't quite remember. Is it possible to tune "subplot" to do ganged plotting as in the example script without the overhead? Cheers, Malte. |
From: Dominique O. <Dom...@po...> - 2005-01-17 23:28:32
|
John Hunter wrote: >>>>>>"Dominique" == Dominique Orban <Dom...@po...> writes: > > > Dominique> I notice some spurious zigzagging lines towards the top > Dominique> of the plot. Any idea where those might be coming from? > > I don't get zigzag lines either. Try using replacing > matplotlib.axes.Axes.contour with the function included below (from > CVS) and let me know if it works. > > Dominique> Also, the figure produced by the above script is > Dominique> flipped horizontally. The corresponding Matlab script > Dominique> produces the correct plot. > > matplotlib supports two image / contour orientation styles, and this > is controlled by an rc parameter. Try (note the origin kwarg) > > from matplotlib.pylab import * > > def rosenbrock(x,y): > return 10.0 * (y-x**2)**2 + (x-1)**2 > > x = arange( -1.5, 1.5, 0.01 ) > y = arange( -0.5, 1.5, 0.01 ) > [X,Y] = meshgrid( x, y ) > Z = rosenbrock( X, Y ) > contour( Z, x=X, y=Y, levels = 50, origin='lower' ) > show() > > > Amended contour function > [snip] John, Many thanks for the update. That solves some of the issues. The 'origin' keyword argument restores the orientation of the plot. To account for the 'x' and 'y' keyword arguments, I would suggest changing the lines if x == None and y == None: y, x = indices((jmax,imax), 'd') to if x is None: x = indices((jmax,imax), 'd') if y is None: y = indices((jmax,imax), 'd') to account for the situation where only one of x or y is specified (I admit that might be unlikely but hey). Regarding the zigzags, I notice they appear for relatively small values of the increment in arange() (the 3rd argument). When I decrease it to, say, 0.1, zigzags start to appear. For higher values, they don't. It makes me think they might be part of the line collections. Is anyone else able to reproduce this behavior? Thanks much. Dominique |
From: John H. <jdh...@ac...> - 2005-01-17 21:53:37
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes: Dominique> I notice some spurious zigzagging lines towards the top Dominique> of the plot. Any idea where those might be coming from? I don't get zigzag lines either. Try using replacing matplotlib.axes.Axes.contour with the function included below (from CVS) and let me know if it works. Dominique> Also, the figure produced by the above script is Dominique> flipped horizontally. The corresponding Matlab script Dominique> produces the correct plot. matplotlib supports two image / contour orientation styles, and this is controlled by an rc parameter. Try (note the origin kwarg) from matplotlib.pylab import * def rosenbrock(x,y): return 10.0 * (y-x**2)**2 + (x-1)**2 x = arange( -1.5, 1.5, 0.01 ) y = arange( -0.5, 1.5, 0.01 ) [X,Y] = meshgrid( x, y ) Z = rosenbrock( X, Y ) contour( Z, x=X, y=Y, levels = 50, origin='lower' ) show() Amended contour function def contour(self, z, x = None, y = None, levels = None, colors = None, linewidths = None, alpha = 1.0, fmt='%1.3f', origin=None): """\ CONTOUR(z, x = None, y = None, levels = None, colors = None) plots contour lines of an image z z is a 2D array of image values x and y are 2D arrays with coordinates of z values in the two directions. x and y do not need to be evenly spaced but must be of the same shape as z levels can be a list of level values or the number of levels to be plotted. If levels == None, a default number of 7 evenly spaced levels is plotted. colors is one of these: - a tuple of matplotlib color args (string, float, rgb, etc), different levels will be plotted in different colors in the order specified - one string color, e.g. colors = 'r' or colors = 'red', all levels will be plotted in this color - if colors == None, the default color for lines.color in .matplotlibrc is used. linewidths is one of: - a number - all levels will be plotted with this linewidth, e.g. linewidths = 0.6 - a tuple of numbers, e.g. linewidths = (0.4, 0.8, 1.2) different levels will be plotted with different linewidths in the order specified - if linewidths == None, the default width in lines.linewidth in .matplotlibrc is used reg is a 2D region number array with the same dimensions as x and y. The values of reg should be positive region numbers, and zero fro zones wich do not exist. triangle - triangulation array - must be the same shape as reg alpha : the default transparency of contour lines fmt is a format string for adding a label to each collection. Currently this is useful for auto-legending and may be useful down the road for legend labeling origin = 'upper'|'lower'|None. If None, the rc value for image.origin will be used More information on reg and triangle arrays is in _contour.c Return value is levels, collections where levels is a list of contour levels used and collections is a list of matplotlib.collections.LineCollection instances """ if origin is None: origin = rcParams['image.origin'] if origin == 'upper': if x is not None: x = x[::-1] if y is not None: y = y[::-1] z = z[::-1] if not self._hold: self.cla() if which[0] == "numeric": z = array(z.tolist(),typecode = z.typecode()) if len(shape(z)) != 2: raise TypeError("Input must be a 2D array.") else: jmax, imax = shape(z) region = 0 reg = ones((jmax,imax), Int32) reg[:,0]=0 triangle = zeros((jmax,imax), Int32) if x == None and y == None: y, x = indices((jmax,imax), 'd') rz = ravel(z) zmax = nxmax(rz) zmin = nxmin(rz) def autolev(N): return mlab.linspace(zmin, zmax, N+2)[1:-1] if levels is None: lev = autolev(7) else: try: Nlev = int(levels) except TypeError: lev = list(levels) else: lev = autolev(Nlev) Nlev = len(lev) if colors == None: colors = rcParams['lines.color'] if is_string_like(colors): colors = [colors] * Nlev elif iterable(colors) and len(colors) < Nlev: colors = list(colors) * Nlev else: try: gray = float(colors) except TypeError: pass else: colors = [gray] * Nlev tcolors = [] for c in colors: tcolors.append((colorConverter.to_rgba(c, alpha),)) if linewidths == None: tlinewidths = [linewidths] *Nlev else: if iterable(linewidths) and len(linewidths) < Nlev: linewidths = list(linewidths) * int(ceil(Nlev/len(linewidths))) elif not iterable(linewidths) and type(linewidths) in [int, float]: linewidths = [linewidths] * Nlev tlinewidths = [(w,) for w in linewidths] args = zip(lev, tcolors, tlinewidths) levels = [] collections = [] for level, color, width in args: ntotal, nparts = _contour.GcInit1(x, y, reg, triangle, region, z, level) np = zeros((nparts,), Int32) xp = zeros((ntotal, ), Float64) yp = zeros((ntotal,), Float64) nlist = _contour.GcTrace(np, xp, yp) col = LineCollection(nlist, colors=color, linewidths = width) col.set_label(fmt%level) self.add_collection(col) levels.append(level) #col.set_linestyle('dashdot') # dashed|dotted|solid|dashdot #dashes = 0, (4,2,8,1) #col.set_linestyle( (dashes,) ) # offset, onoffseq collections.append(col) if x is not None: rx = ravel(x) self.set_xlim((min(rx), max(rx))) else: self.set_xlim([0,imax]) if y is not None: ry = ravel(y) self.set_ylim((min(ry), max(ry))) else: self.set_ylim([0,jmax]) return levels, collections |
From: Carol L. <car...@sr...> - 2005-01-17 19:05:19
|
The change picked up the top color. However, it looks to me as though the yellowish color is missing from the color bar. I see only 9 colors. The is without tweaking clim. When I do tweak clim to clim(vmin=-.1, vmax = 0.1), I see the yellowish color, but two of the bluer colors seem to be missing. I see only 8 colors in the color bar. > To: Carol Leger <car...@sr...> > Cc: mat...@li... > Subject: Re: [Matplotlib-users] Color bar with discrete colors > From: John Hunter <jdh...@ac...> > Date: Sat, 15 Jan 2005 16:32:48 -0600 > > >>>>>>"Carol" == Carol Leger <car...@sr...> writes: > > > Carol> This is how I modified poormans_contour.py: > > It's a bug; in the matplotlib/pylab.py function "colorbar", replace > the line that reads > > N = 200 > > with > > N = cmap.N > > No need to tweak the clim.... > > Should cure what ails ya, > JDH > -- Ms. Carol A. Leger SRI International Phone: (650) 859-4114 333 Ravenswood Avenue G-273 Menlo Park, CA 94025 e-mail: le...@sr... |
From: <fcc...@fi...> - 2005-01-17 12:56:04
|
On Friday 14 January 2005 14:48, Dominique Orban wrote: I don't get any zig-zag lines on my box when I run your code... as for being sideways, I cant tell since I don't have matlab here... I don't have a solution, but it doesn't seem to be a matplotlib problem. I am running, version 0.70.1 good luck, =46l=E1vio > Hi, > > When trying to plot the contours of the famous Rosenbrock function: > > ---------------------------------------- > from matplotlib.pylab import * > > def rosenbrock(x,y): > return 10.0 * (y-x**2)**2 + (x-1)**2 > > x =3D arange( -1.5, 1.5, 0.01 ) > y =3D arange( -0.5, 1.5, 0.01 ) > [X,Y] =3D meshgrid( x, y ) > Z =3D rosenbrock( X, Y ) > contour( Z, x=3DX, y=3DY, levels =3D 50 ) > show() > ---------------------------------------- > > I notice some spurious zigzagging lines towards the top of the plot. Any > idea where those might be coming from? > > Also, the figure produced by the above script is flipped horizontally. > The corresponding Matlab script produces the correct plot. > > Thanks, > Dominique > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: John H. <jdh...@ac...> - 2005-01-15 22:59:32
|
>>>>> "James" == James Boyle <bo...@ll...> writes: James> To reply to my own post: On question (1): I modified the James> call to colorbar in pylab.py to accept a color map and norm James> keyword arguments. It was this functionality that was Perhaps it would be cleaner simply to derive a custom class from ScalarMappable that does your fill calls and stores your cmap and norm instances; then you would get the observer stuff for free. If you decide to go this route, perhaps you could submit the example. James> I would also like to code up a floating color bar. Often I James> make 4/5 images per page with a common colormap and James> normalization. It is handy just to plop the reference James> colorbar in a central location not attached to a particular James> figure. I just committed changes to CVS to support this -- you can now place a colorbar in a custom axes, and I added an orientation kwarg to support horizontal or vertical colorbar layout. Make sure you get pylab.py revision 1.21 or later. Here is an example from pylab import * ax = axes([0.1, 0.3, 0.8, 0.6]) im = imshow(rand(12,12), interpolation='nearest') cax = axes([0.1, 0.1, 0.8, 0.15]) colorbar(cax=cax, orientation='horizontal') show() James> On question (2): Alan Isaac pointed out that using the same James> edgecolor as the fillcolor would make the borders James> invisible. Yep. JDH |
From: John H. <jdh...@ac...> - 2005-01-15 22:38:13
|
>>>>> "Carol" == Carol Leger <car...@sr...> writes: Carol> This is how I modified poormans_contour.py: It's a bug; in the matplotlib/pylab.py function "colorbar", replace the line that reads N = 200 with N = cmap.N No need to tweak the clim.... Should cure what ails ya, JDH |
From: John H. <jdh...@ac...> - 2005-01-15 20:00:34
|
>>>>> "Alan" == Alan G Isaac <ai...@am...> writes: Alan> Did you make full matplotlib and/or scipy language Alan> definitions? If so, are they available? Alan Isaac I did, as you found in your PS, but I choose not to emphasize them because I found all the extra color distracting. So I made the emph color "black", ie the same as the color of plain text, but left the wordlist there in case I changed my mind emphstyle = \color{black}, % color for matplotlib funcs What do you think? Would it be useful to colorize the matplotlib functions in the guide? JDH |
From: Alan G I. <ai...@am...> - 2005-01-15 17:42:59
|
On Sat, 15 Jan 2005, John Hunter apparently wrote: > I'm using latex with the excellent listings package- > http://www.atscire.de/index.php?nav=products/listings. It knows > python syntax, and can do string, comment, keyword highlighting and > more. Did you make full matplotlib and/or scipy language definitions? If so, are they available? Alan Isaac PS I found this list in the docs, which is of course part of the answer to my question. {axes, axis, bar, cla, clf, clim, close, cohere, colorbar, colors, csd, draw, errorbar, figimage, figlegend, figtext, figure, fill, gca, gcf, gci, get, get_current_fig_manager, get_plot_commands, gray, grid, hist, hlines, hold, imshow, jet, legend, load, loglog, pcolor, pcolor_classic, plot, plot_date, plotting, psd, raise_msg_to_str, rc, rcdefaults, save, savefig, scatter, scatter_classic, semilogx, semilogy, set, specgram, stem, subplot, table, text, title, vlines, xlabel, ylabel}, |
From: John H. <jdh...@ac...> - 2005-01-15 16:49:36
|
>>>>> "Gary" == Gary <pa...@in...> writes: Gary> John, I've been meaning to ask you ... how did you produce Gary> the very fine User Guide? Is that TeXmacs? LyX? raw Gary> LaTeX? ConTeXt? emacs magic? I'm using latex with the excellent listings package- http://www.atscire.de/index.php?nav=products/listings. It knows python syntax, and can do string, comment, keyword highlighting and more. You can see the latex src that created the user's guide by checking out users_guide from matplotlib CVS, or visiting http://cvs.sourceforge.net/viewcvs.py/matplotlib/users_guide . The README file in that directory contains more information. For much of the user's guide, I keep the python code in external files and include them in a special verbatim environment that does syntax highlighting with , eg \lstinputlisting[linerange=1-12,caption={Wild and wonderful ways to specify colors; see Figure~\ref{fig:color_demo}}, label=lst:color_demo]{code/color_demo.py} The linerange is used to leave some boilerplate at the beginning and end of the file (eg some savefig calls to generate the accompanying figures in eps and png). This helps insure that the python code in the manual actually runs, since it is the same code used to generate the figures for the guide. Gary> Is there some slick way of getting the listings from the Gary> command line window into the document, especially with the Gary> comments colorized? I'm writing a small local guide, and Gary> was wondering ... By "the command line window" do you mean the python shell? If so, you'll have to do some special tweaks to handle the >>> prompt, but the listings packages is very sophisticated, and can ignore prefixes or add them, etc.... There is a fairly comprehensive manual. Or did you mean something else? JDH |
From: Gary <pa...@in...> - 2005-01-14 19:59:14
|
John, I've been meaning to ask you ... how did you produce the very fine User Guide? Is that TeXmacs? LyX? raw LaTeX? ConTeXt? emacs magic? Is there some slick way of getting the listings from the command line window into the document, especially with the comments colorized? I'm writing a small local guide, and was wondering ... -gary |
From: John H. <jdh...@ac...> - 2005-01-14 17:44:22
|
>>>>> "James" == James Boyle <bo...@ll...> writes: James> Is there anyway to place the tick marks so that they are James> located outside the axes, i.e. on the same side of the axis James> line as the axis labels? James> With plots such as imshow and pcolor and even some busy James> line plots, the interior minor ticks are completely James> obscured and the exact location of the major ticks is James> ambiguous. James> It would be nice to be able to specify the ticks as inside James> or outside (or both), right or left (or both), top or James> bottom (or both). This functionality may already be present James> but I cannot figure out how to invoke it if it is. I would like to make tick placement more flexible, for example to support a detachable tick line so the axis line, tick lines and labels float below the axes boundary. In addition, I would like the ability to position ticks along this line as above, centered or below, as you suggest. But for now this doesn't exist, but you can hack an approximation. The tick markers are TICKUP, TICKDOWN, TICKLEFT, and TICKRIGHT, and these are constants in matplotlib.lines. You can set the tick markers, for example, to be TICKDOWN. But you'll have to manually adjust the y position of the labels to be below them. The second hack is this only works in interactive mode. ticks are generated dynamically (eg for panning and zooming) and the ticks aren't generated until the plot is show. In non-interactive mode, the change of the default tick's line style is not propogating to the new ticks that are dynamically generated when the line is shown. This appears to be a bug so I'll look into it. For now, though, you should be able to get something that works in non-interactive mode. import matplotlib matplotlib.interactive(True) import matplotlib.lines as mpllines import pylab as pl ax = pl.subplot(111) pl.plot([1,2,3]) lines = ax.get_xticklines() labels = ax.get_xticklabels() for line in lines: line.set_marker(mpllines.TICKDOWN) # labels are in axes coords, where 0,0 is lower left of axes rectangle # and 1,1 is upper right for label in labels: label.set_y(-0.02) pl.show() |
From: John H. <jdh...@ac...> - 2005-01-14 17:12:43
|
>>>>> "seberino" == seberino <seb...@sp...> writes: seberino> Imagine your arrays had points (Cartesian position seberino> vectors) all over the place at completely random points seberino> in space. The 'shape' of this plot depends on max and seberino> min values of each coordinate. I believe Mathematica seberino> plotting would automagically calculate these max and min seberino> values and set plot ranges for you. This is why 'shape' seberino> attribute of Matplotlib/Numarray seems awkward and seberino> unnecessary to me unless I'm missing something. There are a variety of issues here. - The "shape" attribute comes form Numeric/numarray and is outside the realm of matplotlib. matplotlib plots numerix arrays. - The pcolor interface is determined by matlab. matlab has a pcolor function which I have tried to implement faithfully. To the extent that matplotlib has been successful, this is due in part because matlab has a good interface for plotting and replicating it generally, is a good thing. - Storing the "shape" of a data set allows for memory and efficiency savings. To take your example of a set of x,y,z points, you are right you cold reconstruct rectilinear grid from this data -- one might have to use interpolation but it can be done -- but it would require a lot of unnecessary computation for data which already lives on a grid. So pcolor assumes your data are on a rectilinear grid and it is incumbent upon you to get it into that form. The meshgrid function takes regularly sampled vector data and turns it into a rectilinear grid (this is also a matlab function). The matlab griddata function (which is not yet implemented in matplotlib) does the same for irregularly sampled data. JDH |
From: Dominique O. <Dom...@po...> - 2005-01-14 16:49:08
|
Hi, When trying to plot the contours of the famous Rosenbrock function: ---------------------------------------- from matplotlib.pylab import * def rosenbrock(x,y): return 10.0 * (y-x**2)**2 + (x-1)**2 x = arange( -1.5, 1.5, 0.01 ) y = arange( -0.5, 1.5, 0.01 ) [X,Y] = meshgrid( x, y ) Z = rosenbrock( X, Y ) contour( Z, x=X, y=Y, levels = 50 ) show() ---------------------------------------- I notice some spurious zigzagging lines towards the top of the plot. Any idea where those might be coming from? Also, the figure produced by the above script is flipped horizontally. The corresponding Matlab script produces the correct plot. Thanks, Dominique |
From: James B. <bo...@ll...> - 2005-01-13 18:53:03
|
Is there anyway to place the tick marks so that they are located outside the axes, i.e. on the same side of the axis line as the axis labels? With plots such as imshow and pcolor and even some busy line plots, the interior minor ticks are completely obscured and the exact location of the major ticks is ambiguous. It would be nice to be able to specify the ticks as inside or outside (or both), right or left (or both), top or bottom (or both). This functionality may already be present but I cannot figure out how to invoke it if it is. --Jim |
From: James B. <bo...@ll...> - 2005-01-13 17:53:46
|
To reply to my own post: On question (1): I modified the call to colorbar in pylab.py to accept a color map and norm keyword arguments. It was this functionality that was needed from the mappable image. So if the keywords are provided colorbar uses them, otherwise it looks for a mappable image. This modification disables the observer feature for now if the color map is a keyword, a bit more work should get this going. It looks like it would be easily doable, but I need something for the exigencies of work and will get back to this later. This also would allow for a colorbar key for coloring contours and vectors. I would also like to code up a floating color bar. Often I make 4/5 images per page with a common colormap and normalization. It is handy just to plop the reference colorbar in a central location not attached to a particular figure. On question (2): Alan Isaac pointed out that using the same edgecolor as the fillcolor would make the borders invisible. --Jim On Jan 12, 2005, at 12:55 PM, James Boyle wrote: > I have a mesh of irregular polygons, like a finite element mesh. Each > polygon has an associated value. > So, I have defined a color map with a appropriate normalization to > define a color for each value and then > built a collection consisting of the polygon vertices and colors. > The resulting plot looks pretty good. This technique would seem to be > useful for FE grids and Delaunay triangles. > > Two questions: > (1) I want to attach a colorbar to the figure, but as of yet I have > not worked out how to do it. > images such as scatter, imshow, pcolor are mappable and will accept a > color bar but my simple polygon fill will not. > > (2) How do I eliminate the edge lines about each polygon? I can make > them very thin but a width of zero does not appear to work. > I recall this being discussed on the list, but now I cannot find the > reference. > > Thanks for any help. > > --Jim > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: <seb...@sp...> - 2005-01-13 16:57:34
|
As you know you must set 'shape' attribute of your coordinate arrays used to generate a pcolor plot. Imagine your arrays had points (Cartesian position vectors) all over the place at completely random points in space. The 'shape' of this plot depends on max and min values of each coordinate. I believe Mathematica plotting would automagically calculate these max and min values and set plot ranges for you. This is why 'shape' attribute of Matplotlib/Numarray seems awkward and unnecessary to me unless I'm missing something. You should not have ability to set 'shape' your self. It seems it wouldn't make any sense to *change* the shape since that is decided by range of your values already. Chris -- _______________________________________ Christian Seberino, Ph.D. SPAWAR Systems Center San Diego Code 2872 49258 Mills Street, Room 158 San Diego, CA 92152-5385 U.S.A. Phone: (619) 553-9973 Fax : (619) 553-6521 Email: seb...@sp... _______________________________________ |
From: <seb...@sp...> - 2005-01-13 05:05:26
|
I'm still confused about 'shape' attribute of arrays used to make a pcolor plot. Suppose you have xarray, yarray and zarray. The 'shape' of the plot is determined by the max and min values of each dimension. Hence you can't really change the 'shape' of a plot drastically. Therefore, what does it mean when we set and later change the 'shape' attribute of these data arrays? It seems you should not be allowed to do this and/or perhaps shape should be calculated automatically. Chris -- _______________________________________ Christian Seberino, Ph.D. SPAWAR Systems Center San Diego Code 2872 49258 Mills Street, Room 158 San Diego, CA 92152-5385 U.S.A. Phone: (619) 553-9973 Fax : (619) 553-6521 Email: seb...@sp... _______________________________________ |
From: Alan G I. <ai...@am...> - 2005-01-13 00:57:19
|
On Wed, 12 Jan 2005, James Boyle apparently wrote: > (2) How do I eliminate the edge lines about each polygon? I can make > them very thin but a width of zero does not appear to work. > I recall this being discussed on the list, but now I cannot find the > reference. I recall John suggesting to also set the edge color (to the same color, of course). I hope a true zero width will implemented. However note that interpreting a linewidth of zero as a 1 pixel wide line is what PostScript does. So the only way to get a true zero width for PostScript output is to fill the polygon without stroking it. hth, Alan Isaac |
From: James B. <bo...@ll...> - 2005-01-12 20:56:04
|
I have a mesh of irregular polygons, like a finite element mesh. Each polygon has an associated value. So, I have defined a color map with a appropriate normalization to define a color for each value and then built a collection consisting of the polygon vertices and colors. The resulting plot looks pretty good. This technique would seem to be useful for FE grids and Delaunay triangles. Two questions: (1) I want to attach a colorbar to the figure, but as of yet I have not worked out how to do it. images such as scatter, imshow, pcolor are mappable and will accept a color bar but my simple polygon fill will not. (2) How do I eliminate the edge lines about each polygon? I can make them very thin but a width of zero does not appear to work. I recall this being discussed on the list, but now I cannot find the reference. Thanks for any help. --Jim |
From: Carol L. <car...@sr...> - 2005-01-12 20:04:32
|
I am confused about what is happening when I add a color bar to an image using discrete colors. I took the example code for poormans_contour.py and added a color bar to it. The color bar show 9, not 10, equal sized pieces. I figured that the 10th color could be just a strip on top which was never used in the plot. Therefor I set the limits of the plot to -0.1 and 0.1 to ensure that parts of the image were below the minimum and parts were above the maximum. Now I can clearly see 10 colors on the plot, but only 9 on the color bar. Was this the intention? Is there another method of putting a color bar on a contour plot of this type? This is how I modified poormans_contour.py: After the call to imshow in line 34, I added clim(vmin = -0.1, vmax = 0.1) colorbar() -- Ms. Carol A. Leger SRI International Phone: (650) 859-4114 333 Ravenswood Avenue G-273 Menlo Park, CA 94025 e-mail: le...@sr... |
From: John H. <jdh...@ac...> - 2005-01-12 15:49:15
|
>>>>> "Edward" == Edward Abraham <Edw...@da...> writes: Edward> At present, the clip_on property needs to be set manually, Edward> rather than from within the plot command Cheers, OK, I believe I fixed this in CVS. In artist.py, replace set_clip_on with def set_clip_on(self, b): """ Set whether artist uses clipping ACCEPTS: [True | False] """ self._clipon = b if not b: self.clipbox = None And let me know if this fixes your problem. Thanks for the report, JDH |