Re: [Matplotlib-users] colorbar tick label fontproperties
John, The following code works for me (Python 2.5.4, Matplotlib 0.99): # create and format the colorbar cbar = pl.colorbar(G, ticks=range(g1,g2+1)) cbar.ax.set_ylabel('Gradient (%)', fontsize=10) cl = pl.getp(cbar.ax, 'ymajorticklabels') pl.setp(cl, fontsize=10) -Paul M. Hobson -Original Message- From: John [H2O] [mailto:washa...@gmail.com] Sent: Tuesday, September 22, 2009 8:03 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] colorbar tick label fontproperties Could someone please explain how to change the font properties for a colorbar tick label, the following causes no error, but it does NOT work: ## CREATE COLORBAR ## make a copy of the image object im2 = copy.copy(im) im2.set_cmap(colmap) ## create new axis for colorbar. cax = plt.axes([l+w+0.03, b, 0.025, h-0.035]) cb = plt.colorbar(im2, cax)#, format='%3.2g') # draw colorbar ## set colorbar label and ticks p_cax = mpl.font_manager.FontProperties(size='6') clabels = clevs[::10] ##clevs, by 10 steps clabels.append(clevs[-1]) ## add the last label cb.ax.set_yticks(np.linspace(0,1,len(clabels))) cb.ax.set_yticklabels(['%3.2g' % cl for cl in clabels], fontproperties=p_cax) cax.set_title('sensitivity\n(%s)' % units, fontproperties=p_cax) NOTE: It does set the title properties correctly. -- View this message in context: http://www.nabble.com/colorbar-tick- label-fontproperties-tp25530779p25530779.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Come build with us! The BlackBerryreg; Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9#45;12, 2009. Register now#33; http://p.sf.net/sfu/devconf ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg
Group, This error occurs for me with Matplotlib 0.99.1, Python 2.5.4 and 2.6.2, while using the Qt4Agg backend on Windows XP. Basically, savefig('aweomse_plot.pdf') barfs if I have some math text in there. For example: -- |C:\Documents and Settings\phobsonipython26 -pylab |Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] |Type copyright, credits or license for more information. | |IPython 0.10 -- An enhanced Interactive Python. |? - Introduction and overview of IPython's features. |%quickref - Quick reference. |help - Python's own help system. |object? - Details about 'object'. ?object also works, ?? prints more | | Welcome to pylab, a matplotlib-based Python environment. | For more information, type 'help(pylab)'.In [1]: x = arange(10) | |In [2]: y = 0.5*x**2 | |In [3]: plot(x,y,'ko') |Out[3]: [matplotlib.lines.Line2D object at 0x039F3C10] | |In [4]: savefig('test.png') | |In [5]: savefig('test.pdf') | |In [6]: xlabel('rSome math: $X$') |Out[6]: matplotlib.text.Text object at 0x03A7A350 | |In [7]: savefig('test.pdf') -- Spits out a nasty error at Input Line 7. I've include it below my sig for those who might want to look at it. I don't know much about back ends, but I feel like I've neglected to install something since the last line of the TraceBack includes ValueError: unichr() arg not in range(0x1) (narrow Python build). I have an update-version of MikTeX on this machine. Any thoughts? Many thanks, Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: (503) 222-9518 Web: www.geosyntec.com Erros message: In [7]: savefig('test.pdf') ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (550, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (550, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (550, 0)) --- ValueErrorTraceback (most recent call last) C:\Documents and Settings\phobson\ipython console in module() C:\Python26\lib\site-packages\matplotlib\pyplot.pyc in savefig(*args, **kwargs) 354 def savefig(*args, **kwargs): 355 fig = gcf() -- 356 return fig.savefig(*args, **kwargs) 357 if Figure.savefig.__doc__ is not None: 358 savefig.__doc__ = dedent(Figure.savefig.__doc__) C:\Python26\lib\site-packages\matplotlib\figure.pyc in savefig(self, *args, **kwargs) 1030 patch.set_alpha(0.0) 1031 - 1032 self.canvas.print_figure(*args, **kwargs) 1033 1034 if transparent: C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4agg.pyc in print_figure(self, *args, **kwargs) 141 self.update(l, self.renderer.height-t, w, h) 142 143 def print_figure(self, *args, **kwargs): -- 144 FigureCanvasAgg.print_figure(self, *args, **kwargs) 145 self.draw() C:\Python26\lib\site-packages\matplotlib\backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edgecolor, orientation format, **kwargs) 1474 orientation=orientation, 1475 bbox_inches_restore=_bbox_inches_restore, - 1476 **kwargs) 1477 finally: 1478 if bbox_inches and restore_bbox: C:\Python26\lib\site-packages\matplotlib\backend_bases.pyc in print_pdf(self, *args, **kwargs) 1332 from backends.backend_pdf import FigureCanvasPdf # lazy import 1333 pdf = self.switch_backends(FigureCanvasPdf) - 1334 return pdf.print_pdf(*args, **kwargs) 1335 1336 def print_png(self, *args, **kwargs): C:\Python26\lib\site-packages\matplotlib\backends\backend_pdf.pyc in print_pdf(self, filename, **kwargs) 2023 width, height, image_dpi, RendererPdf(file, image_dpi), 2024 bbox_inches_restore=_bbox_inches_restore) - 2025 self.figure.draw(renderer) 2026 renderer.finalize() 2027 if isinstance(filename, PdfPages): # finish off this page C:\Python26\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *kl) 44 def draw_wrapper(artist, renderer, *kl): 45 before(artist, renderer) --- 46 draw(artist, renderer, *kl) 47 after(artist, renderer) 48 C:\Python26\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer) 771 772 # render the axes -- 773
Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg
Sheesh it's been a weird day. I failed to reply to the whole list. Jouni, sorry about the duplciate message... phob...@geosyntec.com writes: |C:\Documents and Settings\phobsonipython26 -pylab From: Jouni K. Seppänen [mailto:j...@iki.fi] Could you try this in plain Python? I'm asking because you seem to be getting an IPython warning about a possibly corrupted traceback: ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (550, 0)) I suggest you write your commands in a script and run it with python script.py --verbose-debug Jouni: Thanks for the prompt reply. I did just that. Calling the script both ways (w/ and w/o the PDF backend) fails with a lot of out. This time I've included the verbose output as an attached text file. I apologize of that's a mailing list faux pas. Here's the code for the script, pyTest.py: import pylab as pl x = pl.arange(6) y = x + 5 pl.plot(x,y,'ko', zorder=10) pl.xlabel('X-label, no TeX') pl.ylabel('Y-label. no math') pl.savefig('no_math.png') pl.savefig('no_math.pdf') pl.xlabel(r'some math: $\tau_{y}$') pl.savefig('some_math.png') pl.savefig('some_math.pdf') # EOF no_math.* and some_math.png are created just fine. The error occurred trying to create some_math.pdf. I'm really at a loss b/c I could swear I created fairly complex figures with output to PDF about a week ago and don't recall changing my Python or MPL installation. so that we can get a better picture of where it is going wrong. Also, does it matter that you are using Qt4Agg? You can test this by trying Both seemed to provide the same error message, so I've only included the verbose output from C:\Python25python c:\GDAG2009\python\pyTest.py -d pdf --verbose-debug For grins and giggles, I went to my matplotlibrc file and commented out the lines telling MPL to use Droid fonts (even though they never gave me a problem before). That didn't change anything. Thanks again, -paul C:\Python25python c:\GDAG2009\python\pyTest.py -d pdf --verbose-debug $HOME=C:\Documents and Settings\phobson CONFIGDIR=C:\Documents and Settings\phobson\.matplotlib matplotlib data path C:\Python25\lib\site-packages\matplotlib\mpl-data loaded rc file C:\Documents and Settings\phobson\.matplotlib\matplotlibrc matplotlib version 0.99.1 verbose.level debug interactive is False units is False platform is win32 loaded modules: ['numpy.lib._iotools', 'xml.sax.urlparse', 'distutils', 'matplotlib.errno', 'pylab', 'subprocess', 'gc', 'matplotl ib.tempfile', 'distutils.sysconfig', 'ctypes._endian', 'encodings.encodings', 'matplotlib.colors', 'msvcrt', 'numpy.testing.sys', 'numpy.core.info', 'xml', 'numpy.fft.types', 'numpy.ma.operator', 'numpy.ma.cPickle', 'struct', 'numpy.random.info', 'tempfile', ' xml.sax.urllib', 'numpy.linalg', 'matplotlib.threading', 'numpy.testing.operator', 'imp', 'numpy.testing', 'collections', 'numpy.c ore.umath', '_struct', 'distutils.types', 'numpy.lib.numpy', 'numpy.core.scalarmath', 'matplotlib.matplotlib', 'string', 'matplotl ib.subprocess', 'numpy.testing.os', 'matplotlib.locale', 'numpy.lib.arraysetops', 'numpy.testing.unittest', 'numpy.lib.math', 'mat plotlib.__future__', 'numpy.testing.re', 'itertools', 'numpy.version', 'numpy.lib.re', 'distutils.re', 'ctypes.os', 'numpy.core.os ', 'numpy.lib.type_check', 'numpy.lib.__builtin__', 'signal', 'numpy.lib.types', 'numpy.lib._datasource', 'random', 'threading', ' token', 'numpy.fft.fftpack_lite', 'matplotlib.cbook', 'ctypes.ctypes', 'xml.sax.xmlreader', 'numpy.__builtin__', 'dis', 'distutils .version', 'cStringIO', 'numpy.ma.core', 'numpy.numpy', 'matplotlib.StringIO', 'locale', 'numpy.add_newdocs', 'numpy.lib.getlimits ', 'xml.sax.saxutils', 'matplotlib.numpy', 'numpy.lib.sys', 'encodings', 'numpy.ma.itertools', 'numpy.lib.io', 'numpy.ma.extras', 'numpy.testing.decorators', 'matplotlib.warnings', 'matplotlib.string', '_subprocess', 'urllib', 'matplotlib.sys', 're', 'numpy.li b._compiled_base', 'ntpath', 'new', 'numpy.random.mtrand', 'math', 'numpy.fft.helper', 'numpy.ma.warnings', 'inspect', 'numpy.ma.i nspect', 'UserDict', 'numpy.lib.function_base', 'distutils.os', 'matplotlib', 'numpy.fft.numpy', 'numpy.lib.ufunclike', 'numpy.lib .info', 'numpy.core.numerictypes', 'ctypes', 'numpy.lib.warnings', 'ctypes.struct', 'codecs', 'numpy.core._sort', 'numpy.os', '_lo cale', 'matplotlib.sre_constants', 'matplotlib.os', 'thread', 'StringIO', 'numpy.core.memmap', 'traceback', 'weakref', 'numpy.core ._internal', 'numpy.fft.fftpack', 'opcode', 'numpy.linalg.lapack_lite', 'distutils.sys', 'os', 'numpy.lib.itertools', '__future__' , 'matplotlib.copy', 'xml.sax.types', 'matplotlib.traceback', '_sre', 'unittest', 'numpy.core.sys', 'numpy.random', 'numpy.linalg. numpy', '__builtin__', 'numpy.lib.twodim_base', 'matplotlib.re', 'numpy.core.cPickle', 'operator', 'numpy.core.arrayprint', 'distu tils.string
Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg
Jouni, I found the error! I got bored this past weekend and changed my mathtext.fontset to 'stixsans' just to see hopw it would look -- and then forgot about it. Changing that value back to 'cm' let's my original code and pyTest.py run without errors. I really appreciate your help with this and all of the other insight I've gained from the regular contributers to this list. Many thanks, -paul Regardless, here's my command line output with stixsans as my mathtext.fontset: C:\Python25python -i c:\gdag2009\python\pyTest.py -d pdf Traceback (most recent call last): File c:\gdag2009\python\pyTest.py, line 12, in module pl.savefig('some_math.pdf') File C:\Python25\Lib\site-packages\matplotlib\pyplot.py, line 356, in savefig return fig.savefig(*args, **kwargs) File C:\Python25\Lib\site-packages\matplotlib\figure.py, line 1032, in savefig self.canvas.print_figure(*args, **kwargs) File C:\Python25\Lib\site-packages\matplotlib\backends\backend_qt4agg.py, line 144, in print_figure FigureCanvasAgg.print_figure(self, *args, **kwargs) File C:\Python25\Lib\site-packages\matplotlib\backend_bases.py, line 1476, in print_figure **kwargs) File C:\Python25\Lib\site-packages\matplotlib\backend_bases.py, line 1334, in print_pdf return pdf.print_pdf(*args, **kwargs) File C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py, line 2025, in print_pdf self.figure.draw(renderer) File C:\Python25\Lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *kl) File C:\Python25\Lib\site-packages\matplotlib\figure.py, line 773, in draw for a in self.axes: a.draw(renderer) File C:\Python25\Lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *kl) File C:\Python25\Lib\site-packages\matplotlib\axes.py, line 1735, in draw a.draw(renderer) File C:\Python25\Lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *kl) File C:\Python25\Lib\site-packages\matplotlib\axis.py, line 757, in draw self.label.draw(renderer) File C:\Python25\Lib\site-packages\matplotlib\text.py, line 565, in draw ismath=ismath) File C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py, line 1516, in draw_text if ismath: return self.draw_mathtext(gc, x, y, s, prop, angle) File C:\Python25\Lib\site-packages\matplotlib\backends\backend_pdf.py, line 1378, in draw_mathtext self.file.output(self.encode_string(unichr(num), fonttype), Op.show) ValueError: unichr() arg not in range(0x1) (narrow Python build) from pdb import pm pm() c:\python25\lib\site-packages\matplotlib\backends\backend_pdf.py(1378)draw_mathtext() - self.file.output(self.encode_string(unichr(num), fonttype), Op.show) (Pdb) p fontname, fontsize, num, symbol_name ('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf', 7.0, 120378, 'u1D63A') (Pdb) p s, width, height, descent, glyphs, rects, used_characters ('some math: $\\tau_{y}$', 72.0, 11.0, 3.0, [(0.0, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\V era.ttf', 10.0, 115, 's'), (5.2099609375, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 111, 'o'), (11.328125, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 109, 'm'), (21.0693359375, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 101, 'e'), (2 7.2216796875, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 32, 'space'), (30.400 390625, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 109, 'm'), (40.1416015625, 3.40625, 'C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 97, 'a'), (46.26953125, 3.40625, 'C :\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 116, 't'), (50.1904296875, 3.40625, 'C:\\Pytho n25\\lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 104, 'h'), (56.5283203125, 3.40625, 'C:\\Python25\\lib \\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 58, 'colon'), (59.8974609375, 3.40625, 'C:\\Python25\\lib\\sit e-packages\\matplotlib\\mpl-data\\fonts\\ttf\\Vera.ttf', 10.0, 32, 'space'), (63.076171875, 3.40625, 'C:\\Python25\\lib\\site-pack ages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXNonUniIta.ttf', 10.0, 57835, 'uniE1EB'), (67.75616455078125, 2.046875, 'C:\\Python25\\ lib\\site-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf', 7.0, 120378, 'u1D63A')], [], {'C:\\Python25\\lib\\si te-packages\\matplotlib\\mpl-data\\fonts\\ttf\\STIXGeneralItalic.ttf': ('C:\\Python25\\lib\\site-packages\\matplotlib\\mpl-data\\f onts\\ttf\\STIXGeneralItalic.ttf', set([120378])),
Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg
Mike, Thanks for the reply. I found that I had (on a whim) set my mathtext.fontset to stixsans and then forgot about it. Returning that value to cm fixes my issues. In short, I'm all squared away now. Thanks! Paul M. Hobson -Original Message- From: Michael Droettboom [mailto:md...@stsci.edu] Sent: Monday, October 12, 2009 1:38 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Errors with PDF (TeX-string) output using Qt4Agg On 10/12/2009 04:17 PM, Jouni K. Seppänen wrote: phob...@geosyntec.com writes: File C:\Python25\Lib\site- packages\matplotlib\backends\backend_pdf.py, line 1378, in draw_mathtext self.file.output(self.encode_string(unichr(num), fonttype), Op.show) ValueError: unichr() arg not in range(0x1) (narrow Python build) Right, IPython really had mangled the traceback. That looks like the mathtext parser is outputting some characters outside the Basic Multilingual Plane. Could you try the following: python -i c:\GDAG2009\python\pyTest.py -d pdf Then when the error occurs, you should be at a Python prompt. Then type (or just copy and paste from here - be careful with the first two lines, since any exception will cause Python to forget the existing traceback): from pdb import pm pm() p fontname, fontsize, num, symbol_name p s, width, height, descent, glyphs, rects, used_characters p fonttype, global_fonttype It might work to set pdf.fonttype to 3 in matplotlibrc, but even if it helps, it would be useful to find the root of this problem. What is your mathtext.fontset setting? If it's stixsans, then it is possible that mathtext would produce codepoints outside of the BMP (this is due to the way the STIX fonts are encoded). Unfortunately, the standard Python builds for Windows don't support characters in this range. There might actually be a work around possible in the PDF backend -- but it will have to involve encoding Unicode characters without using Python unicode objects. I'm looking into a patch now. Cheers, Mike -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Log scale for horizontal bar chart (2 bugs)
-Original Message- From: Donovan Parks [mailto:donovan.pa...@gmail.com] Sent: Wednesday, October 14, 2009 1:31 PM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] Log scale for horizontal bar chart (2 bugs) Hello, I've encountered two bugs recently in matplotlib. I am hoping someone can tell me if these are known issues and if any workarounds have been proposed. The bug occurs for horizontal bar chart where the x-axis has a log scale: from pylab import * val = 3+10*rand(5) # the bar lengths pos = arange(5)+.5# the bar centers on the y axis axes = subplot(111) axes.barh(pos,val, align='center') axes.set_xscale('log') for a in axes.yaxis.majorTicks: a.tick1On=False a.tick2On=False for a in axes.xaxis.majorTicks: a.tick1On=True a.tick2On=False for loc, spine in axes.spines.iteritems(): if loc in ['left','right','top']: spine.set_color('none') show() If you run this code, you will see that only the end caps of the horizontal bars are drawn. Furthermore, tick marks appear at the top of the plot (despite explicitly turning them off). If a linear scale is used the plot is generated as expected. The issue with tick marks appearing incorrectly with log axes appears to occur with many types of graphs (well, at least the three I tried). Just wanted to chime in here and note that a similar issue can occur with boxplots and log-scales. I think the issue here is that the rectangle patch is told to draw at the patch length at *zero*. Since there is no zero on a log scale, the rectangle patch is not fully rendered. That's just my observation/hypothesis. Good luck, -paul -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Location matplotlibrc file on my Mac
Hey everyone, The existence of the matplotlibrc file is one reason I like MPL so much. I won't go into the convoluted work flow I had for getting my MATLAB figures completely processed in TeX, but it was nasty. On my Windows machine, I've used it with great success. But I can't get my Mac (OS 10.5) to see it at all. I've put it in my current working directory, in /Library/Frameworks/.../mpl_data, and in /Users/paul. I've confirmed that those directories are in my sys.path variable as well. Nothing seems to work. Mac OS 10.5 Python 2.6.2 MPL 0.99.1 Any advice? Thanks, Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: (503) 222-9518 Web: www.geosyntec.com -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Location matplotlibrc file on my Mac
On Nov 3, 2009, at 3:08 PM, phob...@geosyntec.com phob...@geosyntec.com wrote: -Original Message- From: Tony S Yu [mailto:ton...@mit.edu] Hi Paul, I think your matplotlibrc file should be put in: /Users/paul/.matplotlib -Tony Thanks Tony, I'll give that a shot. Shouldn't keeping it in my current working directory work as well? One of the great things about using the matplotlibrc file on my Windows machine is that I can keep different files for different projects. -Original Message- From: Tony S Yu [mailto:ton...@mit.edu] (Paul, I hope you don't mind if I bring this bump this back to the list). Not at all. I meant to reply to the whole list last time :) Apparently I skimmed your original email and didn't see that you tried putting the file in your working directory. That should work. (My original response is still appropriate for a global rc file.) As suggested on the mpl website (specifically: http://matplotlib.sourceforge.net/users/customizing.html ), you can try printing out the path of the rc file being used by adding the following to your script: import matplotlib print matplotlib.matplotlib_fname() I missed this in my frustration last night (when I was last at my Mac). I'm confident that will be a huge help. Also, you may want to check that the working directory is where you think it is. For example, if you run a script from the terminal as: $ python ~/path/to/file.py Your working directory is '~' and not '~/path/to/'---so matplotlibrc file located in the same directory as file.py would not be in the working directory. Yeah. I've got all that part of it straightened out. I'll try everything tonight and post back tomorrow. Otherwise, I have no idea why the matplotlibrc is not being found in the working directory. Thanks, Tony. I really appreciate the help. -paul -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Location matplotlibrc file on my Mac
-Original Message- From: Tony S Yu [mailto:ton...@mit.edu] Sent: Tuesday, November 03, 2009 1:11 PM To: Paul Hobson Cc: Matplotlib Users Subject: Re: [Matplotlib-users] Location matplotlibrc file on my Mac (Paul, I hope you don't mind if I bring this bump this back to the list). Apparently I skimmed your original email and didn't see that you tried putting the file in your working directory. That should work. (My original response is still appropriate for a global rc file.) As suggested on the mpl website (specifically: http://matplotlib.sourceforge.net/users/customizing.html ), you can try printing out the path of the rc file being used by adding the following to your script: import matplotlib print matplotlib.matplotlib_fname() Also, you may want to check that the working directory is where you think it is. For example, if you run a script from the terminal as: $ python ~/path/to/file.py Your working directory is '~' and not '~/path/to/'---so matplotlibrc file located in the same directory as file.py would not be in the working directory. Otherwise, I have no idea why the matplotlibrc is not being found in the working directory. Best, -Tony I won't mention how long it had been so I had done this, but I had to move the file to /Users/paul/.matplotlib in Terminal since Mac OSX won't let you do that in Finder (sigh). This made everything work splendidly. I even got it to work in the present working directory (not sure how I was messing that up earlier). Thanks so much, Tony. Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: (503) 222-9518 Web: www.geosyntec.com -- 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 Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] How do I change where MPL looks for Latex?
I know support for the usetex feature is limited, but I think (*hope*) that this is purely an MPL question and not out of the scope and annoying to the members of the group. I like to use the fourier.sty package since I like the Utopia font and it's math font is particularly nice. But MPL is using this Latex installation: /sw/share/texmf-dist/tex/latex/ which has no fourier package, and raises predictable errors when I set text.latex.preamble : \usepackage{fourier} But I only use and maintain this one: /usr/local/texlive/2008/texmf-dist/tex/latex/ (fourier and many other packages I like) Is there a way to tell MPL to use my preferred Latex directory, or should I update and maintain the one it currently searches? Mac OS 10.5 MPL 0.99.1 Many thanks, Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: (503) 222-9518 Web: www.geosyntec.com -- 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 Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How do I change where MPL looks for Latex?
On Wed, Nov 4, 2009 at 11:25 AM, phob...@geosyntec.com wrote: I know support for the usetex feature is limited, but I think (*hope*) that this is purely an MPL question and not out of the scope and annoying to the members of the group. I like to use the fourier.sty package since I like the Utopia font and it's math font is particularly nice. But MPL is using this Latex installation: /sw/share/texmf-dist/tex/latex/ which has no fourier package, and raises predictable errors when I set text.latex.preamble : \usepackage{fourier} But I only use and maintain this one: /usr/local/texlive/2008/texmf-dist/tex/latex/ (fourier and many other packages I like) From: John Hunter [mailto:jdh2...@gmail.com] Sent: Wednesday, November 04, 2009 9:33 AM This looks like a UNIX PATH issue -- mpl will use the version of latex it finds first in your PATH, so if you want it to find /usr/local/texlive/2008/texmf-dist/tex/latex/, put the directory containing that latex ahead of the fink one (/sw) Thanks, John. Looks like I can take from here. I'll add my Texlive directory to near the top of the path. -paul -- 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 Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] add table to axes
From: Sahar [mailto:sa...@cmt.co.il] Sent: Monday, November 23, 2009 7:20 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] add table to axes Hi, I'm trying to add some notes in a table to a plot, and I don't know how to use the 'matplotlib.pyplot.table command. I really don't want to use ax.text(...) with different x,y values... Any suggestions? Example to table command, insert LaTex tables... I think the LaTeX root might be a good one. Set your usetex to True in rcParams and make a separate file (table.tex). Then use: figure.figtext(fig_x, fig_y, r'\input{table.tex}') I haven't tested this, but it seems like it should work. I'd be curious to hear how it goes. -paul h -- 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 Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Installing iPython on Win XP
This is indeed a DOS prompt issue. Right-click the very top of the window and go to Properties. Upon exit, select that the changes should be applied to future windows with the same title. HTH -paul -Original Message- From: Wayne Watson [mailto:sierra_mtnv...@sbcglobal.net] Sent: Monday, November 30, 2009 8:58 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Installing iPython on Win XP Looking a little further at this problem it looks like iPython was installed. I mis-interpreted some lines at the bottom. The very bottom one showed [1]. I didn't recognize that as a line prompt. The next question is whether one can accept a complete program. I suspect this is a purely interactive program, and it's total interface is the DOS like console? I see one must use properties of the Window to change its size. I would think there would be a way to make these the same each time? I think there's a tutor for this, so it looks like I need to visit it. Wayne Watson wrote: I downloaded ipython-0.10.win32-setup.exe and began the execution. It seem like it installed components. It may have brought up a download for ipython-0.10-py2.5.egg some minutes later. When I noticed it I thought maybe I accidentally triggered its appearnace from the Start menu. I tried ipython from the menu to see what it might look like. I got a console window with messages of various kinds about a successful install and some general comments about features. It stated I should hit Enter to continue. That did nothing. I closed the window. What next? Am I supposed to install the egg file? I thought I'd download it and try, but Win doesn't recognize it. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet The popular press and many authorities believe the number of pedifiles that prowl the web is 50,00. There are no figures that support this. The number of children below 18 years of age kidnapped by strangers is 1 in 600,00, or 115 per year. -- The Science of Fear by D. Gardner Web Page: www.speckledwithstars.net/ - - 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 Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- 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 Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Rotating X-Labels on AxesGrid?
Hey folks, I'm trying to make some bar plots using AxesGrid and the set_xlabels method doesn't seem to notice that I'm passing a 'rotation' kwarg. Here's a small script that showing that this doesn't work: # -- import matplotlib.pyplot as pl from mpl_toolkits.axes_grid import AxesGrid fig = pl.figure() grid = AxesGrid(fig, 111, nrows_ncols=(1,1), axes_pad=0.12) xlabs = ['paul', 'chris', 'patti'] for ax in grid: ax.plot([1,2,3], [2,2.5,3], 'bo') ax.set_ylim([0,5]) ax.set_xlim([0,4]) ax.set_xticks([1,2,3]) ax.set_xticklabels(xlabs, rotation=90) # - As you can see from the attached image, my labels aren't rotating. This is obviously a trivial example, but I'm trying to plot some chemical concentrations and the names are quite long. Any tips? Should I just be using subpolot instead? Python 2.6.2 and: In [25]: import matplotlib as mpl In [26]: mpl.__version__ Out[26]: '0.99.1' In [27]: import numpy as np In [28]: np.__version__ Out[28]: '1.3.0' Thanks! Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: (503) 222-9518 www.geosyntec.com attachment: rotate_test.png-- Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] I Need a Couple of Tips for Windows to Get Started on IPython
Wayne, Are you using the IPython shell? If so, cd, pwd, ls, etc will work just fine. If you using the standard python shell, AFAIK, you need to import the os module and use that to navigate. Ipython session: C:\Documents and Settings\phobsonipython Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] Type copyright, credits or license for more information. IPython 0.10 -- An enhanced Interactive Python. ? - Introduction and overview of IPython's features. %quickref - Quick reference. help - Python's own help system. object? - Details about 'object'. ?object also works, ?? prints more. In [1]: pwd Out[1]: 'C:\\Documents and Settings\\phobson' In [2]: cd c:\stuff\utils\py c:\stuff\utils\py In [3]: pwd Out[3]: 'c:\\stuff\\utils\\py' In [4]: cd c:\ c:\ In [5]: cd c:\stuff\utils\py c:\stuff\utils\py In [6]: ls *.pdf Volume in drive C has no label. Volume Serial Number is 24FD-DA13 Directory of c:\stuff\utils\py 09/11/2009 11:39 AM 1,515,182 elev_test5.pdf 10/18/2009 01:06 PM 147,663 frLarch_elev.pdf 05/12/2009 10:30 AM28,029 gear.pdf 03/11/2009 09:56 AM30,622 test.pdf 08/27/2009 09:18 AM17,175 tidal_cdf.pdf 11/16/2009 08:20 AM 118,902 zoom_test.pdf 11/16/2009 08:18 AM 124,000 zoom_test_final.pdf 7 File(s) 1,981,573 bytes 0 Dir(s) 82,894,716,928 bytes free Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: (503) 222-9518 www.geosyntec.com -Original Message- From: Wayne Watson [mailto:sierra_mtnv...@sbcglobal.net] Sent: Sunday, December 06, 2009 3:02 PM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] I Need a Couple of Tips for Windows to Get Started on IPython I've seen the tutorial, but need something more. How do I know what folder I'm in? How do I move from where I am to, for example, C:\abc\def? So far I've tried various combinations like this: cd .. cd C:\ pwd (yes, I know it's not windows) I tried %cd .., and that may have moved me but I seem to get back to the same place. I seem to be in C:\Documents and Settings\administrator. If I doa %cp ..\\ it looks like I get to C:\, but follwing that with pwd gets me back to where I started--C:\Documents and Settings\administrator. If I want to execute a program with %run, I need to be where abc.py is or, perhaps say something like %run C:\myPyPrograms\abc.py. Dir doesn't work and I haven't been able to even see what's in the folder. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet ... humans'innate skills with numbers isn't much better than that of rats and dolphins. -- Stanislas Dehaene, neurosurgeon Web Page: www.speckledwithstars.net/ - - Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] I Need a Couple of Tips for Windows to Get Started on IPython
Third Google result for copy paste in DOS prompt http://www.copy--paste.org/copy-paste-between-dos-windows.htm Note that right-clicking is going to execute behavior, not bring up a contextual menu. -p -Original Message- From: Wayne Watson [mailto:sierra_mtnv...@sbcglobal.net] Sent: Monday, December 07, 2009 12:57 PM To: Gary Pajer Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] I Need a Couple of Tips for Windows to Get Started on IPython Right-click does nothing on the IPython window. The Windows command console is, I think, a lost cause all together. I've tried a right-click on it with the same result as in IPython. I'm using Win XP, and I hope they improve on Win 7, which I plan to install on all my machines this month. Gary Pajer wrote: On Mon, Dec 7, 2009 at 11:41 AM, Wayne Watson sierra_mtnv...@sbcglobal.net mailto:sierra_mtnv...@sbcglobal.net wrote: Good. Thanks. Interesting that ls and pwd are used for Win, but that's fine. How do I copy parts of the window? All I can do at the moment is sweep out a rectangular area with the mouse. It looks like I underestimated the need for automagic. Copy and paste from a Windows command shell is different that copy and paste from *nix command shell. Right-click in the command window Choose Mark from the drop-down menu Select the (rectangular) region of text you want to copy. Hit Return. That does a copy operation. Then go to your other application, and paste however you like. David Arnold wrote: Depends on whether automagic is enabled or not. If automagic is OFF, you need to enter the %, as in %cd. If automagic is ON (the default), then you don't need to enter the %, as in cd. automagic can be toggled on and off as follows: In [8]: automagic Automagic is OFF, % prefix IS needed for magic functions. In [9]: %automagic Automagic is ON, % prefix NOT needed for magic functions. On my mac, I can change to my home directory as follows: In [10]: cd /Users/darnold I can list the files in this directory with: In [11]: ls Desktop/Movies/context/ Documents/Music/java.log.344 Downloads/NetBeansProjects/java.log.415 Dropbox/Pictures/luatex-cache/ Library/Public/matlab_crash_dump.344 LizThesis/Sites/matlab_crash_dump.415 I can cd into my Sites folder with: In [12]: cd Sites /Users/darnold/Sites I can get the current directory with: In [13]: pwd Out[13]: '/Users/darnold/Sites' I can move up a directory level with: In [14]: cd .. /Users/darnold Hope this helps. D. On Dec 6, 2009, at 3:01 PM, Wayne Watson wrote: I've seen the tutorial, but need something more. How do I know what folder I'm in? How do I move from where I am to, for example, C:\abc\def? So far I've tried various combinations like this: cd .. cd C:\ pwd (yes, I know it's not windows) I tried %cd .., and that may have moved me but I seem to get back to the same place. I seem to be in C:\Documents and Settings\administrator. If I doa %cp ..\\ it looks like I get to C:\, but follwing that with pwd gets me back to where I started--C:\Documents and Settings\administrator. If I want to execute a program with %run, I need to be where abc.py is or, perhaps say something like %run C:\myPyPrograms\abc.py. Dir doesn't work and I haven't been able to even see what's in the folder. -- Wayne Watson (Watson Adventures, Prop., Nevada City, CA) (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2' 32 W, 2700 feet ... humans'innate skills with numbers isn't much better than that of rats and dolphins. -- Stanislas Dehaene, neurosurgeon Web Page: www.speckledwithstars.net/ http://www.speckledwithstars.net/ --- --- Join us December 9, 2009 for the Red Hat Virtual Experience, a free event focused on virtualization and cloud computing. Attend in-depth sessions from your desk. Your couch. Anywhere. http://p.sf.net/sfu/redhat-sfdev2dev ___
Re: [Matplotlib-users] mplot3d: plot_surface() and contour on grid?
Reinier, This in incredible. Wow. Thanks for all of your hard work. Cheers, -paul -Original Message- From: Reinier Heeres [mailto:rein...@heeres.eu] Sent: Thursday, December 10, 2009 3:37 PM To: Matthias Michler Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] mplot3d: plot_surface() and contour on grid? Hi, I just committed a patch to do this in svn, also allowing for contour lines along other directions. See the attached image for an example. -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Surface Plot
Hey Ted, I don't quite understand how you're getting the Z data below. But if you have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for you. http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata HTH, -paul - From: Ted Kord [mailto:teddy.k...@googlemail.com] Sent: Saturday, February 06, 2010 1:05 PM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] Surface Plot Hi I'd like to generate a surface plot using mplot3d. However, Z is not a function of X and/or Y. It's just a set of scalar values. So, the following doesn't work: X = np.arange(2, 102, 2) Y = np.arange(0, 15.15, 0.15) X, Y = np.meshgrid(X, Y) Z = f[2] ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet) Is there a way that I can do this? Thank you. Ted -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Surface Plot
Ted, How does this example run for you? http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html From: Ted Kord [mailto:teddy.k...@googlemail.com] Sent: Monday, February 08, 2010 12:00 PM To: Paul Hobson Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Surface Plot On 8 February 2010 17:37, phob...@geosyntec.commailto:phob...@geosyntec.com wrote: Hey Ted, I don't quite understand how you're getting the Z data below. But if you have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for you. http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata HTH, -paul Hi Paul Is there a way to colour the output? For some reason, the final output is in a single colour even though I've specified cm.jet for the colour map. Regards Ted -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] LateX Legend (again)
Jeff, I send all of my figures through LaTeX and don't have this problem. The only thing I can think of is to check your matplotlibrc file and make sure you've set the legend font to be the same size as the other fonts. HTH, -paul h. -Original Message- From: Jeffrey Blackburne [mailto:je...@mit.edu] Sent: Wednesday, February 10, 2010 9:45 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] LateX Legend (again) Hi everyone, This has been brought up before, but not completely addressed. Is it possible to get the text in a Legend to match the rest of the text when using LateX? Here is an example of the problem: import matplotlib as mpl mpl.rcParams['text.usetex'] = True import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot([1,5,2,3]) # random data plt.figlegend(ax.lines,[r'$\rm{label}$ label'],loc='upper left') plt.show() The first word is at least in a roman font, but the font size is wrong. I am using svn revision 8005 with gtkagg backend on linux, and confirm the behavior with 0.99.0 with tkagg on OS X. Thanks, Jeff - - SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] half-filled markers, two-colors
TJ, I think this current implementation and adding a marker rotation key word would be wonderful. When I get stuck doing GIS work, I end up using split markers very often. It's quite useful. Now's probably not the time, but maybe dividing the markers up into 2, 3, or 4 sections would be useful too. But perhaps at that point it'd be easier to create half and quarter markers and then rotate accordingly as the user makes multiple calls to plot. I dunno...just thinking aloud. This is a great contribution. Thanks a lot! -paul -Original Message- From: T J [mailto:tjhn...@gmail.com] Sent: Monday, February 15, 2010 4:00 PM To: Matplotlib Users Subject: Re: [Matplotlib-users] half-filled markers, two-colors On Sun, Feb 14, 2010 at 2:49 PM, T J tjhn...@gmail.com wrote: I ran across: http://old.nabble.com/half-filled-markers-td24003576.html The name fillstyle can give the wrong impression about what is being filled. For example, see the comment here: http://www.mail-archive.com/matplotlib- us...@lists.sourceforge.net/msg13074.html It's probably too late, but would markerfillstyle be a better name for this? Also, the current implementation fills half of the marker with the markerfacecolor and doesn't fill the marker at all for the other half. I think a neat (and simple) feature would be for users to specify two colors. Perhaps 'markerfacecolor2'. The change to the code is minimal, but the functionality it brings is quite flexible. markerfacecolor2 can default to 'none' to maintain current functionality. Should I file a ticket for this? I went ahead and implemented this. The user can now specify 'markercoloralt'. In the process, I finished the half-marker code for all remaining filled_markers. The diff is attached, which also includes a fix for bug #560720: https://sourceforge.net/tracker/?func=detailaid=2952236group_id=80706a tid=560720 Please comment. If there are no comments in a few days, I'll file a ticket. A picture demonstrating this functionality is attached. Demos for all filled markers can be obtained here: http://www.filedropper.com/filledmarkers Note, the diff contains the script used to generate the pictures. More generally, I wonder if there should be a 'markerangle' keyword. I can probably push through and implement this, but I'd like to hear what people think about it. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] DateFormatter + Latex issue
-Original Message- From: Ernest Adrogué [mailto:eadro...@gmx.net] Sent: Tuesday, February 16, 2010 1:58 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] DateFormatter + Latex issue 16/02/10 @ 16:20 (-0500), thus spake Filipe Pires Alvarenga Fernandes: \\ works for titles and label, but not for DateFormatter, but \vspace did the trick! Thanks again for the help. ps: I'm new to python, but maybe there is a way to mix Latex and unicode? Yes, the inputenc package from latex lets you use unicode. Try adding this to your script: plt.rc('text.latex', preamble='\usepackage[utf]{inputenc}') Note that this setting is not officially supported, whatever that means :) I also like the txfonts package: \usepackage[varg]{txfonts} which changes the default font to Times, including the text in mathematical expressions. It looks great. Good tip. I also like \usapackage{fourier} to get the utopia fonts, which are particularly useful since I'm always plotting concentrations and having a upright mu ($\othermu$) is really nice. -paul h. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] DateFormatter + Latex issue
On Tue, Feb 16, 2010 at 9:53 PM, John Hunter jdh2...@gmail.com wrote: I think it means that Darren, who did most of the heavy lifting for these features, was getting tired of the endless line of additional things TeX users wanted to do and the difficulties supporting these across all platforms (eg MikTex on Windows) and drew a line in the sand saying I'll add this stuff but if you report problems I may not stay up all night trying to fix them. From: Darren Dale [mailto:dsdal...@gmail.com] Sent: Wednesday, February 17, 2010 4:55 AM That is a fair explanation. Adding arbitrary lines to the latex preamble adds an incredible amount of flexibility if you are a user, and it provides plenty of rope with which to hang yourself if you are a developer (answering questions/problems related to people writing bad python code, misconfigured latex installations, and bad latex code!). At the time, we had finally shaped the latex backend into something that worked across platforms (and different versions of latex installations), plus I was also finishing up grad school and starting a new job, so I had reservations about even adding this feature to the library. But people really wanted it so we compromised. Compromised or not, it's a great feature and I'm *really* happy it made it was included! Thanks for all of the effort. -Paul H. -- SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Help needed on specific plot
Whoops. Give this one a shot: http://dpaste.com/161847/ -Original Message- From: Paul Hobson Sent: Friday, February 19, 2010 2:54 PM To: matplot...@liste.fastmail.fm; matplotlib-users@lists.sourceforge.net Subject: RE: [Matplotlib-users] Help needed on specific plot Hugo, I don't have time to really explain how to do this, so instead I'm just going to send some code I made that I think might be very similar to what you're looking for. http://dpaste.com/161843/ I've also attached some data so you can run the code. Good luck, -paul -Original Message- From: matplot...@liste.fastmail.fm [mailto:matplot...@liste.fastmail.fm] Sent: Friday, February 19, 2010 2:16 PM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] Help needed on specific plot Hi, I have the exterior shape of a nozzle given by S(x). Now what I want to do is first reflect it with respect to the y=0 axis (easily achieved by -S(x) right?) and then map each x node's value of an array (say density) to a color that would fill the vertical space between S(x) and -S(x). In other words I need something like the matplotlib.pyplot.fill_between method using x, S(x) and -S(x) but where the fill color would be relative to a third array (say density again) at each point x. Thanks! -- Hugo Gagnon -- Hugo Gagnon --- -- - Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Change the size of the plotted 'o's ?
-Original Message- From: mikey [mailto:abc.mi...@googlemail.com] Sent: Friday, February 26, 2010 4:29 PM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] Change the size of the plotted 'o's ? Hi there, I've just made script for displaying discrete data clustered in boxes on my graph. The plots are plotted with plt.plot(x,y,'o') and the 'o's seem a reasonable size on screen but when I render it to file they look huge so I'd like to reduce their size. Does anyone know how this is done? Mike, There are a couple of ways. See below: # untested, might have typos import numpy as np import matplotlib.pyplot as pl x = np.random.randn(20) fig = pl.figure() ax = pl.add_subplot(1,1,1) # you can specify the marker size two ways directly: ax.plot(x, 'ko', markersize=4) # size in points ax.plot(x, 'bs', ms=4) % ms is just an alias for markersize # or you can specify it after the plotting: X = ax.plot(x, 'ko') # X is a *list* of line2d objects... X[0].set_markersize(4) # set_ms works too # or... pl.setp(Y, markersize=4) # again, ms works. # For a list of all the properties you can tweak, type: pl.getp(object) HTH, -paul -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Making tick marks of a secondary axis line up with the primary axis
-Original Message- From: Alex S [mailto:schmitt.happ...@gmail.com] Hi there, I'm trying to make a plot with two y axes. I'm able to do that no problem, but what I'd really like to do now is make the tick marks line up for them both so that they both use the same grid. Is there a simple way to do this? Basically, I want to force the number of tick marks on the right hand axis to be the same as on the left hand axis, and I'd like it to select nice numbers to do so (ie not intervals of .358 or something). Hey Alex, I always just figure this out on my own. There might exist a more elegant way though. Starting with this: import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(111) ax2 = ax1.twinx() # plot stuff # So then you could do something like: ytx1 = ax1.get_yticks() ...and then use to len(ytx1) and range() to ax2.set_yticks(blahblah). The tricky part is picking a max for your range() so that your stepsize produces nice numbers. Also, on a somewhat related note, is there a simple way to force the y ticks to start at 0 rather than some other value? ax1.set_ylim(ymin=0) HTH, -paul h. -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] axis aspect ratio
Give this a shot: import matplotlib.pyplot as plt fig = pl.figure(figsize=(4,4)) ax = fig.add_sublot(1,1,1) # tweak as needed # [plot your data] ax.set_aspect(‘equal’) http://matplotlib.sourceforge.net/api/axes_api.html?highlight=set_aspect#matplotlib.axes.Axes.set_aspect From: tomislav_ma...@gmx.com [mailto:tomislav.ma...@gmx.com] Sent: Monday, March 15, 2010 9:33 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] axis aspect ratio Hello everyone, I'm using matplotlib for plotting data results from numerical simulations that involve a lot of geometric calculations. I did read the tutorial, but I haven't been able to figure out the proper way to set the axis aspect ratio to 1 when numerical data is plotted. Here is an example of my plot: http://img715.imageshack.us/img715/9318/projections.png since I need the aspect ratio to be 1 so that I can visually inspect my numerical code for bugs, I would really appreciate the help. I've loaded the data using pylab.load and I've plotted the files without using figure or axes, just plain old pyplot. -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] where's superpack?
How up-to-date is Macports? This is a reasonable approximation of how I got my OX 10.6 machine set up: http://newmediaandcapitalmarkets.org/component/content/article/68-how-i-got-matplotlib-working-on-my-macbook.html -Original Message- From: Christopher Barker [mailto:chris.bar...@noaa.gov] Sent: Wednesday, March 24, 2010 3:47 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] where's superpack? David Kremer wrote: Does anybody know where I could get a copy of superpack? I don't know of the status of that, but this is what I recommend: install the python2.6 from python.org install the numpy1.3 binary from scipy.org install the matplotlib binary (*.dmg) from matplotlib.org (optional) install the scipy binary from scipy.org and there you go -- I suppose it would be nice to have it all in one install, but that's not too hard. (if you really want all in one -- check out Python(x,y) or EPD) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.bar...@noaa.gov - - Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to show separate legend for each subplot
From: Omer Khalid [mailto:omer.kha...@cern.ch] Sent: Wednesday, March 31, 2010 6:20 AM To: Matplotlib Users Subject: [Matplotlib-users] How to show separate legend for each subplot Hi, I am wondering is there a way one could show a separate legend for each subplot in a figure? I would really really appreciate any ideas on this. `~' Omer, Give this a shot: # code - import matplotlib.pyplot as pl fig = pl.figure() ax1 = fig.add_subplot(1,2,1) ax2 = fig.add_subplot(1,2,2) ax1.plot([1,2], [3,4], 'ko', label='First Axes') ax2.plot([2,3], [4,5[, 'bs', label='Second Axes') ax1.legend() ax2.legend() # - code There's also an example in the Examples section of the MPL website: http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html Hope that helps, -paul -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to show last value on the line
From: Omer Khalid [mailto:omer.kha...@cern.ch] Sent: Wednesday, March 31, 2010 6:14 AM To: Matplotlib Users Subject: [Matplotlib-users] How to show last value on the line Hi, I have produced number of charts in my research thesis. On any given chart, there are number of lines. I would like to display the last value on each line to show at which precise value it's ending. Thanks, Omer Omer, Give something like this a shot: http://matplotlib.sourceforge.net/examples/pylab_examples/annotation_demo.html Remember that in python you can easily access the last element of an array (x) with x[-1]. -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Publication quality plots in papers
Gökhan, I like to use png files at 300dpi. I’m stuck using MS Word 2007 at work, and that’s what works best in my experience. If MS ever starts to support svg files… -paul h. From: Gökhan Sever [mailto:gokhanse...@gmail.com] Sent: Tuesday, April 27, 2010 8:53 AM To: Matplotlib Users Subject: [Matplotlib-users] Publication quality plots in papers Hello, This is a question mostly for non-Latex users. What is your preferred saving format from matplotlib that you use in OpenOffice or a similar open office tool? A format that looks good on both screen and printed output. In my experiences so far I have found getting the best quality outputs from PDF files (using the highest quality settings in matplotlibrc). It wins over eps, ps, and png outputs both on screen and printed texts. -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to set constant y-axis scale value
-Original Message- From: melons [mailto:xic...@cc.hut.fi] Sent: Wednesday, April 28, 2010 5:14 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] How to set constant y-axis scale value Hello, I am quite new in matplotlib, I am now facing a quite simple problem but have no idea to solve. I just want set the y axis scale to value 100, which means in the image, the y axis is always of scale 100, because the points in my image indicates the percentage value(for example, 20%, 87%) which will never exceed 100. So, How to set the y axis scale to constant value 100 ?? It's really hard to find a answer from internet. Give this a shot: # import matplotlib.pyplot as plt import numpy as np x = np.arange(20) y = np.random.randn(20) y = y/y.max() * 100 fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x,y,'ko', mfc='none') # you can do this: ax.set_ylim([0,100]) # or something like this: ax.set_ylim(ymin=0, ymax=100) plt.show() -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] introducing mpl_toolkits.gridspec
-Original Message- From: Jae-Joon Lee [mailto:lee.j.j...@gmail.com] Sent: Tuesday, May 11, 2010 8:58 AM To: Matplotlib Users Subject: [Matplotlib-users] introducing mpl_toolkits.gridspec Hi, gridspec is a module that implements matplotlib’s Subplot slightly differently. Current matplotlib’s Subplot only allows a Subplot to occupy a single cell of the n x m grid. gridspec enables a Subplot to occupy multiple cells. http://leejjoon.github.com/mpl_toolkits-gridspec/ This is really awesome! Thanks for all the time and hard work, JJ. -paul -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] hist question...
Nick, Check out this demo on the MPL website: http://matplotlib.sourceforge.net/examples/api/histogram_demo.html This line in particular: n, bins, patches = ax.hist(x, 50, normed=...) The variables 'n' and 'bins' can be fed into ax.bar() later on. I could swear that this was clear from the docstring, but that's definitely not the case anymore. I'll submit a patch to the list tomorrow if I can remember to work on it some tonight. Do see the docstring for an explanation of what can be done with the 'patches' variable. Hope this helps, -paul -Original Message- From: Nick Schurch [mailto:n.schu...@dundee.ac.uk] Sent: Tuesday, May 18, 2010 6:56 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] hist question... Hi all, Is there anyway of re-ploting the distribution generated by hist at a later point? I want to call it in a subroutine and have the resulting distributions returned so I can plot them without having to recalculate them each time. I couldn't find anything int he online documentation but I figured it'd be something like: import matplotlib.pyplot as plt hplot=plt.hist(data, bins=1000) plt.hist(hplot) or plt.hist(hplot[0],bins=hplot[1]) or plt.plot(hist) etc, but nothing works. -- Cheers, Nick Schurch Data Analysis Group (The Barton Group), School of Life Sciences, University of Dundee, Dow St, Dundee, DD1 5EH, Scotland, UK Tel: +44 1382 388707 Fax: +44 1382 345 893 - - ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] qqplot
Thierry, You need either scipy or rpy2 (and R) to do this. I've attached some code below. Please keep in mind that I've written for the general case of having a censored data set, therefore I rely on masked arrays from numpy.ma and scipy.stats.mstats -- but I have apply the mask midway through the process, which is different than the numpy's standard operating procedure. Let me know if any of this isn't clear. I also have code that generates a quick comparison of the results from scipy.stats.mstats and ryp2+R, if you're interested. HTH, -paul # code... import matplotlib.pyplot as pl import scipy.stats as st import numpy as np def censoredProbPlot(data, mask): ppos = st.mstats.plotting_positions(data) qntl = st.distributions.norm.ppf(ppos) qntlMask = np.ma.MaskedArray(qntl, mask=mask) dataMask = np.ma.MaskedArray(data, mask=mask) fit = st.mstats.linregress(dataMask, qntlMask) mu = -fit[1] sigma = fit[0] d_ = np.linspace(np.min(data),np.max(data)) q_ = sigma * d_ - mu maskedProbPlot = {mskData : dataMask, mskQntl : qntlMask, unmskData : data, unmskQntl : qntl, bestFitD : d_, bestFitQ : q_, mu : mu, sigma : sigma} return maskedProbPlot if 1: #~~ you need to put your data here: #data = np.array([]) #mask = np.array([],dtype=bool) mpp = censoredProbPlot(data, mask) fig = pl.figure() ax1 = fig.add_subplot(111) ax1.plot(mpp['mskQntl'], mpp['mskData'], 'ko', ms=6, label='Detected Samples') ax1.plot(mpp['unmskQntl'], mpp['unmskData'], 'r.', ms=6, label='Raw Samples') ax1.plot(mpp['bestFitQ'], mpp['bestFitD'], 'b-', lw=2) fig.savefig('example_censoredProbPlot.png') -Original Message- From: MONTAGU Thierry [mailto:thierry.mont...@cea.fr] Sent: Friday, May 21, 2010 6:37 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] qqplot hi all has anyone ever tried to make a quantile-quantile plot with pylab? is there any build in function named say qqplot available ? thanks Thierry - - ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Is there a way to link axes of imshow plots?
Do the sharex and sharey kwargs help? http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axes http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html -paul From: Adam Fraser [mailto:adam.n.fra...@gmail.com] Sent: Thursday, May 27, 2010 10:44 AM To: matplotlib-users Subject: [Matplotlib-users] Is there a way to link axes of imshow plots? Suppose I have a figure canvas with 3 plots... 2 are images of the same dimensions plotted with imshow, and the other is a scatterplot. I'd like to be able to link the x and y axes of the imshow plots so that when I zoom in one, the other zooms to the same coordinates, and when I pan in one, the other pans as well. I started hacking my way around this by subclassing NavigationToolbar2WxAgg (shown below)... but there are several problems here. 1) This will link the axes of all plots in a canvas since all I've done is get rid of the checks for a.in_axes() 2) This worked well for panning, but zooming caused all subplots to zoom from the same global point, rather than from the same point in each of their respective axes. Can anyone suggest a workaround? Much thanks! -Adam from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg as NavigationToolbar class MyNavToolbar(NavigationToolbar): def __init__(self, canvas, cpfig): NavigationToolbar.__init__(self, canvas) # override def press_pan(self, event): 'the press mouse button in pan/zoom mode callback' if event.button == 1: self._button_pressed=1 elif event.button == 3: self._button_pressed=3 else: self._button_pressed=None return x, y = event.x, event.y # push the current view to define home if stack is empty if self._views.empty(): self.push_current() self._xypress=[] for i, a in enumerate(self.canvas.figure.get_axes()): # only difference from overridden method is that this one doesn't # check a.in_axes(event) if x is not None and y is not None and a.get_navigate(): a.start_pan(x, y, event.button) self._xypress.append((a, i)) self.canvas.mpl_disconnect(self._idDrag) self._idDrag=self.canvas.mpl_connect('motion_notify_event', self.drag_pan) def press_zoom(self, event): 'the press mouse button in zoom to rect mode callback' if event.button == 1: self._button_pressed=1 elif event.button == 3: self._button_pressed=3 else: self._button_pressed=None return x, y = event.x, event.y # push the current view to define home if stack is empty if self._views.empty(): self.push_current() self._xypress=[] for i, a in enumerate(self.canvas.figure.get_axes()): # only difference from overridden method is that this one doesn't # check a.in_axes(event) if x is not None and y is not None and a.get_navigate() and a.can_zoom(): self._xypress.append(( x, y, a, i, a.viewLim.frozen(), a.transData.frozen())) self.press(event) -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] leading whitespace in text
-Original Message- From: Christoph Gohlke [mailto:cgoh...@uci.edu] Sent: Sunday, May 30, 2010 3:41 PM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] leading whitespace in text Hello, consider the following simple code: import matplotlib from matplotlib import pyplot pyplot.text(0, 0, --, family='monospace') pyplot.show() Using matplotlib-0.99.3.win32-py2.6, the text '--' is drawn with an x-offset from the y-axis, as expected from the presence of leading whitespace. Using matplotlib-1.0.svn.win32-py2.6 rev 8347, the leading whitespace is apparently removed from the text and '--' is drawn right at the y-axis with no x-offset. In both cases the font is monospace. Is this change intended or a regression in 1.0svn? Christoph, I haven't had a chance to try this out with my machine that has MPL 1.0svn on it, but is there any chance that you have mpl.rcParams['text.usetex'] = True when you get the error? -paul -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] how to define custom colormap from set of RGB values ?
Give this a shot: http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps From: Jim Vickroy [mailto:jim.vick...@noaa.gov] Sent: Wednesday, June 16, 2010 8:14 AM To: Matplotlib Subject: [Matplotlib-users] how to define custom colormap from set of RGB values ? Hello, The attached script shows my (failed) attempt to define a custom color map from a set of RGB values (taken from an IDL palette). My approach is presumably completely wrong, but I have not found information or examples on how to do this. Could someone point in the right direction? Thanks, -- jv P.S. When run on my workstation, the output from the attached script is: output Python version: 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] matplotlib version: 0.99.3 numpy version: 1.4.0 Traceback (most recent call last): File custom-colormap.py, line 97, in module plotter.savefig('%s.png' %colormap.name, facecolor='black', edgecolor='black') File C:\Python26\lib\site-packages\matplotlib\pyplot.py, line 356, in savefig return fig.savefig(*args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\figure.py, line 1032, in savefig self.canvas.print_figure(*args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\backend_bases.py, line 1476, in print_figure **kwargs) File C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py, line 358, in print_png FigureCanvasAgg.draw(self) File C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py, line 314, in draw self.figure.draw(self.renderer) File C:\Python26\lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\figure.py, line 773, in draw for a in self.axes: a.draw(renderer) File C:\Python26\lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\axes.py, line 1701, in draw im.draw(renderer) File C:\Python26\lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\image.py, line 237, in draw im = self.make_image(renderer.get_image_magnification()) File C:\Python26\lib\site-packages\matplotlib\image.py, line 182, in make_image x = self.to_rgba(self._A, self._alpha) File C:\Python26\lib\site-packages\matplotlib\cm.py, line 167, in to_rgba x = self.cmap(x, alpha=alpha, bytes=bytes) File C:\Python26\lib\site-packages\matplotlib\colors.py, line 489, in __call__ if not self._isinit: self._init() File C:\Python26\lib\site-packages\matplotlib\colors.py, line 720, in _init for c in self.colors], np.float) File C:\Python26\lib\site-packages\matplotlib\colors.py, line 311, in to_rgb raise ValueError('to_rgb: Invalid rgb arg %s\n%s' % (str(arg), exc)) ValueError: to_rgb: Invalid rgb arg (0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 25, 26, 28, 29, 31, 33, 34, 36, 38, 40, 41, 43, 45, 47, 49, 50, 53, 55, 57, 59, 61, 64, 66, 68, 70, 72, 74, 76, 79, 82, 84, 87, 89, 91, 94, 96, 99, 101, 104, 106, 108, 110, 113, 116, 118, 121, 124, 127, 128, 131, 134, 137 , 138, 141, 144, 147, 149, 152, 155, 156, 160, 161, 164, 168, 169, 172, 174, 177, 179, 182, 184, 188, 189, 191, 195, 196, 198, 202, 203, 205, 209, 211, 212, 214, 216, 220, 222, 224, 225 , 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 , 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 , 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 , 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255) sequence length is 256; must be 3 or 4 /output -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] how to define custom colormap from set of RGB values ?
You're not defining your dictionary in the way specified in the link. In fact, I don't think you have a dictionary at all. First, create a script that will map the range (0,1) to values in the RGB spectrum. In this dictionary, you will have a series of tuples for each color 'red', 'green', and 'blue'. The first elements in each of these color series needs to be ordered from 0 to 1, with arbitrary spacing in between. Now, consider (0.5, 1.0, 0.7) in the 'red' series below. This tuple says that at 0.5 in the range from (0,1) , interpolate from below to 1.0, and above from 0.7. Often, the second two values in each tuple will be the same, but using different values is helpful for putting breaks in your colormap. This is easier understand than might sound, as demonstrated by this simple script From: Jim Vickroy [mailto:jim.vick...@noaa.gov] Sent: Wednesday, June 16, 2010 9:15 AM To: Paul Hobson Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] how to define custom colormap from set of RGB values ? phob...@geosyntec.commailto:phob...@geosyntec.com wrote: Give this a shot: http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps Thanks for your reply. Previously, I had tried something based on the second example at that URL, but, after considerable time, I could only get a palette that was close. I do not understand how to use that example to replicate an IDL color map. The requirement is for me to exactly duplicate the IDL color map (actually several IDL color maps) listed in my script. -- jv From: Jim Vickroy [mailto:jim.vick...@noaa.gov] Sent: Wednesday, June 16, 2010 8:14 AM To: Matplotlib Subject: [Matplotlib-users] how to define custom colormap from set of RGB values ? Hello, The attached script shows my (failed) attempt to define a custom color map from a set of RGB values (taken from an IDL palette). My approach is presumably completely wrong, but I have not found information or examples on how to do this. Could someone point in the right direction? Thanks, -- jv P.S. When run on my workstation, the output from the attached script is: output Python version: 2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)] matplotlib version: 0.99.3 numpy version: 1.4.0 Traceback (most recent call last): File custom-colormap.py, line 97, in module plotter.savefig('%s.png' %colormap.name, facecolor='black', edgecolor='black') File C:\Python26\lib\site-packages\matplotlib\pyplot.py, line 356, in savefig return fig.savefig(*args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\figure.py, line 1032, in savefig self.canvas.print_figure(*args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\backend_bases.py, line 1476, in print_figure **kwargs) File C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py, line 358, in print_png FigureCanvasAgg.draw(self) File C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.py, line 314, in draw self.figure.draw(self.renderer) File C:\Python26\lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\figure.py, line 773, in draw for a in self.axes: a.draw(renderer) File C:\Python26\lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\axes.py, line 1701, in draw im.draw(renderer) File C:\Python26\lib\site-packages\matplotlib\artist.py, line 46, in draw_wrapper draw(artist, renderer, *args, **kwargs) File C:\Python26\lib\site-packages\matplotlib\image.py, line 237, in draw im = self.make_image(renderer.get_image_magnification()) File C:\Python26\lib\site-packages\matplotlib\image.py, line 182, in make_image x = self.to_rgba(self._A, self._alpha) File C:\Python26\lib\site-packages\matplotlib\cm.py, line 167, in to_rgba x = self.cmap(x, alpha=alpha, bytes=bytes) File C:\Python26\lib\site-packages\matplotlib\colors.py, line 489, in __call__ if not self._isinit: self._init() File C:\Python26\lib\site-packages\matplotlib\colors.py, line 720, in _init for c in self.colors], np.float) File C:\Python26\lib\site-packages\matplotlib\colors.py, line 311, in to_rgb raise ValueError('to_rgb: Invalid rgb arg %s\n%s' % (str(arg), exc)) ValueError: to_rgb: Invalid rgb arg (0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 22, 23, 25, 26, 28, 29, 31, 33, 34, 36, 38, 40, 41, 43, 45, 47, 49, 50, 53, 55, 57, 59, 61, 64, 66, 68, 70, 72, 74, 76, 79, 82, 84, 87, 89, 91, 94, 96, 99, 101, 104, 106, 108, 110, 113, 116, 118, 121, 124, 127, 128, 131, 134, 137 , 138, 141, 144, 147, 149, 152, 155, 156, 160, 161, 164, 168, 169, 172, 174, 177, 179, 182, 184, 188, 189, 191, 195, 196, 198, 202, 203, 205, 209, 211, 212, 214, 216, 220, 222, 224, 225 ,
Re: [Matplotlib-users] basemap broken with matplotlib 0.99.3?
Bill, Unfortunately, I don't have a solution for you. I just wanted to chime in and say that I'm getting the same error. I'm on XP, py2.6, mpl0.99.3, np1.4.1, sp0.8.0b1. Basemap came from the latest Windows binary on Sourceforge. -paul -Original Message- From: Bill Eaton [mailto:e...@aeroantenna.com] Sent: Wednesday, June 23, 2010 8:24 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] basemap broken with matplotlib 0.99.3? I stumbled across a basemap demo a couple of days ago and was immediately enchanted. I can't get it to install nicely on a Windoze box with matplotlib 0.99.3. When I try the famous from mpl_toolkits.basemap import Basemap directive, I get In [1]: from mpl_toolkits.basemap import Basemap - -- ValueErrorTraceback (most recent call last) C:\Documents and Settings\Bill.DC1\ipython console in module() C:\Python26\lib\site-packages\mpl_toolkits\basemap\__init__.py in module() 36 from matplotlib.lines import Line2D 37 from matplotlib.transforms import Bbox --- 38 import pyproj, sys, os, math, dbflib 39 from proj import Proj 40 import numpy as np C:\Python26\lib\site-packages\mpl_toolkits\basemap\pyproj.py in module() 46 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 47 --- 48 from _proj import Proj as _Proj 49 from _geod import Geod as _Geod 50 from _proj import _transform C:\Documents and Settings\Bill.DC1\c_numpy.pxd in _proj (src/_proj.c:3234)() ValueError: numpy.dtype does not appear to be the correct type object I tried manually installing many of the prerequisites (which should be bundled) and also reinstalling MPL. But still no joy. On my Linux box running 0.99.0, I was able to install basemap and run one of the example codes. Works quite nicely. - - ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] basemap broken with matplotlib 0.99.3?
Success! (well, the import worked) Christoph, thanks so much for the link, it is awesome! It can't be said enough that this is an awesome project and I'm so glad and thankful that it exists. -Original Message- From: Christoph Gohlke [mailto:cgoh...@uci.edu] Sent: Friday, June 25, 2010 11:37 AM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] basemap broken with matplotlib 0.99.3? IIRC basemap contains Cython code, which would need to be recythonized with the latest Cython version in order to work with numpy 1.4.1. If you don't mind trying developer releases, use basemap 0.99.5 from http://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap, which should work with numpy 1.4.1. Christoph On 6/25/2010 11:21 AM, phob...@geosyntec.com wrote: Bill, Unfortunately, I don't have a solution for you. I just wanted to chime in and say that I'm getting the same error. I'm on XP, py2.6, mpl0.99.3, np1.4.1, sp0.8.0b1. Basemap came from the latest Windows binary on Sourceforge. -paul -Original Message- From: Bill Eaton [mailto:e...@aeroantenna.com] Sent: Wednesday, June 23, 2010 8:24 AM To: matplotlib-users@lists.sourceforge.net Subject: [Matplotlib-users] basemap broken with matplotlib 0.99.3? I stumbled across a basemap demo a couple of days ago and was immediately enchanted. I can't get it to install nicely on a Windoze box with matplotlib 0.99.3. When I try the famous from mpl_toolkits.basemap import Basemap directive, I get In [1]: from mpl_toolkits.basemap import Basemap -- --- -- ValueErrorTraceback (most recent call last) C:\Documents and Settings\Bill.DC1\ipython console inmodule() C:\Python26\lib\site-packages\mpl_toolkits\basemap\__init__.py in module() 36 from matplotlib.lines import Line2D 37 from matplotlib.transforms import Bbox --- 38 import pyproj, sys, os, math, dbflib 39 from proj import Proj 40 import numpy as np C:\Python26\lib\site-packages\mpl_toolkits\basemap\pyproj.py in module() 46 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 47 --- 48 from _proj import Proj as _Proj 49 from _geod import Geod as _Geod 50 from _proj import _transform C:\Documents and Settings\Bill.DC1\c_numpy.pxd in _proj (src/_proj.c:3234)() ValueError: numpy.dtype does not appear to be the correct type object I tried manually installing many of the prerequisites (which should be bundled) and also reinstalling MPL. But still no joy. On my Linux box running 0.99.0, I was able to install basemap and run one of the example codes. Works quite nicely. -- --- - ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users --- --- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - - ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Hz to KHz
Replace this line: ax.plot(f/1000, Sserie) With this line: ax.plot(f/1000.0, Sserie) And tell us how things go. Python 2.6 distinguishes between integers and floats very strictly. Hence: In [1]: 20/1000 Out[1]: 0 In [2]: 20.0/1000.0 Out[2]: 0.02 See the difference? -paul From: Waléria Antunes David [mailto:waleriantu...@gmail.com] Sent: Monday, July 26, 2010 10:01 AM To: Angus McMorland Cc: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Hz to KHz i don't understand.. On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland amcm...@gmail.commailto:amcm...@gmail.com wrote: On 26 July 2010 12:47, Waléria Antunes David waleriantu...@gmail.commailto:waleriantu...@gmail.com wrote: My code like this in django: http://pastebin.com/nzM5jvuc Are you perhaps suffering from integer division? How about dividing by 1000.0, instead of 1000? Angus. i'm lost On Mon, Jul 26, 2010 at 1:42 PM, phob...@geosyntec.commailto:phob...@geosyntec.com wrote: Make sure that you're dividing by 1000.0 (as opposed to 1000) to avoid any integer nonsense and make sure to reset your axis limits. Posting a small code snippet would help us get you on the right track. -p From: Waléria Antunes David [mailto:waleriantu...@gmail.commailto:waleriantu...@gmail.com] Sent: Monday, July 26, 2010 9:32 AM To: Matthieu Brucher Cc: matplotlib-users@lists.sourceforge.netmailto:matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Hz to KHz I know...I tried but I'm using django and also when divided by 1000 the image does not appear... I don't know what to do.help me On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher matthieu.bruc...@gmail.commailto:matthieu.bruc...@gmail.com wrote: Hi, You may just divide them by 1000? Matthieu 2010/7/26 Waléria Antunes David waleriantu...@gmail.commailto:waleriantu...@gmail.com: Hello all, I need to format the values of graphic to KHz.my values are in Hz see at idle python it displays the values as: 3000 3050 3100 3400 , but I need to go where it will be displayed KHz: 3.0 3.1 can someone help me? -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://ad.doubleclick.net/clk;226879339;13503038;l? http://clk.atdmt.com/CRS/go/247765532/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.netmailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Information System Engineer, Ph.D. Blog: http://matt.eifelle.com LinkedIn: http://www.linkedin.com/in/matthieubrucher -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://ad.doubleclick.net/clk;226879339;13503038;l? http://clk.atdmt.com/CRS/go/247765532/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.netmailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- AJC McMorland Post-doctoral research fellow Neurobiology, University of Pittsburgh -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://ad.doubleclick.net/clk;226879339;13503038;l? http://clk.atdmt.com/CRS/go/247765532/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 80
I submitted a correction to the code in your pastebin link below. Revisit the link (http://pastebin.com/vSbkXDzE) and run that code. -paul - From: Waléria Antunes David [mailto:waleriantu...@gmail.com] Sent: Thursday, July 29, 2010 12:08 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 80 Hi , I made the changes as bellow and it displays the x-axis values formatted as expected, see my current image and my code. But, now i need to change the scale and the numbers of decimal places in order to appear on the graph like this: 3.0 3.1 3.2 .. 3.4 My code: http://pastebin.com/vSbkXDzE Can you help me? -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 80
Whoops. That didn't stick like I thought it would. Try here: http://pastebin.com/rJtUuWne -paul From: Paul Hobson Sent: Thursday, July 29, 2010 5:46 PM To: Waléria Antunes David; matplotlib-users@lists.sourceforge.net Subject: RE: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 80 I submitted a correction to the code in your pastebin link below. Revisit the link (http://pastebin.com/vSbkXDzE) and run that code. -paul - From: Waléria Antunes David [mailto:waleriantu...@gmail.com] Sent: Thursday, July 29, 2010 12:08 PM To: matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 80 Hi , I made the changes as bellow and it displays the x-axis values formatted as expected, see my current image and my code. But, now i need to change the scale and the numbers of decimal places in order to appear on the graph like this: 3.0 3.1 3.2 .. 3.4 My code: http://pastebin.com/vSbkXDzE Can you help me? -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users