Re: [Matplotlib-users] (no subject)
Hi, Thanks a lot for the clue, Pierre. Unicode fix this thread, at least for my case. Cheers, Arnaldo. --- *Arnaldo D'Amaral Pereira Granja Russo* Lab. de Estudos dos Oceanos e Clima Instituto de Oceanografia - FURG 2014-09-08 7:06 GMT-03:00 Pierre Haesssig pierre.haes...@crans.org: Le 05/09/2014 21:53, Arnaldo Russo a écrit : The following code plots my table, but greek letters are not in Arial. What about adding greek letters directly with a Unicode string and keeping LaTex only for the table? best, Pierre (my greek and math unicode copy-pasting files attached) -- Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
Le 05/09/2014 21:53, Arnaldo Russo a écrit : The following code plots my table, but greek letters are not in Arial. What about adding greek letters directly with a Unicode string and keeping LaTex only for the table? best, Pierre (my greek and math unicode copy-pasting files attached) Table de caractères grecs à copier-coller - α . β . γ Γ δ Δ ε . ζ . η . θ Θ . . κ . λ Λ μ . ν . ξ Ξ . . π Π ρ . ς . σ Σ τ . υ . φ Φ (et aussi ϕ en U+03d5) χ . ψ Ψ ω Ω Pierre H - 8 fév 2012 MàJ septembre 2012 pour le ϕ mathématique Code Python : l = [unichr(a)+u' '+unichr(b) for a,b in zip(range(0x3b1, 0x3ca), range(0x391,0x3aa)) ] print(u'\n'.join(l)) Table de caractères matheux à copier-coller --- Arithmetic -- plus-minus ± multiplication × division÷ power ² ³ root√ ∛ infinity∞ Operators - integrals and sum ∫ ∬ ∑ partial diff. ∂ increment, Laplace ∆ (different from Greek delta : Δ) nabla ∇ expectation 피 ⟨⟩ probability ℙ norm‖ Relationships - equality= ≈ ≠ ≡ inequality≤ ≥ ⩽ ⩾ proportional to ∝ element of ∈ ∉ subset of ⊂ ⊄ quantifiers ∀ ∃ ∄ Sets integersℕ ℤ 퓝 퓩 real numbersℝ 퓡 complex numbers ℂ 퓒 empty set ∅ Arrows -- arrows : → ⟶ ⇒ maps to : ↦ ⟼ -- Want excitement? Manually upgrade your production database. When you want reliability, choose Perforce Perforce version control. Predictably reliable. http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
Hi Tobi and others, I have tested include other packages (e.g \usepackage{cmbright} ), but it seems to not solve my problem. Including on matplotlibrc, exactly the lines as you said, my output is the same as I have attached (Matplotlib To.png). On pure LaTex, I really don't know how it should be charged. I have tried this: \documentclass{report} \usepackage{fontspec}\setmainfont{Arial}\setmathrm{Arial}\setmathsf{Arial}\setmathtt{Arial}\usepackage{amsmath} \begin{document} $\mu$text $\eta$text $\cdot$ m$^{-2}$ s$^{-1}$ \end{document} Thanks --- *Arnaldo D'Amaral Pereira Granja Russo* Lab. de Estudos dos Oceanos e Clima Instituto de Oceanografia - FURG 2014-09-06 6:19 GMT-03:00 Tobias Winchen tob...@winchen.de: Hi, On Friday 05 September 2014 16:53:47 Arnaldo Russo wrote: I'm trying to figure out how I could use greek letters on axis labels, without italic. I have read a lot about alternatives, but I do need to use LaTeX to insert a table inside the plot area. I use the sfmath package together with the sans-serif latex fonts in matplotlib. The relevant lines in my matplotlibrc are: font.family: sans-serif font.serif : Computer Modern Roman, Times, Palatino, font.sans-serif: Computer Modern Sans serif, Helvetica, Avant Garde, font.cursive : Zapf Chancery font.monospace : Courier, Computer Modern Typewriter text.latex.unicode : True text.latex.preamble : \usepackage{lmodern},\usepackage{sfmath}, \usepackage{amsmath}, \usepackage{amssymb}, \usepackage{siunitx}, This should do what you want? Best regards, Tobi -- Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
How do you do this in a normal LaTeX document? On Fri, Sep 5, 2014 at 12:53 PM, Arnaldo Russo arnaldoru...@gmail.com wrote: Hi, I'm trying to figure out how I could use greek letters on axis labels, without italic. I have read a lot about alternatives, but I do need to use LaTeX to insert a table inside the plot area. Using mathtex it responds with normal font on greek letters. What I`m doing wrong? The following code plots my table, but greek letters are not in Arial. import numpy as npimport matplotlib.pyplot as plt t2 = np.arange(100) fig = plt.figure(figsize=(8,4)) ax = fig.add_subplot(111) plt.rcParams.update({'font.family' : 'sans-serif', 'font.sans-serif' : 'Arial', 'font.style' : 'normal', 'xtick.labelsize' : 12, 'ytick.labelsize' : 12, 'mathtext.fontset' : 'stixsans', 'mathtext.default': 'regular', 'mathtext.tt' : 'Arial', }) plt.subplots_adjust(left=0.12, right=0.95, top=0.95, bottom=0.1) ax.set_xlim(0,100) xvals = [0, 16.6, 33.33, 50, 66.66, 83.33, 100] ax.set_xticks(xvals) ax.set_xticklabels(['tick 0', 'tick 1', 'tick 2','tick 3', 'tick 4', 'tick 5', 'tick 6']) ax.set_ylabel(r'$\mu$text $\eta$text $\cdot$ m$^{-2}$ s$^{-1}$') ax.set_yticklabels(['0', '200', '400', '600', '800', '1000', '1200', '1400']) ax.plot(t2, color='black') ax.fill_between(np.arange(0, len(t2)),t2,0, color='black', alpha=0.8) from matplotlib import rc rc('font',**{'family':'sans-serif','sans-serif':['Arial']}) rc('text', usetex=True) table = r'''\begin{tabular}{lccc}\hlinetick 0 tick 1 tick 2 tick 3 tick 4 tick 5 tick 6 \\\hline Vals 32.00 3.28 5.80 5 8 45 7.3 \\\hline \end{tabular}''' plt.text(20,80,table,size=10) plt.show() And an example using Mathtex, using regular fonts work out of the box, but my table of course is included as plain text. I have to close my IPython session and start it again to correct usage of plot parameters. import numpy as npimport matplotlib.pyplot as plt t2 = np.arange(100) fig = plt.figure(figsize=(8,4)) ax = fig.add_subplot(111) plt.rcParams.update({'xtick.labelsize' : 12, 'ytick.labelsize' : 12, 'mathtext.fontset' : 'stixsans', 'mathtext.default': 'regular', 'mathtext.tt' : 'Arial', }) plt.subplots_adjust(left=0.12, right=0.95, top=0.95, bottom=0.1) ax.set_xlim(0,100) xvals = [0, 16.6, 33.33, 50, 66.66, 83.33, 100] ax.set_xticks(xvals) ax.set_xticklabels(['tick 0', 'tick 1', 'tick 2','tick 3', 'tick 4', 'tick 5', 'tick 6']) ax.set_ylabel(r'$\mu$text $\eta$text $\cdot$ m$^{-2}$ s$^{-1}$') ax.set_yticklabels(['0', '200', '400', '600', '800', '1000', '1200', '1400']) ax.plot(t2, color='black') ax.fill_between(np.arange(0, len(t2)),t2,0, color='black', alpha=0.8) #from matplotlib import rc#rc('font',**{'family':'sans-serif','sans-serif':['Arial']})#rc('text', usetex=True) table = r'''\begin{tabular}{lccc}\hlinetick 0 tick 1 tick 2 tick 3 tick 4 tick 5 tick 6 \\\hline Vals 32.00 3.28 5.80 5 8 45 7.3 \\\hline \end{tabular}''' plt.text(20,80,table,size=10) plt.show() Regards, Arnaldo. --- *Arnaldo D'Amaral Pereira Granja Russo* Lab. de Estudos dos Oceanos e Clima Instituto de Oceanografia - FURG -- Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
When I wanted to make my math text in a LaTeX beamer presentation upright, I added the following to my beamer style file: %%Attempt to get upright math symbols \AtBeginDocument{ \DeclareSymbolFont{pureletters}{\encodingdefault}{\mathfamilydefault}{m}{n} \SetMathAlphabet{\mathrm}{normal}{\encodingdefault}{\rmdefault}{m}{n} \DeclareMathAlphabet{\mathbf}{\encodingdefault}{\mathfamilydefault}{bx}{n} \DeclareMathAlphabet{\mathsf}{\encodingdefault}{\sfdefault}{m}{n} \DeclareMathAlphabet{\mathit}{\encodingdefault}{\mathfamilydefault}{m}{it} \DeclareMathAlphabet{\mathtt}{\encodingdefault}{\ttdefault}{m}{n} \ifx\mv at bold\@undefined\else \SetSymbolFont{numbers}{bold}{\encodingdefault}{\mathfamilydefault}{bx}{n} \SetSymbolFont{pureletters}{bold}{\encodingdefault}{\mathfamilydefault}{bx}{n} \SetMathAlphabet{\mathrm}{bold}{\encodingdefault}{\rmdefault}{bx}{n} \SetMathAlphabet{\mathbf}{bold}{\encodingdefault}{\mathfamilydefault}{bx}{n} \SetMathAlphabet{\mathsf}{bold}{\encodingdefault}{\sfdefault}{bx}{n} \SetMathAlphabet{\mathit}{bold}{\encodingdefault}{\mathfamilydefault}{bx}{it} \SetMathAlphabet{\mathtt}{bold}{\encodingdefault}{\ttdefault}{bx}{n} \fi \def\operator at font{\mathgroup\symnumbers} \DeclareMathSymbol{0}\mathalpha{numbers}{30} \DeclareMathSymbol{1}\mathalpha{numbers}{31} \DeclareMathSymbol{2}\mathalpha{numbers}{32} \DeclareMathSymbol{3}\mathalpha{numbers}{33} \DeclareMathSymbol{4}\mathalpha{numbers}{34} \DeclareMathSymbol{5}\mathalpha{numbers}{35} \DeclareMathSymbol{6}\mathalpha{numbers}{36} \DeclareMathSymbol{7}\mathalpha{numbers}{37} \DeclareMathSymbol{8}\mathalpha{numbers}{38} \DeclareMathSymbol{9}\mathalpha{numbers}{39} \DeclareMathSymbol{A}\mathalpha{pureletters}{41} \DeclareMathSymbol{B}\mathalpha{pureletters}{42} \DeclareMathSymbol{C}\mathalpha{pureletters}{43} \DeclareMathSymbol{D}\mathalpha{pureletters}{44} \DeclareMathSymbol{E}\mathalpha{pureletters}{45} \DeclareMathSymbol{F}\mathalpha{pureletters}{46} \DeclareMathSymbol{G}\mathalpha{pureletters}{47} \DeclareMathSymbol{H}\mathalpha{pureletters}{48} \DeclareMathSymbol{I}\mathalpha{pureletters}{49} \DeclareMathSymbol{J}\mathalpha{pureletters}{4A} \DeclareMathSymbol{K}\mathalpha{pureletters}{4B} \DeclareMathSymbol{L}\mathalpha{pureletters}{4C} \DeclareMathSymbol{M}\mathalpha{pureletters}{4D} \DeclareMathSymbol{N}\mathalpha{pureletters}{4E} \DeclareMathSymbol{O}\mathalpha{pureletters}{4F} \DeclareMathSymbol{P}\mathalpha{pureletters}{50} \DeclareMathSymbol{Q}\mathalpha{pureletters}{51} \DeclareMathSymbol{R}\mathalpha{pureletters}{52} \DeclareMathSymbol{S}\mathalpha{pureletters}{53} \DeclareMathSymbol{T}\mathalpha{pureletters}{54} \DeclareMathSymbol{U}\mathalpha{pureletters}{55} \DeclareMathSymbol{V}\mathalpha{pureletters}{56} \DeclareMathSymbol{W}\mathalpha{pureletters}{57} \DeclareMathSymbol{X}\mathalpha{pureletters}{58} \DeclareMathSymbol{Y}\mathalpha{pureletters}{59} \DeclareMathSymbol{Z}\mathalpha{pureletters}{5A} \DeclareMathSymbol{a}\mathalpha{pureletters}{61} \DeclareMathSymbol{b}\mathalpha{pureletters}{62} \DeclareMathSymbol{c}\mathalpha{pureletters}{63} \DeclareMathSymbol{d}\mathalpha{pureletters}{64} \DeclareMathSymbol{e}\mathalpha{pureletters}{65} \DeclareMathSymbol{f}\mathalpha{pureletters}{66} \DeclareMathSymbol{g}\mathalpha{pureletters}{67} \DeclareMathSymbol{h}\mathalpha{pureletters}{68} \DeclareMathSymbol{i}\mathalpha{pureletters}{69} \DeclareMathSymbol{j}\mathalpha{pureletters}{6A} \DeclareMathSymbol{k}\mathalpha{pureletters}{6B} \DeclareMathSymbol{l}\mathalpha{pureletters}{6C} \DeclareMathSymbol{m}\mathalpha{pureletters}{6D} \DeclareMathSymbol{n}\mathalpha{pureletters}{6E} \DeclareMathSymbol{o}\mathalpha{pureletters}{6F} \DeclareMathSymbol{p}\mathalpha{pureletters}{70} \DeclareMathSymbol{q}\mathalpha{pureletters}{71} \DeclareMathSymbol{r}\mathalpha{pureletters}{72} \DeclareMathSymbol{s}\mathalpha{pureletters}{73} \DeclareMathSymbol{t}\mathalpha{pureletters}{74} \DeclareMathSymbol{u}\mathalpha{pureletters}{75} \DeclareMathSymbol{v}\mathalpha{pureletters}{76} \DeclareMathSymbol{w}\mathalpha{pureletters}{77} \DeclareMathSymbol{x}\mathalpha{pureletters}{78} \DeclareMathSymbol{y}\mathalpha{pureletters}{79} \DeclareMathSymbol{z}\mathalpha{pureletters}{7A} } I don't know if that helps here. Perhaps you would add this to rcParams['latex.preamble'], which was always advertised as being experimental. (You may need to preface it with \makeatletter, and end with \makeatother.) -Sterling On Sep 5, 2014, at 1:21PM, Paul Hobson wrote: How do you do this in a normal LaTeX document? On Fri, Sep 5, 2014 at 12:53 PM, Arnaldo Russo arnaldoru...@gmail.com wrote: Hi, I'm trying to figure out how I could use greek
Re: [Matplotlib-users] (no subject)
From: Francesco Montesano franz.berges...@googlemail.com To: Dorm Eight dormei...@yahoo.com Cc: matplotlib-users@lists.sourceforge.net matplotlib-users@lists.sourceforge.net Sent: Tuesday, March 27, 2012 3:38 PM Subject: Re: [Matplotlib-users] (no subject) Il 27 marzo 2012 05:08, Dorm Eight dormei...@yahoo.com ha scritto: hi, everybody! when I run my script, why there is no figure show up? I downloaded the demos from matplotlib gallery and it didn't work either. x=np.arange(100) y=x**2+3*x-1 pl.plot(x,y) [matplotlib.lines.Line2D object at 0x2581050] pl.show() there is no error, no figure pop-up! Thank you for any answer! Hi Dorm If you can send more info about the operating system and matplotlib version, it's easier to help you (for the latter do import matplotlib print matplotlib.__version__ ) Cheers, Francesco -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Il 30 marzo 2012 13:23, Dorm Eight dormei...@yahoo.com ha scritto: Dear Dorm, please reply to all the list. My system is Fedora 3.3.0-4.fc16.x86_64, after I recently updated the system with 'yum update', the problem appeared. the Matplotlib version is 1.10. I have no idea at all now. I've tested your small example on python 2.6, matplotlib 1.0.0 with MacOSX backend and on Kubuntu 11.04, python 2.7, matplotlib 1.1, with TkAgg and Qt4Agg backends and the small code works for me. In all cases I have set plt.ion() If you save the figure instead of showing, does it work? Which backend are you using: the name is stored in matplotlib.backends.backend Cheers Francesco -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
Dear Dorm, Il 30 marzo 2012 14:17, Dorm Eight dormei...@yahoo.com ha scritto: Dear Francesco, Yes, I just tried it, it can be save perfectly. so might be a problem with the backend. Give a look to this page: http://stackoverflow.com/questions/2512225/matplotlib-not-showing-up-in-mac-osx and try to change the backend. I think that I cannot help much more here. Does anyone else has an idea if there might be any other problem? Cheers, Francesco From: Francesco Montesano franz.berges...@googlemail.com To: Dorm Eight dormei...@yahoo.com; matplotlib-users@lists.sourceforge.net Sent: Friday, March 30, 2012 8:01 PM Subject: Re: [Matplotlib-users] (no subject) From: Francesco Montesano franz.berges...@googlemail.com To: Dorm Eight dormei...@yahoo.com Cc: matplotlib-users@lists.sourceforge.net matplotlib-users@lists.sourceforge.net Sent: Tuesday, March 27, 2012 3:38 PM Subject: Re: [Matplotlib-users] (no subject) Il 27 marzo 2012 05:08, Dorm Eight dormei...@yahoo.com ha scritto: hi, everybody! when I run my script, why there is no figure show up? I downloaded the demos from matplotlib gallery and it didn't work either. x=np.arange(100) y=x**2+3*x-1 pl.plot(x,y) [matplotlib.lines.Line2D object at 0x2581050] pl.show() there is no error, no figure pop-up! Thank you for any answer! Hi Dorm If you can send more info about the operating system and matplotlib version, it's easier to help you (for the latter do import matplotlib print matplotlib.__version__ ) Cheers, Francesco -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users Il 30 marzo 2012 13:23, Dorm Eight dormei...@yahoo.com ha scritto: Dear Dorm, please reply to all the list. My system is Fedora 3.3.0-4.fc16.x86_64, after I recently updated the system with 'yum update', the problem appeared. the Matplotlib version is 1.10. I have no idea at all now. I've tested your small example on python 2.6, matplotlib 1.0.0 with MacOSX backend and on Kubuntu 11.04, python 2.7, matplotlib 1.1, with TkAgg and Qt4Agg backends and the small code works for me. In all cases I have set plt.ion() If you save the figure instead of showing, does it work? Which backend are you using: the name is stored in matplotlib.backends.backend Cheers Francesco -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
Il 27 marzo 2012 05:08, Dorm Eight dormei...@yahoo.com ha scritto: hi, everybody! when I run my script, why there is no figure show up? I downloaded the demos from matplotlib gallery and it didn't work either. x=np.arange(100) y=x**2+3*x-1 pl.plot(x,y) [matplotlib.lines.Line2D object at 0x2581050] pl.show() there is no error, no figure pop-up! Thank you for any answer! Hi Dorm If you can send more info about the operating system and matplotlib version, it's easier to help you (for the latter do import matplotlib print matplotlib.__version__ ) Cheers, Francesco -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
On 02/18/2012 01:44 PM, frank.fei...@hushmail.com wrote: Hello all. I have a rather long code and get always a strange error: can't invoke event command: application has been destroyed while executing event generate $w ThemeChanged (procedure ttk::ThemeChanged line 6) invoked from within ttk::ThemeChanged The code is too long but I found some other code that produces exactly same type of error (see below). Does anybody have an idea what can be done in this case? Thx for some help. Frank. I use: Ubuntu 10.10, 64 bit, Tkinter, Python 2.6, etc ... Confirmed with mpl master, ubuntu 11.04. It seems to be a harmless glitch in Tk. It is triggered by making a figure and then closing it; it does not matter whether anything is drawn in the figure. So the example can be condensed even more to: import matplotlib.pyplot as plt fig1 = plt.figure() plt.close(fig1) fig2 = plt.figure() plt.plot(range(10), 'bo') plt.title('This figure will be shown') plt.show() Eric *** import matplotlib.pyplot as plt fig1 = plt.figure() plt.plot(range(10), 'ro-') plt.title('This figure will be saved but not shown') fig1.savefig('fig1.png') plt.close(fig1) fig2 = plt.figure() plt.plot(range(10), 'bo') plt.title('This figure will be shown') plt.show() -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
..Gain Your Freedom, Manage Your Own Business http://gay68.sexerapide.com/job.link.php?ispage=87dy6 -- Sent using Verizon.net Mobile -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
On Mon, Feb 6, 2012 at 1:07 PM, Debashish Saha silid...@gmail.com wrote: what is the basic difference between the commands import pylab as * import matplotlib.pyplot as plt This page should help you out. Let us know if you have any further questions. http://matplotlib.sourceforge.net/faq/usage_faq.html#matplotlib-pylab-and-pyplot-how-are-they-related Ben Root -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
On Sun, Jan 29, 2012 at 2:21 AM, Paul Hobson pmhob...@gmail.com wrote: There is undoubtedly a more efficient way to do this, but give this a shot: import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 10.5, 0.5) y = -3.0*x + 0.5*x**2 color_list = ['FireBrick', 'Orange', 'DarkGreen', 'DarkBlue', 'Indigo'] limits = np.arange(0, 11, 2) fig, ax1 = plt.subplots() for n, color in enumerate(color_list): lower = np.where(x = limits[n])[0] upper = np.where(x = limits[n+1])[0] index = np.intersect1d(lower, upper) ax1.plot(x[index], y[index], linestyle='-', color=color, linewidth=2) plt.show() HTH, -paul Alternatively, you could replace the loop above with:: indexes = np.searchsorted(x, limits) # add 1 to end index so that segments overlap for i0, i1, color in zip(indexes[:-1], indexes[1:]+1, color_list): ax1.plot(x[i0:i1], y[i0:i1], linestyle='-', color=color, linewidth=2) This is not much different than Paul's example---just whatever you find more readable. -Tony On Fri, Jan 27, 2012 at 8:12 AM, nahren manuel meetnah...@yahoo.com wrote: Dear Users, I want to plot a XY, the X-value is constant, but let assume Y varees from 1-10, so I want o have different colors accordingly for the range 0-2,2-4,4-6,6-8,8-10. thanks a lot najren -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
There is undoubtedly a more efficient way to do this, but give this a shot: import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 10.5, 0.5) y = -3.0*x + 0.5*x**2 color_list = ['FireBrick', 'Orange', 'DarkGreen', 'DarkBlue', 'Indigo'] limits = np.arange(0, 11, 2) fig, ax1 = plt.subplots() for n, color in enumerate(color_list): lower = np.where(x = limits[n])[0] upper = np.where(x = limits[n+1])[0] index = np.intersect1d(lower, upper) ax1.plot(x[index], y[index], linestyle='-', color=color, linewidth=2) plt.show() HTH, -paul On Fri, Jan 27, 2012 at 8:12 AM, nahren manuel meetnah...@yahoo.com wrote: Dear Users, I want to plot a XY, the X-value is constant, but let assume Y varees from 1-10, so I want o have different colors accordingly for the range 0-2,2-4,4-6,6-8,8-10. thanks a lot najren -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
Paul Hobson, on 2012-01-28 23:21, wrote: There is undoubtedly a more efficient way to do this, but give this a shot: import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 10.5, 0.5) y = -3.0*x + 0.5*x**2 color_list = ['FireBrick', 'Orange', 'DarkGreen', 'DarkBlue', 'Indigo'] limits = np.arange(0, 11, 2) fig, ax1 = plt.subplots() for n, color in enumerate(color_list): lower = np.where(x = limits[n])[0] upper = np.where(x = limits[n+1])[0] index = np.intersect1d(lower, upper) ax1.plot(x[index], y[index], linestyle='-', color=color, linewidth=2) Another way (if you're ok with only coloring the markers) would be to use ax1.scatter(x,y,c=colorlist) where the length of all three arguments is the same. Scatter can do that with the size of the markers by passing the s= argument. best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
http://clscomp.com.br/cool01.11.php?SID=981 -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
http://clscomp.com.br/cool01.11.php?SID=685 -- What Every C/C++ and Fortran developer Should Know! Read this article and learn how Intel has extended the reach of its next-generation tools to help Windows* and Linux* C/C++ and Fortran developers boost performance applications - including clusters. http://p.sf.net/sfu/intel-dev2devmay ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
I recently bought a new Macbook Air, with OS X 10.6. I started using a new package manager called homebrew (http://mxcl.github.com/homebrew/) which is simple, clean, and git-based. I find it incredibly easy to use, and my numpy/scipy/mpl stack (using repo MPL) installed very smoothly. The package will build everything from scratch, and it builds python2.7 for you. Here is what I did on my new computer. (NOTE: I had some trouble replicating this on an older computer, but eventually got it working. If this doesn't work for you, let me know, and I'll give you info on the other install I did with homebrew.) brew install python brew install pip # install gfortran from here: # http://r.research.att.com/tools/ brew install fftw brew install suite-sparse # based on: http://mail.scipy.org/pipermail/numpy-discussion/2010-August/052227.html # download numpy 1.5.1 # download scipy 0.8.0 # tarballs # set the following environment vars: export MACOSX_DEPLOYMENT_TARGET=10.6 export CFLAGS=-arch i386 -arch x86_64 export FFLAGS=-m32 -m64 export LDFLAGS=-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64 -framework Accelerate # in numpy directory: python setup.py build --fcompiler=gnu95 python setup.py install # in scipy directory: python setup.py build --fcompiler=gnu95 sudo python setup.py install # fresh shell pip install ipython Uri ... Uri Laserson Graduate Student, Biomedical Engineering Harvard-MIT Division of Health Sciences and Technology M +1 917 742 8019 laser...@mit.edu On Tue, Jan 25, 2011 at 05:09, Peter Smale peter.sm...@gmail.com wrote: Hi, I am using Matplotlib with python 2.6 on a MacBook Pro (Mac OS X 10.6): Darwin Peters-MacBook-Pro.local 10.6.0 Darwin Kernel Version 10.6.0: Wed Nov 10 18:13:17 PST 2010; root:xnu-1504.9.26~3/RELEASE_I386 i386 I had a hard job getting matplotlib going, but eventually managed it using an easy_install script that installed scipy and numpy as well. Matplotlib would not work with the EPD distribution on my machine. I also tried installing python 2.7 on my mac and working with that but it didn't work either. So I deleted all (I hope) the python stuff I had tried to get going, including environment variables, keeping just the default python 2.6 that comes with Mac OS X 10.6. Now matplotlib works just fine. But now when I run port selfupdate and then port -v upgrade outdated i get the following error: ... --- Activating python26 @2.6.6_1 Error: Target org.macports.activate returned: Image error: /opt/local/bin/python2.6 already exists and does not belong to a registered port. Unable to activate port python26. Use 'port -f activate python26' to force the activation. Error: Failed to install python26 Log for python26 is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/main.log Error: The following dependencies were not installed: python26 Error: Unable to upgrade port: 1 To report a bug, see http://guide.macports.org/#project.tickets I wonder if this is due to an old failed install that I tried with macports. My question is: can I force this activation and know that my matplotlib etc will still work? If this is nothing to do with updating the shipped python, how can I stop macports trying to upgrade python 2.6? I really don't want to do anything that will break my lovely matplotlib again. This might be more of a macports question, but I'm interested to hear of others' experiences with matplotlib on mac OS X 10.6 anyway. Cheers, Peter -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
On Sun, Dec 5, 2010 at 5:29 AM, prem kiran premiitm...@gmail.com wrote: THANK YOU thank you for the response .I have problem using sympy libraray in python.I am unable to use plot module .I am unable to import it .what i require is given a function ,i should be able to plot it with all the axes with and origin marked.also i should be able to zoom out the graph and zoom in.Is there any such module?.This sympy is coming clsoe to my requirements an dihave started using it but ended up here.kindly reply if you know the solution. THANKS ONCE AGAIN Prem, I am getting a little bit confused. Have you been using SymPy and you are having difficulty getting the results to plot? If so, is that the reason why you are looking for another way to get your expressions plotted? If this is the case, then you need to take a completely different approach. Obviously, if the Plot module in SymPy is not working, then your installation is somehow messed up and needs to be fixed. SymPy will do everything you need it to do. I suggest contacting the people on the SymPy mailing list: http://groups.google.com/group/sympy?pli=1 and see if they can help you with the plotting issue. Be sure to tell them that you are having difficulty with importing the Plot module. Copy and paste the error message that you get so that they can help you resolve that issue. Ben Root -- What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
On Sat, Dec 4, 2010 at 7:41 AM, prem kiran premiitm...@gmail.com wrote: hi I have got a parametric equation in string form .Now , i want to plot the function for the above equation and find slope for some points on the function.Is there a way to find it using the matplotlib library ?.if there isn't, is there another library which i could use for the above said task. THANK YOU Prem, Matplotlib is used for plotting given data. NumPy is used to perform calculations to produce the data (which, in turn, matplotlib can plot it). However, you said that you have the equation in a string form. Are you looking to be able to evaluate any arbitrary parametric equation (given possibly by user input, perhaps?). If so, then maybe you need to look at Numexpr which can evaluate a string expression for you and return numpy arrays of the result. http://www.scipy.org/SciPyPackages/NumExpr Let us know if you have any questions. Ben Root -- What happens now with your Lotus Notes apps - do you make another costly upgrade, or settle for being marooned without product support? Time to move off Lotus Notes and onto the cloud with Force.com, apps are easier to build, use, and manage than apps on traditional platforms. Sign up for the Lotus Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
On Wed, Mar 24, 2010 at 10:55 AM, david.kremer...@gmail.com wrote: Hello. I would like to know, please, how you can add graphics on a same plot. eg : superpose sine and cosine graphs on the same plot. If you're just starting out with matplotlib, spending some time in our gallery is a great place to learn: http://matplotlib.sourceforge.net/gallery.html For your particular need, I'd look at: http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo2.html Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma -- 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] (no subject)
jouni k seppänen wrote: By the way - do all backends support arbitrary clip paths now? If so, the hatch implementation of backend_ps could perhaps be generalized to all backends, or it could even be done in the Patch class and not the backend. That's a very good suggestion. All except Gdk support clip paths now. So supporting hatching everywhere is definitely something for the TODO list. Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
Jae-Joon Lee lee.j.j...@... writes: It seems as a bug in the pdf backend, which can be fixed by the simple patch below. I didn't commit this fix as I think it would be better if original author (Jouni?) make sure this is a correct way. Your patch is correct - I probably copy-pasted the cache code from some other function and didn't pay attention to what exactly is being cached. I am unable to commit myself, since I am traveling. Please feel free to commit the fix. ps. I didn't know that hatch is supported in pdf backend. The documentation needs update. Also the patch demo or some unit test should cover that branch of the code, ie the case when more than one patch has the same hatch pattern. By the way - do all backends support arbitrary clip paths now? If so, the hatch implementation of backend_ps could perhaps be generalized to all backends, or it could even be done in the Patch class and not the backend. Jouni -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
On Sat, Dec 20, 2008 at 8:52 AM, jouni k seppänen j...@iki.fi wrote: Also the patch demo or some unit test should cover that branch of the code, ie the case when more than one patch has the same hatch pattern. I just check in the patch with a slight change in the hatch_demo.py Regards, -JJ -- ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] (no subject)
I've committed these changes to matplotlib SVN, and it should make it into the next release of 0.91.x, if we decide to make one. You may be right that Qt's SVG support is iffy (I don't know enough about the spec to be sure, so I'm not conceding that), but either way it doesn't bother me to make changes that help SVG work in more places. It's like all those pragmatic web developers who have to make things work with IE... Thanks for your help. I'll try to get the Qt SVG demo installed here so I can test with that the next time our SVG code changes. Cheers, Mike Christiaan Putter wrote: Hi Michael, Sorry for getting back to you only now, and thanks for the help. If you have Qt installed there should be an sample Svg viewer app in the examples somewhere. If you'd like I can send it to you somehow, just let me know. I tested the new .svg you sent me it's rendering the same in Firefox and Qt. So it works. Once again thanks for your help and let me know if I can send you something to help with testing in Qt. Personally I think Qt's support for svg is still a bit iffy. Have a nice, Christiaan On 04/01/2008, *Michael Droettboom* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Can you please test the attached SVG file? Cheers, Mike Michael Droettboom wrote: Between 0.90 and 0.91, the SVG backend was changed to store the glyph outlines of the characters in the SVG file itself. (This is on by default, but can be turned off with the rc parameter svg.embed_char_paths). This helps make the SVG files much more portable, as the need to install the math fonts has long been a FAQ on this list. I've been doing all my testing with Firefox and Inkscape. Is there a simple Qt-based SVG viewer I could add to my testing regimen? I won't pretend to be an expert on the SVG spec, but it does say this: http://www.w3.org/TR/SVG/struct.html#Head To provide some SVG user agents with an opportunity to implement efficient implementations in streaming environments, creators of SVG content are encouraged to place all elements which are targets of local URI references within a 'defs' element which is a direct child of one of the ancestors of the referencing element. For example: ?xml version=1.0 standalone=no? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; svg width=8cm height=3cm xmlns=http://www.w3.org/2000/svg; descLocal URI references within ancestor's 'defs' element./desc defs linearGradient id=Gradient01 stop offset=20% stop-color=#39F / stop offset=90% stop-color=#F3F / /linearGradient /defs rect x=1cm y=1cm width=6cm height=1cm fill=url(#Gradient01) / !-- Show outline of canvas using 'rect' element -- rect x=.01cm y=.01cm width=7.98cm height= 2.98cm fill=none stroke=blue stroke-width=.02cm / /svg View this example as SVG (SVG-enabled browsers only) In the document above, the linear gradient is defined within a 'defs' element which is the direct child of the 'svg' element, which in turn is an ancestor of the 'rect' element which references the linear gradient. Thus, the above document conforms to the guideline. So we are complying to that part of the spec. The spec doesn't seem to say anything about whether the defs must appear before or after their use -- but maybe I just can't find the relevant paragraph. In any case, this should be easy enough to fix on matplotlib's end, and certainly won't break compliance with the spec. I'll have a look, and may come back to you for help with testing with Qt if you don't mind. Cheers, Mike Christiaan Putter wrote: Hi there, Just an update regarding the svg problem I was having: I simply went back to 0.90 and that's working now. Would still be nice to know if the svg output from matplotlib complies with the standard or whether it's Qt that's messing things up. Merry x-mass! cputter On 21/12/2007, *Christiaan Putter* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi guys and girls, Quick question regarding matplotlib's svg backend... I've embeded pyhton into c++ and Qt's (4.3.3) svg support is having some problems with .svg files created by matplotlib. Text
Re: [Matplotlib-users] (no subject)
Hi Michael, Sorry for getting back to you only now, and thanks for the help. If you have Qt installed there should be an sample Svg viewer app in the examples somewhere. If you'd like I can send it to you somehow, just let me know. I tested the new .svg you sent me it's rendering the same in Firefox and Qt. So it works. Once again thanks for your help and let me know if I can send you something to help with testing in Qt. Personally I think Qt's support for svg is still a bit iffy. Have a nice, Christiaan On 04/01/2008, Michael Droettboom [EMAIL PROTECTED] wrote: Can you please test the attached SVG file? Cheers, Mike Michael Droettboom wrote: Between 0.90 and 0.91, the SVG backend was changed to store the glyph outlines of the characters in the SVG file itself. (This is on by default, but can be turned off with the rc parameter svg.embed_char_paths). This helps make the SVG files much more portable, as the need to install the math fonts has long been a FAQ on this list. I've been doing all my testing with Firefox and Inkscape. Is there a simple Qt-based SVG viewer I could add to my testing regimen? I won't pretend to be an expert on the SVG spec, but it does say this: http://www.w3.org/TR/SVG/struct.html#Head To provide some SVG user agents with an opportunity to implement efficient implementations in streaming environments, creators of SVG content are encouraged to place all elements which are targets of local URI references within a 'defs' element which is a direct child of one of the ancestors of the referencing element. For example: ?xml version=1.0 standalone=no? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; svg width=8cm height=3cm xmlns=http://www.w3.org/2000/svg; descLocal URI references within ancestor's 'defs' element./desc defs linearGradient id=Gradient01 stop offset=20% stop-color=#39F / stop offset=90% stop-color=#F3F / /linearGradient /defs rect x=1cm y=1cm width=6cm height=1cm fill=url(#Gradient01) / !-- Show outline of canvas using 'rect' element -- rect x=.01cm y=.01cm width=7.98cm height=2.98cm fill=none stroke=blue stroke-width=.02cm / /svg View this example as SVG (SVG-enabled browsers only) In the document above, the linear gradient is defined within a 'defs' element which is the direct child of the 'svg' element, which in turn is an ancestor of the 'rect' element which references the linear gradient. Thus, the above document conforms to the guideline. So we are complying to that part of the spec. The spec doesn't seem to say anything about whether the defs must appear before or after their use -- but maybe I just can't find the relevant paragraph. In any case, this should be easy enough to fix on matplotlib's end, and certainly won't break compliance with the spec. I'll have a look, and may come back to you for help with testing with Qt if you don't mind. Cheers, Mike Christiaan Putter wrote: Hi there, Just an update regarding the svg problem I was having: I simply went back to 0.90 and that's working now. Would still be nice to know if the svg output from matplotlib complies with the standard or whether it's Qt that's messing things up. Merry x-mass! cputter On 21/12/2007, *Christiaan Putter* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi guys and girls, Quick question regarding matplotlib's svg backend... I've embeded pyhton into c++ and Qt's (4.3.3) svg support is having some problems with .svg files created by matplotlib. Text isn't showing up. Firefox displays the same .svg file correctly though... The problem: It seems some text stuff is stored in a section called defs at the end of the file with stuff linking to this earlier in the file. Qt doesn't like that and only displays the normal plot stuff (lines, etc.) but not the labels and other text. More exact: use xlink:href=#c_7 . references path id=c_7 d=M10.6875 . at the end of the file. When I simply cut and paste the defs section to the beginning of the file it solves the problem. What does the svg standard say about this? I assume Qt's implementation is defect... Has anybody else encountered this problem? I'll send an e-mail to Qt too and ask them about it. Hope you're all having a nice day. Regards, cputter - 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/ ___
Re: [Matplotlib-users] (no subject)
Between 0.90 and 0.91, the SVG backend was changed to store the glyph outlines of the characters in the SVG file itself. (This is on by default, but can be turned off with the rc parameter svg.embed_char_paths). This helps make the SVG files much more portable, as the need to install the math fonts has long been a FAQ on this list. I've been doing all my testing with Firefox and Inkscape. Is there a simple Qt-based SVG viewer I could add to my testing regimen? I won't pretend to be an expert on the SVG spec, but it does say this: http://www.w3.org/TR/SVG/struct.html#Head To provide some SVG user agents with an opportunity to implement efficient implementations in streaming environments, creators of SVG content are encouraged to place all elements which are targets of local URI references within a 'defs' element which is a direct child of one of the ancestors of the referencing element. For example: ?xml version=1.0 standalone=no? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 1.1//EN http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd; svg width=8cm height=3cm xmlns=http://www.w3.org/2000/svg; descLocal URI references within ancestor's 'defs' element./desc defs linearGradient id=Gradient01 stop offset=20% stop-color=#39F / stop offset=90% stop-color=#F3F / /linearGradient /defs rect x=1cm y=1cm width=6cm height=1cm fill=url(#Gradient01) / !-- Show outline of canvas using 'rect' element -- rect x=.01cm y=.01cm width=7.98cm height=2.98cm fill=none stroke=blue stroke-width=.02cm / /svg View this example as SVG (SVG-enabled browsers only) In the document above, the linear gradient is defined within a 'defs' element which is the direct child of the 'svg' element, which in turn is an ancestor of the 'rect' element which references the linear gradient. Thus, the above document conforms to the guideline. So we are complying to that part of the spec. The spec doesn't seem to say anything about whether the defs must appear before or after their use -- but maybe I just can't find the relevant paragraph. In any case, this should be easy enough to fix on matplotlib's end, and certainly won't break compliance with the spec. I'll have a look, and may come back to you for help with testing with Qt if you don't mind. Cheers, Mike Christiaan Putter wrote: Hi there, Just an update regarding the svg problem I was having: I simply went back to 0.90 and that's working now. Would still be nice to know if the svg output from matplotlib complies with the standard or whether it's Qt that's messing things up. Merry x-mass! cputter On 21/12/2007, *Christiaan Putter* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi guys and girls, Quick question regarding matplotlib's svg backend... I've embeded pyhton into c++ and Qt's (4.3.3) svg support is having some problems with .svg files created by matplotlib. Text isn't showing up. Firefox displays the same .svg file correctly though... The problem: It seems some text stuff is stored in a section called defs at the end of the file with stuff linking to this earlier in the file. Qt doesn't like that and only displays the normal plot stuff (lines, etc.) but not the labels and other text. More exact: use xlink:href=#c_7 . references path id=c_7 d=M10.6875 . at the end of the file. When I simply cut and paste the defs section to the beginning of the file it solves the problem. What does the svg standard say about this? I assume Qt's implementation is defect... Has anybody else encountered this problem? I'll send an e-mail to Qt too and ask them about it. Hope you're all having a nice day. Regards, cputter - 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 mailto:Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users 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
Re: [Matplotlib-users] (no subject)
Hi there, Just an update regarding the svg problem I was having: I simply went back to 0.90 and that's working now. Would still be nice to know if the svg output from matplotlib complies with the standard or whether it's Qt that's messing things up. Merry x-mass! cputter On 21/12/2007, Christiaan Putter [EMAIL PROTECTED] wrote: Hi guys and girls, Quick question regarding matplotlib's svg backend... I've embeded pyhton into c++ and Qt's (4.3.3) svg support is having some problems with .svg files created by matplotlib. Text isn't showing up. Firefox displays the same .svg file correctly though... The problem: It seems some text stuff is stored in a section called defs at the end of the file with stuff linking to this earlier in the file. Qt doesn't like that and only displays the normal plot stuff (lines, etc.) but not the labels and other text. More exact: use xlink:href=#c_7 . references path id=c_7 d=M10.6875 . at the end of the file. When I simply cut and paste the defs section to the beginning of the file it solves the problem. What does the svg standard say about this? I assume Qt's implementation is defect... Has anybody else encountered this problem? I'll send an e-mail to Qt too and ask them about it. Hope you're all having a nice day. Regards, cputter - 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] (no subject)
On Monday 17 September 2007 01:12:46 pm David Montgomery wrote: I am trying to save a sample graph I created as a jpeg image. It seems form the documentation that the type of image can be determined by the extension that is used. Commands seem simple enough. ind = arange(len(importance_IncNodePurity)) # the x locations for the groups width = 0.35 # the width of the bars p1 = bar(ind, importance_IncNodePurity, width, color='r') ylabel('Importance') title('Importance Node Purity') xticks(ind+width, importance_row_names) psave=c:\eclipse\dafaf.jpg savefig(psave) show() However, I seem to get the following errors and I have no idea what they mean. [...] File C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py, line 493, in print_figure raise IOError('Do not know know to handle extension *%s' % ext) IOError: Do not know know to handle extension *.jpg It means the Agg library, which we use for rendering, does not know how to create jpegs. Can you work with png's instead? They are a much better format for plots and line art than jpegs. Darren - 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] (no subject)
On May 7, 2007, at 11:21 AM, Christopher Barker wrote: Praveen Gopalakrishnan wrote: Hi, I'm a newbie trying to install matplotlib (0.87) on Linux (2.6.11,FC4). I have Python 2.4, wxPython 2.8.3 and all required libraries for matplotlib (freetype, libpng, zlib). I'm tring to use wxAgg as the backend, and there is a build error for matplotlib when it tries to compile the wxagg files.. I'm pretty sure that 0.87 will not build with wxPython2.8.* I think it's been fixed in SVN, but not in the 0.90 release either. Chris is correct, you cannot build 0.87's _wxagg module using wxPython 2.8. However, you can edit setup.py and change the value of the BUILD_WXAGG variable from 'auto' to 0. This will inhibit the compilation of the module and everything should work fine. Ken - 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