[Matplotlib-users] Inset plot with a previously draw plot
Hi, I have a previously draw plot that I want to place as an inset in another figure. I've tried with passing the previously drawn axes as the `axes` parameter to the `add_axes` method of the figure, and also tried using the `set_axes` method of the new axes, without success: I get the new inset axes, but without the previously drawn plot, in both cases. The following code shows both approaches: # Passing the inset axes as a parameter to add_axes fig_in, ax_in = plt.subplots() ax_in.plot([1,2,3]) fig, ax = plt.subplots() ax.plot([1,2,1]) fig.add_axes([0.72, 0.72, 0.16, 0.16], axes=ax_in) # Using set_axes fig_in, ax_in = plt.subplots() ax_in.plot([1,2,3]) fig, ax = plt.subplots() ax.plot([1,2,1]) ax_new = fig.add_axes([0.72, 0.72, 0.16, 0.16]) ax_new.set_axes(ax_in) Any help with this will be appreciated. Regards, Alejandro -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Make markers in legend to appear only once
Hi: I am plotting using markers, in a similar way than this example: http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo2.html As you can see in the example above, the markers in the legend appear twice: " 'green circle' 'green circle' oscillatory". Is it possible to make the markers to appear only once, like " 'green circle' oscillatory" ? Regards, Alejandro. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Make markers in legend to appear only once
On Mon, Dec 1, 2008 at 7:13 AM, Manuel Metz <[EMAIL PROTECTED]> wrote: > You can use the keyword "numpoints" in the legend method: Thank you! It did the trick. Now how you conclude that from the documentation is a mystery: >From the docs: " numpoints: integer The number of points in the legend line, default is 4" Regards, Alejandro. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Bug in ubuntu intrepid
Hi: Is anybody aware of the MPL bug on Ubuntu intrepid? https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/299381 Basically you get a warning when import pylab. Beside the warnings things seems to work OK. Is there a workaround for this? Regards, Alejandro. -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Bug in ubuntu intrepid
On Mon, Dec 15, 2008 at 11:22 AM, Alejandro Weinstein wrote: > Is anybody aware of the MPL bug on Ubuntu intrepid? > > https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/299381 The problem is caused by outdated *.pyc files. The solution is sudo python -c 'import matplotlib' -- SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. The future of the web can't happen without you. Join us at MIX09 to help pave the way to the Next Web now. Learn more and register at http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] RuntimeError('main thread is not in main loop', ) after terminating a multithread program
Hi: I have a multithread program. One of the thread is using MPL to plot some data. Everything works as expected, until the moment I terminate the program. When the main thread terminate, I start getting this message: Exception exceptions.RuntimeError: RuntimeError('main thread is not in main loop',) in > ignored I get 8 of this message, and then the program finally stop. I am stopping the thread before terminating. I also close the figure. All the threads are running as Daemons (thread_instance.setDaemon(True) ). Any idea about what could be happening? Regards, Alejandro. -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] No zdata in motion_notify_event when using a 3D plot
Hi: I am trying to use the event associated to motion_notify_event in a 3D plot, and I found that the event does not have the zdata property. The following code illustrate the problem: ## from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt def on_hover(event): print dir(event) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') x = [1, 2, 3] y = [1, 5, 4] z = [3, 5, 6] ax.scatter(x, y, z) cid = fig.canvas.mpl_connect('motion_notify_event', on_hover) plt.show() ## When you move the mouse over the figure, you can see the properties of event: ['__doc__', '__init__', '__module__', '__str__', '_update_enter_leave', 'button', 'canvas', 'dblclick', 'guiEvent', 'inaxes', 'key', 'lastevent', 'name', 'step', 'x', 'xdata', 'y', 'ydata'] There is xdata, ydata, but not zdata. Is zdata missing or should I be using a different event type? Alejandro. -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Upgrade from 1.0.1 to 1.1.0, not quite working
On Thu, Nov 10, 2011 at 11:04 PM, John Ladasky wrote: > But when I started a Python shell, imported, and then printed > matplotlib.__version__, I got 1.0.1. > > Must I explicitly uninstall the older revision somehow? I don't know > how to do this. > Something similar happened to me a few days ago. I followed this instructions http://matplotlib.sourceforge.net/faq/installing_faq.html#how-to-completely-remove-matplotlib to completely remove matplotlib, and then I rebuilt the latest version from source. Alejandro. -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] I get a warning when running code with ipython, but not with python
Hi: I just installed matplolib from source code, and Ipython using pip, in Ubuntu 11.10. When I run this code ### foo.py import matplotlib.pyplot as plt plt.plot([1,2,3,4]) plt.ylabel('some numbers') plt.show() ## in ipython, I get the following warning: In [1]: %run foo.py /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:54: Warning: ignoring sys.argv: it must be a list of strings _gtk.init_check() Other than the warning the plot looks OK. Also, if I type each sentence in ipython, I don't get the warning. I don't get a warning if I use the standard python interpreter either (as in $ python foo.py). Any clue about this? Should I report this in the Ipython mailing list? I am running Ipython 0.11 and matplotlib 1.2.x. Alejandro -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] I get a warning when running code with ipython, but not with python
On Mon, Nov 14, 2011 at 7:11 AM, Michael Droettboom wrote: > This looks like a bug for the IPython folks. If you make a file > containing only "import gtk" and "%run" that file, one gets the same error. It is a bug of IPython 0.11. The problem is solved in 0.12. See http://mail.scipy.org/pipermail/ipython-user/2011-November/008734.html for the details. Alejandro. -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] How to switch to v1.1.0 after upgrade
On Tue, Nov 15, 2011 at 2:45 PM, Y.Wu wrote: > Hi, all > I have installed v1.1.0 from source code at : > /usr/local/lib/python2.6/dist-packages/matplotlib > But whenever I am using python test.py, it still refers to the old v0.99. > could you please tell me how to update to the new version ? Here are some instructions to uninstall a previous version: http://matplotlib.sourceforge.net/faq/installing_faq.html#how-to-completely-remove-matplotlib Alejandro. -- RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Incorrect latex rendering for \hat{x} and \vec{x}
Hi: I am getting incorrect renderings when using \hat{x} or \vec{x}. The following code # import matplotlib.pylab as plt plt.axes([0.1, 0.15, 0.8, 0.75]) plt.plot(range(10)) plt.xlabel(r'$\hat{y}$ $\vec{x}$ $x^2 + y^2$', fontsize=20) plt.show() # produce the attached plot. Note that the "hat" and the "arrow" are in the wrong place. The other Latex part looks OK. I am running version 1.2.x (built from commit 11e528425e230a3e23d04202aea23d88d40d9c4c) and Ubuntu 11.10. Any ideas about how to solve the problem? Alejandro. <>-- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Incorrect latex rendering for \hat{x} and \vec{x}
On Wed, Dec 14, 2011 at 10:20 AM, Peter Liebetraut wrote: > Hi > > Latex rendering looks OK here. > >> In [9]: matplotlib.__version__ >> Out[9]: '1.0.0' Just updated to the last version from github, and now works OK. -- 10 Tips for Better Server Consolidation Server virtualization is being driven by many needs. But none more important than the need to reduce IT complexity while improving strategic productivity. Learn More! http://www.accelacomm.com/jaw/sdnl/114/51507609/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] cycling mechanism
> 2) I also have the need to implement line-style cycling for b&w > publications. What about also grey level cycling for b&w? Sometimes for b&w it looks better to use different gray levels rather than different line-styles. See this for an example: http://media.aau.dk/null_space_pursuits/2011/06/recovery-of-compressively-sensed-sparse-signals-in-noise-pt-2.html Alejandro. -- Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex infrastructure or vast IT resources to deliver seamless, secure access to virtual desktops. With this all-in-one solution, easily deploy virtual desktops for less than the cost of PCs and save 60% on VDI infrastructure costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Error when saving as PDF using $\alpha$ and 'text.usetex':True
Hi: I am getting an error when I save a figure as PDF with a particular configuration and when I use a greek latex leter (say $\alpha$) as a ylabel. The following code illustrates the problem. ### import matplotlib.pyplot as plt import matplotlib as mpl params = { 'text.usetex' : True, 'font.family': 'serif', 'font.serif' : ['Times'], } mpl.rcParams.update(params) plt.figure() plt.plot([1,2,3]) plt.ylabel(r'$\alpha$') plt.savefig('f1.pdf') ### When I run it I get Traceback (most recent call last): File "multipage_pdf.py", line 14, in plt.savefig('f1.pdf') File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 472, in savefig return fig.savefig(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/matplotlib/figure.py", line 1173, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 2027, in print_figure **kwargs) File "/usr/local/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 1799, in print_pdf return pdf.print_pdf(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 2187, in print_pdf file.close() File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 470, in close self.writeFonts() File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 557, in writeFonts fonts[Fx] = self.embedTeXFont(filename, self.dviFontInfo[filename]) File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_pdf.py", line 622, in embedTeXFont t1font = t1font.transform(fontinfo.effects) File "/usr/local/lib/python2.7/dist-packages/matplotlib/type1font.py", line 301, in transform buffer.write(value) TypeError: unicode argument expected, got 'str' Note that with any of the following variations the code works as expected: - If I use plt.ylabel(r'$x_2$') instead of plt.ylabel(r'$\alpha$). - If I save as PNG instead of PDF. - Use the default configuration (comment the mpl.rcParams.update(params) line). I am using MPL verion 1.2.x (built from commit 396a6446). Am I doing something wrong? Any idea how to solve it? Alejandro. -- Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Error when saving as PDF using $\alpha$ and 'text.usetex':True
On Thu, Mar 8, 2012 at 12:45 PM, Jouni K. Seppänen wrote: > Alejandro Weinstein writes: > >> TypeError: unicode argument expected, got 'str' >> I am using MPL verion 1.2.x (built from commit 396a6446). > > That reminds me of a problem fixed in commit 680edf7, so could you > either try cherry-picking that commit or updating to a later revision? > Your test case doesn't produce an error on a recent-ish master. You're right. Just updated to the last version and the problem is gone. Thanks! Alejandro. -- Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] latex bug/feature in labels?
On Wed, Mar 14, 2012 at 5:38 PM, Will Grainger wrote: > Not sure if this is a bug or a feature, but > xlabel (and ylabel) doesn't honour the rcParams['font.size'] > parameters. I think xlabel and ylabel honor rcParams['axes.labelsize']. Alejandro. -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Matplotlib in Latex documents
On Wed, Apr 25, 2012 at 6:54 AM, Peter Würtz wrote: > I'm having trouble when creating plots for use in latex documents. I use the following setup (under Ubuntu, in case that matters): params = {'backend': 'Agg', 'ps.usedistiller' : 'xpdf', 'text.usetex' : True, 'font.family': 'serif', 'font.serif' : ['Times'], } mpl.rcParams.update(params) I am not sure if all of them are necessary. I made all the figures in this paper using these parameters: http://arxiv.org/pdf/1110.5063v1 Alejandro. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Problem/Bug with Text rendering With LaTeX
On Sun, May 20, 2012 at 4:14 PM, Yang Zhang wrote: > Recently I have tried to use latex to render all the texts in a plot for > consistent look with other texts in a paper. However, it seems that all the > texts in the plot are rendered in bold font. Please see the attached code. Can you try with the following setup? params = {'backend': 'Agg', 'ps.usedistiller' : 'xpdf', 'text.usetex' : True, 'font.family': 'serif', 'font.serif' : ['Times'], } mpl.rcParams.update(params) I made all the figures in this paper using these parameters: http://arxiv.org/pdf/1110.5063v1 Alejandro -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] default backend on 1.2.0rc1 and master
On Wed, Oct 17, 2012 at 1:41 AM, Eric Firing wrote: > sudo apt-get build-dep python-matplotlib > > It might pull in more than you really want, but it will certainly > include gui toolkits. If you want to avoid installing all the packages that you get with the `apt-get build-dep pythoh-matplotlib`, the following seems to be enough: sudo apt-get install libfreetype6-dev libpng12-dev python-tk tk-dev python-gtk2-dev Alejandro. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Plot data from file while is file is constantly updated
If you are in a Linux machine, you can use `inotify`: "Inotify (inode notify) is a Linux kernel subsystem that acts to extend filesystems to notice changes to the filesystem". It seems that there are a few option to use this from Python: http://pyinotify.sourceforge.net/ http://code.activestate.com/recipes/576375-low-level-inotify-wrapper/ Alejandro. On Thu, Nov 8, 2012 at 1:34 AM, Sebastian Rhode wrote: > Hi, > > I have a textfile where every second a line is written. Usually the look > like this: > > 1; 124; 455 > > a second later > > 1; 124; 455 > 2; 104; 600 > > ... > > Finally such a file is quite easy to plot using matplotlib. But what would > be very useful for me is a script, that is watching the TXT file and updates > the plot when a new row "arrives". Any good ideas? > > Cheers, > > Sebi > > > -- > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_nov > ___ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Clipped colorbar values in matshow
On Mon, Jan 14, 2013 at 10:39 AM, Paul Hobson wrote: > Does the call to tight_layout() fig your problem? Actually, I just realized that is not tight_layout() what fixed my problem, but using ax.matshow instead of plt.matshow. The following code produces an unclipped colorbar: A = np.random.rand(100,10) / 100 fig, ax = plt.subplots() img = ax.matshow(A) plt.colorbar(img) plt.show() Alejandro. -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] "Sorry, could not import Basemap" in http://matplotlib.org/users/screenshots.html
Hi: I just want to report that in the screenshots section of the website (http://matplotlib.org/users/screenshots.html), in the Basemap demo (http://matplotlib.org/users/screenshots.html#basemap-demo) section, instead of the plot there is a message saying "Sorry, could not import Basemap". Alejandro. -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Use a marker symbol in a text string
Hi: I want to use the symbol corresponding to a marker in a text annotation. Something like textstr = 'This is the square marker: ?' ax.text(0.05, 0.95, textstr) Is there something I can place where the question mark is above to get the actual square (or any other of the symbols you can use as a marker)? This is similar to what the legend command does, but I need more flexibility. Alejandro. -- Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Use a marker symbol in a text string
On Tue, Nov 23, 2010 at 8:15 PM, Nicolas Bigaouette wrote: > Why not just use latex? > plt.text(0.05, 0.95, r"This is the square marker: $\Box$ Subscript: $_\Box$ > superscript: $^\Box$", fontsize=20) It produces the following error: Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 212, in resize self.show() File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py", line 215, in draw FigureCanvasAgg.draw(self) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 314, in draw self.figure.draw(self.renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *kl) File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 773, in draw for a in self.axes: a.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *kl) File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1735, in draw a.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/text.py", line 515, in draw bbox, info = self._get_layout(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/text.py", line 279, in _get_layout clean_line, self._fontproperties, ismath=ismath) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 156, in get_text_width_height_descent self.mathtext_parser.parse(s, self.dpi, prop) File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line 2810, in parse box = self._parser.parse(s, font_output, fontsize, dpi) File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line 2259, in parse self._expression.parseString(s) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 1048, in parseString loc, tokens = self._parse( instring, 0 ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 981, in _parseCache value = self._parseNoCache( instring, loc, doActions, callPreParse ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 924, in _parseNoCache loc,tokens = self.parseImpl( instring, preloc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 2559, in parseImpl return self.expr._parse( instring, loc, doActions, callPreParse=False ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 981, in _parseCache value = self._parseNoCache( instring, loc, doActions, callPreParse ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 924, in _parseNoCache loc,tokens = self.parseImpl( instring, preloc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 2307, in parseImpl loc, exprtokens = e._parse( instring, loc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 981, in _parseCache value = self._parseNoCache( instring, loc, doActions, callPreParse ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 924, in _parseNoCache loc,tokens = self.parseImpl( instring, preloc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 2672, in parseImpl loc, tokens = self.expr._parse( instring, loc, doActions, callPreParse=False ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 981, in _parseCache value = self._parseNoCache( instring, loc, doActions, callPreParse ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 924, in _parseNoCache loc,tokens = self.parseImpl( instring, preloc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 2307, in parseImpl loc, exprtokens = e._parse( instring, loc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 981, in _parseCache value = self._parseNoCache( instring, loc, doActions, callPreParse ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 924, in _parseNoCache loc,tokens = self.parseImpl( instring, preloc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 2416, in parseImpl ret = e._parse( instring, loc, doActions ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 981, in _parseCache value = self._parseNoCache( instring, loc, doActions, callPreParse ) File "/usr/lib/pymodules/python2.6/matplotlib/pyparsing.py", line 950, in _parseNoCache tokens = fn( instring, tokensStart, retTokens ) File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line 1997, in raise_error raise ParseFatalException(msg + "\n" + s) ParseFatalException: Expected end of math '$' This is the square marker: $\Box$ Subscript (at char 0), (line:1, col:1) --
Re: [Matplotlib-users] Use a marker symbol in a text string
On Tue, Nov 23, 2010 at 9:37 AM, Gökhan Sever wrote: > As I have learnt from Michael Droettboom, you can simply use unicode > characters with a supported font set: > In my setup I prefer DejaVu-Sans. First install these fonts into your > system, then edit your matplotlibrc Thanks for the answer. But I think there must be an easier way without the need to install anything. After all, the legend command is able to create text using the markers. Alejandro. -- Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Using legend with a stem plot
Hi: I want to add a legend to a stem plot with two plots. The basic code is: ### from pylab import * x = [1,2,3,4,5] y1 = [1, 2, 3, 4, 5] y2 = [5, 4, 3, 2, 1] subplot(211) plot(x, y1, 'rx-') plot(x, y2, 'bx-') legend(('a', 'b')) subplot(212) stem(x, y1, 'r') stem(x,y2, 'b') legend(('a', 'b')) show() ### The left subplot is the same plot using plot instead of stem. You can see the result here: http://imagebin.org/128376 . I expect the legend for the stem case to look similar to the plot case, however, for the stem, I get the two labels of the legend associated with the first stem command: 'a' linked to the marker and 'b' linked to the stem line. Is there any way to fix this? Is this a bug? Alejandro. -- Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Using legend with a stem plot
On Wed, Jan 5, 2011 at 9:24 PM, Benjamin Root wrote: > To prevent it from getting lost, could you please > file a report on our bug tracker? Done: https://sourceforge.net/tracker/?func=detail&aid=3152447&group_id=80706&atid=560720 I think the right behavior should mimic what Matlab does. I added the plot generated by Matlab in the bug report. Alejandro. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Using legend with a stem plot
On Thu, Jan 6, 2011 at 7:20 AM, Jae-Joon Lee wrote: > I think this should be more like a feature request (rather than a > bug). Legend only support simple artists such as > lines/patches/collections. I disagree about this not being a bug. I understand that it can be difficult to implement, however legend produce the wrong result. >This is mentioned in the documentation > (http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.legend) > but may be not explicit enough. I couldn't find any reference about this in the documentation. Alejandro. -- Learn how Oracle Real Application Clusters (RAC) One Node allows customers to consolidate database storage, standardize their database environment, and, should the need arise, upgrade to a full multi-node Oracle RAC database without downtime or disruption http://p.sf.net/sfu/oracle-sfdevnl ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Stair plot
Hi: Any suggestion for making a stair plot in Matplotlib (like the stairs function in Matlab)? The attached figure is the output of the following Matlab commands: x = 0:10; stairs(x); I guess it is a matter of using a zero-order hold interpolation rather than linear interpolation between the points in the plot command, but I haven't find how to do that. Alejandro. <>-- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Stair plot
On Wed, Feb 9, 2011 at 1:23 PM, Paul Ivanov wrote: > no need for interpolation - just use plt.step: Thanks! Just what I need it. Any reason for the step function not appearing in the main Matplotlib page (http://matplotlib.sourceforge.net/)? Alejandro. -- The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Animating selected plot elements
Hi: I am trying to use this code http://tinyurl.com/44zcpfk (Scipy cookbook) to make an animation where the background is fix and only a line is updated. However, after executing the code, I only get a window with an empty plot. Some debugging shows that the update_line function is not being called. I changed the use of numerix by numpy with respect to the original code. Other than that is the same. Any advice on how to fix the problem? Or may be this way is obsolete, but all the animation examples I've found so far don't consider a fixed background. Alejandro. -- Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Animating selected plot elements
On Mon, Apr 4, 2011 at 4:46 PM, Alejandro Weinstein wrote: > Any advice on how to fix the problem? Or may be this way is obsolete, > but all the animation examples I've found so far don't consider a > fixed background. Adding import matplotlib matplotlib.use('GTKAgg') solved the problem. But now I get this warning: /usr/lib/pymodules/python2.6/matplotlib/backends/backend_gtk.py:621: DeprecationWarning: Use the new widget gtk.Tooltip self.tooltips = gtk.Tooltips() I am running Ubuntu 10.04, with MPL version 0.99.1.2-3ubuntu1, in case that matter. Alejandro. -- Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Animating selected plot elements
On Mon, Apr 4, 2011 at 6:14 PM, Drew Frank wrote: > This will not address your immediate problem with update_line not > being called, but if you want to animate something over a non-blank > background you will soon run into another issue. I posted here about > that issue a while back: > http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg19104.html > > To aid future web searchers, here is my final reply to that thread, > which I accidentally sent to Benjamin Root rather than to the list: > "The way the cookbook example is written (calling copy_from_background > early), it will always copy a blank, white region -- even if > non-animated elements have been plotted prior to the call. This > caused problems for me because I wanted to animate some patches on the > top of a non-blank background, but calling restore_from_region just > overwrote my background with white." > > Drew Frank I also needed to use Frank's approach (described in the link above) to make my animation works. Is it possible to fix the code in the cookbook? I tried to edit the page but I am not allowed. Alejandro. -- Xperia(TM) PLAY It's a major breakthrough. An authentic gaming smartphone on the nation's most reliable network. And it wants your games. http://p.sf.net/sfu/verizon-sfdev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Can't render the \dagger LaTex symbol
Hi: I am having problems with the \dagger LaTex symbol. The following code import matplotlib.pyplot as plt plt.plot([1,2,3]) plt.title(r'$ \dagger $') plt.show() produce a long Traceback that ends in File "/usr/lib/pymodules/python2.6/matplotlib/mathtext.py", line 1997, in raise_error raise ParseFatalException(msg + "\n" + s) ParseFatalException: Expected end of math '$' $ \dagger $ (at char 0), (line:1, col:1) Other LaTex symbols works OK. For instance, if I use plt.title(r'$ \diamond $') instead, it works. I checked in mathtext.py, and \dagger is in the list of symbols. I am running Matplotlib '0.99.1.1'. Any idea about this problem? Alejandro. -- Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsisghtdev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users