[Matplotlib-users] Matplotlib 1.0.1 Tk backend
In preparing to upgrade from 0.99 to 1.0.1, I was reading the online documentation about the various backends. I do not see a TkAgg backend listed. Is that because there is no longer a backend for Tk? Has support for Tk been dropped in 1.0.1? Or has it not yet been added to the documentation? Trevor -- 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
Re: [Matplotlib-users] Matplotlib 1.0.1 Tk backend
Dear Trevor, I am using 1.0.1 and the TkAgg backend with no problems. I'm not sure why you can't find the documentation. It is listed in the faq as a viable backend. Chad From: Trevor J Christensen tre...@jcmanagement.net To: matplotlib-users@lists.sourceforge.net Sent: Wednesday, August 31, 2011 9:01 AM Subject: [Matplotlib-users] Matplotlib 1.0.1 Tk backend In preparing to upgrade from 0.99 to 1.0.1, I was reading the online documentation about the various backends. I do not see a TkAgg backend listed. Is that because there is no longer a backend for Tk? Has support for Tk been dropped in 1.0.1? Or has it not yet been added to the documentation? Trevor -- 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-- 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
Re: [Matplotlib-users] Matplotlib 1.0.1 Tk backend
On 08/31/2011 04:01 AM, Trevor J Christensen wrote: In preparing to upgrade from 0.99 to 1.0.1, I was reading the online documentation about the various backends. I do not see a TkAgg backend listed. Is that because there is no longer a backend for Tk? Has support for Tk been dropped in 1.0.1? Or has it not yet been added to the documentation? Trevor Trevor, Where did you expect to find it, but not see it? Eric -- 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
[Matplotlib-users] edge joinstyle on rectangles
Hi, Are the edges of the rectangles returned by plt.bar() supposed to conform to the 'lines.solid_joinstyle' rcParam? If not, is there another method for specifying that joinstyle? I have not been able to change the joinstyle using this method in versions 1.0.0 (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a minimal example script if requested. -Jeff -- 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
Re: [Matplotlib-users] Inner boundaries in tricontourf
On 30 August 2011 18:23, Tijs de Kler tijs.dek...@sara.nl wrote: Im trying to use the tricontourf function in matplotlib to reduce the complexity of an unstructured dataset into contours. The resulting contours are retrieved from the path by the to_polygon() function, but i have some trouble distinguishing inner boundaries on the polygons, while plot.show() clearly doesn't Using Matplotlib 1.01, and the attached code, I get one level, consisting of 2 polygons, where the first is the outer boundary, and the second should be the inner boundary. The figure shown by show() correctly displays a square with a inner square cut-out. However i cannot distinguish between inner and outer boundaries in the list of polygons that to_polygon() returns. Is there a trick how the plot functions distinguish inner boundaries? Calculating for each polygon if it is contained in other polygons will become complicated with a large number of polygons: As far as i can tell this would be checking if the starting point of each polygon is contained in any of the other polygons. Is there a simpler method i missed? Matplotlib includes a function to determine if a set of points is within a polygon, called points_inside_poly. For an example see http://matplotlib.sourceforge.net/faq/howto_faq.html#test-whether-a-point-is-inside-a-polygon That is about as simple as it gets from a user's perspective! Since you ask about tricks in plot functions, no there aren't any. Rendering functions don't explicitly determine if a contour polygon is an inner or outer boundary. Usually a sweep algorithm is performed across all points to construct the triangulation of the polygons as it progresses. You could extract the inner/outer-ness of each boundary from such an algorithm but it would be overkill for what you want to do. Ian Thomas -- 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
Re: [Matplotlib-users] edge joinstyle on rectangles
On 08/31/2011 06:45 AM, Jeffrey Blackburne wrote: Hi, Are the edges of the rectangles returned by plt.bar() supposed to conform to the 'lines.solid_joinstyle' rcParam? If not, is there another method for specifying that joinstyle? I have not been able to change the joinstyle using this method in versions 1.0.0 (linux, gtkagg and tkagg) or 1.0.1 (os x, tkagg). I can send a minimal example script if requested. The bar rectangles are Patch object outlines, not Line2D objects, and solid_joinstyle is not presently supported by patches, as far as I can see. Eric -Jeff -- 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
[Matplotlib-users] 1D heat map
Hi, I have a code for making graphical representations of sentences, Sentence is represented as a bar, and under in you can represent the words. It works fine and I have an example at the end. Now I wanted to add some more features to it, but I am stuck. you can see the previous post from this link Now, if we assign a number to each letter in a sentence and get a list of these numbers, [2,4,7,-7,8,6,4,4,-7,9,5,3,-7,9,5,-3,7,8,9,5,3,6,8,9,-5,3] can I create a 1D heat map with this list as and additional bar? First problem will be to get the range of numbers and normalize it, or we should be able to assign a range for the heat map. It would be great if you can help. here is the example code. [CODE] text ='''World number two Nadal breezed through the first set, taking it with breaks of serve in the fourth and sixth games. Monfils put up more resistance in an erratic second set but his wayward display was summed up by a double fault which sealed Nadal's victory. The Spaniard will face a semi-final against compatriot Nicolas Almagro, who beat Austrian Juergen Melzer 6-3 6-1. In the women's competition, fourth seed Venus Williams booked her place in the semi-finals with a 6-3 6-3 win over Australia's Samantha Stosur.''' import pylab import matplotlib # Put text into list of sentences sentences = [] sentences = text.split('\n') # Get the lenght of longest sentence-Lmax and number of sentences Lmax=0 it = 0 for i in sentences: it = it + 1 LenSen= len(i) if LenSen Lmax: Lmax = LenSen totalnumber = it #Set the image properties pylab.rcParams['figure.figsize'] = [Lmax/20, totalnumber] pylab.rcParams['figure.subplot.left'] = 0.2 # Left margin pylab.rcParams['figure.subplot.right'] = 1.0-0.04 # Right margin pylab.rcParams['font.size'] = 7 # Axes range from 0 to 1 for x-axis (simplifying calls to .axhspan()) and # 20 down to 0 for Y-values because that's convenient for this example ax = [0, 1, totalnumber+1, 0] # [xlo, xhi, ylo, yhi] # printer is a drawing module def printer(searchterm, Input,start,end,xstart,color): lens = len(searchterm) while True: inDex = Input.find(searchterm, start,end) if inDex == -1: break inDex = float(inDex) inDS=inDex/Lmax inDE=(inDex+lens)/Lmax matplotlib.pyplot.axhspan(it+xstart,it+0.2+xstart, xmin=inDS, xmax=inDE, ec='k', fc=color) # if search string not found, find() returns -1 # search is complete, break out of the while loop # move to next possible start position inDex= int(inDex) start = inDex + 1 it=0 for i in sentences: it = it+1 LenSen= len(i) LenF = float(LenSen) matplotlib.pyplot.axhspan(it+0.2,it+0.4, xmin=0, xmax=LenF/Lmax, ec='k', fc='r') #creates sentence bar pylab.text(-0.2, it+0.4, 'sentence'+str(it)+' with spaces') # create the sentence bar printer(' ', i, 1, LenSen,0.2,'b')#blue represents the spaces on sentence bar printer('the', i, 1, LenSen,0,'y') #above sentence bar, yellow represents 'the' pylab.text(-0.2, it+0.2, 'the') pylab.axis(ax) matplotlib.pyplot.title(Analysis) matplotlib.pyplot.xticks((),()) # No labels for X-axis matplotlib.pyplot.yticks((),()) # No labels for Y-axis pylab.show() [CODE] -- View this message in context: http://old.nabble.com/1D-heat-map-tp32374379p32374379.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- 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
Re: [Matplotlib-users] Inner boundaries in tricontourf
I forgot to mention the obvious solution! Outer boundaries are ordered anticlockwise, inner boundaries clockwise. Calculate the area of each boundary assuming it is ordered anticlockwise, and if the area is positive it is an outer boundary, if negative it is an inner boundary. I've attached a modified version of your debug.py to show this. This may be simpler to use than points_inside_poly, but if you have multiple nested boundaries it could get confusing unless you know which boundary encloses which others. Ian Thomas import matplotlib import matplotlib.pyplot as plot import numpy as np def get_polygon_area(vertices): v2 = np.roll(vertices, -1, axis=0) return np.cross(vertices, v2).sum() / 2.0 def is_polygon_inner_boundary(vertices): return get_polygon_area(vertices) 0.0 x_array = [] y_array = [] for i in range(1,5) : for j in range(1,5) : x_array.append(i) y_array.append(j) triang = [ [0,4,5],[0,5,1], [1,5,6],[1,6,2], [2,6,7], [2,7,3],[4,8,9], [4,9,5], [6,10,11],[6,11,7], [8,12,13], [8,13,9],[9,13,14], [9,14,10], [10,14,15],[10,15,11]] triangle_poly =matplotlib.tri.Triangulation(x_array, y_array, triang) data=[1]*16 level_list = [0,2] contourplot = plot.tricontourf(triangle_poly, data, level_list) for level in contourplot.collections: polys = level.get_paths()[0].to_polygons() for poly in polys: print 'polygon:', poly print 'inner boundary:', is_polygon_inner_boundary(poly) plot.show() -- 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
[Matplotlib-users] adding scrollbars to plot embedded in tk
I have a plot canvas added to a tk interface (python 2.7.2, matplotlib 1.0.1) according to the recipe here: http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk.html When the window containing the plot is resized the plot shrinks, often leading to REALLY ugly, unreadable plots. I tried adding scrollbars to the canvas returned by get_tk_widget() and they connect as expected (using the yview method). Then, I set a scrollarea config option for the canvas. Everything seems to be working just like a tkinter canvas, but then when the window is resized, the plot still resizes and the scrollbars never activate. I was hoping the plot wouldn't resize and the scrollbars would activate to allow the user to scroll to see the appropriate part of the plot, while still keeping the plot looking pretty. Is there a way (besides editing backend_tkagg.py self.resize method) that would allow the scrollbars to work properly? If my question isn't clear, I can mock up some code, but it may be a bit lengthy, so if anyone can steer me in a better direction that would be great. Thanks, -Matt -- 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
Re: [Matplotlib-users] Trouble with reading 2d array
On Tue, Aug 30, 2011 at 9:47 PM, Alexa Villaume alexa7...@gmail.com wrote: Thanks for responding, Ben. I used loadtxt() and I'm still getting a very strange looking contour plot. I've attached it and maybe that will be helpful in diagnosing what is wrong with it. I have no reason to believe that the data itself is bad since I was making contours in IDL with the same set. Thank you. When I see graphing artifacts like that, the usual suspect is that the X and Y coordinates are mixed up or something to that effect. Could you please post some code? Ben Root -- 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
Re: [Matplotlib-users] adding scrollbars to plot embedded in tk
On Wed, Aug 31, 2011 at 2:55 PM, Matthew Hemke mghe...@gmail.com wrote: I have a plot canvas added to a tk interface (python 2.7.2, matplotlib 1.0.1) according to the recipe here: http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk.html When the window containing the plot is resized the plot shrinks, often leading to REALLY ugly, unreadable plots. I tried adding scrollbars to the canvas returned by get_tk_widget() and they connect as expected (using the yview method). Then, I set a scrollarea config option for the canvas. Everything seems to be working just like a tkinter canvas, but then when the window is resized, the plot still resizes and the scrollbars never activate. I was hoping the plot wouldn't resize and the scrollbars would activate to allow the user to scroll to see the appropriate part of the plot, while still keeping the plot looking pretty. Is there a way (besides editing backend_tkagg.py self.resize method) that would allow the scrollbars to work properly? If my question isn't clear, I can mock up some code, but it may be a bit lengthy, so if anyone can steer me in a better direction that would be great. Thanks, -Matt Matt, Currently, (if I understand the backends and the event handling correctly), mpl makes the assumption that a window resize event directly means a figure resize event. Maybe these two concepts should be decoupled to allow for interception and handling? I don't know how much work the mpl backends have to do to handle the various possibilities of when to scale the figures and when to use scrollbars. Certainly would be quite messier than the current assumption. Unless I am being completely unaware of current ways to implement what you want, I would suggest filing a feature request. In the meantime, editing the tk backend might be your best bet. Cheers, Ben Root -- 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
Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib
I corrected the problem with the FreeType2 header file and rebuilt matplotlib from scratch, but I'm getting the same error. Centos5 puts the file ft2build.h in /usr/lib but matplotlib looks for it in /usr/lib/freetype2. I used this command: PKG_CONFIG_PATH=/home/cfinch/lib/pkgconfig python2.7 setup.py build build_log.txt and got this output: basedirlist is: ['/home/cfinch'] BUILDING MATPLOTLIB matplotlib: 1.0.1 python: 2.7.2 (default, Aug 30 2011, 12:57:00) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.6.1 freetype2: 9.10.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.10 Tkinter: no * TKAgg requires Tkinter wxPython: no * wxPython not found Gtk+: gtk+: 2.10.4, glib: 2.12.3, pygtk: 2.10.6, pygobject: 2.14.2 Mac OS X native: no Qt: no Qt4: no Cairo: 1.2.2 OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: 1.5 pytz: 2010o OPTIONAL USETEX DEPENDENCIES dvipng: 1.5 ghostscript: 8.70 latex: 3.141592 pdftops: 3.00 [Edit setup.cfg to suppress the above messages] pymods ['pylab'] packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.tri', 'matplotlib.delaunay'] running install running build running build_py ... There are no errors in the rest of the build or install logs. Further, I rebuild pycairo, pygtk, and matplotlib just to make sure one of them wasn't missing a freetype dependency. Unfortunately, I am still getting exactly the same error as before. Any other suggestions? Craig From: Eric Firing efir...@hawaii.edu To: matplotlib-users@lists.sourceforge.net Sent: Tuesday, August 30, 2011 6:19 PM Subject: Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib On 08/30/2011 12:14 PM, Craig Finch wrote: I successfully built Python 2.7.2, NumPy 1.61, and Scipy 0.9.0 in my home directory on a Centos5 system. I am trying to build matplotlib 1.0.1 in my home directory, but I am having a problem with the GTK backends. I also built pycairo 1.2.2, pygobject 2.14.2, and pygtk 2.10.6 in my home directory (using the libraries and headers installed in the default system locations). I downloaded a few pygtk examples from the tutorial section of their web site and ran them to verify that pygtk works correctly. Here is the error I get when I run a script that contains only the line import matplotlib.pyplot: python2.7 test.py --verbose-helpful $HOME=/home/cfinch CONFIGDIR=/home/cfinch/.matplotlib matplotlib data path /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/mpl-data loaded rc file /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 1.0.1 verbose.level helpful interactive is False units is False platform is linux2 Using fontManager instance from /home/cfinch/.matplotlib/fontList.cache Traceback (most recent call last): File test.py, line 1, in module import matplotlib.pyplot File /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/pyplot.py, line 95, in module new_figure_manager, draw_if_interactive, show = pylab_setup() File /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/backends/__init__.py, line 25, in pylab_setup globals(),locals(),[backend_name]) File /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/backends/backend_gtkagg.py, line 10, in module from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, FigureCanvasGTK,\ File /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py, line 28, in module from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK File /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/backends/backend_gdk.py, line 29, in module from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array ImportError: No module named _backend_gdk Here is the beginning of my matplotlib build log, which shows that the build process is actually finding the GTK
Re: [Matplotlib-users] Trouble with reading 2d array
On Wed, Aug 31, 2011 at 3:45 PM, Alexa Villaume alexa7...@gmail.com wrote: #Load data in O3 = loadtxt('O3arr.txt') #Specify coordinates of the surface y=np.arange(-0.25, 6.0, 0.25) #The range of the ionization parameter x=np.arange(-1.0, 3.1, 0.1) #The range of the metallcity values #Define levels. Observed column density +- 3 sigma O3Level = [13.936, 14.047, 14.158] #Contour the arrays. plt.contour(x, y, O3, O3Level) With x and y defined as they are I get a type error that says x and y should be the same length as the columns and rows of z, which they are. So I'm not sure why I get that error. What does print O3.shape return? Ben Root -- 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
Re: [Matplotlib-users] Trouble with reading 2d array
On Wed, Aug 31, 2011 at 3:50 PM, Alexa Villaume alexa7...@gmail.com wrote: 41, 25 Yes, you have it backwards. The first axis of O3 is the rows, while the second axis is the columns. Keep in mind that Python and NumPy follow C array conventions while Matlab (and IDL?) follow Fortran array conventions. So, either transpose O3, or swap x and y in the call to contourf. Cheers! Ben Root -- 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
[Matplotlib-users] change font properties of legend title?
How can I change font properties of a legend title? Thanks, Alan Isaac -- 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
Re: [Matplotlib-users] change font properties of legend title?
On 8/31/2011 5:48 PM, Alan G Isaac wrote: How can I change font properties of a legend title? Related question: would it be a reasonable suggestion for Legend.set_title to take a ``prop`` argument? Alan Isaac -- 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
[Matplotlib-users] Error probably due to misconfiguration
Hello, some weeks ago, I recompiled matplotlib to get locale support for commas, and started to get strange dimension errors while trying to save the figure. Now here is another error that I think that is somewhat related to it. When I try to run the script below, savefig() gives me an IndexError: -- from pylab import * a1 = figure(1).add_subplot(111, polar=True) a1.scatter([ 3.*pi/7. ], [ 0.65 ], color='black', marker='o') a1.annotate('Target', (3.*pi/7., 0.65), xytext=(3.*pi/7., 0.7)) savefig(Radar.eps) ...long stack... IndexError: Unexpected SeqBaseT length. --- This is in the savefig() function again, and this is related to text, since the error disappear if I remove the annotation. But I think I can affirm, with a great degree of certainty, that this happens because I recompiled matplotlib: this is an old script that wouldn't give me any error before. So, I'm probably missing some dependency, but the setup.py script won't tell me what is missing, and the only warning I get during compilation is the -Wstrict_prototypes one. Actually, I am happy to find out this, since it was probably a configuration problem that generated the errors (and matplotlib source is ok). But if anyone can give me any clue on how to solve this, that would be greatly appreciated. --- José Alexandre Nalon na...@terra.com.br -- 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
Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib
I figured it out! I accidentally did something weird. When I built NumPy and SciPy, I used the --user option to tell distutils to build them in my home directory. I had not realized that --user installs the packages in ~/.local/lib/python2.7/site-packages/. I was assuming they would be installed in ~/lib/python2.7/site-packages, but I didn't notice they were missing until just now. When I reinstalled NumPy and Scipy using the option --prefix=/home/cfinch and then rebuilt matplotlib, everything started working. I didn't have to rebuild pycairo or pygtk; I just had to get everything in the same location. This is the first I've heard of installing anything in a .local directory...why is that even an option??? Thanks for your help! From: Craig Finch oan...@yahoo.com To: Eric Firing efir...@hawaii.edu; matplotlib-users@lists.sourceforge.net matplotlib-users@lists.sourceforge.net Sent: Wednesday, August 31, 2011 4:31 PM Subject: Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib I corrected the problem with the FreeType2 header file and rebuilt matplotlib from scratch, but I'm getting the same error. Centos5 puts the file ft2build.h in /usr/lib but matplotlib looks for it in /usr/lib/freetype2. I used this command: PKG_CONFIG_PATH=/home/cfinch/lib/pkgconfig python2.7 setup.py build build_log.txt and got this output: basedirlist is: ['/home/cfinch'] BUILDING MATPLOTLIB matplotlib: 1.0.1 python: 2.7.2 (default, Aug 30 2011, 12:57:00) [GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.6.1 freetype2: 9.10.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.10 Tkinter: no * TKAgg requires Tkinter wxPython: no * wxPython not found Gtk+: gtk+: 2.10.4, glib: 2.12.3, pygtk: 2.10.6, pygobject: 2.14.2 Mac OS X native: no Qt: no Qt4: no Cairo: 1.2.2 OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: 1.5 pytz: 2010o OPTIONAL USETEX DEPENDENCIES dvipng: 1.5 ghostscript: 8.70 latex: 3.141592 pdftops: 3.00 [Edit setup.cfg to suppress the above messages] pymods ['pylab'] packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.tri', 'matplotlib.delaunay'] running install running build running build_py ... There are no errors in the rest of the build or install logs. Further, I rebuild pycairo, pygtk, and matplotlib just to make sure one of them wasn't missing a freetype dependency. Unfortunately, I am still getting exactly the same error as before. Any other suggestions? Craig From: Eric Firing efir...@hawaii.edu To: matplotlib-users@lists.sourceforge.net Sent: Tuesday, August 30, 2011 6:19 PM Subject: Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib On 08/30/2011 12:14 PM, Craig Finch wrote: I successfully built Python 2.7.2, NumPy 1.61, and Scipy 0.9.0 in my home directory on a Centos5 system. I am trying to build matplotlib 1.0.1 in my home directory, but I am having a problem with the GTK backends. I also built pycairo 1.2.2, pygobject 2.14.2, and pygtk 2.10.6 in my home directory (using the libraries and headers installed in the default system locations). I downloaded a few pygtk examples from the tutorial section of their web site and ran them to verify that pygtk works correctly. Here is the error I get when I run a script that contains only the line import matplotlib.pyplot: python2.7 test.py --verbose-helpful $HOME=/home/cfinch CONFIGDIR=/home/cfinch/.matplotlib matplotlib data path /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/mpl-data loaded rc file /home/cfinch/.local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 1.0.1 verbose.level helpful interactive is False units is False platform is linux2 Using fontManager instance from /home/cfinch/.matplotlib/fontList.cache Traceback (most recent call last): File test.py,
Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib
On Wed, Aug 31, 2011 at 6:35 PM, Craig Finch cfi...@ieee.org wrote: I figured it out! I accidentally did something weird. When I built NumPy and SciPy, I used the --user option to tell distutils to build them in my home directory. I had not realized that --user installs the packages in ~/.local/lib/python2.7/site-packages/. I was assuming they would be installed in ~/lib/python2.7/site-packages, but I didn't notice they were missing until just now. When I reinstalled NumPy and Scipy using the option --prefix=/home/cfinch and then rebuilt matplotlib, everything started working. I didn't have to rebuild pycairo or pygtk; I just had to get everything in the same location. This is the first I've heard of installing anything in a .local directory...why is that even an option??? Thanks for your help! It is a standard directory in linux now. Started by the freedesktop.org, I think. Personally, I prefer it over having ~/lib, ~/bin and such cluttering my home directory. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html Ben Root -- 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
Re: [Matplotlib-users] change font properties of legend title?
l = legend() l.get_title().set_fontproperties(...) -JJ On Thu, Sep 1, 2011 at 6:48 AM, Alan G Isaac alan.is...@gmail.com wrote: How can I change font properties of a legend title? Thanks, Alan Isaac -- 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 -- 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
Re: [Matplotlib-users] change font properties of legend title?
On Thu, Sep 1, 2011 at 7:21 AM, Alan G Isaac alan.is...@gmail.com wrote: On 8/31/2011 5:48 PM, Alan G Isaac wrote: How can I change font properties of a legend title? Related question: would it be a reasonable suggestion for Legend.set_title to take a ``prop`` argument? Alan Isaac Can you file an github issue for this? Regards, -JJ -- 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 -- 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
[Matplotlib-users] Re fresh colorbar in 3D graph animation
Hello I have an animation which shows 3D diffusion I added color bar at the side during the animation the colors changing but the scale at the colorbar of the graph stay asame. please help with that soon as you can! Thanks! Gal:working: -- View this message in context: http://old.nabble.com/Refresh-colorbar-in-3D-graph-animation-tp32356118p32356118.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- 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
[Matplotlib-users] Missing grid lines with MultipleLocator, set_smart_bounds and ax.axis(equal)
Dear matplotlib Gurus If I run the script below then I end up creating a graph where some of the grid lines are missing. The problem disappear if I remove the call to ax.axis(equal) or the calls to set_smart_bounds(True). I already found a different way to solve my problem, but I thought that this bugreport might be useful to you. Kind regards Niels #!/usr/bin/env python import numpy as np imporot matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator fig = plt.figure(1, frameon=False,) ax = fig.add_subplot(1,1,1) #If you remove these two line the problem disappears ax.spines['left'].set_smart_bounds(True) ax.spines['bottom'].set_smart_bounds(True) #Grid ax.xaxis.set_major_locator(MultipleLocator(0.2)) ax.xaxis.set_minor_locator(MultipleLocator(0.1)) ax.yaxis.set_major_locator(MultipleLocator(0.2)) ax.yaxis.set_minor_locator(MultipleLocator(0.1)) ax.xaxis.grid(True,'minor') ax.yaxis.grid(True,'minor') ax.xaxis.grid(True,'major',linewidth=2) ax.yaxis.grid(True,'major',linewidth=2) #If you remove this line the problem disappears ax.axis(equal) #The graph phi=np.arange(0,np.pi,0.1) ax.plot(np.cos(phi),np.sin(phi)) #Save fig.savefig('unit_circle.png', dpi=200) -- 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
Re: [Matplotlib-users] Error probably due to misconfiguration
On 08/31/2011 01:15 PM, José Alexandre Nalon wrote: Hello, some weeks ago, I recompiled matplotlib to get locale support for commas, and started to get strange dimension errors while trying to save the figure. Now here is another error that I think that is somewhat related to it. When I try to run the script below, savefig() gives me an IndexError: -- from pylab import * a1 = figure(1).add_subplot(111, polar=True) a1.scatter([ 3.*pi/7. ], [ 0.65 ], color='black', marker='o') a1.annotate('Target', (3.*pi/7., 0.65), xytext=(3.*pi/7., 0.7)) savefig(Radar.eps) ...long stack... IndexError: Unexpected SeqBaseT length. This is coming from CXX. I am not going to be able to figure out what the problem is, but those who are (the C++ wizards) will probably want to see the full stack trace, as well as the matplotlib version and the compilation parameters: platform, compiler, python version, etc. The first part of the output from setup.py build has all that. Eric --- This is in the savefig() function again, and this is related to text, since the error disappear if I remove the annotation. But I think I can affirm, with a great degree of certainty, that this happens because I recompiled matplotlib: this is an old script that wouldn't give me any error before. So, I'm probably missing some dependency, but the setup.py script won't tell me what is missing, and the only warning I get during compilation is the -Wstrict_prototypes one. Actually, I am happy to find out this, since it was probably a configuration problem that generated the errors (and matplotlib source is ok). But if anyone can give me any clue on how to solve this, that would be greatly appreciated. --- José Alexandre Nalon na...@terra.com.br -- 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
Re: [Matplotlib-users] Problem with GTK backends after compiling matplotlib
On 08/31/2011 01:59 PM, Benjamin Root wrote: On Wed, Aug 31, 2011 at 6:35 PM, Craig Finch cfi...@ieee.org mailto:cfi...@ieee.org wrote: I figured it out! I accidentally did something weird. When I built NumPy and SciPy, I used the --user option to tell distutils to build them in my home directory. I had not realized that --user installs the packages in ~/.local/lib/python2.7/site-packages/. I was assuming they would be installed in ~/lib/python2.7/site-packages, but I didn't notice they were missing until just now. When I reinstalled NumPy and Scipy using the option --prefix=/home/cfinch and then rebuilt matplotlib, everything started working. I didn't have to rebuild pycairo or pygtk; I just had to get everything in the same location. This is the first I've heard of installing anything in a .local directory...why is that even an option??? Thanks for your help! It is a standard directory in linux now. Started by the freedesktop.org http://freedesktop.org, I think. Personally, I prefer it over having ~/lib, ~/bin and such cluttering my home directory. http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html Aha! So that's where .config came from, also. IPython is using it; I suppose we should, too. Eric Ben Root -- 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 -- 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
[Matplotlib-users] py2app setup.py example?
Hello all. I've been looking for a good example of setup.py to build a bundle app with wxpython+matplotlib. Can someone share or point me in a direction? thanks -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano http://lattes.cnpq.br/5846052449613692 Linux User #89721 Can’t stop the signal. -- 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