[Matplotlib-users] GTK+ config on Fedora 12.... change in filesystem structure?
Hi there, I am not sure whether I am the only one to experience that but on my new FEDORA 12 box GTK+ is shipped with the following structure for the headers : /usr/include/gtk-1.2/gtk/gtk.h This does not seem to be expected by matplotlib setup.cfg , or am I missing something? thanks, Johann -- Download Intel#174; Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] centering axis ticks labels
hello, anyone has an idea about how to get this right? thanks a lot in advance, Johann Johann Cohen-Tanugi wrote: hi there, I stumbled into yet another problem, see script attached. Now there are 10 pixels and 10 label values on each axis, but I get only half the ticks, and as a result half the labels get discarded... How can I specify the number of ticks it uses? Note that I could use plt.pcolor(np.array(EMINS),np.array(ROIS),d) and at least the labelling would be correct, but the pixels are now more or less wide depending on the interval between values, which was not intended thanks a lot in advance for your help, Johann Johann Cohen-Tanugi wrote: Hello, how can I center axis tick labels, so that the labels ends up at the center between 2 ticks. thanks in advance, Johann -- 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 -- 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 mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] centering axis ticks labels
hi there, I stumbled into yet another problem, see script attached. Now there are 10 pixels and 10 label values on each axis, but I get only half the ticks, and as a result half the labels get discarded... How can I specify the number of ticks it uses? Note that I could use plt.pcolor(np.array(EMINS),np.array(ROIS),d) and at least the labelling would be correct, but the pixels are now more or less wide depending on the interval between values, which was not intended thanks a lot in advance for your help, Johann Johann Cohen-Tanugi wrote: Hello, how can I center axis tick labels, so that the labels ends up at the center between 2 ticks. thanks in advance, Johann -- 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 import matplotlib.pyplot as plt import numpy as np d = np.array([[ 157.95277364, 153.43173695, 146.13158977, 141.54839658, 144.52643315, 124.31540514, 121.25041319, 94.97418322, 64.74824341, 27.69885997], [ 166.42505119, 161.6584763 , 152.96285478, 149.94707942, 148.95740797, 135.38872561, 131.60396144, 104.24714341, 69.36953504, 28.22984027], [ 180.18354975, 175.80862266, 163.19215239, 161.79956642, 157.49777483, 143.04049195, 144.89181555, 116.46328816, 84.029379 , 31.41834047], [ 189.67039827, 186.61746661, 177.39989771, 178.12248221, 172.37834168, 152.80223899, 164.45528247, 141.6235974 , 115.46930152, 61.55211961], [ 157.09501131, 154.46700398, 145.35801984, 151.56479068, 141.09453561, 130.09545669, 135.6759625 , 120.79901256, 98.09147933, 59.62847031], [ 141.05859093, 137.90739078, 128.05909052, 136.6963394 , 134.19701193, 129.56047371, 131.74742858, 119.75074075, 98.92957831, 68.68764481], [ 125.13744117, 123.38731079, 123.93182985, 126.59952041, 127.12588879, 124.92796151, 132.8109024 , 133.95243655, 121.58352334, 99.01494134], [ 82.49855115, 82.5109548 , 83.65697445, 85.33888768, 83.28319399, 83.81724338, 93.04441865, 91.65137654, 86.05573836, 75.8860952 ], [ 55.3082678 , 56.98568928, 54.49724808, 52.80536213, 52.41055057, 56.78071926, 62.01649764, 65.72762368, 56.78034563, 53.16029942], [ 23.8194714 , 24.16684446, 22.86100321, 23.87513858, 22.2958795 , 27.16573087, 28.94610545, 38.55528517, 43.05176998, 41.46975149]]) ROIS=[1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1] EMINS=[100,125,150,175,200,250,300,500,700,1000] fig = plt.figure() ax = fig.add_subplot(111) plt.pcolor(d) ax.set_xticklabels(EMINS) plt.xlabel(Emin(MeV)) ax.set_yticklabels(ROIS) plt.ylabel(Roi(deg)) plt.colorbar() -- 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
Re: [Matplotlib-users] centering axis ticks labels
the example works very well, but what I have is 10 numbers that I want to put in between 11 ticks. Actually what I havve is a checkerboard (using pcolor) and I want to label the X and Y of each pixel and now I am confused with the API to do that... The example uses objects that can provide Locator and Formatter instances, but I just have a sequence of numbers Johann Johann Cohen-Tanugi wrote: thanks a lot! Johann John Hunter wrote: On Sat, Jul 11, 2009 at 1:15 PM, Eric Firingefir...@hawaii.edu wrote: John Hunter wrote: On Thu, Jul 9, 2009 at 9:44 AM, Johann Cohen-Tanugico...@lpta.in2p3.fr wrote: Hello, how can I center axis tick labels, so that the labels ends up at the center between 2 ticks. There is no support for this, though you can left or right align a label with a single tick:: for label in ax.xaxis.get_xticklabels(): label.set_horizontalalignment('right') JDH Labels for intervals rather than ticks would be nice to have; this is commonly used for labeling months or years, for example. I don't have time to work on it now, unfortunately. The best way to fake it with present facilities might be to use no labels on the major ticks, place minor ticks half-way between the majors, set their lengths to zero, and label them. Nice idea, just committed this example to svn as examples/pylab_examples/centered_ticklabels.py import datetime import numpy as np import matplotlib import matplotlib.dates as dates import matplotlib.ticker as ticker import matplotlib.pyplot as plt # load some financial data; apple's stock price fh = matplotlib.get_example_data('aapl.npy') r = np.load(fh); fh.close() r = r[-250:] # get the last 250 days fig = plt.figure() ax = fig.add_subplot(111) ax.plot(r.date, r.adj_close) ax.xaxis.set_major_locator(dates.MonthLocator()) ax.xaxis.set_minor_locator(dates.MonthLocator(bymonthday=15)) ax.xaxis.set_major_formatter(ticker.NullFormatter()) ax.xaxis.set_minor_formatter(dates.DateFormatter('%b')) for tick in ax.xaxis.get_minor_ticks(): tick.tick1line.set_markersize(0) tick.tick2line.set_markersize(0) tick.label1.set_horizontalalignment('center') imid = len(r)/2 ax.set_xlabel(str(r.date[imid].year)) plt.show() -- 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 -- 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
Re: [Matplotlib-users] centering axis ticks labels
import numpy as np import matplotlib.pylab as plt ROIS=[1.0,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1] EMINS=[100,125,150,175,200,250,300,500,700,1000] d=np.array([81.820974990633303, 82.905629922471107, 79.590599078715002, 83.8076661158848, 84.340371447361704, 86.470741120340406, 86.325669295272604, 78.547789147572104, 61.234561761417801, 42.336057180561099, 79.452456461883799, 78.886459859281402, 76.101705425124905, 81.152956140890893, 79.325736080403303, 81.869315277384999, 82.334627586818499, 80.751043622934901, 63.687981070736697, 42.336057180561099, 81.561434110553193, 81.733934887474803, 77.281383826158105, 81.735026440126006, 78.759069413428506, 83.011430606978095, 83.1028280527253, 84.831802384752606, 70.310404261509206, 42.336057180561099, 79.049391539046098, 80.359440097576794, 77.772159524822001, 83.654958151325204, 79.578518689189593, 83.313224279315094, 85.904971250263898, 88.016057678182506, 72.556205760527106, 43.079858727017502, 74.014083853922003, 74.991828576951406, 72.176483952900597, 79.931150578720604, 76.810283824455198, 81.319067727368093, 82.606434816726093, 79.296669680086296, 67.530619223090795, 43.830850940183701, 78.570285512017804, 80.011420916551302, 78.048745087146898, 85.986292098240298, 83.757389242109198, 85.399220867247493, 84.378739151586601, 83.838909509599304, 72.219496155423101, 54.667696386193299, 64.771390756530494, 65.179725530642799, 65.901293578971206, 70.324974696479799, 68.229487152871201, 69.183487824467093, 72.191878118072495, 75.809844472900906, 64.968437827963001, 54.162402578714399, 57.958372971901703, 57.342923745772502, 58.459763976540003, 61.621347971812597, 56.633079601774597, 56.443549659648298, 55.463724005796699, 57.973081450418903, 48.107631297574798, 40.4952182396881, 46.761865533859897, 47.869196203907997, 47.310621469889, 47.7642158774199, 45.1306027800862, 49.647667752226802, 47.310281669050198, 48.629496015722999, 40.947773761156398, 33.032212415148798, 27.819471401269102, 28.166844457481599, 26.861003210437801, 27.875138576975701, 26.295879497460898, 31.165730874019399, 29.333496744941801, 35.518932552857997, 34.476676188903603, 30.448752651955001]) d.resize(len(EMINS),len(ROIS)) plt.pcolor(d) and now I would like to have EMINS and ROIS values labelling each pixel or each square of the checkerboard if you prefer. thanks a lot for your help. Johann -- 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
Re: [Matplotlib-users] Plot a Dictionary, time and value
hmm, reading the initial email, this is not what I understood the idea would be. So let me the following : I have a dictionnary with the 7 days of week as keys (strings) and a value attached to it. I would like to plot the days of the week in x and the corresponding values in y. It amounts to a histogram of 7 bins, and to correctly labeling the ticks with the keys instead of the integer 0...6. So it becomes kind of a bar chart. See p.40 of ftp://root.cern.ch/root/doc/3Histograms.pdf for an illustration. I would imagine that requesting to plot a dictionary would naturally mean this kind of result, but I may overlook possible ambiguities. Anyway, that is what I understood the initial question was. Johann John Hunter wrote: On Wed, Jul 30, 2008 at 9:17 AM, stuartornum [EMAIL PROTECTED] wrote: Hi, Wondering if anyone has done something similar and could point me in the right direction. I have a dictionary like this: Dict{'00:00:00':'23', '00:01:00':'29', '00:02:00':'13', '00:03:00':'78', '00:04:00':'45', '23:59:00':54} So as you can see there is 24 hours worth of minutes, with a value attached to each minute. Firstly, just to note the Dictionary Dict is not actually in order as above, it is all jumbled up. However is it possible to plot a dictionary using MatPlotLib, and using the time along the x-axis and values up the y? You will have to extract the x and y values, and convert them from strings to values matplotlib can understand (for example dates and floating point numbers). Eg In [30]: d = {'00:00:00':'23', '00:01:00':'29', '00:02:00':'13', '00:03:00':'78', '00:04:00':'45', '23:59:00':54} In [32]: from dateutil.parser import parse In [33]: items = [(parse(date), float(val)) for date, val in d.items()] In [34]: items.sort() In [35]: items Out[35]: [(datetime.datetime(2008, 7, 30, 0, 0), 23.0), (datetime.datetime(2008, 7, 30, 0, 1), 29.0), (datetime.datetime(2008, 7, 30, 0, 2), 13.0), (datetime.datetime(2008, 7, 30, 0, 3), 78.0), (datetime.datetime(2008, 7, 30, 0, 4), 45.0), (datetime.datetime(2008, 7, 30, 23, 59), 54.0)] In [36]: dates, values = zip(*items) In [37]: plot(dates, values) Out[37]: [matplotlib.lines.Line2D object at 0xb45a5ec] - 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
Re: [Matplotlib-users] Installing Matplotlib
are you sure you need to specify -arch i386 -arch ppc and not only -arch ppc ?? It seems that according to the log mentioning i386 here does not please the linker. Maybe try without it? my 2 cents, Johann Ari Ehrmann wrote: Hey all, I've been having a lot of trouble installing matplotlib. I'm using a macbook, on version 10.5.4 of Mac OS, intel processor (if that's important). I've installed both numpy and scipy without problems, but when I type this command to install matplotlib: CFLAGS=-Os -arch i386 -arch ppc LDFLAGS=-Os -arch i386 -arch ppc python setup.py build I get this output: BUILDING MATPLOTLIB matplotlib: 0.98.3 python: 2.5 (r25:51918, Sep 19 2006, 08:49:13) [GCC 4.0.1 (Apple Computer, Inc. build 5341)] platform: darwin REQUIRED DEPENDENCIES numpy: 1.2.0.dev5513 freetype2: found, but unknown version (no pkg-config) OPTIONAL BACKEND DEPENDENCIES libpng: found, but unknown version (no pkg-config) Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 wxPython: no * wxPython not found Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to import gtk in your build/install environment Qt: no Qt4: no Cairo: no OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide OPTIONAL USETEX DEPENDENCIES dvipng: no ghostscript: /bin/sh: gs: command not found latex: no EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES configobj: matplotlib will provide enthought.traits: no [Edit setup.cfg to suppress the above messages] running build running build_py copying lib/matplotlib/mpl-data/matplotlibrc - build/lib.macosx-10.3-fat-2.5/matplotlib/mpl-data copying lib/matplotlib/mpl-data/matplotlib.conf - build/lib.macosx-10.3-fat-2.5/matplotlib/mpl-data running build_ext building 'matplotlib.ft2font' extension g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup -Os -arch i386 -arch ppc -Os -arch i386 -arch ppc build/temp.macosx-10.3-fat-2.5/src/ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/usr/X11R6/lib -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so ld warning: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libstdc++.dylib, file is not of required architecture ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libstdc++.6.dylib, file is not of required architecture for architecture i386 collect2: ld returned 1 exit status ld warning: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libstdc++.dylib, file is not of required architecture ld: in /Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/libstdc++.6.dylib, file is not of required architecture for architecture ppc collect2: ld returned 1 exit status lipo: can't open input file: /var/folders/S0/S0i2z-OAEtG1ZHpis54obU+++TM/-Tmp-//ccfhpaN5.out (No such file or directory) error: command 'g++' failed with exit status 1 Has anyone had this problem or know what's even going here? Any help would be greatly appreciated. Thanks, Ari - 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] [Fwd: hists with empty bins and log option]
Reposting as it seems to have fallen through the cracks... sorry in advance if it was not the case, Johann hello, when histogramming a distribution in log scale, I have some empty bins, which drives the y axis to 1e-100 as a lower limit, completely squashing the histogram Bug or feature? Johann PS To be specific : In [22]: entries, bins, patches = pl.hist(np.array(list1),bins=50,normed=1,log=True) In [23]: entries Out[23]: array([ 1.18347753e+00, 4.10926113e-01, 2.53989507e-01, 1.84039145e-01, 1.27510992e-01, 9.21486321e-02, 7.45965117e-02, 5.08495253e-02, 4.23315845e-02, 3.43298825e-02, 2.78768971e-02, 1.83264787e-02, 1.62615233e-02, 1.23897320e-02, 1.26478515e-02, 7.74358253e-03, 4.38803010e-03, 5.93674661e-03, 3.61367185e-03, 4.38803010e-03, 2.58119418e-03, 1.29059709e-03, 7.74358253e-04, 1.03247767e-03, 1.54871651e-03, 2.32307476e-03, 5.16238835e-04, 2.58119418e-04, 1.03247767e-03, 2.58119418e-04, 5.16238835e-04, 0.e+00, 2.58119418e-04, 0.e+00, 0.e+00, 0.e+00, 2.58119418e-04, 2.58119418e-04, 2.58119418e-04, 0.e+00, 0.e+00, 0.e+00, 0.e+00, 0.e+00, 0.e+00, 0.e+00, 0.e+00, 0.e+00, 0.e+00, 2.58119418e-04]) In [24]: bins Out[24]: array([ 3.36150086e-09, 3.87417583e-01, 7.74835162e-01, 1.16225274e+00, 1.54967032e+00, 1.93708790e+00, 2.32450548e+00, 2.71192306e+00, 3.09934064e+00, 3.48675822e+00, 3.87417580e+00, 4.26159338e+00, 4.64901096e+00, 5.03642854e+00, 5.42384612e+00, 5.81126370e+00, 6.19868128e+00, 6.58609885e+00, 6.97351643e+00, 7.36093401e+00, 7.74835159e+00, 8.13576917e+00, 8.52318675e+00, 8.91060433e+00, 9.29802191e+00, 9.68543949e+00, 1.00728571e+01, 1.04602746e+01, 1.08476922e+01, 1.12351098e+01, 1.16225274e+01, 1.20099450e+01, 1.23973625e+01, 1.27847801e+01, 1.31721977e+01, 1.35596153e+01, 1.39470329e+01, 1.43344504e+01, 1.47218680e+01, 1.51092856e+01, 1.54967032e+01, 1.58841208e+01, 1.62715383e+01, 1.66589559e+01, 1.70463735e+01, 1.74337911e+01, 1.78212087e+01, 1.82086262e+01, 1.85960438e+01, 1.89834614e+01, 1.93708790e+01]) - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] hist is broken in SVN when using numpy 1.1.0.dev5077
Hi Glenn, I do not reproduce your problem with current revisions of numpy and matplotlib. best, Johann G Jones wrote: Hello, I am using r5186 from the SVN with numpy 1.1.0.dev5077. When I try hist(rand(512),arange(-128,127)) I get: --- type 'exceptions.TypeError' Traceback (most recent call last) /home/gej/casper_work/backend/qtSpec/src/ipython console in module() /usr/lib/python2.5/site-packages/matplotlib/pyplot.py in hist(*args, **kwargs) 1688 hold(h) 1689 try: - 1690 ret = gca().hist(*args, **kwargs) 1691 draw_if_interactive() 1692 except: /usr/lib/python2.5/site-packages/matplotlib/axes.py in hist(self, x, bins, normed, cumulative, bottom, histtype, align, orientation, width, log, **kwargs) 5472 if not self._hold: self.cla() 5473 n, bins = np.histogram(x, bins, range=None, - 5474 normed=bool(normed), new=True) 5475 5476 if cumulative: type 'exceptions.TypeError': histogram() got an unexpected keyword argument 'new' I guess the new keyword argument has been deprecated? - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] getting the min and max values of an axis for plotting
hello, I have a function, which I am plotting. I want to add a line positioned at, say, the mean of the function, so I want to do plot([x,x],[y0,y1]). In order to get y0, and y1, my brute force trial and error browsing of the API lead me to : y0=gca().yaxis.get_majorticklabels()[0].get_position()[1] y1=gca().yaxis.get_majorticklabels()[-1].get_position()[1] and as I am never contented, I now ask : is it really the manner of choice to get this information. I sense that I did not take the straightest path to get it :) thanks in advance, Johann - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Non-linear Regression to a Histogram
Hi Adrian, if you need low level access there is a python wrapper of the MINUIT and MINUIT2 fitting libraries : http://code.google.com/p/pyminuit/ and http://code.google.com/p/pyminuit2/ It is targeted primarily toward High Energy Physics people, most of whom are familiar with the MINUIT library, but it would solve your problem as well. The doc is still lacking in the project, as I do not have much time, so feel free to ask me questions about it or even to send me some files so that I can try out to script the fit on my side (I work in the field of astro-particle physics and astrophysics, so I might even be interested in the context of your problem!) . best, Johann Adrian Price-Whelan wrote: Hey guys - I'm working on a Histogram of pixel values from an astronomical image that looks like a Gaussian curve and then polynomial decay. I'm trying to figure out a way to fit a Gaussian regression to the histogram, but can't find any documentation on this. thanks! -adrian - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ 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 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Postscript problem
hello, so the freetype.rc is defined with env variables that are supposed to be fed in when packaging it. LIBZ seemingly was missing when the fedora 8 packaging of freetype was done. I added -lz directly to freetype.rc and rebuilt successfully matplotlib. I have no clue which mailing list to ping for a fedora packaging issue Anyway, end of story for this part of the thread best, Johann John Hunter wrote: On Tue, Apr 29, 2008 at 2:06 AM, Johann Cohen-Tanugi [EMAIL PROTECTED] wrote: hi John, for the record, I have a fedora 8 box, and the shipped version of pkgconfig (pkgconfig-0.22-4.fc8) gives me : [EMAIL PROTECTED] matplotlib]$ /usr/bin/pkg-config --libs freetype2 -lfreetype No -lz here, if I am not wrong in my querying this tool . This looks like the correct incantation, so it appears that your proplem is a misconfigured freetype2.pc. You might want to post something to the fedora list, or to the free type list, or simply make a patch against the pc file. I am not sure who maintains that part. JDH - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Postscript problem
hi John, for the record, I have a fedora 8 box, and the shipped version of pkgconfig (pkgconfig-0.22-4.fc8) gives me : [EMAIL PROTECTED] matplotlib]$ /usr/bin/pkg-config --libs freetype2 -lfreetype No -lz here, if I am not wrong in my querying this tool . best, Johann - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Postscript problem
After browsing the web a little, it seems that the matplotlib build of ft2font2 is missing the linking of libz.so : if I add it to the command line [EMAIL PROTECTED] matplotlib]$ g++ -pthread -shared build/temp.linux-i686-2.5/src/ft2font.o build/temp.linux-i686-2.5/src/mplutils.o build/temp.linux-i686-2.5/CXX/cxxsupport.o build/temp.linux-i686-2.5/CXX/cxx_extensions.o build/temp.linux-i686-2.5/CXX/IndirectPythonInterface.o build/temp.linux-i686-2.5/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -lstdc++ -lm -lpython2.5 -L/usr/lib -lfreetype _lz -o build/lib.linux-i686-2.5/matplotlib/ft2font.so and then reinstall matplotlib, the problem goes away, id est I can import pylab, and the pstest example works. One word on this last statement though : as is the pstest example does not open any window to show the plots, id est the final show() command does not do anything. But if I savefig('pstest'), I can open the pstest.ps resulting file with gv and can see the plots. I do not know whether this behavior is expected So, should I fill a ticket for the inclusion of libz.so at link time of ft2font.so? thanks, Johann Arthur M. Greene wrote: The replies have been helpful, but I'm still trying to figure out where the problem lies, but I have noticed that matplotlib-0.90.1 apparently doesn't use ttconv. I have this version installed at home and am able to generate poscript without a problem. Are you able to tell which package is complaining about the undefined symbol(s)? If I downgrade (at work) I will probably lose some capabilities, since the file size of 0.91.2 is more than twice that of 0.90.1 (!) But I would prefer to be able to generate .ps or .eps, even if I lose the capability of using LaTeX for plot labels, e.g. Best wishes, Arthur --- amg -at- iri -dot- columbia -dot- edu Johann Cohen-Tanugi wrote: Sorry for the preceding mis-threaded version. Here it is again : I dont know if it is related, but I am actually failing an exemple : [EMAIL PROTECTED] matplotlib]$ ipython examples/pstest.py --- ImportError Traceback (most recent call last) /home/cohen/data1/sources/python/matplotlib-svn/matplotlib/examples/pstest.py in module() 2 import matplotlib 3 matplotlib.use('PS') 4 from pylab import * 5 6 def f(t): /usr/lib/python2.5/site-packages/pylab.py in module() 1 2 3 from matplotlib.pylab import * 4 import matplotlib.pylab 5 __doc__ = matplotlib.pylab.__doc__ /usr/lib/python2.5/site-packages/matplotlib/pylab.py in module() 201 from numpy import ma 202 -- 203 from matplotlib import mpl # pulls in most modules 204 205 # catch more than an import error here, since the src could fail too, /usr/lib/python2.5/site-packages/matplotlib/mpl.py in module() 1 2 from matplotlib import artist 3 from matplotlib import axis 4 from matplotlib import axes 5 from matplotlib import cbook 6 from matplotlib import collections /usr/lib/python2.5/site-packages/matplotlib/axis.py in module() 12 from ticker import NullLocator, FixedLocator, AutoLocator 13 --- 14 from font_manager import FontProperties 15 from text import Text, TextWithDash 16 from transforms import Affine2D, Bbox, blended_transform_factory, \ /usr/lib/python2.5/site-packages/matplotlib/font_manager.py in module() 38 import matplotlib 39 from matplotlib import afm --- 40 from matplotlib import ft2font 41 from matplotlib import rcParams, get_configdir 42 from matplotlib.cbook import is_string_like ImportError: /usr/lib/python2.5/site-packages/matplotlib/ft2font.so: undefined symbol: inflateReset My config is : BUILDING MATPLOTLIB matplotlib: 0.98pre python: 2.5.1 (r251:54863, Oct 30 2007, 13:54:11) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.1.0.dev5077 freetype2: 9.16.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.22 Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 wxPython: 2.8.4.0 * WxAgg extension not required for wxPython = 2.8 Gtk+: gtk+: 2.12.5, glib: 2.14.6, pygtk: 2.12.0, pygobject: 2.14.0 Qt: Qt: 3.3.8, PyQt: 3.17.4 Qt4: Qt: 4.3.3, PyQt4: 4.3.3 Cairo: 1.4.12 OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide OPTIONAL USETEX DEPENDENCIES
Re: [Matplotlib-users] Postscript problem
yes it does! -lz now shows up and the pstest runs fine. Any idea what is failing wrt pkgconfig? thanks, Johann John Hunter wrote: On Mon, Apr 28, 2008 at 3:55 PM, Johann Cohen-Tanugi [EMAIL PROTECTED] wrote: Hi Michael, ok, here it is attached. For completion, from the matplotlib directory, I issued : [EMAIL PROTECTED] matplotlib]$ \rm -rf build [EMAIL PROTECTED] matplotlib]$ python setup.py build build.log The following was printed out to the screen and not redirected : src/backend_agg.cpp: In member function 'Py::Object RendererAgg::write_rgba(const Py::Tuple)': src/backend_agg.cpp:1303: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result src/backend_agg.cpp:1308: warning: ignoring return value of 'size_t fwrite(const void*, size_t, size_t, FILE*)', declared with attribute warn_unused_result lib/enthought/traits/ctraits.c: In function '_trait_cast': lib/enthought/traits/ctraits.c:2370: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'Py_ssize_t' I have revision 5087 of matplotlib. In the log you can see that libz is linked against for the backends, but not for ft2font.. Best, Do you have pkgconfig installed? In setupext.py, it looks like the 'z' lib is added only if we are not finding pkgconfig: def add_ft2font_flags(module): 'Add the module flags to ft2font extension' if not get_pkgconfig(module, 'freetype2'): module.libraries.extend(['freetype', 'z']) If get_pkgconfig is returning True, but it is not configured properly to find libz for freetype2, you may fall into a configure black hole where libz never gets added. Does it help to modify this function to read: def add_ft2font_flags(module): 'Add the module flags to ft2font extension' if not get_pkgconfig(module, 'freetype2'): module.libraries.extend(['freetype', 'z']) add_base_flags(module) basedirs = module.include_dirs[:] # copy the list to avoid inf loop! for d in basedirs: module.include_dirs.append(os.path.join(d, 'freetype2')) p = os.path.join(d, 'lib/freetype2/include') if os.path.exists(p): module.include_dirs.append(p) p = os.path.join(d, 'lib/freetype2/include/freetype2') if os.path.exists(p): module.include_dirs.append(p) basedirs = module.library_dirs[:] # copy the list to avoid inf loop! for d in basedirs: p = os.path.join(d, 'freetype2/lib') if os.path.exists(p): module.library_dirs.append(p) else: add_base_flags(module) module.libraries.append('z') - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Postscript problem
hmm, I did not use matplotlib recently, but looking at the library, I would guess that I have the same issue : [EMAIL PROTECTED] ~]$ ldd /usr/lib/python2.5/site-packages/matplotlib/ttconv.so linux-gate.so.1 = (0x0011) libpython2.5.so.1.0 = /usr/lib/libpython2.5.so.1.0 (0x001c1000) libstdc++.so.6 = /usr/lib/libstdc++.so.6 (0x00308000) libm.so.6 = /lib/libm.so.6 (0x0011f000) libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x00148000) libpthread.so.0 = /lib/libpthread.so.0 (0x00154000) libc.so.6 = /lib/libc.so.6 (0x003f3000) libdl.so.2 = /lib/libdl.so.2 (0x0016d000) libutil.so.1 = /lib/libutil.so.1 (0x00172000) /lib/ld-linux.so.2 (0x001a4000) [EMAIL PROTECTED] ~]$ nm /usr/lib/python2.5/site-packages/matplotlib/ttconv.so | grep _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE U _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE@@GLIBCXX_3.4 Arthur M. Greene wrote: Hello Matplotlib users, I'm having difficulty generating postscript, and receiving an error that I'm guessing reflects a version conflict, but I'm not sure exactly which version of what needs to be changed. If I generate a plot (backend is QtAGG, so I get a window), then click on the save button, I get a dialog saying: /path_to/matplotlib/ttconv.so: undefined symbol: _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE Alternatively, if I do import matplotlib; matplotlib.use('PS'); from pylab import * the result is as follows (essentially the same error): exceptions.ImportError Traceback (most recent call last) /home/amg/ipython console /home/amg/cdat4_1/lib/python2.4/site-packages/pylab.py 1 from matplotlib.pylab import * 2 import matplotlib.pylab 3 __doc__ = matplotlib.pylab.__doc__ /home/amg/cdat4_1/lib/python2.4/site-packages/matplotlib/pylab.py 290 291 -- 292 from matplotlib.pyplot import * 293 294 /home/amg/cdat4_1/lib/python2.4/site-packages/matplotlib/pyplot.py 35 36 from matplotlib.backends import pylab_setup --- 37 new_figure_manager, draw_if_interactive, show = pylab_setup() 38 39 def switch_backend(newbackend): /home/amg/cdat4_1/lib/python2.4/site-packages/matplotlib/backends/__init__.py in pylab_setup() 22 backend_name = 'backend_'+backend.lower() 23 backend_mod = __import__('matplotlib.backends.'+backend_name, --- 24 globals(),locals(),[backend_name]) 25 26 # Things we pull in from all backends /home/amg/cdat4_1/lib/python2.4/site-packages/matplotlib/backends/backend_ps.py 22 from matplotlib.font_manager import findfont, is_opentype_cff_font 23 from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING --- 24 from matplotlib.ttconv import convert_ttf_to_ps 25 from matplotlib.mathtext import MathTextParser 26 from matplotlib._mathtext_data import uni2type1 ImportError: /home/amg/cdat4_1/lib/python2.4/site-packages/matplotlib/ttconv.so: undefined symbol: _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE (The above backtrace is from iPython, but I get the same thing running from plain ol' Python.) Googling suggests that this might mean I have a version of Matplotlib that is too recent for the g++ compiler on my system, but I'm not really certain. I'm running as an unprivileged user on RHEL4, with most of the necessary libraries already present on the system. I've only had to add qt and PyQt, which are installed in my home directory, where Matplotlib can apparently find them. Version info is as follows: These are locally installed: Python 2.4 qt-3.3.8b PyQt-3.17.4 Matplotlib-0.91.2 The following were already present: Kernel: 2.6.9-67.0.1.ELsmp, on i686 glibc-2.3.4-2.39 gcc-3.4.6-9 tcl-8.4.7-2 tk-8.4.7-3.el4_6.1 freetype-2.1.9-6.el4 libpng-1.2.7-3.el4_5.1 zlib-1.2.1.2-1.2 ghostscript-7.07-33.2.el4_6.1 Output of 'gs --version': 8.50 I tried switching to qt4/PyQt4, but then ipython -pylab hangs... Not sure what other info to supply; suggestions appreciated. Thanks! Arthur --- amg -at- iri -dot- columbia -dot- edu - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ 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 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to
Re: [Matplotlib-users] Matplotlib-users Digest, Vol 23, Issue 38
I dont know if it is related, but I am actually failing an exemple : [EMAIL PROTECTED] matplotlib]$ ipython examples/pstest.py --- ImportError Traceback (most recent call last) /home/cohen/data1/sources/python/matplotlib-svn/matplotlib/examples/pstest.py in module() 2 import matplotlib 3 matplotlib.use('PS') 4 from pylab import * 5 6 def f(t): /usr/lib/python2.5/site-packages/pylab.py in module() 1 2 3 from matplotlib.pylab import * 4 import matplotlib.pylab 5 __doc__ = matplotlib.pylab.__doc__ /usr/lib/python2.5/site-packages/matplotlib/pylab.py in module() 201 from numpy import ma 202 -- 203 from matplotlib import mpl # pulls in most modules 204 205 # catch more than an import error here, since the src could fail too, /usr/lib/python2.5/site-packages/matplotlib/mpl.py in module() 1 2 from matplotlib import artist 3 from matplotlib import axis 4 from matplotlib import axes 5 from matplotlib import cbook 6 from matplotlib import collections /usr/lib/python2.5/site-packages/matplotlib/axis.py in module() 12 from ticker import NullLocator, FixedLocator, AutoLocator 13 --- 14 from font_manager import FontProperties 15 from text import Text, TextWithDash 16 from transforms import Affine2D, Bbox, blended_transform_factory, \ /usr/lib/python2.5/site-packages/matplotlib/font_manager.py in module() 38 import matplotlib 39 from matplotlib import afm --- 40 from matplotlib import ft2font 41 from matplotlib import rcParams, get_configdir 42 from matplotlib.cbook import is_string_like ImportError: /usr/lib/python2.5/site-packages/matplotlib/ft2font.so: undefined symbol: inflateReset My config is : BUILDING MATPLOTLIB matplotlib: 0.98pre python: 2.5.1 (r251:54863, Oct 30 2007, 13:54:11) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.1.0.dev5077 freetype2: 9.16.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.22 Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 wxPython: 2.8.4.0 * WxAgg extension not required for wxPython = 2.8 Gtk+: gtk+: 2.12.5, glib: 2.14.6, pygtk: 2.12.0, pygobject: 2.14.0 Qt: Qt: 3.3.8, PyQt: 3.17.4 Qt4: Qt: 4.3.3, PyQt4: 4.3.3 Cairo: 1.4.12 OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide OPTIONAL USETEX DEPENDENCIES dvipng: 1.5 ghostscript: 8.61 latex: 3.141592 EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES configobj: matplotlib will provide enthought.traits: matplotlib will provide best, Johann - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Postscript problem
Sorry for the preceding mis-threaded version. Here it is again : I dont know if it is related, but I am actually failing an exemple : [EMAIL PROTECTED] matplotlib]$ ipython examples/pstest.py --- ImportError Traceback (most recent call last) /home/cohen/data1/sources/python/matplotlib-svn/matplotlib/examples/pstest.py in module() 2 import matplotlib 3 matplotlib.use('PS') 4 from pylab import * 5 6 def f(t): /usr/lib/python2.5/site-packages/pylab.py in module() 1 2 3 from matplotlib.pylab import * 4 import matplotlib.pylab 5 __doc__ = matplotlib.pylab.__doc__ /usr/lib/python2.5/site-packages/matplotlib/pylab.py in module() 201 from numpy import ma 202 -- 203 from matplotlib import mpl # pulls in most modules 204 205 # catch more than an import error here, since the src could fail too, /usr/lib/python2.5/site-packages/matplotlib/mpl.py in module() 1 2 from matplotlib import artist 3 from matplotlib import axis 4 from matplotlib import axes 5 from matplotlib import cbook 6 from matplotlib import collections /usr/lib/python2.5/site-packages/matplotlib/axis.py in module() 12 from ticker import NullLocator, FixedLocator, AutoLocator 13 --- 14 from font_manager import FontProperties 15 from text import Text, TextWithDash 16 from transforms import Affine2D, Bbox, blended_transform_factory, \ /usr/lib/python2.5/site-packages/matplotlib/font_manager.py in module() 38 import matplotlib 39 from matplotlib import afm --- 40 from matplotlib import ft2font 41 from matplotlib import rcParams, get_configdir 42 from matplotlib.cbook import is_string_like ImportError: /usr/lib/python2.5/site-packages/matplotlib/ft2font.so: undefined symbol: inflateReset My config is : BUILDING MATPLOTLIB matplotlib: 0.98pre python: 2.5.1 (r251:54863, Oct 30 2007, 13:54:11) [GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.1.0.dev5077 freetype2: 9.16.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.22 Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 wxPython: 2.8.4.0 * WxAgg extension not required for wxPython = 2.8 Gtk+: gtk+: 2.12.5, glib: 2.14.6, pygtk: 2.12.0, pygobject: 2.14.0 Qt: Qt: 3.3.8, PyQt: 3.17.4 Qt4: Qt: 4.3.3, PyQt4: 4.3.3 Cairo: 1.4.12 OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: matplotlib will provide pytz: matplotlib will provide OPTIONAL USETEX DEPENDENCIES dvipng: 1.5 ghostscript: 8.61 latex: 3.141592 EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES configobj: matplotlib will provide enthought.traits: matplotlib will provide best, Johann Johann Cohen-Tanugi wrote: hmm, I did not use matplotlib recently, but looking at the library, I would guess that I have the same issue : [EMAIL PROTECTED] ~]$ ldd /usr/lib/python2.5/site-packages/matplotlib/ttconv.so linux-gate.so.1 = (0x0011) libpython2.5.so.1.0 = /usr/lib/libpython2.5.so.1.0 (0x001c1000) libstdc++.so.6 = /usr/lib/libstdc++.so.6 (0x00308000) libm.so.6 = /lib/libm.so.6 (0x0011f000) libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x00148000) libpthread.so.0 = /lib/libpthread.so.0 (0x00154000) libc.so.6 = /lib/libc.so.6 (0x003f3000) libdl.so.2 = /lib/libdl.so.2 (0x0016d000) libutil.so.1 = /lib/libutil.so.1 (0x00172000) /lib/ld-linux.so.2 (0x001a4000) [EMAIL PROTECTED] ~]$ nm /usr/lib/python2.5/site-packages/matplotlib/ttconv.so | grep _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE U _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE@@GLIBCXX_3.4 Arthur M. Greene wrote: Hello Matplotlib users, I'm having difficulty generating postscript, and receiving an error that I'm guessing reflects a version conflict, but I'm not sure exactly which version of what needs to be changed. If I generate a plot (backend is QtAGG, so I get a window), then click on the save button, I get a dialog saying: /path_to/matplotlib/ttconv.so: undefined symbol: _ZTVSt19basic_ostringstreamIcSt11char_traitsIcESaIcEE Alternatively, if I do import matplotlib; matplotlib.use('PS'); from pylab import * the result is as follows (essentially the same error): exceptions.ImportError Traceback (most recent call last) /home/amg/ipython console /home/amg/cdat4_1/lib/python2.4/site-packages/pylab.py
Re: [Matplotlib-users] plotting a series of 3D points and, picker=True and 3D
hello, thanks for answering. I actually fail with the import : In [1]: from matplotlib import axes3d --- ImportError Traceback (most recent call last) /home/cohen/bstw/ipython console in module() /usr/lib/python2.5/site-packages/matplotlib/axes3d.py in module() 14 from axes import Axes 15 import cbook --- 16 from transforms import unit_bbox 17 18 import numpy as npy ImportError: cannot import name unit_bbox any idea? -- Message: 1 Date: Sun, 27 Jan 2008 22:18:00 + From: Neil Crighton [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] plotting a series of 3D points and picker=True and 3D To: matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 I think scatter3D does what you want: from matplotlib import axes3d import pylab as pl fig = pl.figure() ax = axes3d.Axes3D(fig) ax.scatter3D(data[:,0],data[:,1],data[:,2]) ax.set_xlabel('X value') ax.set_ylabel('Y value') ax.set_zlabel('Z value') pl.show() You could also change the colour and size of each point based on other array values: col = ax.scatter3D(data[:,0], data[:,1], data[:,2], c=data[:,3], cmap=pl.cm.jet, s=data[:,4]) cbar = fig.colorbar(col,shrink=0.9,extend='both') cbar.ax.set_ylabel('axis 3 data values') Pretty nifty. Neil - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plotting a series of 3D points
hello, I would like to plot in 3D a dataset organized as 1000 x,y,z points in a numpy array, so it would be smthg like plot3d(data[:,0],data[:,1],data[:,2]). I looked at the plot3D cookbook page, but it all seems to expect some sort of binning on a grid. best, Johann - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] power law fitting of data
hi jessica, thanks So scipy.optmizer as it stands cannot do that? I gues I should move the issue to the scipy list then. Yes there is mpfit, there is also pyminuit in google.code that is wrapper of the high energy physics standard package MINUIT, etc but I would think that fitting data, with fixed/thawed parameters, is a basic feature of a scientific package. As there seems to be a snergy between matplotlib and scipy, I would expect the latter to take care of optimization thanks for the replies, Johann Jessica Lu wrote: Hi Johann, I would recommend using the python mpfit module: http://cars9.uchicago.edu/software/python/mpfit.html Cheers, Jessica On Dec 22, 2007, at 8:57 PM, Johann Cohen-Tanugi wrote: hi jessica, This FittingData tutorial is very nice. Could you illustrate how to fix/thaw parameters? I did not find any such attribute and when I try some kludges they fail with a msg saying type 'exceptions.ValueError': shape mismatch: objects cannot be broadcast to a single shape thanks, Johann - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] power law fitting of data
hi jessica, This FittingData tutorial is very nice. Could you illustrate how to fix/thaw parameters? I did not find any such attribute and when I try some kludges they fail with a msg saying type 'exceptions.ValueError': shape mismatch: objects cannot be broadcast to a single shape thanks, Johann - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] grayscale
hello, is there a quick way to get a figure in greyscale? thanks, Johann - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] inverted x-axis
Jouni, thanks for your reply. I could test that plot([1,2,3],[1,2,3]) setp(gca(), 'xlim', (3.0,1.0)) works, but setp(gca(), 'xlim', reversed(getp(gca(), 'xlim'))) gives me an error : --- TypeError Traceback (most recent call last) /home/cohen/ipython console in module() /usr/lib/python2.5/site-packages/matplotlib/pylab.py in setp(*args, **kwargs) 1386 1387 def setp(*args, **kwargs): - 1388 ret = _setp(*args, **kwargs) 1389 draw_if_interactive() 1390 return ret /usr/lib/python2.5/site-packages/matplotlib/artist.py in setp(h, *args, **kwargs) 704 funcName = set_%s%s 705 func = getattr(o,funcName) -- 706 ret.extend( [func(val)] ) 707 return [x for x in flatten(ret)] 708 /usr/lib/python2.5/site-packages/matplotlib/axes.py in set_xlim(self, xmin, xmax, emit, **kwargs) 1543 raise ValueError('Cannot set nonpositive limits with log transform') 1544 - 1545 xmin, xmax = mtrans.nonsingular(xmin, xmax, increasing=False) 1546 self.viewLim.intervalx().set_bounds(xmin, xmax) 1547 if emit: self.callbacks.process('xlim_changed', self) /usr/lib/python2.5/site-packages/matplotlib/transforms.py in nonsingular(vmin, vmax, expander, tiny, increasing) 272 vmin, vmax = vmax, vmin 273 swapped = True -- 274 if vmax - vmin = max(abs(vmin), abs(vmax)) * tiny: 275 if vmin==0.0: 276 vmin = -expander TypeError: unsupported operand type(s) for -: 'reversed' and 'float' I guess that the issue is that reversed returns the reversed iterator on the sequnce, not the reversed sequence itself. Best, Johann - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] erasing the figure border
hello, I am using matplotlib to make a drawing, so though I am using distances on the pad I do not need to display the axes and would rather have no frame and no tick. To achieve this, I tried using : rc('axes', edgecolor='white') rc('xtick', color='white') rc('ytick', color='white') The first command works, but not the 2 tick commands (the ticks still show up, in black).. Bug or feature? Besides, I am sure there is a better way to do that, but could not find out. I am using the GTKAgg backend. thanks, Johann - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with set in current svn HEAD
hi Matthieu, this will work too, with setp instead of set. Clearly 'set' is now reserved. Someone should update the user's guide. best, Johann -- Message: 1 Date: Thu, 16 Aug 2007 18:27:33 +0200 From: Matthieu Brucher [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] problem with set in current svn HEAD To: Matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 Hi, I think you must type : set(gca(), 'xticklabels', []) Matthieu - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] problem with set in current svn HEAD
hello, I must be doing something stupid I am trying to test the snippets of code in http://matplotlib.sourceforge.net/users_guide_0.90.0.pdf p.29, and I get : [EMAIL PROTECTED] python]$ python Python 2.5 (r25:51908, Apr 10 2007, 10:29:13) [GCC 4.1.2 20070403 (Red Hat 4.1.2-8)] on linux2 Type help, copyright, credits or license for more information. from pylab import * subplot(211) matplotlib.axes.Subplot instance at 0x9c5412c plot([1,2,3],[1,2,3]) [matplotlib.lines.Line2D instance at 0x9c5a8ac] set(gca(), xticklabels=[]) Traceback (most recent call last): File stdin, line 1, in module TypeError: set() does not take keyword arguments Can somebody help me understand what goes wrong here? thanks, Johann - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now http://get.splunk.com/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] problem with contour3D
hello, the following script correctly plots the 2D exponential, but when I put my mouse on it, matplotlib sends this exception on the terminal : --- exceptions.RuntimeError Traceback (most recent call last) /usr/lib/python2.4/site-packages/matplotlib/backends/backend_qt.py in mouseMoveEvent(self, event) 119 # flipy so y=0 is bottom of canvas 120 y = self.figure.bbox.height() - event.y() -- 121 FigureCanvasBase.motion_notify_event( self, x, y ) 122 if DEBUG: print 'mouse move' 123 /usr/lib/python2.4/site-packages/matplotlib/backend_bases.py in motion_notify_event(self, x, y, guiEvent) 952 event = MouseEvent(s, self, x, y, self._button, self._key, 953guiEvent=guiEvent) -- 954 self.callbacks.process(s, event) 955 956 def draw(self, *args, **kwargs): /usr/lib/python2.4/site-packages/matplotlib/cbook.py in process(self, s, *args, **kwargs) 81 self._check_signal(s) 82 for func in self.callbacks[s].values(): --- 83 func(*args, **kwargs) 84 85 /usr/lib/python2.4/site-packages/matplotlib/backend_bases.py in mouse_move(self, event) 1246 if event.inaxes and event.inaxes.get_navigate(): 1247 - 1248 try: s = event.inaxes.format_coord(event.xdata, event.ydata) 1249 except ValueError: pass 1250 except OverflowError: pass /usr/lib/python2.4/site-packages/matplotlib/axes3d.py in format_coord(self, xd, yd) 375 #lines = [proj3d.line2d(p0,p1) for (p0,p1) in edges] 376 ldists = [(proj3d.line2d_seg_dist(p0,p1,p),i) for i,(p0,p1) in enumerate(edges)] -- 377 ldists.sort() 378 # nearest edge 379 edgei = ldists[0][1] RuntimeError: An array doesn't make sense as a truth value. Use any(a) or all(a). the script is : from pylab import * import numarray as num import matplotlib.axes3d as p3 x = num.arange(-3.,3.,0.01) y = num.arange(-3.,3.,0.01) X, Y = meshgrid(x,y) Z = exp(-(X**2)-(Y**2)) fig=figure() ax = p3.Axes3D(fig) ax.contour3D(X,Y,Z) ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') show() Am I doing something wrong? thanks, Johann - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with saving eps and ps with GTKAgg backend (and current head of SVN)
I am closing the issue I had with ghostscript : I just built in /usr/local ghostscript 8.56 and now saving in eps file does not truncate the figure anymore. Thanks to Darren for pointing out that the FC5 version of ghostscript is way old And it looks like the FC7 version is as old !! Probably a licensing issue. Anyway, thanks. Johann Darren Dale wrote: On Monday 21 May 2007 10:42:26 am you wrote: hi Darren, thanks. I am not sure what you have in mind with the GPL My ghostscript rpm are : [EMAIL PROTECTED] ~]$ rpm -qa | grep ghostscript ghostscript-devel-8.15.2-1.1 ghostscript-8.15.2-1.1 ghostscript-fonts-5.50-13.1 ghostscript-gtk-8.15.2-1.1 There are three different versions of ghostscript: AFPL, GPL (formerly GNU), and ESP ghostscript. You most likely have ESP ghostscript. Fortunately, I just read that ESP and GPL ghostscript are merging as of version 8.57, and the ESP project will be discontinued. Given the fact that I use FC5 I would be surprised to be using very old versions, which then would cause problems. GPL 8.15 was released almost 3 years ago. I had more in mind configuration probl;ems or mismatch There have been all kinds of problems reported on this mailing list with usetex that were solved by upgrading ghostscript to 8.54. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] problem with saving eps and ps with GTKAgg backend (and current head of SVN)
Well, matplotlib starts with a canvas bigger than my screen (vertically only) but in the end it seems to resize it so everything fits in. I can see the whole drawing and the bottom toolbar. Again, saving in png or jpg works perfectly and of course I checked that gv was not cutting the graph when displaying it. I just tried to use GTK as a backend, and ipython tells me that there are non implemented errors on my script I attach it here. thanks! Johann Darren Dale wrote: On Wednesday 09 May 2007 12:19:24 pm Johann Cohen-Tanugi wrote: I am creating a big drawing ( figure(figsize=(16,20)) ), and when I try to save it in eps/ps form, it mishandle the overall size and only save a portion of the drawing. Saving in png or jpg works fine though. Any idea? On my system, you cant create a figure that is larger than the monitor size, unless I use a non-gui backend like agg or ps. It doesnt matter whether I save an eps, png, or jpg. Also, make sure your postscript viewer is not truncating the page due to an inappropriate page size setting. Darren import numarray from pylab import * rc('text', usetex=True) m=0. #CASE 1 figure(figsize=(16,20)) subplot(311) #title('CASE 1') tRsh = 1.15 gstar2 = 2 tRemax = 1.05 tRe = numarray.arange(0.0,tRemax+0.04,0.005,numarray.Float32) x = tRe y = sqrt(tRe*( gstar2*((tRsh - tRe)**2 - (1-tRe)**2) + (tRsh-tRe)*(tRsh**(m+1) - tRe**(m+1))/(m+1) )) y[numarray.isnan(y)]=0.0 print x[-1],y[-1] plot([-0.0,1.2],[0,0],b,hold=False) plot(x,y,b,linewidth=3) plot(x,-y,b,linewidth=3) text(1.,-0.05,r'$R_t$',size=26) text(0.25,0.3,r'$R_e$',size=26) text(0.6,0.37,r'$r$',size=26) plot([0,x[50]],[0,y[50]],r,hold=True) plot([x[50],1],[y[50],0],r,hold=True) an=linspace(0,pi/12,10) plot(1+0.3*cos(pi-an),0.4*gstar2*sin(an),g) text(0.67,0.01,r'$\theta_r$',size=26) an=linspace(0,pi/6,10) plot(0.15*cos(an),0.3*gstar2*sin(an),g) text(0.17,0.01,r'$\theta_e$',size=26) s=linspace(-arcsin(0.099/0.75),arcsin(0.12/0.75),10) plot(tRsh*cos(s),4*sin(s),g--) #s=linspace(-arcsin(0.2),arcsin(0.3),10) #plot(tRsh*cos(s), gstar2*tRsh*sin(s),g--) text(1.05,0.3,r'$R_{sh}(t_t)$',size=26) text(1.05,-0.70,'CASE 1',size=26) #CASE 2 #figure(figsize=(16,8)) subplot(312) Remax=1. tRe = numarray.arange(0.0,Remax+0.001,0.001,numarray.Float32) plot([-0.0,1.2],[0,0],b,hold=False) Re_gammaTheta = sqrt(tRe*(1- tRe)/(m+1)*(1.-tRe**(m+1))) plot(tRe,Re_gammaTheta,b,linewidth=3,hold=True) plot(tRe,-Re_gammaTheta,b,linewidth=3,hold=True) plot([0,tRe[600]],[0,Re_gammaTheta[600]],r,hold=True) plot([tRe[600],1],[Re_gammaTheta[600],0],r,hold=True) #xlabel(r'$R_e$',fontsize=24) #text(-0.15,0, r'$R_e\gamma_t\theta_e$',fontsize=24) text(-0.15,0, r'$x_e/\gamma_t/R_t$',fontsize=24) text(-0.15,-0.15, r'$\approx \gamma_t{\tilde{R}}_e\theta_e$',fontsize=24) #text(-0.15,-0.15, r'$\approx \gamma_t{R}_e\theta_e$',fontsize=24) text(1.02,-0.15,r'$R_t=R_{sh}(t_t)$',size=26) text(0.37,0.2,r'$R_e$',size=26) text(0.74,0.1,r'$r$',size=26) an=linspace(0,pi/7,10) plot(0.24*cos(an),0.24*sin(an),g) text(0.25,0.01,r'$\theta_e$',size=26) an=linspace(0,pi/5,10) plot(1+0.15*cos(pi-an),0.15*sin(an),g) text(0.82,0.01,r'$\theta_r$',size=26) #plot the shell at tt s=linspace(-arcsin(0.15/0.75),arcsin(0.15/0.75),10) plot(1.*cos(s),1.7*sin(s),g--) #s=linspace(-arcsin(0.38),arcsin(0.38),10) #plot(1.*cos(s),1.*sin(s),g--) text(1.05,-0.35,'CASE 2', size=26) #CASE 3 #figure(figsize=(16,8)) subplot(313) Remax=0.70 tRe = numarray.arange(0.0,Remax+0.001,0.001,numarray.Float32) Re_gammaTheta = sqrt(tRe*(1- tRe)/(m+1)*(Remax**(m+1)-tRe**(m+1))) plot(tRe,Re_gammaTheta,b,linewidth=3,hold=False) plot(tRe,-Re_gammaTheta,b,linewidth=3,hold=True) plot([0.0,1.2],[0,0],hold=True) plot([0,tRe[100]],[0,Re_gammaTheta[100]],r,hold=True) plot([tRe[100],1],[Re_gammaTheta[100],0],r,hold=True) text(1.,-0.1,r'$R_t$',size=26) text(0.04,0.21,r'$R_e$',size=26) text(0.5,0.15,r'$r$',size=26) #xlabel(r'$R_e$',fontsize=24) xlabel(r'$z_e/R_t \approx{\tilde{R}}_e$',fontsize=24) #xlabel(r'$z_e/R_t \approx{R}_e$',fontsize=24) #text(-0.15,0, r'$R_e\gamma_t\theta_e$',fontsize=24) an=linspace(0,pi/3.7,10) plot(0.08*cos(an),0.16*sin(an),g) text(0.07,0.065,r'$\theta_e$',size=26) an=linspace(0,pi/13,10) plot(1+0.4*cos(pi-an),0.4*sin(an),g) text(0.55,0.005,r'$\theta_r$',size=26) #plot the shell at tt s=linspace(-arcsin(0.11/0.75),arcsin(0.11/0.75),10) plot(0.95*cos(s),2*sin(s),g--) text(0.85,-0.15,r'$R_{sh}(t_t)$',size=26) #theta_r,max #plot([0,tRe[460]],[0,Re_gammaTheta[460]],y) #plot([tRe[460],1],[Re_gammaTheta[460],0],y) plot([0.4,1],[Re_gammaTheta[360],0],y) an=linspace(0,pi/7.2,10) plot(1+0.2*cos(pi-an),0.2*sin(an),y) text(0.8,0.11,r'$\theta_{r,max}$',size=26) text(1.05,-0.25,'CASE 3',size=26) - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net
[Matplotlib-users] problem with saving eps and ps with GTKAgg backend (and current head of SVN)
hello, I am creating a big drawing ( figure(figsize=(16,20)) ), and when I try to save it in eps/ps form, it mishandle the overall size and only save a portion of the drawing. Saving in png or jpg works fine though. Any idea? Thanks, Johann - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] a bug in tex formatting?
, fontsize, dpi): - 1110 Element.set_size_info(self, fontsize, dpi) self.metrics = Element.fonts.get_metrics( 1112 self.font, self.sym, self.fontsize, dpi) /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1021 element.set_size_info(0.7*self.fontsize, dpi) 1022 else: - 1023 element.set_size_info(self.fontsize, dpi) 1024 1025 def pady(self): /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1108 1109 def set_size_info(self, fontsize, dpi): - 1110 Element.set_size_info(self, fontsize, dpi) self.metrics = Element.fonts.get_metrics( 1112 self.font, self.sym, self.fontsize, dpi) /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1021 element.set_size_info(0.7*self.fontsize, dpi) 1022 else: - 1023 element.set_size_info(self.fontsize, dpi) 1024 1025 def pady(self): /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1108 1109 def set_size_info(self, fontsize, dpi): - 1110 Element.set_size_info(self, fontsize, dpi) self.metrics = Element.fonts.get_metrics( 1112 self.font, self.sym, self.fontsize, dpi) /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1021 element.set_size_info(0.7*self.fontsize, dpi) 1022 else: - 1023 element.set_size_info(self.fontsize, dpi) 1024 1025 def pady(self): /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1108 1109 def set_size_info(self, fontsize, dpi): - 1110 Element.set_size_info(self, fontsize, dpi) self.metrics = Element.fonts.get_metrics( 1112 self.font, self.sym, self.fontsize, dpi) /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1021 element.set_size_info(0.7*self.fontsize, dpi) 1022 else: - 1023 element.set_size_info(self.fontsize, dpi) 1024 1025 def pady(self): /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1197 1198 def set_size_info(self, fontsize, dpi): - 1199 self.elements[0].set_size_info(self._scale*fontsize, dpi) 1200 Element.set_size_info(self, fontsize, dpi) 1201 #print 'set size' /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1108 1109 def set_size_info(self, fontsize, dpi): - 1110 Element.set_size_info(self, fontsize, dpi) self.metrics = Element.fonts.get_metrics( 1112 self.font, self.sym, self.fontsize, dpi) /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1021 element.set_size_info(0.7*self.fontsize, dpi) 1022 else: - 1023 element.set_size_info(self.fontsize, dpi) 1024 1025 def pady(self): /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in set_size_info(self, f ontsize, dpi) 1109 def set_size_info(self, fontsize, dpi): 1110 Element.set_size_info(self, fontsize, dpi) - self.metrics = Element.fonts.get_metrics( 1112 self.font, self.sym, self.fontsize, dpi) 1113 /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in get_metrics(self, fon t, sym, fontsize, dpi) 799 800 def get_metrics(self, font, sym, fontsize, dpi): -- 801 basename, metrics, sym, offset = \ 802 self._get_info(font, sym, fontsize, dpi) 803 return metrics /usr/lib/python2.4/site-packages/matplotlib/mathtext.py in _get_info(self, font, sym, fontsize, dpi) 748 num = 0 749 sym = '.notdef' -- 750 raise ValueError('unrecognized symbol %s, %d' % (sym, num) ) 751 filename = os.path.join(self.basepath, basename) + '.ttf' 752 if filename not in bakoma_fonts: ValueError: unrecognized symbol .notdef, 0 On 3/7/07, johann cohen-tanugi [EMAIL PROTECTED] wrote: Hello, I am attaching my python script to this email. It makes three figures, and everything is fine (I started with matplotlib a couple of weeks ago and so far I love it!), but for the way \tilde is dealt with, which seems to be a bug : If I do r'$A\tilde{B}$' the tilde is actually on the A !! If instead I do (like in the attached script) r'$AB\tilde$' then the tilde is on the B, but looks pretty ugly. Is there a quick fix? Do I need to choose another font? thanks for your help, Johann -- - Take Surveys