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
(2) |
3
|
4
(1) |
5
|
6
|
7
(2) |
8
(3) |
9
|
10
|
11
(2) |
12
(5) |
13
(2) |
14
(3) |
15
|
16
|
17
|
18
(2) |
19
(8) |
20
(3) |
21
(9) |
22
(3) |
23
|
24
(3) |
25
(1) |
26
(10) |
27
(15) |
28
(8) |
|
|
From: Pierre H. <pie...@cr...> - 2013-02-26 15:30:25
|
Le 26/02/2013 14:38, Gökhan Sever a écrit : > > Could you test my outputs if they look fine on your side? > > http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf > <http://atmos.uwyo.edu/%7Egsever/data/matplotlib/test.pdf> > http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps > <http://atmos.uwyo.edu/%7Egsever/data/matplotlib/test.ps> > Good idea ! * your PDF file looks fine with Okular * your PS indeed has the problem you describe (again Okular) : - "°" (degree sign) is fine - but "⁰" (zero superscript) is replaced by "?" In case it may explain the difference : I'm using mpl 1.1.1rc2 from Debian testing and I have the following line in my matplotlibrc (is it relevant ???) font.sans-serif : DejaVu Sans, sans-serif Best, Pierre |
From: Benjamin R. <ben...@ou...> - 2013-02-26 14:45:35
|
On Tue, Feb 26, 2013 at 7:44 AM, Rita <rmo...@gm...> wrote: > Hi, > > I have a time series data which I am using plot_time(). I am able to get a > legend and I also have axvspan to show weekends. However, how can I state > the "yellow" (axvspan) is a weekend on the legend or is there a better way > to show this? > > I believe you are looking for Proxy Artists: http://matplotlib.org/users/legend_guide.html#using-proxy-artist Cheers! Ben Root |
From: Gökhan S. <gok...@gm...> - 2013-02-26 13:38:49
|
On Tue, Feb 26, 2013 at 6:02 AM, Pierre Haessig <pie...@cr...>wrote: > Hi, > > Le 26/02/2013 12:38, Gökhan Sever a écrit : > > fp = plt.figure(figsize=(8.5, 11)) >> fp.text(0.5, 0.5, u"Temperature, \u00B0C", color='black', fontsize=16) >> plt.savefig('test.ps', papertype='letter') >> plt.savefig('test.pdf', papertype='letter') >> >> Just a thought. Hope it helps. >> >> Ryan >> > > This works fine. However it is easy to remember a superscript o then its > code :) By the way, can you select the text within the PS file? > > > I just noticed that you are using here the character U+2070 "superscript > zero" (⁰) while Ryan's proposition is U+00B0 "degree sign" (°) which I > think is the correct one to use. > > This being said, there should be no difference between using the Unicode > code and actual "°" character (and I agree it's simpler to remember) > You are right, U+00B0 is the right one. I think, I couldn't find a "superscript o" easily then decided to use superscript zero from http://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts However, there is a slight difference in their appearance when I compare them side by side. For simplicity, I just use subscript and superscript unicode symbols to construct simple units. > > In [1]: a = u"Temperature, \u00B0C" > In [2]: a > Out[2]: u'Temperature, \xb0C' > > In [6]: b = u"Temperature °C" > In [7]: b > Out[7]: u'Temperature \xb0C' > > > Coming back to your other question, I can't select the text in the PS file > (using Okular or Evince). (but PDF is selectable) > > Also, the PS file renders properly with both "⁰" and "°" signs. (but with > PDF, the "⁰" is placed to low, while "°" is fine) > Could you test my outputs if they look fine on your side? http://atmos.uwyo.edu/~gsever/data/matplotlib/test.pdf http://atmos.uwyo.edu/~gsever/data/matplotlib/test.ps Thanks. > > Best, > Pierre > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Gökhan |
From: Pierre H. <pie...@cr...> - 2013-02-26 13:03:52
|
Hi, Le 26/02/2013 12:38, Gökhan Sever a écrit : > > fp = plt.figure(figsize=(8.5, 11)) > fp.text(0.5, 0.5, u"Temperature, \u00B0C", color='black', fontsize=16) > plt.savefig('test.ps <http://test.ps>', papertype='letter') > plt.savefig('test.pdf', papertype='letter') > > Just a thought. Hope it helps. > > Ryan > > > This works fine. However it is easy to remember a superscript o then > its code :) By the way, can you select the text within the PS file? I just noticed that you are using here the character U+2070 "superscript zero" (^(0)) while Ryan's proposition is U+00B0 "degree sign" (°) which I think is the correct one to use. This being said, there should be no difference between using the Unicode code and actual "°" character (and I agree it's simpler to remember) In [1]: a = u"Temperature, \u00B0C" In [2]: a Out[2]: u'Temperature, \xb0C' In [6]: b = u"Temperature °C" In [7]: b Out[7]: u'Temperature \xb0C' Coming back to your other question, I can't select the text in the PS file (using Okular or Evince). (but PDF is selectable) Also, the PS file renders properly with both "^(0)" and "°" signs. (but with PDF, the "^(0)" is placed to low, while "°" is fine) Best, Pierre |
From: Rita <rmo...@gm...> - 2013-02-26 12:45:10
|
Hi, I have a time series data which I am using plot_time(). I am able to get a legend and I also have axvspan to show weekends. However, how can I state the "yellow" (axvspan) is a weekend on the legend or is there a better way to show this? -- --- Get your facts first, then you can distort them as you please.-- |
From: Gökhan S. <gok...@gm...> - 2013-02-26 11:39:22
|
On Mon, Feb 25, 2013 at 11:00 PM, Ryan Nelson <rne...@gm...> wrote: > On 2/25/2013 9:29 PM, Gökhan Sever wrote: > > Hello, > > For some reason, I can't get the degree sign showing up in my ps output: > > Here is the simple test code: > > fp = plt.figure(figsize=(8.5, 11)) > fp.text(0.5, 0.5, u"Temperature, ⁰C", color='black', fontsize=16) > plt.savefig('test.ps', papertype='letter') > plt.savefig('test.pdf', papertype='letter') > > PS output shows Temperature, ?C, however PDF renders degree sign > correctly. > > I can't seem to select the text in PS output, but the text is selectable > in PDF. > > This is probably a font issue, where PDF uses DejaVu, on the other hand > PS uses a Times type font. > > So, how can I adjust matplotlib to save in PS file? > > Thanks. > > -- > Gökhan > > Gökhan, > > I tried your code, and everything worked fine for me. (PythonXY 2.7.3.1 on > Windows 7) > However, I usually use the escaped unicode value rather than unicode > characters directly. Does the following work instead: > > fp = plt.figure(figsize=(8.5, 11)) > fp.text(0.5, 0.5, u"Temperature, \u00B0C", color='black', fontsize=16) > plt.savefig('test.ps', papertype='letter') > plt.savefig('test.pdf', papertype='letter') > > Just a thought. Hope it helps. > > Ryan > This works fine. However it is easy to remember a superscript o then its code :) By the way, can you select the text within the PS file? -- Gökhan |
From: Ryan N. <rne...@gm...> - 2013-02-26 06:02:02
|
On 2/25/2013 9:29 PM, Gökhan Sever wrote: > Hello, > > For some reason, I can't get the degree sign showing up in my ps output: > > Here is the simple test code: > > fp = plt.figure(figsize=(8.5, 11)) > fp.text(0.5, 0.5, u"Temperature, ^(0)C", color='black', fontsize=16) > plt.savefig('test.ps <http://test.ps>', papertype='letter') > plt.savefig('test.pdf', papertype='letter') > > PS output shows Temperature, ?C, however PDF renders degree sign > correctly. > > I can't seem to select the text in PS output, but the text is > selectable in PDF. > > This is probably a font issue, where PDF uses DejaVu, on the other > hand PS uses a Times type font. > > So, how can I adjust matplotlib to save in PS file? > > Thanks. > > -- > Gökhan > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users Gökhan, I tried your code, and everything worked fine for me. (PythonXY 2.7.3.1 on Windows 7) However, I usually use the escaped unicode value rather than unicode characters directly. Does the following work instead: fp = plt.figure(figsize=(8.5, 11)) fp.text(0.5, 0.5, u"Temperature, \u00B0C", color='black', fontsize=16) plt.savefig('test.ps <http://test.ps>', papertype='letter') plt.savefig('test.pdf', papertype='letter') Just a thought. Hope it helps. Ryan |
From: Gökhan S. <gok...@gm...> - 2013-02-26 02:30:36
|
Hello, For some reason, I can't get the degree sign showing up in my ps output: Here is the simple test code: fp = plt.figure(figsize=(8.5, 11)) fp.text(0.5, 0.5, u"Temperature, ⁰C", color='black', fontsize=16) plt.savefig('test.ps', papertype='letter') plt.savefig('test.pdf', papertype='letter') PS output shows Temperature, ?C, however PDF renders degree sign correctly. I can't seem to select the text in PS output, but the text is selectable in PDF. This is probably a font issue, where PDF uses DejaVu, on the other hand PS uses a Times type font. So, how can I adjust matplotlib to save in PS file? Thanks. -- Gökhan |
From: patricia <ptr...@ho...> - 2013-02-25 07:27:32
|
Thanks a lot JJ, this worked perfectly! Patricia -- View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446p40467.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Ryan N. <rne...@gm...> - 2013-02-24 20:47:45
|
On 2/24/2013 1:28 PM, Paul Anton Letnes wrote: > Hi everyone, > > I've been looking into making an animation of a mechanical system. In its first incarnation, my plan was as follows: > 1) Make a fading line plot of two variables (say, x and y) > 2) Run a series of such plots through ffmpeg/avencode to generate an animation > > First, I'm wondering whether there's a built-in way of making a fading line plot, i.e. a plot where one end of the line is plotted with high alpha, the other end with low alpha, and intermediate line segments with linearly scaled alpha. For now, I've done this by manually "chunking" the x and y arrays and plotting each chunk with different alpha. Is there a better way? Is there interest in creating such a plotting function and adding it to matplotlib? > > Second, is there a way of integrating the "chunked" generation of fading lines with the animation generating features of matplotlib? It seems possible, although a bit clunky, at present, but maybe someone has a better idea at what overall approach to take than I do. > > Cheers > Paul > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users Paul, I've had to do something similar to what you need, and I found the following example from the Gallery quite helpful: http://matplotlib.org/examples/pylab_examples/multicolored_line.html I think the second plot in particular is pretty close to what you want; however, you'll need to set the alpha values manually. This is what I've done for line collections, scatter plots, etc. _________________________________ import numpy as np import matplotlib.pyplot as plt norm_data = np.random.rand(20) xs = np.random.rand(20) # Pick a colormap and generate the color array for your data cmap = plt.cm.spectral colors = cmap(norm_data) # Reset the alpha data using your desired values colors[:,3] = norm_data # Adding a colorbar is a bit of a pain here, need to use a mappable fig = plt.figure() plt.scatter(xs, norm_data, c=colors, s=55) mappable = plt.cm.ScalarMappable(cmap=cmap) mappable.set_array(norm_data) fig.colorbar(mappable) plt.show() _________________________________ Hope that helps a little. Ryan |
From: Mark L. <bre...@ya...> - 2013-02-24 18:40:27
|
On 24/02/2013 18:28, Paul Anton Letnes wrote: > Hi everyone, > > I've been looking into making an animation of a mechanical system. In its first incarnation, my plan was as follows: > 1) Make a fading line plot of two variables (say, x and y) > 2) Run a series of such plots through ffmpeg/avencode to generate an animation > > First, I'm wondering whether there's a built-in way of making a fading line plot, i.e. a plot where one end of the line is plotted with high alpha, the other end with low alpha, and intermediate line segments with linearly scaled alpha. For now, I've done this by manually "chunking" the x and y arrays and plotting each chunk with different alpha. Is there a better way? Is there interest in creating such a plotting function and adding it to matplotlib? > > Second, is there a way of integrating the "chunked" generation of fading lines with the animation generating features of matplotlib? It seems possible, although a bit clunky, at present, but maybe someone has a better idea at what overall approach to take than I do. > > Cheers > Paul > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > I remember this http://www.johndcook.com/blog/2013/02/20/python-animation-for-mechanical-vibrations/ from a few days back, HTH. -- Cheers. Mark Lawrence |
From: Paul A. L. <pau...@gm...> - 2013-02-24 18:28:36
|
Hi everyone, I've been looking into making an animation of a mechanical system. In its first incarnation, my plan was as follows: 1) Make a fading line plot of two variables (say, x and y) 2) Run a series of such plots through ffmpeg/avencode to generate an animation First, I'm wondering whether there's a built-in way of making a fading line plot, i.e. a plot where one end of the line is plotted with high alpha, the other end with low alpha, and intermediate line segments with linearly scaled alpha. For now, I've done this by manually "chunking" the x and y arrays and plotting each chunk with different alpha. Is there a better way? Is there interest in creating such a plotting function and adding it to matplotlib? Second, is there a way of integrating the "chunked" generation of fading lines with the animation generating features of matplotlib? It seems possible, although a bit clunky, at present, but maybe someone has a better idea at what overall approach to take than I do. Cheers Paul |
From: Neal B. <ndb...@gm...> - 2013-02-22 13:10:37
|
Neal Becker wrote: > Objective: > produce multi-page pdfs using xelatex so I can have advanced latex and stix > fonts (using xits package) > > I've used pdf multipage with the recipe: > > import matplotlib as mpl > mpl.use ('pdf') > import matplotlib.pyplot as plt > > from matplotlib.backends.backend_pdf import PdfPages > pdf = PdfPages('test_uw3.pdf') > for page in ... > fig = plt.figure() > pdf.savefig (fig) > plt.close() > pdf.close() > > Now I'm interested in using xelatex (to use stix fonts). So I saw the > I should use pgf > > If I add: > > from matplotlib.backends.backend_pgf import FigureCanvasPgf > matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf) > > as suggested by > http://matplotlib.org/users/pgf.html > > I get an error: > Traceback (most recent call last): > File "./read_hist3.py", line 121, in <module> > pdf.savefig (fig) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.py", > line 2258, in savefig > figure.savefig(self, format='pdf', **kwargs) > File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1363, > in > savefig > self.canvas.print_figure(*args, **kwargs) > File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line > 2093, in print_figure > **kwargs) > File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line > 1943, in _print_method > return print_method(*args, **kwargs) > File > "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", > line 830, in print_pdf > raise ValueError("filename must be a path or a file-like object") > ValueError: filename must be a path or a file-like object > > Any ideas? > The best thing I've come up with so far is this, which will write out each page to a pdf file, then use subprocess to call 'pdfunite' to join the pdfs. I like the xits-math + xits - it gives a much more unified look so the text and math fonts match. Only problems: It's extremely slow The resulting pdf has duplicate embedded fonts ------------------------------------ import matplotlib as mpl mpl.use ('pgf') import numpy as np import matplotlib.pyplot as plt pgf_with_custom_preamble = { "font.family": "serif", # use serif/main font for text elements "text.usetex": True, # use inline math for ticks "pgf.rcfonts": False, # don't setup fonts from rc parameters 'pgf.texsystem' : 'lualatex', "pgf.preamble": [ r'\usepackage{fontspec,xunicode}', r"\usepackage{unicode-math}", # unicode math setup r"\setmathfont{xits-math.otf}", r'\usepackage{cancel}', r'\usepackage{xcolor}', r'\renewcommand{\CancelColor}{\color{red}}', r'\setmainfont{xits}', ] } mpl.rcParams.update(pgf_with_custom_preamble) for ... plt.savefig ('xxx.pdf') subprocess.call (['pdfunite'] + files + ['test_uw4.pdf']) |
From: Jae-Joon L. <lee...@gm...> - 2013-02-22 01:08:10
|
AxisArtist utilizes a different (compared to the vanilla matplotlib) mechanism for determining tick location etc., so some of the matplotlibcommands do not work. Unfortunately, AxisArtist is still not well documented, and things are often opaque. Below I implemented a method that you can use to control the nbins. To manually specify the tick locations you need to use the FixedLocator. IHTH, -JJ class TaylorDiagram(object): ... def set_nbins(self, nbins): ghelper = self._ax.get_grid_helper() # get grid_helper ghelper.grid_finder.grid_locator2.set_params(nbins=nbins) # update the parameter of the grid_locator2 (2 means 2nd coordinate). Helper. invalidate () # invalidate the helper so that new parameters become effective On Thu, Feb 21, 2013 at 6:08 PM, patricia <ptr...@ho...> wrote: > Dear Jody, > This is the original code that I am using: > http://old.nabble.com/Taylor-diagram-(2nd-take)-p33364690.html > It is a code that plots Taylor diagrams. > I would like to get ticks every two points in the standard deviation axis > of > the Taylor diagrams to avoid overlapping of labels (as I am making a figure > with several small Taylor Diagrams subplots). > Thanks! > Patricia > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446p40454.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Paul H. <pmh...@gm...> - 2013-02-22 00:36:03
|
On Thu, Feb 21, 2013 at 1:08 AM, patricia <ptr...@ho...> wrote: > Dear Jody, > This is the original code that I am using: > http://old.nabble.com/Taylor-diagram-(2nd-take)-p33364690.html > It is a code that plots Taylor diagrams. > I would like to get ticks every two points in the standard deviation axis > of > the Taylor diagrams to avoid overlapping of labels (as I am making a figure > with several small Taylor Diagrams subplots). > Thanks! > Patricia Patrica, Could you post a simple, self contained example that demonstrates your problem (see http://sscce.org/). I'd like to help you, but don't have the bandwidth to dig through all that code. A link to pastebin, a github gist or similar service would be preferred. -paul |
From: Pierre H. <pie...@cr...> - 2013-02-21 17:21:34
|
Le 21/02/2013 17:33, Sudheer Joseph a écrit : > Thank you Pierre, > I will test the other options. I did not > know the number limitation in case of plt.xcorr. > Thanks a lot > with best regards, Just for reference : http://stackoverflow.com/questions/6991471/computing-cross-correlation-function You'll see that (cross)correlation in Python a long ongoing topic. best, Pierre |
From: Sudheer J. <sud...@ya...> - 2013-02-21 16:33:26
|
Thank you Pierre, I will test the other options. I did not know the number limitation in case of plt.xcorr. Thanks a lot with best regards, Sudheer *************************************************************** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo...@gm...;sud...@ya... Web- http://oppamthadathil.tripod.com *************************************************************** ________________________________ From: Pierre Haessig <pie...@cr...> To: mat...@li... Sent: Thursday, 21 February 2013 9:52 PM Subject: Re: [Matplotlib-users] cross correlation Hi Sudheer, Le 21/02/2013 02:22, Sudheer Joseph a écrit : Thank you very much Smith and Paul, > I was away from office due to a medical situation. So could not respond and thank you regarding the help. I have got the results now and the tips from both of you were extremely useful. I am facing an issue with the code when I call plt.xcorr, in a loop. it builds up usage of memory by python and reaches to the RAM what ever available ( in my 4 GB laptop it reaches almost full and in my 24 GB desktop it reaches the available. I suspected the plot not being closed during each iteration so have given a plt.close('all') in the loop. after which it is taking a good time to run the code which was otherwise faster until ram usage reaches its maximum. >Is there a way to get out of this situation?. I am attaching the code here and also the link to the data I am using. If possible kindly help. > Thanks for sharing the code. By a quick look at gen_xcorr_wnd.py, you are generating a quite high number (about len(lons)*len(lats)) of xcorr series over 365 lags. Here are two thoughts about why I would not recommend using xcorr from matplotlib for this job : 1) There is an overhead in creating a plot object which is unnecessary since you're only interested in correlation values 2) internally, plt.xcorr uses numpy.correlate (https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes.py#L4319 and https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py#L731) which is quite fast but unfortunately cannot be well tuned in terms of the output length (only three modes : 'valid', 'same' or 'full'. Matplotlib uses 'full' ) All this to say that when you're interested in 365 correlation values, the internal computations takes place on (N+M-1) points (where N, M are the length of the input vectors, i.e. 2189 if I'm right) and so about 90 % of the output is thrown away. This being said, there is a tiny issue : I don't know a good module which has the (x)correlation function. statsmodel has acf (aka correlation) but I don't remember if there is crosscorrelation. For acf has two computation modes : one based on fft, one based on numpy.correlate which suffer from the same problem as matplotlib's xcorr ( https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/stattools.py#L347) best, Pierre ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_feb _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Pierre H. <pie...@cr...> - 2013-02-21 16:22:51
|
Hi Sudheer, Le 21/02/2013 02:22, Sudheer Joseph a écrit : > Thank you very much Smith and Paul, > I was away from office due > to a medical situation. So could not respond and thank you regarding > the help. I have got the results now and the tips from both of you > were extremely useful. I am facing an issue with the code when I call > plt.xcorr, in a loop. it builds up usage of memory by python and > reaches to the RAM what ever available ( in my 4 GB laptop it reaches > almost full and in my 24 GB desktop it reaches the available. I > suspected the plot not being closed during each iteration so have > given a plt.close('all') in the loop. after which it is taking a good > time to run the code which was otherwise faster until ram usage > reaches its maximum. > Is there a way to get out of this situation?. I am attaching the code > here and also the link to the data I am using. If possible kindly help. > Thanks for sharing the code. By a quick look at gen_xcorr_wnd.py, you are generating a quite high number (about len(lons)*len(lats)) of xcorr series over 365 lags. Here are two thoughts about why I would not recommend using xcorr from matplotlib for this job : 1) There is an overhead in creating a plot object which is unnecessary since you're only interested in correlation values 2) internally, plt.xcorr uses numpy.correlate (https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes.py#L4319 and https://github.com/numpy/numpy/blob/master/numpy/core/numeric.py#L731) which is quite fast but unfortunately cannot be well tuned in terms of the output length (only three modes : 'valid', 'same' or 'full'. Matplotlib uses 'full' ) All this to say that when you're interested in 365 correlation values, the internal computations takes place on (N+M-1) points (where N, M are the length of the input vectors, i.e. 2189 if I'm right) and so about 90 % of the output is thrown away. This being said, there is a tiny issue : I don't know a good module which has the (x)correlation function. statsmodel has acf (aka correlation) but I don't remember if there is crosscorrelation. For acf has two computation modes : one based on fft, one based on numpy.correlate which suffer from the same problem as matplotlib's xcorr ( https://github.com/statsmodels/statsmodels/blob/master/statsmodels/tsa/stattools.py#L347) best, Pierre |
From: Neal B. <ndb...@gm...> - 2013-02-21 15:03:24
|
Objective: produce multi-page pdfs using xelatex so I can have advanced latex and stix fonts (using xits package) I've used pdf multipage with the recipe: import matplotlib as mpl mpl.use ('pdf') import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages pdf = PdfPages('test_uw3.pdf') for page in ... fig = plt.figure() pdf.savefig (fig) plt.close() pdf.close() Now I'm interested in using xelatex (to use stix fonts). So I saw the I should use pgf If I add: from matplotlib.backends.backend_pgf import FigureCanvasPgf matplotlib.backend_bases.register_backend('pdf', FigureCanvasPgf) as suggested by http://matplotlib.org/users/pgf.html I get an error: Traceback (most recent call last): File "./read_hist3.py", line 121, in <module> pdf.savefig (fig) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 2258, in savefig figure.savefig(self, format='pdf', **kwargs) File "/usr/lib64/python2.7/site-packages/matplotlib/figure.py", line 1363, in savefig self.canvas.print_figure(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 2093, in print_figure **kwargs) File "/usr/lib64/python2.7/site-packages/matplotlib/backend_bases.py", line 1943, in _print_method return print_method(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/matplotlib/backends/backend_pgf.py", line 830, in print_pdf raise ValueError("filename must be a path or a file-like object") ValueError: filename must be a path or a file-like object Any ideas? |
From: patricia <ptr...@ho...> - 2013-02-21 09:08:44
|
Dear Jody, This is the original code that I am using: http://old.nabble.com/Taylor-diagram-(2nd-take)-p33364690.html It is a code that plots Taylor diagrams. I would like to get ticks every two points in the standard deviation axis of the Taylor diagrams to avoid overlapping of labels (as I am making a figure with several small Taylor Diagrams subplots). Thanks! Patricia -- View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446p40454.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: ChaoYue <cha...@gm...> - 2013-02-21 04:35:18
|
Hi, could you use a loop to solve it? arr1list = [np.arange(10) + i for i in range(10)] arr2list = [np.arange(10) -i for i in range(10)] for arr1,arr2 in zip(arr1list,arr2list): plot(arr1,arr2) you can use a more object oriented way: fig = plt.figure() ax = fig.add_subplot() for arr1,arr2 in zip(arr1list,arr2list): ax.plot(arr1,arr2) code not tested. cheers, Chao On Thu, Feb 21, 2013 at 4:17 AM, lkz2366 [via matplotlib] < ml-...@n5...> wrote: > I am confused on how to plot a variable number of XY plots on a single > chart. I want to superimpose XY plots on a single chart but the number of > plots is unknown until runtime. > For example, if I want to plot 4 plots the code would be: > figure() > plot(x1,y1,x2,y2,x3,y3,x4,y4) > show() > > But the number of plots is variable and could be anywhere from 5-30. Any > ideas on how I can do this? > I already have the rest of my program working. The program reads all of > the data from all of the files in a target directory and writes the data to > X and Y lists. > Thanks for any help. > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://matplotlib.1069221.n5.nabble.com/Multiple-XY-plots-tp40451.html > To start a new topic under matplotlib - users, email > ml-...@n5... > To unsubscribe from matplotlib, click here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx> > . > NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Multiple-XY-plots-tp40451p40453.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jody K. <jk...@uv...> - 2013-02-21 04:23:50
|
Perhaps you could include some code that illustrates what you are trying to do? I'm confused if you are trying to do something simple and are just going about it the wrong way, or if you are doing something hard. If I do ax=axes() ax.plot(arange(1.,10.)) xticks(range(0,10,2)) yticks(range(0,10,2)) I get ticks every 2 points. Thanks, Jody On Feb 20, 2013, at 11:34 AM, patricia <ptr...@ho...> wrote: > Dear Jody, > No, I tried it also... > ax.axis["left"].xticks() results in error: 'AxisArtist' object has no > attribute 'xticks' > ax.xticks() results in error: 'Floating AxesHostAxesSubplot' object has no > attribute 'xticks' > plt.xticks() or just xticks() does not produce any change. > Any idea? > > http://www.ce.mu.edu.tr/sharedoc/python-matplotlib-doc-.0.1/html/mpl_toolkits/axes_grid/users/axisartist.html#gridhelper > gives some explanation with the The GridHelperRectlinear, but I cannot make > it work > > Thanks, > Patricia > > > > -- > View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446p40448.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Everyone hates slow websites. So do we. > Make your web apps faster with AppDynamics > Download AppDynamics Lite for free today: > http://p.sf.net/sfu/appdyn_d2d_feb > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Jody Klymak http://web.uvic.ca/~jklymak/ |
From: Bernard W. <bwi...@gm...> - 2013-02-21 02:33:34
|
I'm using the recently added PGF/Tikz support to save figures as .pgf commands to include in a Latex document (I love this new feature!). The final rendered figures look great after running through pdflatex, but occasionally it's impractical to use pure vector drawing instructions. For example, I'm currently working on a figure with 6 subplots, each containing a scatter type plot with ~400k markers. The resulting .pgf file is ~350MB. Is it possible to rasterize the individual axes plots (to .png say) and then generate a 'hybrid' .pgf output where things like axes ticks, labels, etc are still vectorized, but the excessively dense scatter plot are treated as imshow plots are and imported a raster images? I've tried setting 'rasterized' = True on both the axes and the plot command, but no dice. Sample code: p = np.random.randn(400000,4) # of course I have actual data, but this should produce the same problem when saving count = 0 for i in xrange(4): for j in xrange(i+1,4): count += 1 ax = fig.add_subplot(2,3, count, rasterized=True) ax.plot(p[:,i], p[:,j], 'k.', markersize=0.25, rasterized=True) Any advice or insight would be greatly appreciated. Thanks |
From: Sudheer J. <sud...@ya...> - 2013-02-21 01:22:40
|
Thank you very much Smith and Paul, I was away from office due to a medical situation. So could not respond and thank you regarding the help. I have got the results now and the tips from both of you were extremely useful. I am facing an issue with the code when I call plt.xcorr, in a loop. it builds up usage of memory by python and reaches to the RAM what ever available ( in my 4 GB laptop it reaches almost full and in my 24 GB desktop it reaches the available. I suspected the plot not being closed during each iteration so have given a plt.close('all') in the loop. after which it is taking a good time to run the code which was otherwise faster until ram usage reaches its maximum. Is there a way to get out of this situation?. I am attaching the code here and also the link to the data I am using. If possible kindly help. ftp ftpser.incois.gov.in user temp password incoistemp cd /home0/temp/comp bin mget qu_test.nc.gz gunzip qu_test.nc.gz *************************************************************** Sudheer Joseph Indian National Centre for Ocean Information Services Ministry of Earth Sciences, Govt. of India POST BOX NO: 21, IDA Jeedeemetla P.O. Via Pragathi Nagar,Kukatpally, Hyderabad; Pin:5000 55 Tel:+91-40-23886047(O),Fax:+91-40-23895011(O), Tel:+91-40-23044600(R),Tel:+91-40-9440832534(Mobile) E-mail:sjo...@gm...;sud...@ya... Web- http://oppamthadathil.tripod.com *************************************************************** ________________________________ From: Sterling Smith <sm...@fu...> To: Sudheer Joseph <sud...@ya...> Cc: Paul Hobson <pmh...@gm...>; "mat...@li..." <mat...@li...> Sent: Friday, 8 February 2013 10:23 PM Subject: Re: [Matplotlib-users] cross correlation Sudheer, For the documentation you are looking for print ax1.xcorr.__doc__ (Paul tried to give you the IPython method of getting that documentation which is by typing a ? (or ??) after the desired object.) In the documentation (at the link you gave http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.xcorr), it says that there are three objects returned by xcorr: Return value is a tuple (*lags*, *c*, *line*) where: - *lags* are a length ``2*maxlags+1`` lag vector - *c* is the ``2*maxlags+1`` auto correlation vector - *line* is a :class:`~matplotlib.lines.Line2D` instance returned by :func:`~matplotlib.pyplot.plot`. So the error you were getting is due to the fact that you have only specified two variables to hold the three returned objects. Try: lags,c,line = ax1.xcorr ..... (Note that you have xcorr and lags backwards in your attempt.) -Sterling On Feb 8, 2013, at 1:56AM, Sudheer Joseph wrote: > Thank you verymuch Hobson, > However I think I did not understand the suggestion by you fully( pardon my ignorance). I use the below test code from matplotlib site. How does one make a call to get lags and correlation corresponding to the x and y values in the plot. a Print command of > In [23]: print ax1.xcorr > <bound method AxesSubplot.xcorr of <matplotlib.axes.AxesSubplot object at 0x44c1410>> > results as above. Is it possible to assign the xcorr,lags=ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) ? with a different syntax? I get below error when I try the above . > In [27]: xcorr,lags=ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) > --------------------------------------------------------------------------- > ValueError Traceback (most recent call last) > /home/sjo/work/PY_WORK/stats/<ipython-input-27-e1e58c045ad4> in <module>() > ----> 1 xcorr,lags=ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) > > ValueError: too many values to unpack > > > > import matplotlib.pyplot as plt > import numpy as np > x,y = np.random.randn(2,100) > fig = plt.figure() > ax1 = fig.add_subplot(211) > ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2) > ax1.grid(True) > ax1.axhline(0, color='black', lw=2) > ax2 = fig.add_subplot(212, sharex=ax1) > ax2.acorr(x, usevlines=True, normed=True, maxlags=50, lw=2) > ax2.grid(True) > ax2.axhline(0, color='black', lw=2) > plt.show() > > > From: Paul Hobson <pmh...@gm...> > To: Sudheer Joseph <sud...@ya...> > Cc: "mat...@li..." <mat...@li...> > Sent: Thursday, 7 February 2013 10:31 PM > Subject: Re: [Matplotlib-users] cross correlation > > > > > On Thu, Feb 7, 2013 at 3:24 AM, Sudheer Joseph <sud...@ya...> wrote: > Dear Users, > I am relatively new to Matplotlib. I wanted to find cross correlation between 2 time series for my research and was looking at options available with python and found http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.xcorr . However I wanted to save the results in a netcdf file for further use. ie the correlation, lags and significance if possible. Is there a way to get the corr and lags from the axis.xcorr ?? any help in this matter will be greatly appreciated. > Sudheer > > Sudheer, > > A call to axes.xcorr returns the lags, correlation (from np.correlate) and the line artists on the figure. > > In IPython, doing "plt.xcorr??" should provide sufficient information. It's a pretty simple method. > -paul > > > ------------------------------------------------------------------------------ > Free Next-Gen Firewall Hardware Offer > Buy your Sophos next-gen firewall before the end March 2013 > and get the hardware for free! Learn more. > http://p.sf.net/sfu/sophos-d2d-feb_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: patricia <ptr...@ho...> - 2013-02-20 19:35:07
|
Dear Jody, No, I tried it also... ax.axis["left"].xticks() results in error: 'AxisArtist' object has no attribute 'xticks' ax.xticks() results in error: 'Floating AxesHostAxesSubplot' object has no attribute 'xticks' plt.xticks() or just xticks() does not produce any change. Any idea? http://www.ce.mu.edu.tr/sharedoc/python-matplotlib-doc-.0.1/html/mpl_toolkits/axes_grid/users/axisartist.html#gridhelper gives some explanation with the The GridHelperRectlinear, but I cannot make it work Thanks, Patricia -- View this message in context: http://matplotlib.1069221.n5.nabble.com/I-cannot-change-the-axis-tick-separation-or-nbins-in-Axis-artist-tp40446p40448.html Sent from the matplotlib - users mailing list archive at Nabble.com. |