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
(38) |
2
(31) |
3
(9) |
4
(13) |
5
(24) |
6
(11) |
7
(8) |
8
(14) |
9
(7) |
10
(4) |
11
(7) |
12
(11) |
13
(16) |
14
(19) |
15
(11) |
16
(9) |
17
(3) |
18
(4) |
19
(47) |
20
(28) |
21
(9) |
22
(9) |
23
(11) |
24
|
25
|
26
(12) |
27
(22) |
28
(20) |
29
(16) |
30
(19) |
|
I just had a quick look, but while extra "restore" could be a problem, the erroneous one may not be the one at line 1073, but the one at line 1066. I believe that the "restore" at 1073 is written by "pstoeps" function in backend_ps.py, and this function did write a matching "save" at line 11. Regards, -JJ On Fri, Apr 2, 2010 at 10:35 AM, Thomas Robitaille <tho...@gm...> wrote: > It seems that removing 'restore' on line 1073 of the test_tex_r8216.eps file fixes the problem, although I don't understand postscript well enough to understand why that is. > > Thomas > > On Apr 2, 2010, at 9:30 AM, Michael Droettboom wrote: > >> Can you provide us with the EPS file? What version of LaTeX is this? >> >> Mike >> >> Thomas Robitaille wrote: >>> Hello, >>> >>> I upgraded to the latest svn version of matplotlib today, and found that eps files produced with the system latex now seem to be invalid. For example, if I run the following script >>> >>> import matplotlib >>> matplotlib.use('Agg') >>> import matplotlib.pyplot as mpl >>> >>> mpl.rc('text', usetex=False) >>> >>> fig = mpl.figure() >>> ax = fig.add_subplot(1,1,1) >>> fig.savefig('test_notex.eps') >>> >>> mpl.rc('text', usetex=True) >>> >>> fig = mpl.figure() >>> ax = fig.add_subplot(1,1,1) >>> fig.savefig('test_tex.eps') >>> >>> and try running pstopdf on them (on MacOS 10.6) I get the following >>> >>> air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file produced. ] %% >>> air:air tom$ pstopdf test_notex.eps air:air tom$ >>> So the file with the system LaTeX enabled no longer works. ps2pdf still works, but the error with pstopdf is important, because for example Preview.app on mac relies on pstopdf, not ps2pdf. >>> >>> I tried this on two different computers under MacOS 10.6, and tried with ghostscript 8.70 and 8.71 installed, and the problem occurs either way. >>> >>> Does anyone know what might be causing this? I submitted a bug report a little while back about this >>> >>> https://sourceforge.net/tracker/?func=detail&aid=2974953&group_id=80706&atid=560720 >>> >>> Thanks in advance for any help, >>> >>> Thomas >>> >>> >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >> -- >> Michael Droettboom >> Science Software Branch >> Operations and Engineering Division >> Space Telescope Science Institute >> Operated by AURA for NASA >> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Below is the example script (sorry!). I've tried all three methods of establishing a colormap to no avail. The most promising looked like option 2, but that gave me the "AttributeError: 'module' object has no attribute 'register_cmap'" error. I'm getting this error with: Python 2.4 (user requirement because this application I'm building will live on a RHEL5 server) matplotlib 0.99.1.1 numpy 1.3.0 Could this be a versioning issue? Bruce #!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap """ Example: suppose you want red to increase from 0 to 1 over the bottom half, green to do the same over the middle half, and blue over the top half. Then you would use: cdict = {'red': ((0.0, 0.0, 0.0), (0.5, 1.0, 1.0), (1.0, 1.0, 1.0)), 'green': ((0.0, 0.0, 0.0), (0.25, 0.0, 0.0), (0.75, 1.0, 1.0), (1.0, 1.0, 1.0)), 'blue': ((0.0, 0.0, 0.0), (0.5, 0.0, 0.0), (1.0, 1.0, 1.0))} If, as in this example, there are no discontinuities in the r, g, and b components, then it is quite simple: the second and third element of each tuple, above, is the same--call it "y". The first element ("x") defines interpolation intervals over the full range of 0 to 1, and it must span that whole range. In other words, the values of x divide the 0-to-1 range into a set of segments, and y gives the end-point color values for each segment. Now consider the green. cdict['green'] is saying that for 0 <= x <= 0.25, y is zero; no green. 0.25 < x <= 0.75, y varies linearly from 0 to 1. x > 0.75, y remains at 1, full green. If there are discontinuities, then it is a little more complicated. Label the 3 elements in each row in the cdict entry for a given color as (x, y0, y1). Then for values of x between x[i] and x[i+1] the color value is interpolated between y1[i] and y0[i+1]. Going back to the cookbook example, look at cdict['red']; because y0 != y1, it is saying that for x from 0 to 0.5, red increases from 0 to 1, but then it jumps down, so that for x from 0.5 to 1, red increases from 0.7 to 1. Green ramps from 0 to 1 as x goes from 0 to 0.5, then jumps back to 0, and ramps back to 1 as x goes from 0.5 to 1. row i: x y0 y1 / / row i+1: x y0 y1 Above is an attempt to show that for x in the range x[i] to x[i+1], the interpolation is between y1[i] and y0[i+1]. So, y0[0] and y1[-1] are never used. """ cdict1 = {'red': ((0.0, 0.0, 0.0), (0.5, 0.0, 0.1), (1.0, 1.0, 1.0)), 'green': ((0.0, 0.0, 0.0), (1.0, 0.0, 0.0)), 'blue': ((0.0, 0.0, 1.0), (0.5, 0.1, 0.0), (1.0, 0.0, 0.0)) } cdict2 = {'red': ((0.0, 0.0, 0.0), (0.5, 0.0, 1.0), (1.0, 0.1, 1.0)), 'green': ((0.0, 0.0, 0.0), (1.0, 0.0, 0.0)), 'blue': ((0.0, 0.0, 0.1), (0.5, 1.0, 0.0), (1.0, 0.0, 0.0)) } cdict3 = {'red': ((0.0, 0.0, 0.0), (0.25,0.0, 0.0), (0.5, 0.8, 1.0), (0.75,1.0, 1.0), (1.0, 0.4, 1.0)), 'green': ((0.0, 0.0, 0.0), (0.25,0.0, 0.0), (0.5, 0.9, 0.9), (0.75,0.0, 0.0), (1.0, 0.0, 0.0)), 'blue': ((0.0, 0.0, 0.4), (0.25,1.0, 1.0), (0.5, 1.0, 0.8), (0.75,0.0, 0.0), (1.0, 0.0, 0.0)) } # Now we will use this example to illustrate 3 ways of # handling custom colormaps. # First, the most direct and explicit: blue_red1 = LinearSegmentedColormap('BlueRed1', cdict1) # Second, create the map explicitly and register it. # Like the first method, this method works with any kind # of Colormap, not just # a LinearSegmentedColormap: blue_red2 = LinearSegmentedColormap('BlueRed2', cdict2) plt.register_cmap(cmap=blue_red2) # Third, for LinearSegmentedColormap only, # leave everything to register_cmap: plt.register_cmap(name='BlueRed3', data=cdict3) # optional lut kwarg x = np.arange(0, np.pi, 0.1) y = np.arange(0, 2*np.pi, 0.1) X, Y = np.meshgrid(x,y) Z = np.cos(X) * np.sin(Y) plt.figure(figsize=(10,4)) plt.subplots_adjust(wspace=0.3) plt.subplot(1,3,1) plt.imshow(Z, interpolation='nearest', cmap=blue_red1) plt.colorbar() plt.subplot(1,3,2) cmap = plt.get_cmap('BlueRed2') plt.imshow(Z, interpolation='nearest', cmap=cmap) plt.colorbar() # Now we will set the third cmap as the default. One would # not normally do this in the middle of a script like this; # it is done here just to illustrate the method. plt.rcParams['image.cmap'] = 'BlueRed3' # Also see below for an alternative, particularly for # interactive use. plt.subplot(1,3,3) plt.imshow(Z, interpolation='nearest') plt.colorbar() # Or as yet another variation, we could replace the rcParams # specification *before* the imshow with the following *after* # imshow: # # plt.set_cmap('BlueRed3') # # This sets the new default *and* sets the colormap of the last # image-like item plotted via pyplot, if any. plt.suptitle('Custom Blue-Red colormaps') plt.show() --------------------------------------- Bruce W. Ford Clear Science, Inc. br...@cl... bru...@na... http://www.ClearScienceInc.com Phone/Fax: 904-379-9704 8241 Parkridge Circle N. Jacksonville, FL 32211 Skype: bruce.w.ford Google Talk: fo...@gm... On Thu, Apr 1, 2010 at 6:30 PM, Chloe Lewis <ch...@be...> wrote: > The example works for me; Python 2.6.4 (recent Enthought install). > > Can you use your new colormap without registering it? > > &C > > On Apr 1, 2010, at 1 Apr, 2:14 PM, Bruce Ford wrote: > >> I'm running into walls trying to create a custom cmap. >> >> Running the example custom_cmap.py unchanged, I get : >> >> AttributeError: 'module' object has no attribute 'register_cmap' >> args = ("'module' object has no attribute 'register_cmap'",) >> >> I've included custom_cmap.py below. It's a major shortcoming that >> there is not a suitable anomaly cmap (with white about the middle). >> Please consider this for an addition. >> >> Anyway, what am I missing with this error? Thanks so much! >> >> Bruce >> --------------------------------------- >> Bruce W. Ford >> Clear Science, Inc. >> br...@cl... >> http://www.ClearScienceInc.com >> Phone/Fax: 904-379-9704 >> 8241 Parkridge Circle N. >> Jacksonville, FL 32211 >> Skype: bruce.w.ford >> Google Talk: fo...@gm... >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > Chloe Lewis > Graduate student, Amundson Lab > Ecosystem Sciences > 137 Mulford Hall > Berkeley, CA 94720-3114 > http://nature.berkeley.edu/~chlewis > > > > > > > >
It seems that removing 'restore' on line 1073 of the test_tex_r8216.eps file fixes the problem, although I don't understand postscript well enough to understand why that is. Thomas On Apr 2, 2010, at 9:30 AM, Michael Droettboom wrote: > Can you provide us with the EPS file? What version of LaTeX is this? > > Mike > > Thomas Robitaille wrote: >> Hello, >> >> I upgraded to the latest svn version of matplotlib today, and found that eps files produced with the system latex now seem to be invalid. For example, if I run the following script >> >> import matplotlib >> matplotlib.use('Agg') >> import matplotlib.pyplot as mpl >> >> mpl.rc('text', usetex=False) >> >> fig = mpl.figure() >> ax = fig.add_subplot(1,1,1) >> fig.savefig('test_notex.eps') >> >> mpl.rc('text', usetex=True) >> >> fig = mpl.figure() >> ax = fig.add_subplot(1,1,1) >> fig.savefig('test_tex.eps') >> >> and try running pstopdf on them (on MacOS 10.6) I get the following >> >> air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file produced. ] %% >> air:air tom$ pstopdf test_notex.eps air:air tom$ >> So the file with the system LaTeX enabled no longer works. ps2pdf still works, but the error with pstopdf is important, because for example Preview.app on mac relies on pstopdf, not ps2pdf. >> >> I tried this on two different computers under MacOS 10.6, and tried with ghostscript 8.70 and 8.71 installed, and the problem occurs either way. >> >> Does anyone know what might be causing this? I submitted a bug report a little while back about this >> >> https://sourceforge.net/tracker/?func=detail&aid=2974953&group_id=80706&atid=560720 >> >> Thanks in advance for any help, >> >> Thomas >> >> >> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA >
On Fri, Apr 2, 2010 at 8:28 AM, Michael Droettboom <md...@st...> wrote: > My gut says it's probably the GUI framework import that is dominating > the time. Which backend are you using? Does importing it take a large > amount of time as well? > > Can you provide a profiler output file we can examine to narrow it > down? The following from a command prompt should be sufficient to write > out a file called "import.prof": > > python.exe -c "import cProfile; prof=cProfile.Profile(); > prof.run('import pylab', 'import.prof')" > > Mike > Just for the records, It reads as: python -c "import cProfile; cProfile.run('import pylab', filename='test.out') in Python 2.6.2 These helped me to load the profile output: import pstats stats = pstats.Stats("test.out") stats.print_stats() -- Gökhan
Attached is a file made using matplotlib 0.99.1.1 (which opens correctly) and one using matplotlib r8216 (which doesn't). Here's what I get for LaTeX: $ latex --version pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009) kpathsea version 5.0.0 Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Compiled with libpng 1.2.39; using libpng 1.2.39 Compiled with zlib 1.2.3; using zlib 1.2.3 Compiled with xpdf version 3.02pl3 It is the version that comes with MacTex 2009. Here is the ghostscript version: $ gs --version 8.70 I just produced these two files on the same computer, and the only thing I changed was the matplotlib version. LaTeX and ghostscript are unchanged I hope this helps, Thomas
Thomas Robitaille wrote: > > It looks like the zlib website removes previous version of its library > that were previously available for download, so the part in make.osx where > http://www.zlib.net/zlib-1.2.3.tar.gz is fetched now fails (since the > current version is 1.2.4). The error in the matplotlib building is not > explicit enough (incorrect archive type) - maybe one could catch such 404s > and print out an error suggesting to increase the ZLIBVERSION variable? > > I tried changing ZLIBVERSION to 1.2.4 and the following occurs when > building zlib: > > ... > make[1]: *** No rule to make target `libz.dylib', needed by > `install-libs'. Stop. > make[1]: *** Waiting for unfinished jobs.... > make: *** [zlib] Error 2 > I have submitted a simple patch that fixes all these issues: https://sourceforge.net/tracker/?func=detail&aid=2981126&group_id=80706&atid=560722 Matplotlib then compiles 'out of the box' for 10.6. Cheers, Thomas -- View this message in context: http://old.nabble.com/MacOS-10.6-install-dependency-building-fails-%28r8214%29-tp28069099p28119205.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Can you provide us with the EPS file? What version of LaTeX is this? Mike Thomas Robitaille wrote: > Hello, > > I upgraded to the latest svn version of matplotlib today, and found that eps files produced with the system latex now seem to be invalid. For example, if I run the following script > > import matplotlib > matplotlib.use('Agg') > import matplotlib.pyplot as mpl > > mpl.rc('text', usetex=False) > > fig = mpl.figure() > ax = fig.add_subplot(1,1,1) > fig.savefig('test_notex.eps') > > mpl.rc('text', usetex=True) > > fig = mpl.figure() > ax = fig.add_subplot(1,1,1) > fig.savefig('test_tex.eps') > > and try running pstopdf on them (on MacOS 10.6) I get the following > > air:air tom$ pstopdf test_tex.eps > %%[ Warning: Empty job. No PDF file produced. ] %% > air:air tom$ pstopdf test_notex.eps > air:air tom$ > > So the file with the system LaTeX enabled no longer works. ps2pdf still works, but the error with pstopdf is important, because for example Preview.app on mac relies on pstopdf, not ps2pdf. > > I tried this on two different computers under MacOS 10.6, and tried with ghostscript 8.70 and 8.71 installed, and the problem occurs either way. > > Does anyone know what might be causing this? I submitted a bug report a little while back about this > > https://sourceforge.net/tracker/?func=detail&aid=2974953&group_id=80706&atid=560720 > > Thanks in advance for any help, > > Thomas > > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
My gut says it's probably the GUI framework import that is dominating the time. Which backend are you using? Does importing it take a large amount of time as well? Can you provide a profiler output file we can examine to narrow it down? The following from a command prompt should be sufficient to write out a file called "import.prof": python.exe -c "import cProfile; prof=cProfile.Profile(); prof.run('import pylab', 'import.prof')" Mike C M wrote: > On Thu, Apr 1, 2010 at 7:17 PM, Eric Firing <ef...@ha...> wrote: > >> Andrew Kelly wrote: >> >>> Has anyone had any success in speeding up the mpl imports? >>> >>> "import matplotlib.pyplot as plt" >>> ( or "from matplotlib.figure import Figure") >>> >>> takes 6 full seconds to load. That seems excessive. Any ideas? >>> >>> -Andy >>> >> Andy, >> >> A couple replies came back directly to me (probably intended for the >> list, though), and both reported results similar to yours, on Windows >> machines only. What OS and version are you running? >> > > Sorry Eric, that was indeed intended for the list. Just for the > list's sake, I'll repeat it: > > It takes longer than any other Python module for me, too, about 5-6 > seconds on a "cold" load (on Windows), though faster on a "warm" load. > I am running it locally on a laptop that is 1.7 GHz Intel Pentium > laptop with 1Meg RAM. > > And I should add: I don't currently have Linux installed, but will > soon again I hope, and I will take note of how long it takes on Linux. > > Thanks, > Che > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Can you set "verbose.level" to "debug-annoying" in your matplotlibrc file, and then send the output to this list. That may help us track down where the font lookup is failing. Also, what platform and version of matplotlib are you running? Mike Alex S wrote: > Hi, sorry I wasn't too clear... I changed that, but I don't seem to be able > to choose between the different serif fonts, it just always gives me the > default... > > > > Alex S wrote: > >> Hi there, >> I'm trying to change the font default on my graph to New Century >> Schoolbook. I'm trying to do this by editing the matplotlibrc file. >> Unfortunately, although I'm able to change the font.family, I can't figure >> out how to make it use something other than the default in the family... >> I tried changing the list further down to only include the font I want, >> like this: >> >> font.serif : New Century Schoolbook #Bitstream Vera Serif, New >> Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, >> Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif >> >> (note I commented out the other fonts, just rearranging the list to put >> New Century Schoolbook first didn't seem to work either) >> >> Could anyone tell me what I'm doing wrong? >> Thanks a lot! >> Alex >> >> >> > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
On 4/2/10 6:32 AM, Will Hewson wrote: > This is great Jeff, thanks for the help - I'll give it a try over the weekend > (it's bank holiday here in the UK!) and get back to you, if I'm still having > trouble I'll stick up the plotting data too... thanks again. > > Will > Will: I forgot to mention that contourf will work on your data without having to interpolate to projection coordinates. -Jeff > > > Jeff Whitaker wrote: > >> On 4/2/10 4:27 AM, Will Hewson wrote: >> >>> Hi forum/ mailing list, When I plot in the orthographic projection I'm >>> getting the large artefact shown below extending away from the north >>> east of the globe. I'm not finding the same problem when plotting in a >>> full globe projection so I'm presuming the problem is with the way I'm >>> projecting everything rather than my data itself. I've included my >>> plotting code below, if anyone is able to spot some glaring omissions/ >>> errors I'd be most grateful (I've been using python/ matplotlib for >>> only a couple of weeks now!). >>> >> Will: I think what's happening is that pcolormesh is having trouble >> dealing with the higher curvlinear grid, which becomes nearly >> pathological near the horizon of the projection. If you take a look at >> the test.py file in the basemap examples directory, you'll see an >> example orthographic plot that solves this problem by first >> interpolating the data to a regular grid in projection coordinates (with >> values over the plot horizon masked). The example uses imshow, but >> pcolormesh works as well. A standalone version of the example using >> pcolormesah is attached, which uses data files in the basemap examples >> directory. >> >> -Jeff >> >> from mpl_toolkits.basemap import Basemap, shiftgrid >> import numpy as np >> import matplotlib.pyplot as plt >> # read in topo data (on a regular lat/lon grid) >> # longitudes go from 20 to 380. >> topoin = np.loadtxt('etopo20data.gz') >> lons = np.loadtxt('etopo20lons.gz') >> lats = np.loadtxt('etopo20lats.gz') >> # shift data so lons go from -180 to 180 instead of 20 to 380. >> topoin,lons = shiftgrid(180.,topoin,lons,start=False) >> m = Basemap(projection='ortho',lon_0=-105,lat_0=40,resolution='l') >> # transform to nx x ny regularly spaced native projection grid >> nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1 >> topodat,x,y =\ >> m.transform_scalar(topoin,lons,lats,nx,ny,returnxy=True,masked=True,order=1) >> # create the figure. >> fig=plt.figure(figsize=(8,8)) >> im = m.pcolormesh(x,y,topodat,cmap=plt.cm.jet) >> m.drawcoastlines() >> m.drawparallels(np.arange(0.,80,20.)) >> m.drawmeridians(np.arange(10.,360.,30.)) >> m.drawmapboundary() >> plt.show() >> >> >> >
This is great Jeff, thanks for the help - I'll give it a try over the weekend (it's bank holiday here in the UK!) and get back to you, if I'm still having trouble I'll stick up the plotting data too... thanks again. Will Jeff Whitaker wrote: > > On 4/2/10 4:27 AM, Will Hewson wrote: >> Hi forum/ mailing list, When I plot in the orthographic projection I'm >> getting the large artefact shown below extending away from the north >> east of the globe. I'm not finding the same problem when plotting in a >> full globe projection so I'm presuming the problem is with the way I'm >> projecting everything rather than my data itself. I've included my >> plotting code below, if anyone is able to spot some glaring omissions/ >> errors I'd be most grateful (I've been using python/ matplotlib for >> only a couple of weeks now!). > Will: I think what's happening is that pcolormesh is having trouble > dealing with the higher curvlinear grid, which becomes nearly > pathological near the horizon of the projection. If you take a look at > the test.py file in the basemap examples directory, you'll see an > example orthographic plot that solves this problem by first > interpolating the data to a regular grid in projection coordinates (with > values over the plot horizon masked). The example uses imshow, but > pcolormesh works as well. A standalone version of the example using > pcolormesah is attached, which uses data files in the basemap examples > directory. > > -Jeff > > from mpl_toolkits.basemap import Basemap, shiftgrid > import numpy as np > import matplotlib.pyplot as plt > # read in topo data (on a regular lat/lon grid) > # longitudes go from 20 to 380. > topoin = np.loadtxt('etopo20data.gz') > lons = np.loadtxt('etopo20lons.gz') > lats = np.loadtxt('etopo20lats.gz') > # shift data so lons go from -180 to 180 instead of 20 to 380. > topoin,lons = shiftgrid(180.,topoin,lons,start=False) > m = Basemap(projection='ortho',lon_0=-105,lat_0=40,resolution='l') > # transform to nx x ny regularly spaced native projection grid > nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1 > topodat,x,y =\ > m.transform_scalar(topoin,lons,lats,nx,ny,returnxy=True,masked=True,order=1) > # create the figure. > fig=plt.figure(figsize=(8,8)) > im = m.pcolormesh(x,y,topodat,cmap=plt.cm.jet) > m.drawcoastlines() > m.drawparallels(np.arange(0.,80,20.)) > m.drawmeridians(np.arange(10.,360.,30.)) > m.drawmapboundary() > plt.show() > > -- View this message in context: http://old.nabble.com/Basemap--orthographic-projection-plot-doesn%27t-respect-globe-boundary-tp28117654p28118555.html Sent from the matplotlib - users mailing list archive at Nabble.com.
from mpl_toolkits.basemap import Basemap, shiftgrid import numpy as np import matplotlib.pyplot as plt # read in topo data (on a regular lat/lon grid) # longitudes go from 20 to 380. topoin = np.loadtxt('etopo20data.gz') lons = np.loadtxt('etopo20lons.gz') lats = np.loadtxt('etopo20lats.gz') # shift data so lons go from -180 to 180 instead of 20 to 380. topoin,lons = shiftgrid(180.,topoin,lons,start=False) m = Basemap(projection='ortho',lon_0=-105,lat_0=40,resolution='l') # transform to nx x ny regularly spaced native projection grid nx = int((m.xmax-m.xmin)/40000.)+1; ny = int((m.ymax-m.ymin)/40000.)+1 topodat,x,y =\ m.transform_scalar(topoin,lons,lats,nx,ny,returnxy=True,masked=True,order=1) # create the figure. fig=plt.figure(figsize=(8,8)) im = m.pcolormesh(x,y,topodat,cmap=plt.cm.jet) m.drawcoastlines() m.drawparallels(np.arange(0.,80,20.)) m.drawmeridians(np.arange(10.,360.,30.)) m.drawmapboundary() plt.show()
On 4/2/10 4:27 AM, Will Hewson wrote: > Hi forum/ mailing list, When I plot in the orthographic projection I'm > getting the large artefact shown below extending away from the north > east of the globe. I'm not finding the same problem when plotting in a > full globe projection so I'm presuming the problem is with the way I'm > projecting everything rather than my data itself. I've included my > plotting code below, if anyone is able to spot some glaring omissions/ > errors I'd be most grateful (I've been using python/ matplotlib for > only a couple of weeks now!). > Will: You'll have to provide the data so we can actually run the script. -Jeff > #!/usr/local/bin/python2.6 > import numpy as np > import matplotlib.pyplot as plt > from mpl_toolkits.basemap import Basemap > import sys, glob > > #input must be 3 col file of lons lats and data > #bins input values into half degree grid, ignores negative values > > plts = glob.glob('*.plt') > x = np.arange(-180, 180, 0.5); y = np.arange(-90, 90, 0.5) > grid_lon, grid_lat = np.meshgrid(x,y) #regularly spaced 2D grid > n_vals = np.zeros((360,720)) #mean divisor > dat = np.zeros((360,720)) #2D grid of zeros > > for pt in plts: > > in_file = pt > data = np.loadtxt(in_file, comments = ';') > fname = in_file.split('.')[0] > > lon = data[:,0] #original 1D list > lat = data[:,1] #original 1D list > slcol = data[:,2] #z data > > lon = (np.around(lon*2))/2 #round to nearest .0 or 0.5 > lat = (np.around(lat*2))/2 #round to nearest .0 or 0.5 > > ##keep the below between files > > j=0 > > for i in slcol: > if lon[j] < 0: > grid_lon_ind = 360+(lon[j]*2) > grid_lat_ind = 180+(lat[j]*2) > else: > grid_lon_ind = 360-(lon[j]*2) > grid_lat_ind = 180+(lat[j]*2) > > if i > 0: > dat[grid_lat_ind, grid_lon_ind] += i #add i'th value > n_vals[grid_lat_ind, grid_lon_ind] += 1 #increase cell counter by 1 > for each extra value > j+=1 > > dat = np.nan_to_num(dat/n_vals) > > #create map object > fig = plt.figure() > m = Basemap(projection='ortho', lon_0=lon[(len(lon)/2)], lat_0=0, > resolution='l', area_thresh=10000.) > #m = Basemap(projection='moll',lon_0=0,resolution='c', area_thresh=10000.) > > X,Y = m(grid_lon, grid_lat) > > #pass all 2d arrays to pcolor > im = m.pcolormesh(X,Y,dat) > > #add coastlines, globe boundary and colourbar > m.drawcoastlines() > m.drawmapboundary() > m.drawparallels(np.arange(-90, 90,30)) > m.drawmeridians(np.arange(-180,180,30)) > > fig.colorbar(im) > plt.title('CH20 and ting') > plt.savefig('binplot.png') > > Thanks for your help, > Will. > ------------------------------------------------------------------------ > View this message in context: Basemap/ orthographic projection plot > doesn't respect globe boundary > <http://old.nabble.com/Basemap--orthographic-projection-plot-doesn%27t-respect-globe-boundary-tp28117654p28117654.html> > Sent from the matplotlib - users mailing list archive > <http://old.nabble.com/matplotlib---users-f2906.html> at Nabble.com. > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi forum/ mailing list, When I plot in the orthographic projection I'm getting the large artefact shown below extending away from the north east of the globe. I'm not finding the same problem when plotting in a full globe projection so I'm presuming the problem is with the way I'm projecting everything rather than my data itself. I've included my plotting code below, if anyone is able to spot some glaring omissions/ errors I'd be most grateful (I've been using python/ matplotlib for only a couple of weeks now!). http://old.nabble.com/file/p28117654/binploterr.png #!/usr/local/bin/python2.6 import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import sys, glob #input must be 3 col file of lons lats and data #bins input values into half degree grid, ignores negative values plts = glob.glob('*.plt') x = np.arange(-180, 180, 0.5); y = np.arange(-90, 90, 0.5) grid_lon, grid_lat = np.meshgrid(x,y) #regularly spaced 2D grid n_vals = np.zeros((360,720)) #mean divisor dat = np.zeros((360,720)) #2D grid of zeros for pt in plts: in_file = pt data = np.loadtxt(in_file, comments = ';') fname = in_file.split('.')[0] lon = data[:,0] #original 1D list lat = data[:,1] #original 1D list slcol = data[:,2] #z data lon = (np.around(lon*2))/2 #round to nearest .0 or 0.5 lat = (np.around(lat*2))/2 #round to nearest .0 or 0.5 ##keep the below between files j=0 for i in slcol: if lon[j] < 0: grid_lon_ind = 360+(lon[j]*2) grid_lat_ind = 180+(lat[j]*2) else: grid_lon_ind = 360-(lon[j]*2) grid_lat_ind = 180+(lat[j]*2) if i > 0: dat[grid_lat_ind, grid_lon_ind] += i #add i'th value n_vals[grid_lat_ind, grid_lon_ind] += 1 #increase cell counter by 1 for each extra value j+=1 dat = np.nan_to_num(dat/n_vals) #create map object fig = plt.figure() m = Basemap(projection='ortho', lon_0=lon[(len(lon)/2)], lat_0=0, resolution='l', area_thresh=10000.) #m = Basemap(projection='moll',lon_0=0,resolution='c', area_thresh=10000.) X,Y = m(grid_lon, grid_lat) #pass all 2d arrays to pcolor im = m.pcolormesh(X,Y,dat) #add coastlines, globe boundary and colourbar m.drawcoastlines() m.drawmapboundary() m.drawparallels(np.arange(-90, 90,30)) m.drawmeridians(np.arange(-180,180,30)) fig.colorbar(im) plt.title('CH20 and ting') plt.savefig('binplot.png') Thanks for your help, Will. -- View this message in context: http://old.nabble.com/Basemap--orthographic-projection-plot-doesn%27t-respect-globe-boundary-tp28117654p28117654.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi forum/ mailing list, When I plot in the orthographic projection I'm getting the large artefact shown below extending away from the north east of the globe. I'm not finding the same problem when plotting in a full globe projection so I'm presuming the problem is with the way I'm projecting everything rather than my data itself. I've included my plotting code below, if anyone is able to spot some glaring omissions/ errors I'd be most grateful (I've been using python/ matplotlib for only a couple of weeks now!). http://old.nabble.com/file/p28117655/binploterr.png #!/usr/local/bin/python2.6 import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap import sys, glob #input must be 3 col file of lons lats and data #bins input values into half degree grid, ignores negative values plts = glob.glob('*.plt') x = np.arange(-180, 180, 0.5); y = np.arange(-90, 90, 0.5) grid_lon, grid_lat = np.meshgrid(x,y) #regularly spaced 2D grid n_vals = np.zeros((360,720)) #mean divisor dat = np.zeros((360,720)) #2D grid of zeros for pt in plts: in_file = pt data = np.loadtxt(in_file, comments = ';') fname = in_file.split('.')[0] lon = data[:,0] #original 1D list lat = data[:,1] #original 1D list slcol = data[:,2] #z data lon = (np.around(lon*2))/2 #round to nearest .0 or 0.5 lat = (np.around(lat*2))/2 #round to nearest .0 or 0.5 ##keep the below between files j=0 for i in slcol: if lon[j] < 0: grid_lon_ind = 360+(lon[j]*2) grid_lat_ind = 180+(lat[j]*2) else: grid_lon_ind = 360-(lon[j]*2) grid_lat_ind = 180+(lat[j]*2) if i > 0: dat[grid_lat_ind, grid_lon_ind] += i #add i'th value n_vals[grid_lat_ind, grid_lon_ind] += 1 #increase cell counter by 1 for each extra value j+=1 dat = np.nan_to_num(dat/n_vals) #create map object fig = plt.figure() m = Basemap(projection='ortho', lon_0=lon[(len(lon)/2)], lat_0=0, resolution='l', area_thresh=10000.) #m = Basemap(projection='moll',lon_0=0,resolution='c', area_thresh=10000.) X,Y = m(grid_lon, grid_lat) #pass all 2d arrays to pcolor im = m.pcolormesh(X,Y,dat) #add coastlines, globe boundary and colourbar m.drawcoastlines() m.drawmapboundary() m.drawparallels(np.arange(-90, 90,30)) m.drawmeridians(np.arange(-180,180,30)) fig.colorbar(im) plt.title('CH20 and ting') plt.savefig('binplot.png') Thanks for your help, Will. -- View this message in context: http://old.nabble.com/Basemap--orthographic-projection-plot-doesn%27t-respect-globe-boundary-tp28117655p28117655.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Rac...@HM... wrote: > Hello, > > I'm trying to create a heat map from two lists of corresponding X and Y coordinates. > > I've tried both numpy.histogram2d() and pyplot.hexbin(). > > The histogram I get back doesn't correspond to the points I gave it. It seems as if it's sorting each X and Y list and then eliminating some points, which would definitely not give me the coordinates I want. (Also, I want to be able to switch the origin to the upper-left corner, but I can't figure out how to do this with imshow().) > Histogram2d works fine for me, I use it more or less the same way you do, so I can't help there. You can specify the origin in imshow by saying: plt.imshow(heatmap, extent=axesExtent, origin='upper') > The hexbin graph does correspond to my original points, but rather than having hexagons of equal size, some are super thin and tiny. (I'd also like to fill in the entire graph with background color (I want the axes to extend beyond the data) - is there a way to do that?) > You can specify the bins in histogram2d to cover the whole screen (you can also specify bins in hexbin, which should be similar): xedges, yedges = linspace(0,1400,(1400/50)+1), linspace(0,600,(600/50)+1) npy.histogram2d(xList, yList, bins=[xedges,yedges]) > Here's the code I wrote for the histogram and hexbin. Am I doing something wrong? I've attached three graphs - one is my coordinates as a scatter plot, one my histogram result, and the other the hexbin result. > > Thanks! > ~Rachel > > def plotHistogram( coordsTuple ): > > plt.clf() # Clears any previous figure > > xList = coordsTuple[0] > yList = coordsTuple[1] > > heatmap, xedges, yedges = npy.histogram2d(xList, yList) > axesExtent = [0, xedges[-1], 0, yedges[-1]] > plt.imshow(heatmap, extent = axesExtent) > > plt.title( "Heat Map of User Clicks" ) > > name = raw_input("\nImage name and extension: ") > plt.savefig(name) > > > def plotHexbins( coordsTuple ): > > plt.clf() # Clears any previous figure > > xList = coordsTuple[0] > yList = coordsTuple[1] > > plt.hexbin(xList, yList) > > plt.title( "Heat Map of User Clicks" ) > > name = raw_input("\nImage name and extension: ") > plt.savefig(name) > >
Hello, I'm trying to create a heat map from two lists of corresponding X and Y coordinates. I've tried both numpy.histogram2d() and pyplot.hexbin(). The histogram I get back doesn't correspond to the points I gave it. It seems as if it's sorting each X and Y list and then eliminating some points, which would definitely not give me the coordinates I want. (Also, I want to be able to switch the origin to the upper-left corner, but I can't figure out how to do this with imshow().) The hexbin graph does correspond to my original points, but rather than having hexagons of equal size, some are super thin and tiny. (I'd also like to fill in the entire graph with background color (I want the axes to extend beyond the data) - is there a way to do that?) Here's the code I wrote for the histogram and hexbin. Am I doing something wrong? I've attached three graphs - one is my coordinates as a scatter plot, one my histogram result, and the other the hexbin result. Thanks! ~Rachel def plotHistogram( coordsTuple ): plt.clf() # Clears any previous figure xList = coordsTuple[0] yList = coordsTuple[1] heatmap, xedges, yedges = npy.histogram2d(xList, yList) axesExtent = [0, xedges[-1], 0, yedges[-1]] plt.imshow(heatmap, extent = axesExtent) plt.title( "Heat Map of User Clicks" ) name = raw_input("\nImage name and extension: ") plt.savefig(name) def plotHexbins( coordsTuple ): plt.clf() # Clears any previous figure xList = coordsTuple[0] yList = coordsTuple[1] plt.hexbin(xList, yList) plt.title( "Heat Map of User Clicks" ) name = raw_input("\nImage name and extension: ") plt.savefig(name)
On 04/01/2010 08:09 PM, Gökhan Sever wrote: > On Thu, Apr 1, 2010 at 6:04 PM, Stuart McGraw <smc...@fr... > <mailto:smc...@fr...>> wrote: > > I live in a third world part of the US where internet > access is via modem so reading the matplotlib docs via > the internet very painful. A full afternoon trying to > build the docs was unsuccessful. > > Is there anyplace where I can download pre-built HTML > of all the docs (not just the User Manual)? > > My build-html folder is 111.8 MB totaling 4.215 files. > > 7z compression makes it down to 72 MB. tar.lzma 85 MB, and tar.bz2 92MB > > As far as I know having a recent version of Sphinx, you should be able > to build the documentation yourself. What problems are you seeing? I have python-2.6, matplotlib-0.99.1, spinx-0.6.5 installed on Fedora-11 via Fedora's package management system. I unpacked the matplotlib source in a tmp dir, cd'd to the doc/ dir, did "python make.py html" and got a lot of warnings and errors that I do not recall. Figuring it maybe needed the local src built, I cd'd to matplotlib and did a "python setup.py build" which went ok. Retried the doc "python make.py html" -- this time failed when trying to build the examples/pylab_examples/loadrec.py example: could not import xlwt. Downloaded, installed xlwt. Still fails on same example, this time with core dump. (For brevity I've left out a lot of other things I tried.) Gave up. :-( > PDF version ~8MB might be the best option providing that you have > low-speed internet > http://matplotlib.sf.net/Matplotlib.pdf Yes, after looking at it, I think it will do fine. I posted while downloading it and didn't realize the api doc was included. I guess what I am actually missing is only the examples. If I was doing something silly in my attempt to build above (was in a rush so read the install instructions pretty quickly) I 'll give it another try. Otherwise I think I can live without ther examples, or access them online. Thanks for your response.
On Thu, Apr 1, 2010 at 6:04 PM, Stuart McGraw <smc...@fr...> wrote: > I live in a third world part of the US where internet > access is via modem so reading the matplotlib docs via > the internet very painful. A full afternoon trying to > build the docs was unsuccessful. > > Is there anyplace where I can download pre-built HTML > of all the docs (not just the User Manual)? > > My build-html folder is 111.8 MB totaling 4.215 files. 7z compression makes it down to 72 MB. tar.lzma 85 MB, and tar.bz2 92MB As far as I know having a recent version of Sphinx, you should be able to build the documentation yourself. What problems are you seeing? PDF version ~8MB might be the best option providing that you have low-speed internet http://matplotlib.sf.net/Matplotlib.pdf -- Gökhan
On Thu, Apr 1, 2010 at 7:57 PM, C M <cmp...@gm...> wrote: > On Thu, Apr 1, 2010 at 7:17 PM, Eric Firing <ef...@ha...> wrote: > > Andrew Kelly wrote: > >> Has anyone had any success in speeding up the mpl imports? > >> > >> "import matplotlib.pyplot as plt" > >> ( or "from matplotlib.figure import Figure") > >> > >> takes 6 full seconds to load. That seems excessive. Any ideas? > >> > >> -Andy > > > > Andy, > > > > A couple replies came back directly to me (probably intended for the > > list, though), and both reported results similar to yours, on Windows > > machines only. What OS and version are you running? > > Sorry Eric, that was indeed intended for the list. Just for the > list's sake, I'll repeat it: > > It takes longer than any other Python module for me, too, about 5-6 > seconds on a "cold" load (on Windows), though faster on a "warm" load. > I am running it locally on a laptop that is 1.7 GHz Intel Pentium > laptop with 1Meg RAM. > > And I should add: I don't currently have Linux installed, but will > soon again I hope, and I will take note of how long it takes on Linux. > > Thanks, > Che > This is Intel Core 2 Duo 2.5Ghz with 4GB Ram. ================================================================================ Platform : Linux-2.6.31.9-174.fc12.i686.PAE-i686-with-fedora-12-Constantine Python : ('CPython', 'tags/r262', '71600') IPython : 0.10 Matplotlib : 1.0.svn.rev8214 ================================================================================ I[2]: %time import matplotlib.pyplot as plt CPU times: user 0.35 s, sys: 0.09 s, total: 0.43 s Wall time: 1.18 s My test-bed is IPython -pylab and the first load always takes longer. Probably it's caching at the first time to speed-up later imports. -- Gökhan
On Thu, Apr 1, 2010 at 7:17 PM, Eric Firing <ef...@ha...> wrote: > Andrew Kelly wrote: >> Has anyone had any success in speeding up the mpl imports? >> >> "import matplotlib.pyplot as plt" >> ( or "from matplotlib.figure import Figure") >> >> takes 6 full seconds to load. That seems excessive. Any ideas? >> >> -Andy > > Andy, > > A couple replies came back directly to me (probably intended for the > list, though), and both reported results similar to yours, on Windows > machines only. What OS and version are you running? Sorry Eric, that was indeed intended for the list. Just for the list's sake, I'll repeat it: It takes longer than any other Python module for me, too, about 5-6 seconds on a "cold" load (on Windows), though faster on a "warm" load. I am running it locally on a laptop that is 1.7 GHz Intel Pentium laptop with 1Meg RAM. And I should add: I don't currently have Linux installed, but will soon again I hope, and I will take note of how long it takes on Linux. Thanks, Che
I live in a third world part of the US where internet access is via modem so reading the matplotlib docs via the internet very painful. A full afternoon trying to build the docs was unsuccessful. Is there anyplace where I can download pre-built HTML of all the docs (not just the User Manual)?
Eric, I am running it on a windows 7 machine and a windows XP machine. Odd that it does this only on win32. -Andy On Thu, Apr 1, 2010 at 4:17 PM, Eric Firing <ef...@ha...> wrote: > Andrew Kelly wrote: > >> Has anyone had any success in speeding up the mpl imports? >> >> "import matplotlib.pyplot as plt" ( or "from matplotlib.figure import >> Figure") >> >> takes 6 full seconds to load. That seems excessive. Any ideas? >> >> -Andy >> > > Andy, > > A couple replies came back directly to me (probably intended for the list, > though), and both reported results similar to yours, on Windows machines > only. What OS and version are you running? > > Eric >
Andrew Kelly wrote: > Has anyone had any success in speeding up the mpl imports? > > "import matplotlib.pyplot as plt" > ( or "from matplotlib.figure import Figure") > > takes 6 full seconds to load. That seems excessive. Any ideas? > > -Andy Andy, A couple replies came back directly to me (probably intended for the list, though), and both reported results similar to yours, on Windows machines only. What OS and version are you running? Eric
Hello, I upgraded to the latest svn version of matplotlib today, and found that eps files produced with the system latex now seem to be invalid. For example, if I run the following script import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as mpl mpl.rc('text', usetex=False) fig = mpl.figure() ax = fig.add_subplot(1,1,1) fig.savefig('test_notex.eps') mpl.rc('text', usetex=True) fig = mpl.figure() ax = fig.add_subplot(1,1,1) fig.savefig('test_tex.eps') and try running pstopdf on them (on MacOS 10.6) I get the following air:air tom$ pstopdf test_tex.eps %%[ Warning: Empty job. No PDF file produced. ] %% air:air tom$ pstopdf test_notex.eps air:air tom$ So the file with the system LaTeX enabled no longer works. ps2pdf still works, but the error with pstopdf is important, because for example Preview.app on mac relies on pstopdf, not ps2pdf. I tried this on two different computers under MacOS 10.6, and tried with ghostscript 8.70 and 8.71 installed, and the problem occurs either way. Does anyone know what might be causing this? I submitted a bug report a little while back about this https://sourceforge.net/tracker/?func=detail&aid=2974953&group_id=80706&atid=560720 Thanks in advance for any help, Thomas