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
(1) |
2
(4) |
3
(12) |
4
(5) |
5
(30) |
6
(21) |
7
(20) |
8
(11) |
9
(9) |
10
(12) |
11
(11) |
12
(22) |
13
(22) |
14
(38) |
15
(25) |
16
(23) |
17
(20) |
18
(7) |
19
(13) |
20
(13) |
21
(18) |
22
(6) |
23
(7) |
24
(4) |
25
(9) |
26
(35) |
27
(37) |
28
(22) |
29
(27) |
30
(12) |
31
(4) |
Yeah "trying" to plot sun paths. I'll be more than happy to share once it's complete. James. Timmie wrote: > > Hello, > >>>> I am trying to create a plot that resembles the layout of the chart >>>> seen >>>> below: >>>> >>>> http://www.nabble.com/file/p21721073/brisbane.png > are you actually trying to plot sun path digrams? > > May you share a part of your code once it is completed? > > I'd be very interested in seeing a working example. > > Kind regards, > Timme > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/How-to-plot-straight-lines-on-polar-plots-tp21721073p21738933.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hello, >>> I am trying to create a plot that resembles the layout of the chart seen >>> below: >>> >>> http://www.nabble.com/file/p21721073/brisbane.png are you actually trying to plot sun path digrams? May you share a part of your code once it is completed? I'd be very interested in seeing a working example. Kind regards, Timme
Thanks for the help, but I can't quite see where to add the add_axes code. Here is the code I have been using to plot, the polar plot is a subplot. fig=figure() ax=fig.add_subplot(111, polar=True) ax.set_xticklabels(["E",45,"N",315,"W",225,"S",135]) ax.set_yticklabels([80,70,60,50,40,30,20,10]) ... ax.plot(az, alt, 'b') fig.savefig('AzvAlt.png') show() Michael Droettboom-3 wrote: > > I'm embarrassed to see that I neglected to document this, but you can > pass a "resolution" keyword argument to add_axes which sets the number > of points of interpolation between each pair of data points. Set this > to 1 to disable interpolation. > > This will be documented shortly. > > Mike > > jamesf0 wrote: >> Hi, >> >> Im having some trouble with this "seemingly" simple task of plotting >> straight lines/fitted curves on a polar plot. >> >> I am trying to create a plot that resembles the layout of the chart seen >> below: >> >> http://www.nabble.com/file/p21721073/brisbane.png >> >> >> >> So far I have only been able to plot data like so: >> >> http://www.nabble.com/file/p21721073/AzvAlt.png >> >> >> The blue line should be similar to the bottom line of the first example >> plot. The line would ultimately be formed by fitting a straight >> line/curve >> through the points, instead of the way matplotlib is plotting. >> >> I am plotting tuples of values (az and alt), and plotting using: >> >> >> ax.plot(az, alt, 'b') >> > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/How-to-plot-straight-lines-on-polar-plots-tp21721073p21737964.html Sent from the matplotlib - users mailing list archive at Nabble.com.
I'm embarrassed to see that I neglected to document this, but you can pass a "resolution" keyword argument to add_axes which sets the number of points of interpolation between each pair of data points. Set this to 1 to disable interpolation. This will be documented shortly. Mike jamesf0 wrote: > Hi, > > Im having some trouble with this "seemingly" simple task of plotting > straight lines/fitted curves on a polar plot. > > I am trying to create a plot that resembles the layout of the chart seen > below: > > http://www.nabble.com/file/p21721073/brisbane.png > > > > So far I have only been able to plot data like so: > > http://www.nabble.com/file/p21721073/AzvAlt.png > > > The blue line should be similar to the bottom line of the first example > plot. The line would ultimately be formed by fitting a straight line/curve > through the points, instead of the way matplotlib is plotting. > > I am plotting tuples of values (az and alt), and plotting using: > > > ax.plot(az, alt, 'b') > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
>> Thanks, your example works but what I must do so to plot for example y=cos x >> ? I'm a very beginner. > > line, = ax.plot(x, np.cos(x)) > patch = patches.Circle((300,300), radius=100) > line.set_clip_path(patch) > >Everything in the matplotlib figure is an "Artist" (lines, images, >text, rectangles) and you can set the clippath of any artist. See > > http://matplotlib.sourceforge.net/users/artists.html > http://matplotlib.sourceforge.net/api/artist_api.html > >JDH Thanks a lot ! I'll look more precisely the concept of artist later. Best regards. Christophe.
Christopher Barker wrote: > Jeff Whitaker wrote: >> Chris: Here's a self-contained example of the problem (data file >> attached): > > yup -- I get the same problem. Interesting, I thought it might be an > issue with the 'U' flag creating a difference in byte offset, but > that's a unix style file already, so it should make no difference > anyway -- weird. > > Actually, what's probably happening is that the flags are getting > passed in to how python is opening the gzip file itself, in which > case, yes, 'U' would, or course, break things. > > In the MPL code, is the flag passed on through to either file() or > gzip.open() that same way? What I'm getting at is whether it's easy to > use 'U' with raw text files and not with gzipped files. > > In my grepping of the code (SVN head), I only see gzip.open being > called "raw", either with no flags or 'wb', except in mlab.cbook, and > I see you (or someone!) already patched that. However, I might suggest: > > flag = flag.replace('U','') > > instead of: > > if flag == 'rU': flag = 'r' Chris: That's a good idea. Done (r6852). -Jeff > > it case someone passes a U in some other way (not that I know of any > other valid way...) > > > Now I wonder if I can find the energy to submit a bug report to Python... > > -Chris > > > > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
getting carried away here... I took a look at the Python SVN (2.5.4 and 2.6.1) for the gzip lib. I see this: # guarantee the file is opened in binary mode on platforms # that care about that sort of thing if mode and 'b' not in mode: mode += 'b' if fileobj is None: fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb') this is going to break for 'U' == you'll get 'rUb' -- who knowes what that means? now to figure out how to file a ticket... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
On Thu, Jan 29, 2009 at 1:40 PM, <pro...@cl...> wrote: > Thanks, your example works but what I must do so to plot for example y=cos x > ? I'm a very beginner. line, = ax.plot(x, np.cos(x)) patch = patches.Circle((300,300), radius=100) line.set_clip_path(patch) Everything in the matplotlib figure is an "Artist" (lines, images, text, rectangles) and you can set the clippath of any artist. See http://matplotlib.sourceforge.net/users/artists.html http://matplotlib.sourceforge.net/api/artist_api.html JDH
Jeff Whitaker wrote: > Chris: Here's a self-contained example of the problem (data file > attached): yup -- I get the same problem. Interesting, I thought it might be an issue with the 'U' flag creating a difference in byte offset, but that's a unix style file already, so it should make no difference anyway -- weird. Actually, what's probably happening is that the flags are getting passed in to how python is opening the gzip file itself, in which case, yes, 'U' would, or course, break things. In the MPL code, is the flag passed on through to either file() or gzip.open() that same way? What I'm getting at is whether it's easy to use 'U' with raw text files and not with gzipped files. In my grepping of the code (SVN head), I only see gzip.open being called "raw", either with no flags or 'wb', except in mlab.cbook, and I see you (or someone!) already patched that. However, I might suggest: flag = flag.replace('U','') instead of: if flag == 'rU': flag = 'r' it case someone passes a U in some other way (not that I know of any other valid way...) Now I wonder if I can find the energy to submit a bug report to Python... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <title>Flashmail</title> <style type="text/css"> BODY, TABLE, TR, TD, P {margin:0;padding:0;} BODY {background:#FFFFFF;} </style> </head> <body> <P>Thanks, your example works but what I must do so to plot for example y=cos x ? I'm a very beginner.</P> <P> </P> <P>Christophe.</P> <P><BR>----Message d'origine---- <BR>>Date: 2009年1月29日 09:34:11 -0600 <BR>>Sujet: Re: [Matplotlib-users] Plot only inside a disc <BR>>De: John Hunter <BR>>A: pro...@cl... <BR>>Copie à: mat...@li... <BR>> <BR>>On Thu, Jan 29, 2009 at 9:19 AM, <PRO...@CL...>wrote: <BR>>> Hello, <BR>>> I would like to make a kind of magnifying glass. So I need to have a piece of <BR>>> a graph and I would like it to have the form of a disc rather than of a box. <BR>>> So is-it possible to only draw in a disc (I'm searching for a fast way to do <BR>>> that) ? <BR>> <BR>>You can turn off the rendering of the normal axes and axis, and clip <BR>>your data to an arbitrary patch or path; eg <BR>> <BR>> <BR>> """ <BR>> Clipping to arbitrary patches and paths <BR>> """ <BR>> import numpy as np <BR>> import matplotlib.pyplot as plt <BR>> import matplotlib.path as path <BR>> import matplotlib. patches as patches <BR>> <BR>> <BR>> fig = plt.figure() <BR>> ax = fig.add_subplot(111, frameon=False, xticks=[], yticks=[]) <BR>> <BR>> im = ax.imshow(np.random.rand(10,10)) <BR>> <BR>> patch = patches.Circle((300,300), radius=100) <BR>> im.set_clip_path(patch) <BR>> <BR>> plt.show() <BR>> </P></body></html>
Christopher Barker wrote: > Jeff Whitaker wrote: > >> John: 'rU' apparently doesn't work for gzipped text files (at least >> in python 2.5.2). I had to change the default in back to 'r' when >> using gzip.open (r6846 in trunk). > > darn -- sounds like a bug/missing feature in the gzip module. Strange > , though, unknown flags seem to be ignored by file(), and gzip.open > seems to ignore the 'U' too, in my tests (see below). > > I think having the 'U' ignored is less than optimal, but doesn't make > anything worse than it is. What problems did you have? Chris: Here's a self-contained example of the problem (data file attached): >> import gzip >> f = gzip.open('etopo20lats.gz','rU') >> print f.readline() Traceback (most recent call last): File "testread.py", line 3, in <module> print f.readline() File "/sw/lib/python2.5/gzip.py", line 399, in readline c = self.read(readsize) File "/sw/lib/python2.5/gzip.py", line 227, in read self._read(readsize) File "/sw/lib/python2.5/gzip.py", line 279, in _read uncompress = self.decompress.decompress(buf) zlib.error: Error -3 while decompressing: invalid distance too far back >> import gzip >> f = gzip.open('etopo20lats.gz','r') >> print f.readline() '-8.983333330000000672e+01' -Jeff > > tests (on an OS-X system - native unix newlines): > (python 2.5.2) > > >>> file('test_newlines.txt', 'rb').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> file('test_newlines.txt', 'r').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> file('test_newlines.txt', 'U').read() > 'line 1: unix \nline 2: dos \nline 3: mac \nline 4: unix \n' > > # so file() does the right thing > > >>> gzip.open('test_newlines.txt.gz', 'rb').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> gzip.open('test_newlines.txt.gz', 'r').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> gzip.open('test_newlines.txt.gz', 'rU').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > > > # gzip.open() appears to ignore the 'U' flag -- too bad! > > should we post a bug report/feature request to Python? > > -Chris > > > > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
Christopher Barker wrote: > Jeff Whitaker wrote: > >> John: 'rU' apparently doesn't work for gzipped text files (at least >> in python 2.5.2). I had to change the default in back to 'r' when >> using gzip.open (r6846 in trunk). > > darn -- sounds like a bug/missing feature in the gzip module. Strange > , though, unknown flags seem to be ignored by file(), and gzip.open > seems to ignore the 'U' too, in my tests (see below). > > I think having the 'U' ignored is less than optimal, but doesn't make > anything worse than it is. What problems did you have? Chris: If you have basemap, try running the simpletest.py example with matplotlib svn r6845. When the filehandle is obtained using 'rU', it's reading garbage from the gzipped file. Using 'r', it's fine. -Jeff > > tests (on an OS-X system - native unix newlines): > (python 2.5.2) > > >>> file('test_newlines.txt', 'rb').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> file('test_newlines.txt', 'r').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> file('test_newlines.txt', 'U').read() > 'line 1: unix \nline 2: dos \nline 3: mac \nline 4: unix \n' > > # so file() does the right thing > > >>> gzip.open('test_newlines.txt.gz', 'rb').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> gzip.open('test_newlines.txt.gz', 'r').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > >>> gzip.open('test_newlines.txt.gz', 'rU').read() > 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' > > > # gzip.open() appears to ignore the 'U' flag -- too bad! > > should we post a bug report/feature request to Python? > > -Chris > > > > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
I don't see any elegant way to do that. The easiest way I can think of is to use a derived line2d class. Something like below will work. Others may have better ideas. import matplotlib.lines class Line2DNoInterpolation(matplotlib.lines.Line2D): def recache(self): matplotlib.lines.Line2D.recache(self) self._transformed_path.get_transformed_path_and_affine = \ self._transformed_path.get_transformed_points_and_affine ax = subplot(111, projection="polar") r = np.arange(0, 1.0, 0.1) theta = 2*np.pi*r p2 = Line2DNoInterpolation(theta, r, color='r', lw=1) ax.add_line(p2) -JJ On Thu, Jan 29, 2009 at 12:20 AM, jamesf0 <ja...@ut...> wrote: > > Hi, > > Im having some trouble with this "seemingly" simple task of plotting > straight lines/fitted curves on a polar plot. > > I am trying to create a plot that resembles the layout of the chart seen > below: > > http://www.nabble.com/file/p21721073/brisbane.png > > > > So far I have only been able to plot data like so: > > http://www.nabble.com/file/p21721073/AzvAlt.png > > > The blue line should be similar to the bottom line of the first example > plot. The line would ultimately be formed by fitting a straight line/curve > through the points, instead of the way matplotlib is plotting. > > I am plotting tuples of values (az and alt), and plotting using: > > > ax.plot(az, alt, 'b') > -- > View this message in context: http://www.nabble.com/How-to-plot-straight-lines-on-polar-plots-tp21721073p21721073.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Christopher Barker wrote: > here are my test files -- just to save you a minute if you want to try > it yourself. oops -- the email process "fixed" the mixed newlines in test_newlines.txt! At least with my client. It's probably work if you unpack the gz though. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
here are my test files -- just to save you a minute if you want to try it yourself. -CHB -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
C Lewis wrote: > So one argument is that there's > no good reason to risk breaking old defaults, As far as I can see, this won't break any code, though -- Universal newlines won't change anything with native newlines anyway. except maybe with the gzip module... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
Jeff Whitaker wrote: > John: 'rU' apparently doesn't work for gzipped text files (at least in > python 2.5.2). I had to change the default in back to 'r' when using > gzip.open (r6846 in trunk). darn -- sounds like a bug/missing feature in the gzip module. Strange , though, unknown flags seem to be ignored by file(), and gzip.open seems to ignore the 'U' too, in my tests (see below). I think having the 'U' ignored is less than optimal, but doesn't make anything worse than it is. What problems did you have? tests (on an OS-X system - native unix newlines): (python 2.5.2) >>> file('test_newlines.txt', 'rb').read() 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' >>> file('test_newlines.txt', 'r').read() 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' >>> file('test_newlines.txt', 'U').read() 'line 1: unix \nline 2: dos \nline 3: mac \nline 4: unix \n' # so file() does the right thing >>> gzip.open('test_newlines.txt.gz', 'rb').read() 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' >>> gzip.open('test_newlines.txt.gz', 'r').read() 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' >>> gzip.open('test_newlines.txt.gz', 'rU').read() 'line 1: unix \nline 2: dos \r\nline 3: mac \rline 4: unix \n' # gzip.open() appears to ignore the 'U' flag -- too bad! should we post a bug report/feature request to Python? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
To put in an argument each way -- I now recognize that the PEP one gets when looking up "universal newline python" has the necessary info. I saw but did not recognize over the weekend. So one argument is that there's no good reason to risk breaking old defaults, mostly users will be able to solve it themselves. ...*but*, on the other hand: I've checked that more than one Office 2008 install writes files csv2rec can't open without the 'U' flag, and I'm trying to persuade various colleagues that they can move from Excel calculations to Python gradually, and they aren't going to expect line-ending problems. So I guess I see a backwards compatibility problem balanced against a forward evangelizing problem. &C On Jan 29, 2009, at 8:18 AM, Jeff Whitaker wrote: > John Hunter wrote: >> On Wed, Jan 28, 2009 at 2:11 PM, Christopher Barker >> <Chr...@no...> wrote: >> >> >>> But why the heck not? and according to the OP, Excel does create >>> such files. >>> >>> Personally, I try to ALWAYS use 'U' when opening text files -- it >>> can >>> save headaches, and I see no downside. It really should be the >>> default >>> -- it's not, because the default was always text, but that was the >>> same >>> as binary on *nix -- so there is a lot of *nix code out there >>> opening >>> binary files without the 'b' flag. So we couldn't change the default >>> back in 2002, it would have broken a LOT of code. >>> >> >> Fair enough -- changed on the trunk in r6845 >>
John Hunter wrote: > On Wed, Jan 28, 2009 at 2:11 PM, Christopher Barker > <Chr...@no...> wrote: > > >> But why the heck not? and according to the OP, Excel does create such files. >> >> Personally, I try to ALWAYS use 'U' when opening text files -- it can >> save headaches, and I see no downside. It really should be the default >> -- it's not, because the default was always text, but that was the same >> as binary on *nix -- so there is a lot of *nix code out there opening >> binary files without the 'b' flag. So we couldn't change the default >> back in 2002, it would have broken a LOT of code. >> > > Fair enough -- changed on the trunk in r6845 > > JDH > > John: 'rU' apparently doesn't work for gzipped text files (at least in python 2.5.2). I had to change the default in back to 'r' when using gzip.open (r6846 in trunk). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
On Thu, Jan 29, 2009 at 9:19 AM, <pro...@cl...> wrote: > Hello, > I would like to make a kind of magnifying glass. So I need to have a piece of > a graph and I would like it to have the form of a disc rather than of a box. > So is-it possible to only draw in a disc (I'm searching for a fast way to do > that) ? You can turn off the rendering of the normal axes and axis, and clip your data to an arbitrary patch or path; eg """ Clipping to arbitrary patches and paths """ import numpy as np import matplotlib.pyplot as plt import matplotlib.path as path import matplotlib.patches as patches fig = plt.figure() ax = fig.add_subplot(111, frameon=False, xticks=[], yticks=[]) im = ax.imshow(np.random.rand(10,10)) patch = patches.Circle((300,300), radius=100) im.set_clip_path(patch) plt.show()
Hello, I would like to make a kind of magnifying glass. So I need to have a piece of a graph and I would like it to have the form of a disc rather than of a box. So is-it possible to only draw in a disc (I'm searching for a fast way to do that) ? Best regards. Christophe.
On Thu, Jan 29, 2009 at 3:43 AM, Oliver Marks <Oli...@ho...> wrote: > are there any tutorials / examples / documentation on the use of the > cairo backend i am currently using gtk and want to work with cairo for > printing. > > I have looked around and not found much information on this backend. In general, you don't need to know much about a backed to use it, just switch to that backend by either doing import matplotlib matplotlib.use('Cairo') at the top of your script (before importing pylab/pyplot) or making it permanent in your rc file. See http://matplotlib.sourceforge.net/users/customizing.html http://matplotlib.sourceforge.net/faq/installing_faq.html#id1 You can also use cairo rendering in a gtk window by selecting the GTKCairo backend. JDH
On Wed, Jan 28, 2009 at 9:29 PM, Jeff Whitaker <js...@fa...> wrote: > dikshie wrote: >> >> hi, >> does matplotlib support tgif? >> >> >> with best regards, >> > > I had to google tgif to find out that it is the file format output by the > tgif drawing program (http://bourbon.usc.edu:8001/tgif/current.html). It is > not an image format, and matplotlib cannot read or write it. yes, that's what i mean. tgif :) thanks! -dikshie-
are there any tutorials / examples / documentation on the use of the cairo backend i am currently using gtk and want to work with cairo for printing. I have looked around and not found much information on this backend.
hello, I would like to know if there is a way to draw something like x**3+y**2<=3. If there is not a direct way to do that, I would like to know if it could be possible to subclass the method that plots the contours. Best regards. Christophe.