You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
(7) |
2
(12) |
3
(7) |
4
(23) |
5
(5) |
6
(7) |
7
(4) |
|
8
(7) |
9
(25) |
10
(17) |
11
(25) |
12
(11) |
13
(8) |
14
(6) |
|
15
(1) |
16
(22) |
17
(11) |
18
(12) |
19
(22) |
20
(32) |
21
(9) |
|
22
(4) |
23
(16) |
24
(5) |
25
(9) |
26
(26) |
27
(21) |
28
(14) |
|
29
(6) |
30
(8) |
31
(4) |
|
|
|
|
|
From: Daπid <dav...@gm...> - 2010-08-14 14:47:40
|
Hello. I have had an issue trying to plot an histogram with Matplotlib. The line is: plt.hist([SNIa.angles, SNIbc.angles, SNII.angles], 11, range=[-pi, pi], normed=True,histtype='stepfilled',color=['g', 'r', 'b'],alpha=[1, 0.6, 1]) But the error is raised when I try to save the image. For completness, the whole program is here: http://nopaste.voric.com/paste.php?f=8zl9i4 If I call hist as stated above, I get the following error report: Traceback (most recent call last): File "C:\Documents and Settings\David\Escritorio\Python\IAYC\Supernovae\final\Deprecated\supernovae_bug.py", line 35, in <module> plt.savefig('angular_merged_1bis.png') File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 363, in savefig return fig.savefig(*args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 1084, in savefig self.canvas.print_figure(*args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1886, in print_figure **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 438, in print_png FigureCanvasAgg.draw(self) File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 394, in draw self.figure.draw(self.renderer) File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 798, in draw func(*args) File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 1934, in draw a.draw(renderer) File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\patches.py", line 366, in draw r, g, b, a = colors.colorConverter.to_rgba(self._facecolor, self._alpha) File "C:\Python25\Lib\site-packages\matplotlib\colors.py", line 353, in to_rgba raise ValueError('to_rgba: Invalid rgba arg "%s"\n%s' % (str(arg), exc)) ValueError: to_rgba: Invalid rgba arg "[ 0. 0.5 0. 1. ]" alpha must be in range 0-1 If I delete the color declaring, I get instead: Traceback (most recent call last): File "C:\Documents and Settings\David\Escritorio\Python\IAYC\Supernovae\final\Deprecated\supernovae_bug.py", line 35, in <module> plt.savefig('angular_merged_1bis.png') File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 363, in savefig return fig.savefig(*args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 1084, in savefig self.canvas.print_figure(*args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\backend_bases.py", line 1886, in print_figure **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 438, in print_png FigureCanvasAgg.draw(self) File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 394, in draw self.figure.draw(self.renderer) File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\figure.py", line 798, in draw func(*args) File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\axes.py", line 1934, in draw a.draw(renderer) File "C:\Python25\Lib\site-packages\matplotlib\artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "C:\Python25\Lib\site-packages\matplotlib\patches.py", line 383, in draw renderer.draw_path(gc, tpath, affine, rgbFace) File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_agg.py", line 117, in draw_path self._renderer.draw_path(gc, path, transform, rgbFace) TypeError: float() argument must be a string or a number And works fine without alpha statement. Any change in the other arguments does not make any difference on the behaviour. If I run it from the IDLE, once I get an error, I continue getting it even if the problematic part is fixed, until I restart the program. I am running Matplotlib 1.0.0 y Python 2.5 sobre WXP. I haven't find any reference to this in the documentation, so it seems to be a bug. Regards, David. |
|
From: Simon F. <sim...@a-...> - 2010-08-14 10:30:21
|
On 8/12/10 10:57 PM, Aman Thakral wrote: > I'm fairly sure its just a contour plot with different color mappings > for the lines and the fill. Yeah, I think so but I can't get it right. So if anybody knows what to grep/search for in revisions or which revision it was in that would be much appreciated. Best Simon |
|
From: Rob S. <rm...@rm...> - 2010-08-14 05:31:00
|
>> > > Agreed. The only thing I can think of is that the second figure is > reusing the first. You can try calling plt.figure() at the beginning > of the functions to create a new figure, or call plt.figure() in > between the calls to CreateMemberStatCategoryFigure() and > CreateMemberStatFigure(). I can't be sure since you didn't include the > code that actually calls these functions. > > Ryan > > > -- > Ryan May > Graduate Research Assistant > School of Meteorology > University of Oklahoma > > - Ryan, Thanks. Indeed I did provide the code that actually calls these functions and the functions show all plotting-related lines. Yes, I did not provide the single line call that calls the function that calls the two plotting functions, nor did I provide the call which starts the Python program. And I did not provide runnable code. Everyone's attention was on what code I did or did not provide. It was all there. Naively I thought by code inspection by experts who read this mailing list they could quickly spot my flaw. And a flaw it turned out to be. I took your suggestion to put a plt.figure() call at the beginning of each function that generates a plot and the problem disappeared. Now calling each plotting function sequentially within the same instance of a Python program the second plot does not get scrambled. This is good as it now provides the automation I was hoping for. I've now also found http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.figure and http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.close which look to be important. I was not aware of the need for these functions before. Oversight on my part. Using them now. I'm now off doing more productive things. thanks for the pointer!! |
|
From: Filipe F. <oc...@gm...> - 2010-08-13 18:31:54
|
Hello list,
I know that this is very simple for most of the people, but since it
took some time to figure it out I'm sharing here. It's useful for those
that, like me, have dozens of personalized colormaps in matlab r,g,b lists.
def cmat2cmpl(r, g, b):
"""
Convert matlab style colormap to matplotlib style
Enter a list non normalized RGB values from 0-255
"""
r = np.array(r)/255.
g = np.array(g)/255.
b = np.array(b)/255.
cmap = mpl.colors.ListedColormap(zip(r,g,b))
return cmap
r = [8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 11, 11, 10, 9, 8, 8, 7, 6, 5, 5, 4, 3, 2, 2, 1, 0, 0]
g = [241, 237, 234, 231, 228, 225, 222, 218, 215, 212, 209, 204, 199,
194, 190, 185, 180, 175, 171, 166, 161, 160, 158, 157, 156, 154, 153,
152, 150, 149, 148, 146, 145, 144, 142, 141, 140, 134, 129, 124, 119,
114, 109, 103, 98, 93, 88, 83, 77, 72, 67, 62, 57, 51, 46, 41, 36, 31,
25, 20, 15, 10, 5, 0]
b = [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 247, 240, 232, 225, 217, 210,
202, 195, 188, 180, 173, 165, 158, 150, 143]
mycmap = cmat2cmpl(r, g, b)
a=outer(arange(0,1,0.001),ones(10))
imshow(a,aspect='auto',cmap=mycmap,origin="lower")
|
|
From: Harry B. <hen...@gm...> - 2010-08-13 16:12:57
|
On 8/13/10 5:04 PM, mat...@li... wrote: > Send Matplotlib-users mailing list submissions to > mat...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > or, via email, send a message with subject or body 'help' to > mat...@li... > > You can reach the person managing the list at > mat...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Matplotlib-users digest..." > > > Today's Topics: > > 1. Re: TeX not working with Matplotlib (Jouni Sepp?nen) > 2. Screenshot on homepage (Simon Friedberger) > 3. Re: Screenshot on homepage (Aman Thakral) > 4. Re: Hints on sizing plot elements? (Russell Owen) > 5. False empty strings in csv2rec (Sergi Pons Freixes) > 6. embed matplotlib Figure into Tkinter Canvas (gur...@me...) > > > ---------------------------------------------------------------------- > Message: 1 > > Date: Thu, 12 Aug 2010 18:49:44 +0000 (UTC) > From: Jouni Sepp?nen<jk...@ik...> > Subject: Re: [Matplotlib-users] TeX not working with Matplotlib > To: mat...@li... > Message-ID:<loo...@po...> > Content-Type: text/plain; charset=utf-8 > > Harry Boer<henriaboer@...> writes: > >> This is e-TeX, Version 3.141592-2.1 (Web2C 7.5.2) >> This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009) > These are different versions. Do you have two different TeX distributions > installed on your computer? Yes, I did install TeX Live at a later stage thinking that it would clean up the earlier version. >> ~ Harry$ which latex >> /usr/local/bin/latex > I think TeX Live installs in /usr/texbin on Mac OS X, although it could make > symlinks in /usr/local/bin. Perhaps /usr/texbin/latex is the version you want. OK, but how do I go about this? Where can I set which version to use. I have set my PATH to /usr/texbin in the .bash_profile, .bashrc and .profile (just to make sure), but how can I make this my default version for Matplotlib? I did not see any path variables in the matplotlibrc file and I'm not going to tinker with that if I'm not sure. > > > ------------------------------ > > Message: 2 > Date: Thu, 12 Aug 2010 22:44:43 +0200 > From: Simon Friedberger<sim...@a-...> > Subject: [Matplotlib-users] Screenshot on homepage > To: mat...@li... > Message-ID:<201...@a-...> > Content-Type: text/plain; charset=us-ascii > > Hi list members. > > Does anybody know how to create the graph in the middle of this > http://matplotlib.sourceforge.net/_static/logo_sidebar_horiz.png > image on the homepage. I can't find it in the examples and suspect it > may have been taken out in a previous revision. Does anybody remember? > > Best > Simon > > > > ------------------------------ > > Message: 3 > Date: Thu, 12 Aug 2010 16:57:51 -0400 > From: Aman Thakral<ama...@gm...> > Subject: Re: [Matplotlib-users] Screenshot on homepage > To: mat...@li... > Message-ID: > <AAN...@ma...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi Simon, > > I'm fairly sure its just a contour plot with different color mappings for > the lines and the fill. > > There are several examples of this on the site. > > Start here: > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.contour > > Best of Luck, > Aman > > On Thu, Aug 12, 2010 at 4:44 PM, Simon Friedberger< > sim...@a-...<simon%2Bm...@a-...>> wrote: > >> Hi list members. >> >> Does anybody know how to create the graph in the middle of this >> http://matplotlib.sourceforge.net/_static/logo_sidebar_horiz.png >> image on the homepage. I can't find it in the examples and suspect it >> may have been taken out in a previous revision. Does anybody remember? >> >> Best >> Simon >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by >> >> Make an app they can't live without >> Enter the BlackBerry Developer Challenge >> http://p.sf.net/sfu/RIM-dev2dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > |
|
From: Andrea T. <gur...@me...> - 2010-08-13 15:41:37
|
Dear John, thank you for your suggestion. Unfortunately, I have just tried that and I am positive that it does not work. It works only if the option "frameon" of the figure is True, which is not what I want in this case (I have to produce a pdf with transparent background). Regards, Andrea On Aug 13, 2010, at 17:21 , John Hunter wrote: > On Fri, Aug 13, 2010 at 1:42 AM, <gur...@me...> wrote: >> Dear All, >> >> I am trying to embed a matplotlib Figure into a Tkinter Canvas. The problem is, when I change the content of the figure (e.g. I delete and create new axes) the new items are plotted but the old items are not deleted. The old items disappear immediately when I resize the window. > > Just call fig.canvas.draw() after clearing the old items. This is > what the resize is doing. > > JDH |
|
From: John H. <jd...@gm...> - 2010-08-13 15:24:19
|
On Thu, Aug 12, 2010 at 8:10 PM, Sergi Pons Freixes <sp...@ut...> wrote: > Hi everybody, > > I have a csv file which I would like to read with pylab.csv2rec . The > file has a header row, values speparated by commas, and a lot of > missings as empty entries. So, a line with missings looks like: > col1,col2,,,,col6 . I tried specifyng the parameter with name > "missing", so it reads: Can you post the file, here if it is small, or somewhere like drop.io if it is large? Thanks, JDH |
|
From: John H. <jd...@gm...> - 2010-08-13 15:21:40
|
On Fri, Aug 13, 2010 at 1:42 AM, <gur...@me...> wrote: > Dear All, > > I am trying to embed a matplotlib Figure into a Tkinter Canvas. The problem is, when I change the content of the figure (e.g. I delete and create new axes) the new items are plotted but the old items are not deleted. The old items disappear immediately when I resize the window. Just call fig.canvas.draw() after clearing the old items. This is what the resize is doing. JDH |
|
From: <gur...@me...> - 2010-08-13 06:43:16
|
Dear All,
I am trying to embed a matplotlib Figure into a Tkinter Canvas. The problem is, when I change the content of the figure (e.g. I delete and create new axes) the new items are plotted but the old items are not deleted. The old items disappear immediately when I resize the window.
I have checked that the elements of Tkinter do their job: the Canvas that contains my figure properly refreshes itself etc, so this is an issue with matplotlib. A similar problem happens indeed using matplotlib with pylab from e.g. ipython -- there one solves the problem by calling the method show() of pylab.figure. In the present case I cannot do that because I have to use matplotlib.figure.Figure instead of matplotlib.figure, and the former lacks the show() method.
I googled a lot for this problem and, while many people discusses refreshing issues, I did not find the solution that I need. Please find below my short code for reference. I may be missing understanding of how this FigureCanvasTkAgg function works: as far as I see, it connects the Canvas of Tkinter (that is the widget in the application) to the real matplotlib.figure.Figure that I want to plot.
Any help will be greatly appreciated.
Best regards,
Andrea
################################################################################
# CODE BEGINS
################################################################################
#!/usr/bin/env python
import sys
import numpy as N
import Tkinter
import matplotlib, matplotlib.figure
# Set the backend for matplotlib.
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
class App:
def __init__(self,master):
# Set the properties of the whole window.
master.config(background="gray")
master.wm_title("PaperPlot")
# Create a figure and link it to the Tk canvas.
self.f = matplotlib.figure.Figure(figsize=(3.46, 2.14), frameon=False, dpi=200)
# This canvas links the figure to the Tk canvas.
self.canvas = FigureCanvasTkAgg(self.f, master=master)
self.canvas._tkcanvas.config(background="#c0c0c0", borderwidth=0, highlightthickness=0)
self.canvas.draw()
# The Tk canvas.
self.tkcanvas = self.canvas.get_tk_widget()
self.tkcanvas.pack(fill=Tkinter.X)
# A frame that contains the buttons.
frame0 = Tkinter.Frame(master)
frame0.pack(fill=Tkinter.X, pady=3)
# Buttons.
self.buttonNew = Tkinter.Button(frame0,width=10,text="New",command=self.newPlot)
self.buttonNew.pack(side=Tkinter.LEFT)
self.buttonRun = Tkinter.Button(frame0,width=10,text="Run",command=self.runText)
self.buttonRun.pack(side=Tkinter.LEFT)
self.buttonQuit = Tkinter.Button(frame0,width=10,text='Quit',command=frame0.quit)
self.buttonQuit.pack(side=Tkinter.RIGHT)
self.buttonPrint = Tkinter.Button(frame0,width=10,text="Print",command=self.printPlot)
self.buttonPrint.pack(side=Tkinter.RIGHT)
# A frame that contains the source code of the plot.
frame1 = Tkinter.Frame(master)
frame1.pack(fill=Tkinter.X)
# Text widget with scrollbar that fills the frame and shows the code.
self.scrollbar = Tkinter.Scrollbar(frame1)
self.scrollbar.pack(side=Tkinter.RIGHT, fill=Tkinter.Y)
self.editor = Tkinter.Text(frame1, wrap=Tkinter.WORD, height=20, background="white", yscrollcommand=self.scrollbar.set)
self.editor.pack(fill=Tkinter.X)
self.editor.config(highlightthickness=0)
self.scrollbar.config(command=self.editor.yview)
# Load the file with the source code of the plot.
# theFile = open("plot.py", "r")
# self.editor.insert(Tkinter.END, theFile.read())
# theFile.close()
self.i = 1
def newPlot(self):
self.f.clear()
# HERE SOMETHING IS NEEDED TO FORCE THE FIGURE TO REDRAW!
self.a = self.f.add_axes([0.1*self.i, 0.10*self.i, 0.4, 0.74])
self.i = self.i + 1
self.canvas.draw()
def runText(self):
exec(self.editor.get("0.0", Tkinter.END))
self.canvas.draw()
def printPlot(self):
self.f.savefig("plot.png", dpi=300)
self.f.savefig("plot.pdf")
theText = self.editor.get("0.0", Tkinter.END)
theFile = open("plot.py", "w")
print >> theFile, theText
theFile.close()
# Create the main window of the program.
root = Tkinter.Tk()
# The window is not resizable.
root.resizable(0,0)
# The object that organizes all the widgets and the data in the program.
app = App(root)
# Start the program.
root.mainloop()
################################################################################
# CODE ENDS
################################################################################
|
|
From: Russell O. <ro...@uw...> - 2010-08-13 05:08:09
|
On Aug 12, 2010, at 7:37 AM, Tony S Yu wrote:
> On Aug 12, 2010, at 1:08 AM, Russell E. Owen wrote:
>
>> I'm making a strip chart widget (which I plan to make publicly
>> available
>> when finished). The basics are working fine, but the automatic
>> sizing is
>> not doing so well. Strip charts are typically short, and when
>> suitably
>> short the X axis annotations are partially truncated.
>>
>> So...can I convince the automatic sizer to always show the full X
>> (time)
>> axis annotations and put all the variable sizing into the data
>> area? Or
>> do I have to manually set them somehow?
>
> As far as I know, there's nothing to automatically resize the
> padding around the the axes. (The manual way to do it is to call
> `fig.subplots_adjust`). I wrote a helper script (attached below) to
> adjust the layout so that there's a specified amount of padding
> around the axes.
>
> Unfortunately, this resizer doesn't function correctly when using
> the GTK backend. It apparently works fine with TkAgg, MacOSX, and
> Qt4Agg backends.
Fortunately I'm using TkAgg. I'm sorry (though not surprised) I'll
have to size it manually (especially since users of my application can
change the font size), but I very much appreciate the code.
> Also, is there a way from my software (not a .matplotlibrc file) to
>> globally make the default background color white for axis annotation
>> areas? Right now the background is gray for annotations and while for
>> plot area and I'd prefer it was all white.
>
> Just set plt.rc('figure', facecolor='w') in your code (assuming
> you've imported matplotlib.pyplot as plt).
Perfect. Thanks!
>
> <tight_layout.py>
>
> Usage note: Since it sounds like you're not creating subplots, you
> can just use the `tight_borders` function, instead of the
> `tight_layout` function; the later requires two redraws while the
> first requires only one.
Thank you very much for the advice and script!
I do plan to support strip charts stacked atop each other (all using
the same time range, with tick labels only along the bottom x axis),
which I suspect will need subplots (unless there is now a better way)
but so far all I have is multiple lines (including dynamic and static
-- e.g. to display limits) one one plot.
-- Russell
|
|
From: Sergi P. F. <sp...@ut...> - 2010-08-13 01:26:22
|
Hi everybody,
I have a csv file which I would like to read with pylab.csv2rec . The
file has a header row, values speparated by commas, and a lot of
missings as empty entries. So, a line with missings looks like:
col1,col2,,,,col6 . I tried specifyng the parameter with name
"missing", so it reads:
data = pylab.csv2rec("myfile.csv", missing='')
But it returned: ValueError: empty string for float()
I thought that csv2rec didn't like the empty string '', so I replaced
in my original files all the ",," for ",nan,". I also replaced the ","
at the end of files for ",nan". Next I tried:
data = pylab.csv2rec("myfile.csv", missing="nan")
But the same error again:
/usr/lib/python2.6/site-packages/matplotlib/mlab.pyc in csv2rec(fname,
comments, skiprows, checkrows, delimiter, converterd, names, missing,
missingd, use_mrecords)
2323 if not len(row): continue
2324 if row[0].startswith(comments): continue
-> 2325 rows.append([func(name, val) for func, name, val in
zip(converters, names, row)])
2326 rowmasks.append([ismissing(name, val) for name, val in
zip(names, row)])
2327 fh.close()
/usr/lib/python2.6/site-packages/matplotlib/mlab.pyc in newfunc(name, val)
2195 return default
2196 else:
-> 2197 return func(val)
2198 return newfunc
2199
ValueError: empty string for float()
Next, I tried a manual check for empty strings, being paranoid:
fin = open("myfile.csv")
f = fin.readlines()
fin.close()
for i in range(len(f)):
....: tmp = f[i].split(',')
....: for c in tmp:
....: if c == '':
....: print i
And nothing is printed, so no empty strings. Then I tried
scipy.recfromcsv, and it worked perfectly! OpenOffice also has no
problem with it.
Therefore, it seems that the file is ok, but the csv2rec version from
matplotlib find some inconsistency. Any help? Could it be a bug? (as
the scipy version works flawlessly).
--
Sergi Pons Freixes
Ph.D. Student
Marine Technology Unit
Centre Mediterrani d'Investigacions Marines i Ambientals (CMIMA-CSIC)
Pg. Marítim Barceloneta, 37-49
E-08003 Barcelona (Spain)
Ph. +34 93 230 95 00 (ext. 1510)
Fax. +34 93 230 95 55
sp...@ut...
http://www.utm.csic.es
|
|
From: Aman T. <ama...@gm...> - 2010-08-12 20:58:17
|
Hi Simon, I'm fairly sure its just a contour plot with different color mappings for the lines and the fill. There are several examples of this on the site. Start here: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.contour Best of Luck, Aman On Thu, Aug 12, 2010 at 4:44 PM, Simon Friedberger < sim...@a-... <simon%2Bm...@a-...>> wrote: > Hi list members. > > Does anybody know how to create the graph in the middle of this > http://matplotlib.sourceforge.net/_static/logo_sidebar_horiz.png > image on the homepage. I can't find it in the examples and suspect it > may have been taken out in a previous revision. Does anybody remember? > > Best > Simon > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Aman Thakral B.Eng & Biosci, M.Eng Design |
|
From: Simon F. <sim...@a-...> - 2010-08-12 20:44:51
|
Hi list members. Does anybody know how to create the graph in the middle of this http://matplotlib.sourceforge.net/_static/logo_sidebar_horiz.png image on the homepage. I can't find it in the examples and suspect it may have been taken out in a previous revision. Does anybody remember? Best Simon |
|
From: Jouni S. <jk...@ik...> - 2010-08-12 18:50:04
|
Harry Boer <henriaboer@...> writes: > This is e-TeX, Version 3.141592-2.1 (Web2C 7.5.2) > This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009) These are different versions. Do you have two different TeX distributions installed on your computer? > ~ Harry$ which latex > /usr/local/bin/latex I think TeX Live installs in /usr/texbin on Mac OS X, although it could make symlinks in /usr/local/bin. Perhaps /usr/texbin/latex is the version you want. Jouni Seppänen |
|
From: Jeremy C. <jlc...@gm...> - 2010-08-12 18:35:02
|
I have a problem with the scaling of the numbers on a colorbar. The problem occurs when the numbers used as colorbar labels need to be scaled (i.e. by 1E3). The colorbar correctly puts the scaling value on the top of the colorbar, but instead of of multiplying by a scale factor, addition is used instead. See the attached script and figure for example. In the example, it looks like the color scale goes from 0 to 2*5E3. At least, that's what I thought when I first looked at it. Instead it means 5000 to 5002. Is there anyway I can scale the colorbar labels by *multiplying* them by a scaling factor instead of *adding* a scaling factor? That seems more intuitive to me and those I work with. Jeremy |
|
From: Harry B. <hen...@gm...> - 2010-08-12 17:31:57
|
Jouni, I think you're right. If I run LaTeX from the command line I get the error message: warning: Could not open char translation file `cp8bit.tcx'. This is e-TeX, Version 3.141592-2.1 (Web2C 7.5.2) kpathsea: Running mktexfmt latex.efmt fmtutil: unknown format type: latex.efmt. I can't find the format file `latex.efmt'! But if I run it from TeXShop it runs perfectly: This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009) \write18 enabled. entering extended mode and---- ~ Harry$ which latex /usr/local/bin/latex I don't know whether this is the right forum, but could you tell me how to fix this? I'm running OS X 10.6.4. Thanks, Harry On 8/12/10 4:37 PM, mat...@li... wrote: > Send Matplotlib-users mailing list submissions to > mat...@li... > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > or, via email, send a message with subject or body 'help' to > mat...@li... > > You can reach the person managing the list at > mat...@li... > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Matplotlib-users digest..." > > > Today's Topics: > > 1. PNG without transparency (Miha Tom?i?) > 2. TeX not working with Matplotlib (Harry Boer) > 3. Re: TeX not working with Matplotlib (Jouni Sepp?nen) > 4. Re: Hints on sizing plot elements? (Tony S Yu) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Thu, 12 Aug 2010 08:56:06 +0200 > From: Miha Tom?i?<mih...@gm...> > Subject: [Matplotlib-users] PNG without transparency > To: mat...@li... > Message-ID: > <AAN...@ma...> > Content-Type: text/plain; charset="iso-8859-1" > > Hello! > > I am having trouble saving figures to PNG with Agg backend. The problem is I > can't get a PNG without transparency even if I specify: > > fig.savefig("colorAgg.png", dpi=300, transparent=False) > > identify still indicates there is a 1-bit aplha channel present: > > Image: colorAgg.png > Format: PNG (Portable Network Graphics) > Class: DirectClass > Geometry: 390x300+0+0 > Resolution: 118.11x118.11 > Print size: 3.30201x2.54001 > Units: PixelsPerCentimeter > Type: TrueColorMatte > Endianess: Undefined > Colorspace: RGB > Depth: 8-bit > Channel depth: > red: 8-bit > green: 8-bit > blue: 8-bit > alpha: 1-bit > Channel statistics: > red: > min: 0 (0) > max: 255 (1) > mean: 192.918 (0.756542) > standard deviation: 96.4001 (0.37804) > green: > min: 0 (0) > max: 255 (1) > mean: 189.457 (0.74297) > standard deviation: 98.0884 (0.38466) > blue: > min: 0 (0) > max: 255 (1) > mean: 177.814 (0.697309) > standard deviation: 107.593 (0.421932) > opacity: > min: 0 (0) > max: 0 (0) > mean: 0 (0) > standard deviation: 0 (0) > Histogram: > 75477: (255,255,255, 0) #FFFFFF white > 8184: ( 9,106, 37, 0) #096A25 rgb(9,106,37) > 8119: (113,170, 76, 0) #71AA4C rgb(113,170,76) > 8119: (204, 0, 0, 0) #CC0000 rgb(204,0,0) > 6655: ( 0, 0, 0, 0) #000000 black > 3466: ( 1, 1, 1, 0) #010101 rgb(1,1,1) > 2482: (106,106,106, 0) #6A6A6A rgb(106,106,106) > 287: ( 3, 44, 15, 0) #032C0F rgb(3,44,15) > 285: ( 47, 71, 31, 0) #2F471F rgb(47,71,31) > 285: ( 85, 0, 0, 0) #550000 rgb(85,0,0) > 215: ( 2, 2, 2, 0) #020202 rgb(2,2,2) > 196: (116,116,116, 0) #747474 rgb(116,116,116) > ... > ---------------------------------------------------------------- > > This is not a big deal but there si a problem when I insert this PNGs in PDF > and there si a RGB/CMYK conversion on every page that contains transparent > PNG. > > How can I get rid of the aplha channel completely? How do I tell the backend > to work (or at least save) in pure RGB not in RGBA color space? > > Thanks and take care, > Miha > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 2 > Date: Thu, 12 Aug 2010 09:46:41 +0200 > From: Harry Boer<h....@bc...> > Subject: [Matplotlib-users] TeX not working with Matplotlib > To: mat...@li... > Message-ID:<4C6...@bc...> > Content-Type: text/plain; charset="iso-8859-1" > > Hi there, > > I'm trying to render text with LaTeX using the example on page 53 of the > Matplotlib tutorial; see source code and output below. > It's not working. divipng, (latest)Ghostscript, and LaTeX are all > installed; their executables > in my PATH. Matplotlib is working flawlessly. Help is appreciated. > Thanks, Harry > > $gs > GPL Ghostscript 8.71 (2010-02-10) > Copyright (C) 2010 Artifex Software, Inc. All rights reserved. > This software comes with NO WARRANTY: see the file PUBLIC for details. > GS> > > $dvipng > This is dvipng 1.12 Copyright 2002-2008 Jan-Ake Larsson > > > #EXAMPLE TUTORIAL page 53 > #!/Library/Frameworks/Python.framework/Versions/Current/bin/python > > from matplotlib import rc > from numpy import arange, cos, pi > from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \ > grid, savefig, show > > > rc('text', usetex=True) > rc('font', family='serif') > figure(1, figsize=(6,4)) > ax = axes([0.1, 0.1, 0.8, 0.7]) > t = arange(0.0, 1.0+0.01, 0.01) > s = cos(2*2*pi*t)+2 > plot(t, s) > > xlabel(r'\textbf{time (s)}') > ylabel(r'\textit{voltage (mV)}',fontsize=16) > title(r"\TeX\ is Number > $\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!", > fontsize=16, color='r') > grid(True) > savefig('tex_demo') > > show() > > > ###OUTPUT##### > > warning: Could not open char translation file `cp8bit.tcx'. > kpathsea: Running mktexfmt latex.efmt > fmtutil: unknown format type: latex.efmt. > Traceback (most recent call last): > File "tex.py", line 34, in<module> > savefig('tex_demo') > File > "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/pyplot.py", > line 356, in savefig > return fig.savefig(*args, **kwargs) > File > "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/figure.py", > line 1032, in savefig > self.canvas.print_figure(*args, **kwargs) > --------AND A LOT OF MORE OUTPUT LIKE THE ABOVE-------------- > string:\n%s\nHere is the full report generated by LaTeX: \n\n'% > repr(tex)) + report) > RuntimeError: LaTeX was not able to process the following string: > '$0.0$' > Here is the full report generated by LaTeX: > > This is e-TeX, Version 3.141592-2.1 (Web2C 7.5.2) > I can't find the format file `latex.efmt'! > > > Harry > -------------- next part -------------- > An HTML attachment was scrubbed... > > ------------------------------ > > Message: 3 > Date: Thu, 12 Aug 2010 10:41:41 +0000 (UTC) > From: Jouni Sepp?nen<jk...@ik...> > Subject: Re: [Matplotlib-users] TeX not working with Matplotlib > To: mat...@li... > Message-ID:<loo...@po...> > Content-Type: text/plain; charset=utf-8 > > Harry Boer<h.boer@...> writes: > >> kpathsea: Running mktexfmt latex.efmt >> fmtutil: unknown format type: latex.efmt. > Sounds like your LaTeX installation is broken. Can you run latex by hand? Is it > the same binary that matplotlib ends up calling? > > Jouni Sepp?nen > > > > > > ------------------------------ > > Message: 4 > Date: Thu, 12 Aug 2010 10:37:10 -0400 > From: Tony S Yu<ts...@gm...> > Subject: Re: [Matplotlib-users] Hints on sizing plot elements? > To: Russell E. Owen<ro...@uw...> > Cc: mat...@li... > Message-ID:<E1F...@gm...> > Content-Type: text/plain; charset="us-ascii" > > > On Aug 12, 2010, at 1:08 AM, Russell E. Owen wrote: > >> I'm making a strip chart widget (which I plan to make publicly available >> when finished). The basics are working fine, but the automatic sizing is >> not doing so well. Strip charts are typically short, and when suitably >> short the X axis annotations are partially truncated. >> >> So...can I convince the automatic sizer to always show the full X (time) >> axis annotations and put all the variable sizing into the data area? Or >> do I have to manually set them somehow? > As far as I know, there's nothing to automatically resize the padding around the the axes. (The manual way to do it is to call `fig.subplots_adjust`). I wrote a helper script (attached below) to adjust the layout so that there's a specified amount of padding around the axes. > > Unfortunately, this resizer doesn't function correctly when using the GTK backend. It apparently works fine with TkAgg, MacOSX, and Qt4Agg backends. > > >> Also, is there a way from my software (not a .matplotlibrc file) to >> globally make the default background color white for axis annotation >> areas? Right now the background is gray for annotations and while for >> plot area and I'd prefer it was all white. >> >> -- Russell > > Just set plt.rc('figure', facecolor='w') in your code (assuming you've imported matplotlib.pyplot as plt). > > Best, > -Tony > > > -------------- next part -------------- > A non-text attachment was scrubbed... > Name: tight_layout.py > Type: text/x-python-script > Size: 6017 bytes > Desc: not available > -------------- next part -------------- > > > Usage note: Since it sounds like you're not creating subplots, you can just use the `tight_borders` function, instead of the `tight_layout` function; the later requires two redraws while the first requires only one. > > > ------------------------------ > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by > > Make an app they can't live without > Enter the BlackBerry Developer Challenge > http://p.sf.net/sfu/RIM-dev2dev > > ------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > End of Matplotlib-users Digest, Vol 51, Issue 24 > ************************************************ |
|
From: Benjamin R. <ben...@ou...> - 2010-08-12 15:24:07
|
On Thu, Aug 12, 2010 at 1:56 AM, Miha Tomšič <mih...@gm...> wrote:
> Hello!
>
> I am having trouble saving figures to PNG with Agg backend. The problem is
> I can't get a PNG without transparency even if I specify:
>
> fig.savefig("colorAgg.png", dpi=300, transparent=False)
>
> identify still indicates there is a 1-bit aplha channel present:
>
> Image: colorAgg.png
> Format: PNG (Portable Network Graphics)
> Class: DirectClass
> Geometry: 390x300+0+0
> Resolution: 118.11x118.11
> Print size: 3.30201x2.54001
> Units: PixelsPerCentimeter
> Type: TrueColorMatte
> Endianess: Undefined
> Colorspace: RGB
> Depth: 8-bit
> Channel depth:
> red: 8-bit
> green: 8-bit
> blue: 8-bit
> alpha: 1-bit
> Channel statistics:
> red:
> min: 0 (0)
> max: 255 (1)
> mean: 192.918 (0.756542)
> standard deviation: 96.4001 (0.37804)
> green:
> min: 0 (0)
> max: 255 (1)
> mean: 189.457 (0.74297)
> standard deviation: 98.0884 (0.38466)
> blue:
> min: 0 (0)
> max: 255 (1)
> mean: 177.814 (0.697309)
> standard deviation: 107.593 (0.421932)
> opacity:
> min: 0 (0)
> max: 0 (0)
> mean: 0 (0)
> standard deviation: 0 (0)
> Histogram:
> 75477: (255,255,255, 0) #FFFFFF white
> 8184: ( 9,106, 37, 0) #096A25 rgb(9,106,37)
> 8119: (113,170, 76, 0) #71AA4C rgb(113,170,76)
> 8119: (204, 0, 0, 0) #CC0000 rgb(204,0,0)
> 6655: ( 0, 0, 0, 0) #000000 black
> 3466: ( 1, 1, 1, 0) #010101 rgb(1,1,1)
> 2482: (106,106,106, 0) #6A6A6A rgb(106,106,106)
> 287: ( 3, 44, 15, 0) #032C0F rgb(3,44,15)
> 285: ( 47, 71, 31, 0) #2F471F rgb(47,71,31)
> 285: ( 85, 0, 0, 0) #550000 rgb(85,0,0)
> 215: ( 2, 2, 2, 0) #020202 rgb(2,2,2)
> 196: (116,116,116, 0) #747474 rgb(116,116,116)
> ...
> ----------------------------------------------------------------
>
> This is not a big deal but there si a problem when I insert this PNGs in
> PDF and there si a RGB/CMYK conversion on every page that contains
> transparent PNG.
>
> How can I get rid of the aplha channel completely? How do I tell the
> backend to work (or at least save) in pure RGB not in RGBA color space?
>
> Thanks and take care,
> Miha
>
>
>
Miha,
The documentation states that the 'transparent' kwarg controls whether the
background of the figure and the axes will be transparent. It does not
control the transparency of the figure elements.
I dug a little further and also found that the code that writes PNG files
can only save in RGBA mode and has no capability of writing in RGB mode. It
might be "possible", but it certainly isn't doable through a function
argument. New code will have to be written.
If you would like, you can file a feature request for this at
http://sourceforge.net/tracker/?group_id=80706
In the meantime, I believe it is possible to use ImageMagick:
*convert img-rgba.png -flatten img-rgb.png*
I hope that helps.
Ben Root
|
|
From: Tony S Yu <ts...@gm...> - 2010-08-12 14:37:47
|
On Aug 12, 2010, at 1:08 AM, Russell E. Owen wrote:
> I'm making a strip chart widget (which I plan to make publicly available
> when finished). The basics are working fine, but the automatic sizing is
> not doing so well. Strip charts are typically short, and when suitably
> short the X axis annotations are partially truncated.
>
> So...can I convince the automatic sizer to always show the full X (time)
> axis annotations and put all the variable sizing into the data area? Or
> do I have to manually set them somehow?
As far as I know, there's nothing to automatically resize the padding around the the axes. (The manual way to do it is to call `fig.subplots_adjust`). I wrote a helper script (attached below) to adjust the layout so that there's a specified amount of padding around the axes.
Unfortunately, this resizer doesn't function correctly when using the GTK backend. It apparently works fine with TkAgg, MacOSX, and Qt4Agg backends.
> Also, is there a way from my software (not a .matplotlibrc file) to
> globally make the default background color white for axis annotation
> areas? Right now the background is gray for annotations and while for
> plot area and I'd prefer it was all white.
>
> -- Russell
Just set plt.rc('figure', facecolor='w') in your code (assuming you've imported matplotlib.pyplot as plt).
Best,
-Tony
|
|
From: Jouni S. <jk...@ik...> - 2010-08-12 10:42:02
|
Harry Boer <h.boer@...> writes: > kpathsea: Running mktexfmt latex.efmt > fmtutil: unknown format type: latex.efmt. Sounds like your LaTeX installation is broken. Can you run latex by hand? Is it the same binary that matplotlib ends up calling? Jouni Seppänen |
|
From: Harry B. <h....@bc...> - 2010-08-12 08:13:32
|
Hi there,
I'm trying to render text with LaTeX using the example on page 53 of the
Matplotlib tutorial; see source code and output below.
It's not working. divipng, (latest)Ghostscript, and LaTeX are all
installed; their executables
in my PATH. Matplotlib is working flawlessly. Help is appreciated.
Thanks, Harry
$gs
GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc. All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GS>
$dvipng
This is dvipng 1.12 Copyright 2002-2008 Jan-Ake Larsson
#EXAMPLE TUTORIAL page 53
#!/Library/Frameworks/Python.framework/Versions/Current/bin/python
from matplotlib import rc
from numpy import arange, cos, pi
from matplotlib.pyplot import figure, axes, plot, xlabel, ylabel, title, \
grid, savefig, show
rc('text', usetex=True)
rc('font', family='serif')
figure(1, figsize=(6,4))
ax = axes([0.1, 0.1, 0.8, 0.7])
t = arange(0.0, 1.0+0.01, 0.01)
s = cos(2*2*pi*t)+2
plot(t, s)
xlabel(r'\textbf{time (s)}')
ylabel(r'\textit{voltage (mV)}',fontsize=16)
title(r"\TeX\ is Number
$\displaystyle\sum_{n=1}^\infty\frac{-e^{i\pi}}{2^n}$!",
fontsize=16, color='r')
grid(True)
savefig('tex_demo')
show()
###OUTPUT#####
warning: Could not open char translation file `cp8bit.tcx'.
kpathsea: Running mktexfmt latex.efmt
fmtutil: unknown format type: latex.efmt.
Traceback (most recent call last):
File "tex.py", line 34, in <module>
savefig('tex_demo')
File
"/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/pyplot.py",
line 356, in savefig
return fig.savefig(*args, **kwargs)
File
"/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/matplotlib/figure.py",
line 1032, in savefig
self.canvas.print_figure(*args, **kwargs)
--------AND A LOT OF MORE OUTPUT LIKE THE ABOVE--------------
string:\n%s\nHere is the full report generated by LaTeX: \n\n'%
repr(tex)) + report)
RuntimeError: LaTeX was not able to process the following string:
'$0.0$'
Here is the full report generated by LaTeX:
This is e-TeX, Version 3.141592-2.1 (Web2C 7.5.2)
I can't find the format file `latex.efmt'!
Harry
|
|
From: Miha T. <mih...@gm...> - 2010-08-12 06:56:13
|
Hello!
I am having trouble saving figures to PNG with Agg backend. The problem is I
can't get a PNG without transparency even if I specify:
fig.savefig("colorAgg.png", dpi=300, transparent=False)
identify still indicates there is a 1-bit aplha channel present:
Image: colorAgg.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 390x300+0+0
Resolution: 118.11x118.11
Print size: 3.30201x2.54001
Units: PixelsPerCentimeter
Type: TrueColorMatte
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Channel statistics:
red:
min: 0 (0)
max: 255 (1)
mean: 192.918 (0.756542)
standard deviation: 96.4001 (0.37804)
green:
min: 0 (0)
max: 255 (1)
mean: 189.457 (0.74297)
standard deviation: 98.0884 (0.38466)
blue:
min: 0 (0)
max: 255 (1)
mean: 177.814 (0.697309)
standard deviation: 107.593 (0.421932)
opacity:
min: 0 (0)
max: 0 (0)
mean: 0 (0)
standard deviation: 0 (0)
Histogram:
75477: (255,255,255, 0) #FFFFFF white
8184: ( 9,106, 37, 0) #096A25 rgb(9,106,37)
8119: (113,170, 76, 0) #71AA4C rgb(113,170,76)
8119: (204, 0, 0, 0) #CC0000 rgb(204,0,0)
6655: ( 0, 0, 0, 0) #000000 black
3466: ( 1, 1, 1, 0) #010101 rgb(1,1,1)
2482: (106,106,106, 0) #6A6A6A rgb(106,106,106)
287: ( 3, 44, 15, 0) #032C0F rgb(3,44,15)
285: ( 47, 71, 31, 0) #2F471F rgb(47,71,31)
285: ( 85, 0, 0, 0) #550000 rgb(85,0,0)
215: ( 2, 2, 2, 0) #020202 rgb(2,2,2)
196: (116,116,116, 0) #747474 rgb(116,116,116)
...
----------------------------------------------------------------
This is not a big deal but there si a problem when I insert this PNGs in PDF
and there si a RGB/CMYK conversion on every page that contains transparent
PNG.
How can I get rid of the aplha channel completely? How do I tell the backend
to work (or at least save) in pure RGB not in RGBA color space?
Thanks and take care,
Miha
|
|
From: Russell E. O. <ro...@uw...> - 2010-08-12 05:08:55
|
I'm making a strip chart widget (which I plan to make publicly available when finished). The basics are working fine, but the automatic sizing is not doing so well. Strip charts are typically short, and when suitably short the X axis annotations are partially truncated. So...can I convince the automatic sizer to always show the full X (time) axis annotations and put all the variable sizing into the data area? Or do I have to manually set them somehow? Also, is there a way from my software (not a .matplotlibrc file) to globally make the default background color white for axis annotation areas? Right now the background is gray for annotations and while for plot area and I'd prefer it was all white. -- Russell |
|
From: stetrick <sco...@gm...> - 2010-08-11 22:20:07
|
Setting the matplotlib.use('Agg') seems to have made the problem go away.
Thanks for your patience.
Scott
Christoph Gohlke wrote:
>
> Again, please post a complete script that can reproduce the problem.
> Since you do not need a GUI did you try to use the Agg backend?
>
> Christoph
>
>
>
> On 8/11/2010 2:31 PM, stetrick wrote:
>>
>> I removed and reinstalled everything, and I'm still getting it.
>>
>> I am using the multiprocessing lib. Each process then produces a graph
>> with
>> matplotlib, which is only done with Savefig (never interactively
>> displaced
>> during the creation process). I have nothing special in the
>> configuration
>> - just using the 64-bit windows defaults.
>>
>> Probably some setup thing.
>>
>>
>> Christoph Gohlke wrote:
>>>
>>>
>>>
>>>
>>>>> Christoph
>>>>
>>>> I thought that was fixed:
>>>> http://sourceforge.net/tracker/?func=detail&aid=3015013&group_id=80706&atid=560720
>>>>
>>>> Eric
>>>>
>>>
>>> Yes the bug is fixed. If the program is terminated properly. However,
>>> you can still crash the Python interpreter if you close or kill the
>>> console window while the following script is running.
>>>
>>> python -c"from matplotlib import pyplot;pyplot.hot();input()"
>>>
>>> --
>>> Christoph
>>>
>>> ------------------------------------------------------------------------------
>>> This SF.net email is sponsored by
>>>
>>> Make an app they can't live without
>>> Enter the BlackBerry Developer Challenge
>>> http://p.sf.net/sfu/RIM-dev2dev
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
View this message in context: http://old.nabble.com/Fatal-Python-Error-with-64-bit-versions-tp29392620p29413496.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
|
|
From: Christoph G. <cg...@uc...> - 2010-08-11 21:46:40
|
Again, please post a complete script that can reproduce the problem. Since you do not need a GUI did you try to use the Agg backend? Christoph On 8/11/2010 2:31 PM, stetrick wrote: > > I removed and reinstalled everything, and I'm still getting it. > > I am using the multiprocessing lib. Each process then produces a graph with > matplotlib, which is only done with Savefig (never interactively displaced > during the creation process). I have nothing special in the configuration > - just using the 64-bit windows defaults. > > Probably some setup thing. > > > Christoph Gohlke wrote: >> >> >> >> >>>> Christoph >>> >>> I thought that was fixed: >>> http://sourceforge.net/tracker/?func=detail&aid=3015013&group_id=80706&atid=560720 >>> >>> Eric >>> >> >> Yes the bug is fixed. If the program is terminated properly. However, >> you can still crash the Python interpreter if you close or kill the >> console window while the following script is running. >> >> python -c"from matplotlib import pyplot;pyplot.hot();input()" >> >> -- >> Christoph >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by >> >> Make an app they can't live without >> Enter the BlackBerry Developer Challenge >> http://p.sf.net/sfu/RIM-dev2dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |
|
From: stetrick <sco...@gm...> - 2010-08-11 21:42:55
|
Adding a close() at the end didn't do anything - still get the same message. stetrick wrote: > > I removed and reinstalled everything, and I'm still getting it. > > I am using the multiprocessing lib. Each process then produces a graph > with matplotlib, which is only done with Savefig (never interactively > displaced during the creation process). I have nothing special in the > configuration - just using the 64-bit windows defaults. > > Probably some setup thing. > > > Christoph Gohlke wrote: >> >> >> >> >>>> Christoph >>> >>> I thought that was fixed: >>> http://sourceforge.net/tracker/?func=detail&aid=3015013&group_id=80706&atid=560720 >>> >>> Eric >>> >> >> Yes the bug is fixed. If the program is terminated properly. However, >> you can still crash the Python interpreter if you close or kill the >> console window while the following script is running. >> >> python -c"from matplotlib import pyplot;pyplot.hot();input()" >> >> -- >> Christoph >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by >> >> Make an app they can't live without >> Enter the BlackBerry Developer Challenge >> http://p.sf.net/sfu/RIM-dev2dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- View this message in context: http://old.nabble.com/Fatal-Python-Error-with-64-bit-versions-tp29392620p29413159.html Sent from the matplotlib - users mailing list archive at Nabble.com. |