[Matplotlib-users] duplicate matplotlib figure
Hello, Suppose I create a matplotlib figure and plot things in it. In pylab it would be like: from pylab import * figure(1) plot([1,2,3],[1,2,3],'r*',label='label1') plot([1,2,3],[2,3,4],'r',label='label2') legend(loc='upper right') text(1.2,3,'nice figure') xlabel('xlabel') ylabel('ylabel') show() Now, after creating figure(1), I would like to make figure(2) that is completely identical to figure(1). is this possible? Does anyone know how? Thanks, Eli -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] legend font weight with TeX
Hello, I am using pylab with the rc parameter rcParams['text.usetex']=True Now, I would like to make a legend with bold fonts. So, I tried two options: 1) from matplotlib.font_manager import fontManager, FontProperties font= FontProperties(weight='bold',size=26) plot([1,2,3],[1,2,3],'k',label='label1') legend(loc='lower left', prop=font) 2) After the legend(loc='lower left', prop=font) statement, I put: legend1=gca().get_legend() ltext = legend1.get_texts() # all the text.Text instance in the legend setp(ltext, fontweight='bold') # the legend text fontsize Neither of these options changed the legend font weight to bold. How can this be done? How to change the legend font weight when rcParams['text.usetex']=True ? Thanks, Eli -- 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] legend font weight with TeX
Thanks, label=r'$\bf{label1}$' worked. Regards, Eli On Tue, Apr 5, 2011 at 10:14 PM, Darren Dale dsdal...@gmail.com wrote: On Tue, Apr 5, 2011 at 2:51 PM, Eli Brosh ebro...@gmail.com wrote: Hello, I am using pylab with the rc parameter rcParams['text.usetex']=True Now, I would like to make a legend with bold fonts. So, I tried two options: 1) from matplotlib.font_manager import fontManager, FontProperties font= FontProperties(weight='bold',size=26) plot([1,2,3],[1,2,3],'k',label='label1') legend(loc='lower left', prop=font) 2) After the legend(loc='lower left', prop=font) statement, I put: legend1=gca().get_legend() ltext = legend1.get_texts() # all the text.Text instance in the legend setp(ltext, fontweight='bold') # the legend text fontsize Neither of these options changed the legend font weight to bold. How can this be done? How to change the legend font weight when rcParams['text.usetex']=True ? I think you may have to do something like label=r'\textbf{label1}'. -- 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] convert figure from color to BW/grayscale
Hello Friedrich, I tried your second solution: figure = matplotlib.figure.Figure() ... do plotting ... ... save as colour ... figure.set_gray(True) ... save as b/w ... but it gives me an error message: fig.set_gray(True) AttributeError: 'Figure' object has no attribute 'set_gray' I got the same error message when trying in in pylab as: fig1=gcf() fig1.set_gray(True) and when generating the figure with the command fig1 = matplotlib.figure.Figure() I am using matplotlib 0.99.1.1 on ubuntu 10.04/ Is there another way to do it? Thanks, Eli On Mon, Sep 20, 2010 at 11:14 AM, Friedrich Romstedt friedrichromst...@gmail.com wrote: 2010/9/20 Eli Brosh ebro...@gmail.com: Hello, I need to prepare two versions of figures: color and BW(BlackWhite). Is there an easy way to produce just the colored version and than use some command or script to turn it to BW or grayscale? I thought that converting from color to BW really means: in all object in the figure, turn any color that is not white to black. Is there an easy way to implement this? http://github.com/friedrichromstedt/matplotlib I implemented a RC setting 'gray'. Turn it on by setting either matplotlib.rcParams['gray'] = True or by setting it in your matplotlibrc file. You can also gray out any artist (e.g., the figure), by calling artist.set_gray(True). figure = matplotlib.figure.Figure() ... do plotting ... ... save as colour ... figure.set_gray(True) ... save as b/w ... If you're using pyplot or pylab, I'm not sure, but I think there is a function gcf() which gives you the current figure object so that you can turn gray on there. pylab support should be placed on the TODO list, I would appreciate feedback on the preferred pylab way, since I'm not a pylab user at all. I think a pylab function gray(boolean) would do it. It's beta, so try it out. It's tested, though. Friedrich -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] textured bar-chart
Thank you John and Ryan, I like the hatching solution very much. Eli On Mon, Sep 20, 2010 at 3:48 PM, John Hunter jdh2...@gmail.com wrote: On Mon, Sep 20, 2010 at 8:43 AM, Ryan May rma...@gmail.com wrote: It's not what one would call a turn-key solution, but it is possible: http://matplotlib.sourceforge.net/examples/pylab_examples/demo_ribbon_box.html There is also hatching http://matplotlib.sourceforge.net/examples/pylab_examples/hatch_demo.html JDH -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] convert figure from color to BW/grayscale
OK, This worked for me for turning the figure to black and white: After saving the figure in colors I write fig=gcf() for o in fig.findobj(matplotlib.lines.Line2D): o.set_color('k') for o in fig.findobj(matplotlib.text.Text): o.set_color('k') Than I save it as black and white. It is beyond my programming skills, but I wish we could have a built in function of this type. Perhaps as: Fig_BW=makeBW(fig) Regards, Eli On Mon, Sep 20, 2010 at 6:19 PM, Benjamin Root ben.r...@ou.edu wrote: On Mon, Sep 20, 2010 at 11:13 AM, Eli Brosh ebro...@gmail.com wrote: Hello Friedrich, I tried your second solution: figure = matplotlib.figure.Figure() ... do plotting ... ... save as colour ... figure.set_gray(True) ... save as b/w ... but it gives me an error message: fig.set_gray(True) AttributeError: 'Figure' object has no attribute 'set_gray' I got the same error message when trying in in pylab as: fig1=gcf() fig1.set_gray(True) and when generating the figure with the command fig1 = matplotlib.figure.Figure() I am using matplotlib 0.99.1.1 on ubuntu 10.04/ Is there another way to do it? Thanks, Eli Eli, the feature is highly experimental, and is available only though fork of matplotlib that Friedrich made in the link he provided you. You would have to install that matplotlib from its source at that link. Ben Root -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] convert figure from color to BW/grayscale
Hello, I need to prepare two versions of figures: color and BW(BlackWhite). Is there an easy way to produce just the colored version and than use some command or script to turn it to BW or grayscale? I thought that converting from color to BW really means: in all object in the figure, turn any color that is not white to black. Is there an easy way to implement this? Thanks Eli -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] textured bar-chart
Hello, I need to prepare a blackwhite bar chart with several sets of bars. Now, I have white bars and black bars but I need more colorings that are distinguishable in blackwhite. Is it possible to make bars filled with some texture or tiling or a grid? Excel has this function but I could not find a way to do it in python/matplotlib. Thanks, Eli -- Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] RectangleSelector on demand
Hello, I am trying to use the RectangleSelector widget. In the corresponding example http://matplotlib.sourceforge.net/examples/widgets/rectangle_selector.html the rectangle selector is activated every time I click inside the axes. However, I would like to activate it on demand. For example, suppose there is a choice-box (using a simple gui like easygui). One of the possible choices would be select rectangle. I would like the RectangleSelector to be activated only after the select rectangle option is chosen and deactivated after one rectangle selection. It should be activated again only after the choice-menu is presented again and the selected rectangle option is chosen again. The MATLAB equivalent to what I need is the command rbbox http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/rbbox.html It can be activated on demand, in a norma linear program and not just in event-driven GUI. Is there a way to get the same functionality from matplotlib ? Thanks Eli -- 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] half-filled markers
Thanks John, A kwarg fillstyle with options 'full|top|bottom|left|right' for any marker is certainly better than what i have done. I just did not have an idea how to program this kwarg. Further, I can't see an easy way of generalizing the half-filling of markers. is there a better way than just programming each half-filled marker separately ? Perhaps if you can give me some hints, I can try to do the rest of the work. Eli On Sat, Jul 11, 2009 at 4:28 PM, John Hunter jdh2...@gmail.com wrote: On Sat, Jul 11, 2009 at 3:43 AM, Eli Broshebro...@gmail.com wrote: Hello, A few weeks earlier I was asking whether it is possible to plot half-filled markers in matplotlib. As I got no answers I tried to do it myself. There are several ways to do it. For example, I considered following the example in http://matplotlib.sourceforge.net/examples/api/scatter_piecharts.html but with the approach described there I could not reproduce the custom marker in the legend. The approach that did work was to modify the lines.py file in the matplotlib folder. My version of the file is attached with several new markers added. The implementation is not very elegant but half-filled markers are quite useful when plotting lots of data. Does anyone have a better idea for the implementation of half-filled markers in matplotlib ? This looks interesting, and the functionality is certainly nice, but it looks like a brute force hammer approach when a scapel might be preferable, For example, what if we introduce a new kwarg fillstyle with options 'full|top|bottom|left|right' so *any* marker could be half filled. This would result in both less code and more functionality. If you are interested in tackling this, I'd be happy to consider a patch. Please see http://matplotlib.sourceforge.net/faq/howto_faq.html#submit-a-patch JDH -- Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] half-filled markers
Hello, Is there a way to plot half-filled markers in matplotlib ? For example, I would like to use a circle marker, lower half filled in black while the upper half is white. Thanks, Eli -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] contour coordinates
Hello again, I finally found the command I was looking for. It is the to_polygons(). Here is what worked : # make a LineCollection of contours col=contour(X,Y,Z,LevelsNumber).collections for i in np.arange(0,LevelsNumber,1): polygoni=col[i].get_paths()[0].to_polygons()[0] print polygoni All the vertices in each collections are extracted to the polygoni. Thanks again to Jeff and Patrick ! By the way, I found out that I do not actually need this procedure to achieve may goal which was to make a contour plot in ternary coordinates. Eli On Tue, Jan 27, 2009 at 11:08 PM, Patrick Marsh patrickmars...@gmail.comwrote: On Tue, Jan 27, 2009 at 7:16 PM, Eli Brosh ebro...@gmail.com wrote: Many thanks to Jeff and to Patric ! I will try to work along the line suggested by Jeff. Patric, please send me your code. I hope to learn from it. Thanks again, Eli Here is a template that can be used. I use this for meteorological models, but should work with any gridded file. import numpy as np from mpl_toolkits.basemap import Basemap f = (some gridded file) X = np.array(grab longitudes from f) Y = np.array(grab latitudes from f) field = np.array(grab field to be contoured from f) map = Basemap(make a Basemap call here) level = np.arange(minval, maxval, interval) col = map.contour(X, Y, field, level).collections for vertex in col[i].get_paths():# GET THE PATHS FOR THE EACH CONTOUR BY LOOPING THROUGH CONTOURS for vertex in xy.vertices: # ITERATE OVER THE PATH OBJECTS x, y = map(vertex[0],vertex[1],inverse=True) # vertex[0] and now 'x' is the longitude of the vertex and vertex[1] and now 'y' is the latitude of the vertex Let me know how this works. -Patrick On Tue, Jan 27, 2009 at 7:09 PM, Patrick Marsh patrickmars...@gmail.com wrote: On Tue, Jan 27, 2009 at 5:33 PM, Jeff Whitaker jsw...@fastmail.fm wrote: Eli Brosh wrote: Hello, I am trying to extract the coordinates of contour lines. I tried the following: cs = *contour*(Z) for lev, col in zip(cs.levels, cs.collections): s = col._segments that I found in a previous post (title contouring, by Jose Gómez-Dans-2 http://www.nabble.com/user/UserProfile.jtp?user=30071 Nov 30, 2007; 07:47am ) . I hoped that s will be a list of numpy arrays, each containing the (x,y) vertices defining a contour line at level lev. However, I got an error message: AttributeError: 'LineCollection' object has no attribute '_segments' How is it possible to get coordinates of the contours, similar to the MATLAB command [C,H] = *CONTOUR*(...) where the result in C is the coordinates of the contours. A similar question appeared in a post contour data (by Albert Swart http://www.nabble.com/user/UserProfile.jtp?user=382945 May 17, 2006; 09:42am) but I could not understand the answer. Is it possible to get more specific directions with a simple example ? Thanks Eli Eli: Calling get_paths() on each line collection in CS.collections will return a list of Path objects. From the Path objects, you can get a Nx2 array of vertices from the vertices attribute. There are no examples that I know of, but if you get it to do what you want to do, it would be great if you could contribute an example. As you noted, this question has come up several times before. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX: (303)497-6449 NOAA/OAR/PSD R/PSD1Email : jeffrey.s.whita...@noaa.gov 325 BroadwayOffice : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users I'm not sure if this is entirely what you (Eli) are looking for, but I have code that will contour model data on a map and then extract the lat,lon pairs of all the vertices. If this is what you are looking for, I'm happy to share what I've done. -Patrick -- Patrick Marsh Graduate Research Assistant School of Meteorology University of Oklahoma http://www.patricktmarsh.com -- Patrick Marsh Graduate Research Assistant School of Meteorology University of Oklahoma http://www.patricktmarsh.com -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf
[Matplotlib-users] contour coordinates
Hello, I am trying to extract the coordinates of contour lines. I tried the following: cs = *contour*(Z) for lev, col in zip(cs.levels, cs.collections): s = col._segments that I found in a previous post (title contouring, by Jose Gómez-Dans-2http://www.nabble.com/user/UserProfile.jtp?user=30071 Nov 30, 2007; 07:47am ) . I hoped that s will be a list of numpy arrays, each containing the (x,y) vertices defining a contour line at level lev. However, I got an error message: AttributeError: 'LineCollection' object has no attribute '_segments' How is it possible to get coordinates of the contours, similar to the MATLAB command [C,H] = *CONTOUR*(...) where the result in C is the coordinates of the contours. A similar question appeared in a post contour data (by Albert Swarthttp://www.nabble.com/user/UserProfile.jtp?user=382945 May 17, 2006; 09:42am) but I could not understand the answer. Is it possible to get more specific directions with a simple example ? Thanks Eli -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] default mathtext font
Thank you Michael, I tried switching the matplotlib font to Dejavu Sans but it also does not seem to recognize the lunate epsilon ϵ. When I wrote title(u'ϵ-Fe'), it printed ε-Fe instead. I tried several other fonts but the problem did not disappear. It seems that the bes choice after all is to write r'$\rm{\epsilon-Fe}$'. Thanks again Eli On Thu, Jul 31, 2008 at 9:03 AM, Michael Droettboom [EMAIL PROTECTED] wrote: (Sorry for the delay -- just back from vacation) It looks like the default Vera Sans font that matplotlib uses doesn't actually have the lunate epsilon character. If you have it installed, you could have matplotlib use the DejaVu Sans font instead (which is essentially Vera Sans with a larger set of characters). In your matplotlibrc, set font.sans to DejaVu Sans Cheers, Mike Eli Brosh wrote: Thanks, This unicode thing works like magic. The only thing I am still unable to do is to insert the symbol \epsilon (as distinct from \varepsilon). For some reason, the varepsilon ε is printed fine, but a blank square is printed instead of the lunate epsilon ϵ. That is u' ε ' works, while u' ϵ' does not. Any idea why this is happening ? Eli 2008/7/22 Michael Droettboom [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Yes, you would put it at the top of your .py file. In order to use Unicode in Python source code, you have to tell the Python interpreter what encoding the file is in. That's done with a little magic comment at the top of the file. The popular Unixy editors (emacs, vim etc.) also understand this comment and will save the file correctly. Possibly other editors do as well. For more gory details that you probably need, see this: http://www.amk.ca/python/howto/unicode particularly the section Unicode Literals in Python Source Code. Cheers, Mike Eli Brosh wrote: Thanks, This seems to be a solution. I have an editor that supports unicode. But, can you please explain better how do I make the coding directive at the top of my source files ? Where do I write the command: # -*- coding: utf-8 -*- Is it inside the python script ? Sorry for the ignorance. Eli On Tue, Jul 22, 2008 at 10:14 AM, Michael Droettboom [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: As an alternative, you could just use Unicode to insert the Greek characters: rα-Fe (Someone 2003) The default font used by matplotlib, Vera Sans, includes a full set of Greek characters. This, of course, requires an editor that supports Unicode and a coding directive at the top of your source files, eg.: # -*- coding: utf-8 -*- Cheers, Mike Eli Brosh wrote: Here is the use case I have in mind: Plotting properties of various phases of iron, I need a legend with greek letters and normal text: \alpha-Fe, Someone (2003) Now, I need the names e.g. someone to be upright. Also, the relbar between \alpha and Fe is shorter with normal text fonts than with italics. I can solve the problem by using r'\rm{\alpha-Fe, Someone (2003)}' but it would be easier if I could just change the defaults. Eli On Mon, Jul 21, 2008 at 6:21 PM, Michael Droettboom [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Unfortunately there isn't. This is *theoretically* possible with the STIX fonts, but that hasn't been implemented. However, with the Computer Modern fonts, many of the glyphs simply aren't present (upright Greek, for example) to make this happen. That said, I'm not sure this is necessarily a good idea. Math has a set of commonly accepted conventions about when to use italic vs. upright that may only confuse the reader when not followed. Can you provide a use case? Cheers, Mike Eli Brosh wrote: Hello I there a way to change the default mathtext font from cal to rm ? I would like to use the rm (serif) font without stating rm{...} or mathrm{...}. Is it possible to do using
Re: [Matplotlib-users] default mathtext font
Thanks, This seems to be a solution. I have an editor that supports unicode. But, can you please explain better how do I make the coding directive at the top of my source files ? Where do I write the command: # -*- coding: utf-8 -*- Is it inside the python script ? Sorry for the ignorance. Eli On Tue, Jul 22, 2008 at 10:14 AM, Michael Droettboom [EMAIL PROTECTED] wrote: As an alternative, you could just use Unicode to insert the Greek characters: rα-Fe (Someone 2003) The default font used by matplotlib, Vera Sans, includes a full set of Greek characters. This, of course, requires an editor that supports Unicode and a coding directive at the top of your source files, eg.: # -*- coding: utf-8 -*- Cheers, Mike Eli Brosh wrote: Here is the use case I have in mind: Plotting properties of various phases of iron, I need a legend with greek letters and normal text: \alpha-Fe, Someone (2003) Now, I need the names e.g. someone to be upright. Also, the relbar between \alpha and Fe is shorter with normal text fonts than with italics. I can solve the problem by using r'\rm{\alpha-Fe, Someone (2003)}' but it would be easier if I could just change the defaults. Eli On Mon, Jul 21, 2008 at 6:21 PM, Michael Droettboom [EMAIL PROTECTED]mailto: [EMAIL PROTECTED] wrote: Unfortunately there isn't. This is *theoretically* possible with the STIX fonts, but that hasn't been implemented. However, with the Computer Modern fonts, many of the glyphs simply aren't present (upright Greek, for example) to make this happen. That said, I'm not sure this is necessarily a good idea. Math has a set of commonly accepted conventions about when to use italic vs. upright that may only confuse the reader when not followed. Can you provide a use case? Cheers, Mike Eli Brosh wrote: Hello I there a way to change the default mathtext font from cal to rm ? I would like to use the rm (serif) font without stating rm{...} or mathrm{...}. Is it possible to do using the matplotlibrc ? can you give me an example of how this is done ? Thanks Eli - 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=100url=/ http://moblin-contest.org/redirect.php?banner_id=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net mailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA - 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=100url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] default mathtext font
Hello I there a way to change the default mathtext font from cal to rm ? I would like to use the rm (serif) font without stating rm{...} or mathrm{...}. Is it possible to do using the matplotlibrc ? can you give me an example of how this is done ? Thanks Eli - 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=100url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] default mathtext font
Here is the use case I have in mind: Plotting properties of various phases of iron, I need a legend with greek letters and normal text: \alpha-Fe, Someone (2003) Now, I need the names e.g. someone to be upright. Also, the relbar between \alpha and Fe is shorter with normal text fonts than with italics. I can solve the problem by using r'\rm{\alpha-Fe, Someone (2003)}' but it would be easier if I could just change the defaults. Eli On Mon, Jul 21, 2008 at 6:21 PM, Michael Droettboom [EMAIL PROTECTED] wrote: Unfortunately there isn't. This is *theoretically* possible with the STIX fonts, but that hasn't been implemented. However, with the Computer Modern fonts, many of the glyphs simply aren't present (upright Greek, for example) to make this happen. That said, I'm not sure this is necessarily a good idea. Math has a set of commonly accepted conventions about when to use italic vs. upright that may only confuse the reader when not followed. Can you provide a use case? Cheers, Mike Eli Brosh wrote: Hello I there a way to change the default mathtext font from cal to rm ? I would like to use the rm (serif) font without stating rm{...} or mathrm{...}. Is it possible to do using the matplotlibrc ? can you give me an example of how this is done ? Thanks Eli - 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=100url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - 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=100url=/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] The who command in Ipython-PyLab
Hello, I am trying to use pylab interactively from the Ipython shell with the -pylab option on windows. Normally, the Ipython shell has the nice who command that enables one to see only the variables defined by him, rather than the many non-relevant output produced by the python dir() function. for example: I*n [1]: a=2 In [2]: who a* Now, with the pylab option, this command does not work. It gives the output: *In [4]: who Out[4]: function who at 0x0141FAF0 * The same thing happens when I do not use the Ipython -pylab option but just import pylab from Ipython: *In [1]: a=2 In [2]: who a In [3]: from pylab import * In [4]: who Out[4]: function who at 0x0141FAF0* Why is this happening?* Is there a way to use the who command with pylab ?* Thanks Eli Brosh - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] The who command in Ipython-PyLab
Thanks Fernando, I now tried %who. The result was a huge output, apparently containing all the pylab functions. This is exactly the thing I was trying to avoid. I wanted to use the who command to see only the variables I defined as part of the pylab session. Is there a way to do just this ? thank Eli Brosh On Fri, Jul 11, 2008 at 3:10 PM, Fernando Perez [EMAIL PROTECTED] wrote: On Fri, Jul 11, 2008 at 12:02 PM, Eli Brosh [EMAIL PROTECTED] wrote: In [1]: a=2 In [2]: who a In [3]: from pylab import * In [4]: who Out[4]: function who at 0x0141FAF0 Why is this happening? Because pylab provides its own who _function_, which overrides the ipython command ('magic function', in ipythonese). Is there a way to use the who command with pylab ? Try %who instead. The '%' disambiguates and tells ipython that you are explicitly after the magic function, not any other python fuction currently available. Regards, f - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] The who command in Ipython-PyLab
Thanks to Eric and Fernando I will try to update ipython (for some reason I have troubles with that in windows). The ipython -pylab[...] with who() command works but it seems to work only for arrays. i.e. with x = arange(20) it worked but not with x=1. Hence updating ipython remains the only way. Thanks Eli On Fri, Jul 11, 2008 at 3:57 PM, Eric Firing [EMAIL PROTECTED] wrote: Eli Brosh wrote: Thanks Fernando, I now tried %who. The result was a huge output, apparently containing all the pylab functions. This is exactly the thing I was trying to avoid. I wanted to use the who command to see only the variables I defined as part of the pylab session. Is there a way to do just this ? Maybe the pylab command does what you want; you have to include the trailing parentheses: [EMAIL PROTECTED]:~$ ipython -pylab [...] In [2]:x = arange(20) In [3]:who() NameShapeBytesType === x 20 80 int32 Upper bound on total bytes = 80 Eric - Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users