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
(24) |
2
(35) |
3
(21) |
4
(15) |
5
(1) |
6
(2) |
7
(30) |
8
(16) |
9
(11) |
10
(10) |
11
(10) |
12
(4) |
13
(2) |
14
(14) |
15
(21) |
16
(7) |
17
(5) |
18
(2) |
19
(5) |
20
|
21
(4) |
22
(8) |
23
(4) |
24
(6) |
25
(2) |
26
(2) |
27
(5) |
28
(9) |
29
(16) |
30
(14) |
31
(5) |
|
|
Hello Jose- I searched the Python installation on my computer, but have not been able to find the bluemarble image. I also followed the link that you provided, but didn't find any images that cover the entire surface of the Earth. Python Developers- I'd really like to have an option in Basemap.bluemarble() to select from a set of images, rather than just having a single hardwired image. Phillip Jose Gomez-Dans wrote: > Hi, > > 2009年12月14日 Dr. Phillip M. Feldman <pfe...@ve... > <mailto:pfe...@ve...>> > > When I generate a map with a background generated via > Basemap.bluemarble(), > the background is extremely dark. Is there any way to get a > lighter/brighter version? (I've looked at all of the available > parameters, > but none of them seems to allow for adjustment of the luminance). > > > I find this problem when generating a PDF and viewing it in Linux,but > the on-screen version seems to work fine. One reason for your darkness > might be the actual bluemarble scene. There is one for every month > <http://earthobservatory.nasa.gov/Features/BlueMarble/>, so you can > have a look at the different month and pick u which is better for your > area/application. Another thing you can do is to modify the bluemarble > that comes with matplotlib using the gimp, as it is just an image file > you can edit easily. Starts looking like data cooking, tho' ;-) > > J
hi all, i am drawing a 2x3 set of subplots. i want it to eliminate the second subplot of the first row and instead make the first subplot on the first row take up two plots worth of space, i.e. have it so that the first subplot takes up 2,3,1 and 2,3,2. In matlab, the command would be something like subplot(2,3,[1,2]). what is the way to do this in matplotlib? i have a lot of code structured subplots and subplots_adjust, and i really want to avoid switching to drawing my own axes if possible, as in this example: http://matplotlib.sourceforge.net/examples/axes_grid/simple_axes_divider1.html switching to this would be very complicated -- is there a way to do this while still using the subplot command? thanks.
ax = gca() ax.yaxis.set_ticks_position("right") # ticks and ticklabels ax.yaxis.set_label_position("right") # axis label -JJ On Thu, Dec 24, 2009 at 8:34 AM, Maximilian Fabricius <mx...@gm...> wrote: > Hello, > I apologize if this is the n-th time this question is asked. > I wondered what the canonical way is to gel the yticks and the ylabel on the > right > hand side of a plot rather than on the left. > Merry xmas! > Maximilian > > -- > -------------------------------------------------------------------- > Maximilian Fabricius > * Max Planck Institute for Extraterrestrial Physics (MPE) > Giessenbachstrasse, D-85748 Garching, Germany > * University Observatory Munich / Wendelstein Observatory > Scheinerstr. 1, D-81679 München, Germany > eMail: mx...@mp... > Phone: +49 89 30000 3694 > FAX: +49 89 30000 3495 > -------------------------------------------------------------------- > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I once had the same problem and the solution was rather complicated, involving the artist interface I believe. Unfortunately, I can not find it any longer as the mailing list archives are not searchable. Dominik Maximilian Fabricius wrote: > Hello, > > I apologize if this is the n-th time this question is asked. > > I wondered what the canonical way is to gel the yticks and the ylabel on > the right > hand side of a plot rather than on the left. > > Merry xmas! > > Maximilian > > -- > -------------------------------------------------------------------- > Maximilian Fabricius > * Max Planck Institute for Extraterrestrial Physics (MPE) > Giessenbachstrasse, D-85748 Garching, Germany > * University Observatory Munich / Wendelstein Observatory > Scheinerstr. 1, D-81679 München, Germany > eMail: mx...@mp... <mailto:mx...@mp...> > Phone: +49 89 30000 3694 > FAX: +49 89 30000 3495 > -------------------------------------------------------------------- > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkszkNIACgkQ/EBMh9bUuzKPrwCfX1ux5D0TPORtAfkwP2d3S+U7 mIwAoLnjgnoqybGE9dQ0QHA6ok0xP5nm =+ez5 -----END PGP SIGNATURE-----
Hello, I apologize if this is the n-th time this question is asked. I wondered what the canonical way is to gel the yticks and the ylabel on the right hand side of a plot rather than on the left. Merry xmas! Maximilian -- -------------------------------------------------------------------- Maximilian Fabricius * Max Planck Institute for Extraterrestrial Physics (MPE) Giessenbachstrasse, D-85748 Garching, Germany * University Observatory Munich / Wendelstein Observatory Scheinerstr. 1, D-81679 München, Germany eMail: mx...@mp... Phone: +49 89 30000 3694 FAX: +49 89 30000 3495 --------------------------------------------------------------------
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 OK I started hacking and added a color_cycle property to matplotlibrc. Would you be so kind to add this fix to the official version? Thanks! Dominik $ diff -w axes.py axes.py.org 135,137c135 < # DSZ take defaultColors from rcParams < # defaultColors = ['b','g','r','c','m','y','k'] < defaultColors = rcParams['axes.color_cycle'] - --- > defaultColors = ['b','g','r','c','m','y','k'] $ diff -w rcsetup.py rcsetup.py.org 442,443d441 < # DSZ add color_cycle property < 'axes.color_cycle' : [['b','g','r','c','m','y','k'], validate_stringlist], Add to custom matplotlibrc as e.g.: axes.color_cycle : w, w, w, w, w, w, w Dominik Szczerba wrote: > I want to specify my own color cycle in matplotlibrc. I know I can do in > the actual script: > > matplotlib.axes.set_default_color_cycle(['w', 'w', 'w', 'w', 'w', 'w', 'w']) > > but it renders my scripts not portable (if somebody does not have black > bg in matplotlibrc as I do then he will not see the plot). > > (How) Can I specify my color cycle in matplotlibrc - or another portable > fashion? Or at least disable it so the lines.color is used for all colors? > > Dominik - ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkszMqcACgkQ/EBMh9bUuzJIigCgryC7tOPPkWkjjE/6/OTvLiiH OUMAoIsGCWSAC6AO3F12Rv5yQN6tMQkL =Ch5N -----END PGP SIGNATURE-----
per freem wrote: > Hi all, > > I was hoping someone could point to an example of making "inset > graphs", where a small graph appears inside of a large graph. For > example i want to make a line plot (using "plot") and then embed a bar > graph (using "bar") inside it. how can i do that? > http://matplotlib.sourceforge.net/examples/pylab_examples/axes_demo.html
Hi all, I was hoping someone could point to an example of making "inset graphs", where a small graph appears inside of a large graph. For example i want to make a line plot (using "plot") and then embed a bar graph (using "bar") inside it. how can i do that? thanks.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I want to specify my own color cycle in matplotlibrc. I know I can do in the actual script: matplotlib.axes.set_default_color_cycle(['w', 'w', 'w', 'w', 'w', 'w', 'w']) but it renders my scripts not portable (if somebody does not have black bg in matplotlibrc as I do then he will not see the plot). (How) Can I specify my color cycle in matplotlibrc - or another portable fashion? Or at least disable it so the lines.color is used for all colors? Dominik -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAksyhdYACgkQ/EBMh9bUuzJeJgCgtQSa8boMbun+vse8r6+bPhAZ PzoAoLOfH2Pnr0YFkQiR+jYo9TzB6BL5 =OtKF -----END PGP SIGNATURE-----
On 2009年12月22日 17:38:41 -0500 Jae-Joon Lee <lee...@gm...> wrote: > As far as I can see, this happens when there are >obsolete rst files > (related with the Gallery I guess), created during the >doc. build with > previous svn checkout. > >For example, I recently removed > mpl_examples/axes_grid/demo_fixed_size_axes.py from the >svn. But if > you ever have built the documentation with previous svn >checkout > (before that file is removed), then you already have >some associated > rst files under the doc/examples directory. And the >errors are raised > when these obsolete files are processed with sphinx. > > I think removing doc/examples directory will solve the >problem, or > build the doc from the completely new checkout. > > We may delete the "doc/examples" directory within the >"make.py", but > I'm not sure how much this will slow down the build >time. > > Please let me know if there still is a problem. > > Regards, > > -JJ Removing doc/examples has resolved the problem. Thank you very much ! Regards, Nils
Hello, i am using a Matplotlib figure as widget, in a PyQt4 programm. Everything works, except "set_autoscale_on(False)". Everytime i call a figure axes to plot something, it forgets its autoscale status. Here some code, with axs a subplot of a figure: | print axs.get_autoscale_on() print axs.get_autoscaley_on() print axs.get_autoscalex_on() axs.plot(range(100) print axs.get_autoscale_on() print axs.get_autoscaley_on() print axs.get_autoscalex_on() | returns |False False False True True True | any help?
Sharaf Al-Sharif wrote: > Hi, > Is there a way to specify the number of ticks on an axis? Say, I want > the y-axes on all my subplots to have 5 ticks, for example. import matplotlib.ticker as mticker ax.yaxis.set_major_locator(mticker.MaxNLocator(4,steps=[1, 2, 5, 10]))
As far as I can see, this happens when there are obsolete rst files (related with the Gallery I guess), created during the doc. build with previous svn checkout. For example, I recently removed mpl_examples/axes_grid/demo_fixed_size_axes.py from the svn. But if you ever have built the documentation with previous svn checkout (before that file is removed), then you already have some associated rst files under the doc/examples directory. And the errors are raised when these obsolete files are processed with sphinx. I think removing doc/examples directory will solve the problem, or build the doc from the completely new checkout. We may delete the "doc/examples" directory within the "make.py", but I'm not sure how much this will slow down the build time. Please let me know if there still is a problem. Regards, -JJ On Tue, Dec 22, 2009 at 4:32 PM, Michael Droettboom <md...@st...> wrote: > I get the same errors as you (which seem to indicate a bug in the > axis_grid toolkit), but it's not catastrophic -- the documentation is > ultimately built anyway, missing a couple of figures. (I tried with > both Sphinx 0.6.3 and Sphinx hg latest). > > Have you tried a clean rebuild? (By removing the doc/build directory?) > > Mike > > Nils Wagner wrote: >> Hi all, >> >> I cannot build the documentation of matplotlib. >> I am using the latest svn of numpy and matplotlib. >> >> How can I fix the problem ? >> >> >> Nils >> >> python make.py html >> Running Sphinx v1.0 >> loading pickled environment... not found >> animation, api, axes_grid, event_handling, misc, mplot3d, >> pngsuite, pylab_examples, tests, units, user_interfaces, >> widgets, >> building [html]: targets for 494 source files that are out >> of date >> updating environment: 494 added, 0 changed, 0 removed >> /home/nwagner/local/lib64/python2.6/site-packages/numpy/core/numeric.py:692: >> DeprecationWarning: >> The current behavior of correlate is deprecated for 1.4.0, >> and will be removed >> for NumPy 1.5.0. >> >> The new behavior fits the conventional definition of >> correlation: inputs are >> never swapped, and the second argument is conjugated for >> complex arrays. >> DeprecationWarning) >> /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: >> UserWarning: Exception running plot >> /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py >> Traceback (most recent call last): >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 270, in render_figures >> run_code(plot_path, function_name, plot_code) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 182, in run_code >> "__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE)) >> File "demo_axes_divider.py", line 129, in <module> >> File "demo_axes_divider.py", line 125, in demo >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/pyplot.py", >> line 350, in draw >> get_current_fig_manager().canvas.draw() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/backends/backend_agg.py", >> line 388, in draw >> self.figure.draw(self.renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", >> line 55, in draw_wrapper >> draw(artist, renderer, *kl) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/figure.py", >> line 802, in draw >> func(*args) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axes_divider.py", >> line 582, in draw >> self._axes_class.draw(self, renderer, inframe) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axislines.py", >> line 710, in draw >> super(Axes, self).draw(renderer, inframe) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", >> line 55, in draw_wrapper >> draw(artist, renderer, *kl) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/axes.py", >> line 1775, in draw >> a.draw(renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", >> line 55, in draw_wrapper >> draw(artist, renderer, *kl) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 1343, in draw >> self._draw_ticks(renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 1209, in _draw_ticks >> self.major_ticks.draw(renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 309, in draw >> gc.set_foreground(self.get_markeredgecolor()) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 236, in get_markeredgecolor >> return self.get_color() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 232, in get_color >> return self.get_attribute_from_ref_artist("color", >> "k") >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 187, in get_attribute_from_ref_artist >> ref_artist = self.get_ref_artist() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 229, in get_ref_artist >> return self._ref_artist.get_ticklines()[0] >> IndexError: list index out of range >> >> warnings.warn(s) >> /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: >> UserWarning: Exception running plot >> /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_rgb.py >> Traceback (most recent call last): >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 270, in render_figures >> run_code(plot_path, function_name, plot_code) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 182, in run_code >> "__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE)) >> File "demo_axes_rgb.py", line 4, in <module> >> File >> "/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py", >> line 129, in <module> >> demo() >> File >> "/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py", >> line 125, in demo >> plt.draw() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/pyplot.py", >> line 350, in draw >> get_current_fig_manager().canvas.draw() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/backends/backend_agg.py", >> line 388, in draw >> self.figure.draw(self.renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", >> line 55, in draw_wrapper >> draw(artist, renderer, *kl) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/figure.py", >> line 802, in draw >> func(*args) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axes_divider.py", >> line 582, in draw >> self._axes_class.draw(self, renderer, inframe) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axislines.py", >> line 710, in draw >> super(Axes, self).draw(renderer, inframe) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", >> line 55, in draw_wrapper >> draw(artist, renderer, *kl) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/axes.py", >> line 1775, in draw >> a.draw(renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", >> line 55, in draw_wrapper >> draw(artist, renderer, *kl) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 1343, in draw >> self._draw_ticks(renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 1209, in _draw_ticks >> self.major_ticks.draw(renderer) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 309, in draw >> gc.set_foreground(self.get_markeredgecolor()) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 236, in get_markeredgecolor >> return self.get_color() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 232, in get_color >> return self.get_attribute_from_ref_artist("color", >> "k") >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 187, in get_attribute_from_ref_artist >> ref_artist = self.get_ref_artist() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", >> line 229, in get_ref_artist >> return self._ref_artist.get_ticklines()[0] >> IndexError: list index out of range >> >> warnings.warn(s) >> /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: >> UserWarning: Exception running plot >> /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py >> Traceback (most recent call last): >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 270, in render_figures >> run_code(plot_path, function_name, plot_code) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 180, in run_code >> fd = open(fname) >> IOError: [Errno 2] No such file or directory: >> 'demo_fixed_size_axes.py' >> >> warnings.warn(s) >> Exception occurred while building, starting debugger: >> Traceback (most recent call last): >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/cmdline.py", >> line 172, in main >> app.build(all_files, filenames) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/application.py", >> line 130, in build >> self.builder.build_update() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", >> line 265, in build_update >> 'out of date' % len(to_build)) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", >> line 285, in build >> purple, length): >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", >> line 131, in status_iterator >> for item in iterable: >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/environment.py", >> line 513, in update_generator >> self.read_doc(docname, app=app) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/environment.py", >> line 604, in read_doc >> pub.publish() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/core.py", >> line 204, in publish >> self.settings) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/readers/__init__.py", >> line 69, in read >> self.parse() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/readesphinx repositoryrs/__init__.py", >> line 75, in parse >> self.parser.parse(self.input, document) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/__init__.py", >> line 157, in parse >> self.statemachine.run(inputlines, document, >> inliner=self.inliner) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 170, in run >> input_source=document['source']) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", >> line 232, in run >> context, state, transitions) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", >> line 420, in check_line >> return method(match, context, next_state) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 2658, in underline >> self.section(title, source, style, lineno - 1, >> messages) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 308, in section >> self.new_subsection(title, lineno, messages) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 376, in new_subsection >> node=section_node, match_titles=1) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 266, in nested_parse >> node=node, match_titles=match_titles) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 195, in run >> results = StateMachineWS.run(self, input_lines, >> input_offset) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", >> line 232, in run >> context, state, transitions) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", >> line 420, in check_line >> return method(match, context, next_state) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 2239, in explicit_markup >> nodelist, blank_finish = >> self.explicit_construct(match) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 2251, in explicit_construct >> return method(self, expmatch) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 1994, in directive >> directive_class, match, type_name, option_presets) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", >> line 2043, in run_directive >> result = directive_instance.run() >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/__init__.py", >> line 364, in run >> self.state, self.state_machine) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 414, in plot_directive >> options, state_machine) >> File >> "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", >> line 337, in _plot_directive >> shutil.copyfile(plot_path, os.path.join(destdir, >> fname)) >> File "/usr/lib64/python2.6/shutil.py", line 52, in >> copyfile >> fsrc = open(src, 'rb') >> IOError: [Errno 2] No such file or directory: >> u'/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py' >> >>> /usr/lib64/python2.6/shutil.py(52)copyfile() >>> >> -> fsrc = open(src, 'rb') >> >> ------------------------------------------------------------------------------ >> This SF.Net email is sponsored by the Verizon Developer Community >> Take advantage of Verizon's best-in-class app development support >> A streamlined, 14 day to market process makes app distribution fast and easy >> Join now and get one step closer to millions of Verizon customers >> http://p.sf.net/sfu/verizon-dev2dev >> _______________________________________________ >> 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 > > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi, Is there a way to specify the number of ticks on an axis? Say, I want the y-axes on all my subplots to have 5 ticks, for example. Thanks. Sharaf
I get the same errors as you (which seem to indicate a bug in the axis_grid toolkit), but it's not catastrophic -- the documentation is ultimately built anyway, missing a couple of figures. (I tried with both Sphinx 0.6.3 and Sphinx hg latest). Have you tried a clean rebuild? (By removing the doc/build directory?) Mike Nils Wagner wrote: > Hi all, > > I cannot build the documentation of matplotlib. > I am using the latest svn of numpy and matplotlib. > > How can I fix the problem ? > > > Nils > > python make.py html > Running Sphinx v1.0 > loading pickled environment... not found > animation, api, axes_grid, event_handling, misc, mplot3d, > pngsuite, pylab_examples, tests, units, user_interfaces, > widgets, > building [html]: targets for 494 source files that are out > of date > updating environment: 494 added, 0 changed, 0 removed > /home/nwagner/local/lib64/python2.6/site-packages/numpy/core/numeric.py:692: > DeprecationWarning: > The current behavior of correlate is deprecated for 1.4.0, > and will be removed > for NumPy 1.5.0. > > The new behavior fits the conventional definition of > correlation: inputs are > never swapped, and the second argument is conjugated for > complex arrays. > DeprecationWarning) > /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: > UserWarning: Exception running plot > /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py > Traceback (most recent call last): > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 270, in render_figures > run_code(plot_path, function_name, plot_code) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 182, in run_code > "__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE)) > File "demo_axes_divider.py", line 129, in <module> > File "demo_axes_divider.py", line 125, in demo > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/pyplot.py", > line 350, in draw > get_current_fig_manager().canvas.draw() > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/backends/backend_agg.py", > line 388, in draw > self.figure.draw(self.renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *kl) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/figure.py", > line 802, in draw > func(*args) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axes_divider.py", > line 582, in draw > self._axes_class.draw(self, renderer, inframe) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axislines.py", > line 710, in draw > super(Axes, self).draw(renderer, inframe) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *kl) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/axes.py", > line 1775, in draw > a.draw(renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *kl) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 1343, in draw > self._draw_ticks(renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 1209, in _draw_ticks > self.major_ticks.draw(renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 309, in draw > gc.set_foreground(self.get_markeredgecolor()) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 236, in get_markeredgecolor > return self.get_color() > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 232, in get_color > return self.get_attribute_from_ref_artist("color", > "k") > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 187, in get_attribute_from_ref_artist > ref_artist = self.get_ref_artist() > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 229, in get_ref_artist > return self._ref_artist.get_ticklines()[0] > IndexError: list index out of range > > warnings.warn(s) > /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: > UserWarning: Exception running plot > /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_rgb.py > Traceback (most recent call last): > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 270, in render_figures > run_code(plot_path, function_name, plot_code) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 182, in run_code > "__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE)) > File "demo_axes_rgb.py", line 4, in <module> > File > "/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py", > line 129, in <module> > demo() > File > "/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py", > line 125, in demo > plt.draw() > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/pyplot.py", > line 350, in draw > get_current_fig_manager().canvas.draw() > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/backends/backend_agg.py", > line 388, in draw > self.figure.draw(self.renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *kl) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/figure.py", > line 802, in draw > func(*args) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axes_divider.py", > line 582, in draw > self._axes_class.draw(self, renderer, inframe) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axislines.py", > line 710, in draw > super(Axes, self).draw(renderer, inframe) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *kl) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/axes.py", > line 1775, in draw > a.draw(renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", > line 55, in draw_wrapper > draw(artist, renderer, *kl) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 1343, in draw > self._draw_ticks(renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 1209, in _draw_ticks > self.major_ticks.draw(renderer) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 309, in draw > gc.set_foreground(self.get_markeredgecolor()) > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 236, in get_markeredgecolor > return self.get_color() > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 232, in get_color > return self.get_attribute_from_ref_artist("color", > "k") > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 187, in get_attribute_from_ref_artist > ref_artist = self.get_ref_artist() > File > "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", > line 229, in get_ref_artist > return self._ref_artist.get_ticklines()[0] > IndexError: list index out of range > > warnings.warn(s) > /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: > UserWarning: Exception running plot > /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py > Traceback (most recent call last): > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 270, in render_figures > run_code(plot_path, function_name, plot_code) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 180, in run_code > fd = open(fname) > IOError: [Errno 2] No such file or directory: > 'demo_fixed_size_axes.py' > > warnings.warn(s) > Exception occurred while building, starting debugger: > Traceback (most recent call last): > File > "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/cmdline.py", > line 172, in main > app.build(all_files, filenames) > File > "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/application.py", > line 130, in build > self.builder.build_update() > File > "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", > line 265, in build_update > 'out of date' % len(to_build)) > File > "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", > line 285, in build > purple, length): > File > "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", > line 131, in status_iterator > for item in iterable: > File > "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/environment.py", > line 513, in update_generator > self.read_doc(docname, app=app) > File > "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/environment.py", > line 604, in read_doc > pub.publish() > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/core.py", > line 204, in publish > self.settings) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/readers/__init__.py", > line 69, in read > self.parse() > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/readesphinx repositoryrs/__init__.py", > line 75, in parse > self.parser.parse(self.input, document) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/__init__.py", > line 157, in parse > self.statemachine.run(inputlines, document, > inliner=self.inliner) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 170, in run > input_source=document['source']) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", > line 232, in run > context, state, transitions) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", > line 420, in check_line > return method(match, context, next_state) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 2658, in underline > self.section(title, source, style, lineno - 1, > messages) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 308, in section > self.new_subsection(title, lineno, messages) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 376, in new_subsection > node=section_node, match_titles=1) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 266, in nested_parse > node=node, match_titles=match_titles) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 195, in run > results = StateMachineWS.run(self, input_lines, > input_offset) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", > line 232, in run > context, state, transitions) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", > line 420, in check_line > return method(match, context, next_state) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 2239, in explicit_markup > nodelist, blank_finish = > self.explicit_construct(match) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 2251, in explicit_construct > return method(self, expmatch) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 1994, in directive > directive_class, match, type_name, option_presets) > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", > line 2043, in run_directive > result = directive_instance.run() > File > "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/__init__.py", > line 364, in run > self.state, self.state_machine) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 414, in plot_directive > options, state_machine) > File > "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", > line 337, in _plot_directive > shutil.copyfile(plot_path, os.path.join(destdir, > fname)) > File "/usr/lib64/python2.6/shutil.py", line 52, in > copyfile > fsrc = open(src, 'rb') > IOError: [Errno 2] No such file or directory: > u'/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py' > >> /usr/lib64/python2.6/shutil.py(52)copyfile() >> > -> fsrc = open(src, 'rb') > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > 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
Hi all, I cannot build the documentation of matplotlib. I am using the latest svn of numpy and matplotlib. How can I fix the problem ? Nils python make.py html Running Sphinx v1.0 loading pickled environment... not found animation, api, axes_grid, event_handling, misc, mplot3d, pngsuite, pylab_examples, tests, units, user_interfaces, widgets, building [html]: targets for 494 source files that are out of date updating environment: 494 added, 0 changed, 0 removed /home/nwagner/local/lib64/python2.6/site-packages/numpy/core/numeric.py:692: DeprecationWarning: The current behavior of correlate is deprecated for 1.4.0, and will be removed for NumPy 1.5.0. The new behavior fits the conventional definition of correlation: inputs are never swapped, and the second argument is conjugated for complex arrays. DeprecationWarning) /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: UserWarning: Exception running plot /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py Traceback (most recent call last): File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 270, in render_figures run_code(plot_path, function_name, plot_code) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 182, in run_code "__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE)) File "demo_axes_divider.py", line 129, in <module> File "demo_axes_divider.py", line 125, in demo File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/pyplot.py", line 350, in draw get_current_fig_manager().canvas.draw() File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/backends/backend_agg.py", line 388, in draw self.figure.draw(self.renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *kl) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/figure.py", line 802, in draw func(*args) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axes_divider.py", line 582, in draw self._axes_class.draw(self, renderer, inframe) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axislines.py", line 710, in draw super(Axes, self).draw(renderer, inframe) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *kl) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/axes.py", line 1775, in draw a.draw(renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *kl) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 1343, in draw self._draw_ticks(renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 1209, in _draw_ticks self.major_ticks.draw(renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 309, in draw gc.set_foreground(self.get_markeredgecolor()) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 236, in get_markeredgecolor return self.get_color() File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 232, in get_color return self.get_attribute_from_ref_artist("color", "k") File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 187, in get_attribute_from_ref_artist ref_artist = self.get_ref_artist() File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 229, in get_ref_artist return self._ref_artist.get_ticklines()[0] IndexError: list index out of range warnings.warn(s) /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: UserWarning: Exception running plot /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_rgb.py Traceback (most recent call last): File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 270, in render_figures run_code(plot_path, function_name, plot_code) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 182, in run_code "__plot__", fd, fname, ('py', 'r', imp.PY_SOURCE)) File "demo_axes_rgb.py", line 4, in <module> File "/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py", line 129, in <module> demo() File "/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_axes_divider.py", line 125, in demo plt.draw() File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/pyplot.py", line 350, in draw get_current_fig_manager().canvas.draw() File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/backends/backend_agg.py", line 388, in draw self.figure.draw(self.renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *kl) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/figure.py", line 802, in draw func(*args) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axes_divider.py", line 582, in draw self._axes_class.draw(self, renderer, inframe) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axislines.py", line 710, in draw super(Axes, self).draw(renderer, inframe) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *kl) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/axes.py", line 1775, in draw a.draw(renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *kl) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 1343, in draw self._draw_ticks(renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 1209, in _draw_ticks self.major_ticks.draw(renderer) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 309, in draw gc.set_foreground(self.get_markeredgecolor()) File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 236, in get_markeredgecolor return self.get_color() File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 232, in get_color return self.get_attribute_from_ref_artist("color", "k") File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 187, in get_attribute_from_ref_artist ref_artist = self.get_ref_artist() File "/home/nwagner/local/lib64/python2.6/site-packages/mpl_toolkits/axes_grid/axis_artist.py", line 229, in get_ref_artist return self._ref_artist.get_ticklines()[0] IndexError: list index out of range warnings.warn(s) /home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py:273: UserWarning: Exception running plot /home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py Traceback (most recent call last): File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 270, in render_figures run_code(plot_path, function_name, plot_code) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 180, in run_code fd = open(fname) IOError: [Errno 2] No such file or directory: 'demo_fixed_size_axes.py' warnings.warn(s) Exception occurred while building, starting debugger: Traceback (most recent call last): File "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/cmdline.py", line 172, in main app.build(all_files, filenames) File "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/application.py", line 130, in build self.builder.build_update() File "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", line 265, in build_update 'out of date' % len(to_build)) File "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", line 285, in build purple, length): File "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/builders/__init__.py", line 131, in status_iterator for item in iterable: File "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/environment.py", line 513, in update_generator self.read_doc(docname, app=app) File "/home/nwagner/local/lib64/python2.6/site-packages/Sphinx-1.0dev_20091204-py2.6.egg/sphinx/environment.py", line 604, in read_doc pub.publish() File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/core.py", line 204, in publish self.settings) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/readers/__init__.py", line 69, in read self.parse() File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/readers/__init__.py", line 75, in parse self.parser.parse(self.input, document) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/__init__.py", line 157, in parse self.statemachine.run(inputlines, document, inliner=self.inliner) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 170, in run input_source=document['source']) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", line 232, in run context, state, transitions) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", line 420, in check_line return method(match, context, next_state) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 2658, in underline self.section(title, source, style, lineno - 1, messages) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 308, in section self.new_subsection(title, lineno, messages) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 376, in new_subsection node=section_node, match_titles=1) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 266, in nested_parse node=node, match_titles=match_titles) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 195, in run results = StateMachineWS.run(self, input_lines, input_offset) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", line 232, in run context, state, transitions) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/statemachine.py", line 420, in check_line return method(match, context, next_state) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 2239, in explicit_markup nodelist, blank_finish = self.explicit_construct(match) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 2251, in explicit_construct return method(self, expmatch) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 1994, in directive directive_class, match, type_name, option_presets) File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/states.py", line 2043, in run_directive result = directive_instance.run() File "/home/nwagner/local/lib64/python2.6/site-packages/docutils-0.5-py2.6.egg/docutils/parsers/rst/__init__.py", line 364, in run self.state, self.state_machine) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 414, in plot_directive options, state_machine) File "/home/nwagner/local/lib64/python2.6/site-packages/matplotlib/sphinxext/plot_directive.py", line 337, in _plot_directive shutil.copyfile(plot_path, os.path.join(destdir, fname)) File "/usr/lib64/python2.6/shutil.py", line 52, in copyfile fsrc = open(src, 'rb') IOError: [Errno 2] No such file or directory: u'/home/nwagner/svn/matplotlib/doc/mpl_examples/axes_grid/demo_fixed_size_axes.py' > /usr/lib64/python2.6/shutil.py(52)copyfile() -> fsrc = open(src, 'rb')
On Tue, Dec 22, 2009 at 7:17 AM, Ghose, Kaushik < Kau...@hm...> wrote: > Hi, > > Regarding Greg ́s post about how to organize plotting code for data. This is > a common issue encountered regardless of who collected the data or how the > data was generated. I ́m an experimental neuroscientist in that I collect the > data that I then analyze to test hypotheses and models. After some thrashing > about I ́ve kind of settled with the following design (parts in common with > Greg) > > 1. Analysis and plotting are separate. Analysis often takes a lot of CPU > time, whereas plotting doesn ́t. A given analysis can be plotted in many > different ways and often I want to tweak plots. I don ́t want to recompute > the data each time. So a pragmatic way is to save the analysed data as a > pickle file and have the plotting code load it. > > 2. Analysis code is written to be run non-interactively using the command > line options package to pass parameters/instructions. Useful when I want to > run the code on remote machines, or parallelize the code. > I don't do very heavy computations that always require multiple cores to perform the analysis. Most of the time a fast-single computer is enough for my analysis-plotting needs. This said I want to comment on the last two points of your e-mail. > > 3. No GUIs. This has saved me so much time. I just write plotting code that > pops up (or saves as pdf) one figure according to command line options. If I > need a new type of figure I just copy the code into a new script/module and > save it separately. This is much easier to debug than interactive GUIs that > do a gazillion things. > Sometimes GUIs simplify things a lot especially when I am doing quick-looks to the data. You can take a look at Traits [ http://code.enthought.com/projects/traits/] Your opinions might change after seeing how easy to design a GUI for your needs. > > 4. Source control. Don ́t delete any code, save it under different folders > organized by idea or by date. I've always found myself asking, months later, > I made a plot like this, where is it, I want to see what I did there. > There is even a better approach for this. You can use web-based source-code management systems (e.g. code.google.com or www.sourceforge.net) Either way they provide great amount of flexibility for solo or multiple developer projects. > > That's the current credo that has helped me waste a little less time when I > want to test an idea with my data. > > Best > -Kaushik > > ------------------------------ > > Message: 7 > Date: 2009年12月21日 17:42:40 -0500 > From: Greg Novak <no...@uc...> > Subject: [Matplotlib-users] Best practices for organizing plotting > code? > To: mat...@li... > Message-ID: > <ad0...@ma...> > Content-Type: text/plain; charset=ISO-8859-1 > > Hello, > I do computational science and I think I'm typical in that I've > accumulated a huge pile of code to post-process simulations and draw > plots. I think the number of lines of plotting code is now greater > than the number of lines in the actual simulation code... The problem > with plotting code is that so much of it has such a short > lifetime---you have an idea, spend some time writing code to draw the > relevant plot, then the plot isn't interesting and you delete the > code. Therefore there's little incentive to spend any time making > sure that plotting code is at all well-designed. Nevertheless, _some_ > of it tends to live a long time and get ever more complicated---then > the lack of design becomes ever more painful as time goes on. You > simply don't know at the beginning which code will be thrown away and > which will live a long time. > > Over the years I've developed my favorite way to organize my plotting > code but it's far from perfect and I'd love to gather ideas from the > MPL community. So, my current "design principles" are basically > these: > > 1) Don't over-design. A simple system that's used consistently is > better than a half-implemented complicated system. Furthermore, most > plotting code gets thrown away, so keeping overhead down is one of the > primary considerations. > > 2) Keep computation separate from plotting wherever possible. > Therefore I have functions like "def compute_optical_depth(...)" that > compute the physical quantities to be plotted and "def > plot_optical_depth(...)" that handle everything about the visual > appearance of the plot. Then when I want to draw some other plot > involving optical depth, the calculation is neatly packaged into a > function. > > 3) Keep annotation, axis labels, legends, etc, separate from the code > that actually draws the lines on the axes. This allows you to compose > plots to a certain extent. I often find myself saying "I want plot B > to look just like plot A but with this extra information, extra lines, > extra annotation, or whatever" If the function that draws plot A just > puts the data on the axes without axis labels, etc, then the function > that draws plot B can easily use it directly. If the function that > draws plot A _also_ draws a bunch of annotations and labels, then the > function that draws plot B must either get rid of them or hope they > still make sense in the new context. > > 4) Don't put clf() and cla() all over the place. When working > interactively, it's very tempting to put clf()'s into every function > that draws a plot in order to save a few keystrokes. However, plots > don't know the context into which they're being drawn, therefore they > have no authority to clear the screen. They may "own" the whole > plotting window, or they may be incorporated into a larger context. > The function that worries about axis labels, annotations, and titles > is allowed to call cla(). The function that worries about subplots is > allowed to call clf(). If you might use the code over a slow link > (e.g. connecting to a supercomputing site via residential DSL) then no > function should call draw() -- that's the user's job. > > The upshot of these is that I end up with four layers of functions: > > 1) compute_physical_quantity(...): just handles numbers > 2) draw_physical_quantity(...): has calls to pylab.plot() handling > colors, linestyles, etc, but not annotations > 3) some_plot(...): has calls to draw_physical_quantity(), > some_related_physical_quantity(), along with axis labels, annotations, > legends, and pylab.cla() > 4) some_figure(...): has multiple panels with calls to > pylab.subplot(), pylab.clf(), some_plot_a(), some_plot_b(), etc. > > Sometimes layers 2 and 3 are combined because I'm lazy if layer 2 > would really be just a single call to pylab.plot. > > Please remember that I'm not writing these down because I think > they're so great that everyone needs to know about them. I'm hoping > that people will respond with much better ideas that I can adopt for > myself. > > Thanks, > Greg > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and > easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Gökhan
A couple more thoughts on this: > 4) Don't put clf() and cla() all over the place. absolutely -- my addition to this is to use the OO API more than the pylab one. Put all your plotting code into functions that take an axes object as a parameter, then go from there. That way you have separated the generation of figures (collections os axes) from the plotting itself. you can do the same at a higher level too -- put your code that creates the figures in a function that take a figure as an argument -- then you can use the same code to generate PDFs, embed in a GUI, etc. HTH, -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
Hi, Regarding Greg ́s post about how to organize plotting code for data. This is a common issue encountered regardless of who collected the data or how the data was generated. I ́m an experimental neuroscientist in that I collect the data that I then analyze to test hypotheses and models. After some thrashing about I ́ve kind of settled with the following design (parts in common with Greg) 1. Analysis and plotting are separate. Analysis often takes a lot of CPU time, whereas plotting doesn ́t. A given analysis can be plotted in many different ways and often I want to tweak plots. I don ́t want to recompute the data each time. So a pragmatic way is to save the analysed data as a pickle file and have the plotting code load it. 2. Analysis code is written to be run non-interactively using the command line options package to pass parameters/instructions. Useful when I want to run the code on remote machines, or parallelize the code. 3. No GUIs. This has saved me so much time. I just write plotting code that pops up (or saves as pdf) one figure according to command line options. If I need a new type of figure I just copy the code into a new script/module and save it separately. This is much easier to debug than interactive GUIs that do a gazillion things. 4. Source control. Don ́t delete any code, save it under different folders organized by idea or by date. I've always found myself asking, months later, I made a plot like this, where is it, I want to see what I did there. That's the current credo that has helped me waste a little less time when I want to test an idea with my data. Best -Kaushik ------------------------------ Message: 7 Date: 2009年12月21日 17:42:40 -0500 From: Greg Novak <no...@uc...> Subject: [Matplotlib-users] Best practices for organizing plotting code? To: mat...@li... Message-ID: <ad0...@ma...> Content-Type: text/plain; charset=ISO-8859-1 Hello, I do computational science and I think I'm typical in that I've accumulated a huge pile of code to post-process simulations and draw plots. I think the number of lines of plotting code is now greater than the number of lines in the actual simulation code... The problem with plotting code is that so much of it has such a short lifetime---you have an idea, spend some time writing code to draw the relevant plot, then the plot isn't interesting and you delete the code. Therefore there's little incentive to spend any time making sure that plotting code is at all well-designed. Nevertheless, _some_ of it tends to live a long time and get ever more complicated---then the lack of design becomes ever more painful as time goes on. You simply don't know at the beginning which code will be thrown away and which will live a long time. Over the years I've developed my favorite way to organize my plotting code but it's far from perfect and I'd love to gather ideas from the MPL community. So, my current "design principles" are basically these: 1) Don't over-design. A simple system that's used consistently is better than a half-implemented complicated system. Furthermore, most plotting code gets thrown away, so keeping overhead down is one of the primary considerations. 2) Keep computation separate from plotting wherever possible. Therefore I have functions like "def compute_optical_depth(...)" that compute the physical quantities to be plotted and "def plot_optical_depth(...)" that handle everything about the visual appearance of the plot. Then when I want to draw some other plot involving optical depth, the calculation is neatly packaged into a function. 3) Keep annotation, axis labels, legends, etc, separate from the code that actually draws the lines on the axes. This allows you to compose plots to a certain extent. I often find myself saying "I want plot B to look just like plot A but with this extra information, extra lines, extra annotation, or whatever" If the function that draws plot A just puts the data on the axes without axis labels, etc, then the function that draws plot B can easily use it directly. If the function that draws plot A _also_ draws a bunch of annotations and labels, then the function that draws plot B must either get rid of them or hope they still make sense in the new context. 4) Don't put clf() and cla() all over the place. When working interactively, it's very tempting to put clf()'s into every function that draws a plot in order to save a few keystrokes. However, plots don't know the context into which they're being drawn, therefore they have no authority to clear the screen. They may "own" the whole plotting window, or they may be incorporated into a larger context. The function that worries about axis labels, annotations, and titles is allowed to call cla(). The function that worries about subplots is allowed to call clf(). If you might use the code over a slow link (e.g. connecting to a supercomputing site via residential DSL) then no function should call draw() -- that's the user's job. The upshot of these is that I end up with four layers of functions: 1) compute_physical_quantity(...): just handles numbers 2) draw_physical_quantity(...): has calls to pylab.plot() handling colors, linestyles, etc, but not annotations 3) some_plot(...): has calls to draw_physical_quantity(), some_related_physical_quantity(), along with axis labels, annotations, legends, and pylab.cla() 4) some_figure(...): has multiple panels with calls to pylab.subplot(), pylab.clf(), some_plot_a(), some_plot_b(), etc. Sometimes layers 2 and 3 are combined because I'm lazy if layer 2 would really be just a single call to pylab.plot. Please remember that I'm not writing these down because I think they're so great that everyone needs to know about them. I'm hoping that people will respond with much better ideas that I can adopt for myself. Thanks, Greg
set_size_inches method takes a "forward" parameter, which adjusts the window size if True, which I believe is what you want. However, according to the documentation, this is only supported in the Gtk and Wx backend. So, easy way would be to switch to other backend if possible. I quickly go through the source and attached is a patch that seems to fix this for the Tk backend. I never use Tk and I just put the relevant command (copied from your email) at what I think is the right place (but this may introduce some problem although my quick test worked). So, please give it a try. Unless some other developers (who knows Tk) does not pick this up, I'll commit it after a few days of testing. Regards, -JJ On Mon, Dec 21, 2009 at 4:55 PM, Greg Novak <no...@uc...> wrote: > Hello, > I'm trying to resize a matplotlib figure window as part of an > interactive IPython session. I occasionally draw plots that have > strong opinions about the size or aspect ratio of the plotting window, > and I'd like to be able to just put those preferences into the > function that draws the plot. > > I can do this: > > In [96]: gcf().set_size_inches(15,15); draw() > > But then I'm in the awkward position that the canvas doesn't fit > inside the window and only a small part of the plot is visible. If I > touch the corner of the window with the mouse, then the canvas > immediately resizes to the size of the window, destroying my desired > size or aspect ratio. > > After a little googling and digging around in the matplotlib objects, > I was able to do this: > gcf().canvas._tkcanvas.master.geometry("800x800") > > which does successfully resize the plotting window, but violates all > pretense of hiding the details of the backends from the plotting code. > I had hoped that once I figured out how to do this the ugly way then > grepping the matplotlib source tree for "geometry" would lead me to > the "right" way to do this. Alas, that strategy didn't work. > > I'm using version 0.99.1.1 with the TkAgg backend. > > Thanks, > Greg > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hello, I do computational science and I think I'm typical in that I've accumulated a huge pile of code to post-process simulations and draw plots. I think the number of lines of plotting code is now greater than the number of lines in the actual simulation code... The problem with plotting code is that so much of it has such a short lifetime---you have an idea, spend some time writing code to draw the relevant plot, then the plot isn't interesting and you delete the code. Therefore there's little incentive to spend any time making sure that plotting code is at all well-designed. Nevertheless, _some_ of it tends to live a long time and get ever more complicated---then the lack of design becomes ever more painful as time goes on. You simply don't know at the beginning which code will be thrown away and which will live a long time. Over the years I've developed my favorite way to organize my plotting code but it's far from perfect and I'd love to gather ideas from the MPL community. So, my current "design principles" are basically these: 1) Don't over-design. A simple system that's used consistently is better than a half-implemented complicated system. Furthermore, most plotting code gets thrown away, so keeping overhead down is one of the primary considerations. 2) Keep computation separate from plotting wherever possible. Therefore I have functions like "def compute_optical_depth(...)" that compute the physical quantities to be plotted and "def plot_optical_depth(...)" that handle everything about the visual appearance of the plot. Then when I want to draw some other plot involving optical depth, the calculation is neatly packaged into a function. 3) Keep annotation, axis labels, legends, etc, separate from the code that actually draws the lines on the axes. This allows you to compose plots to a certain extent. I often find myself saying "I want plot B to look just like plot A but with this extra information, extra lines, extra annotation, or whatever" If the function that draws plot A just puts the data on the axes without axis labels, etc, then the function that draws plot B can easily use it directly. If the function that draws plot A _also_ draws a bunch of annotations and labels, then the function that draws plot B must either get rid of them or hope they still make sense in the new context. 4) Don't put clf() and cla() all over the place. When working interactively, it's very tempting to put clf()'s into every function that draws a plot in order to save a few keystrokes. However, plots don't know the context into which they're being drawn, therefore they have no authority to clear the screen. They may "own" the whole plotting window, or they may be incorporated into a larger context. The function that worries about axis labels, annotations, and titles is allowed to call cla(). The function that worries about subplots is allowed to call clf(). If you might use the code over a slow link (e.g. connecting to a supercomputing site via residential DSL) then no function should call draw() -- that's the user's job. The upshot of these is that I end up with four layers of functions: 1) compute_physical_quantity(...): just handles numbers 2) draw_physical_quantity(...): has calls to pylab.plot() handling colors, linestyles, etc, but not annotations 3) some_plot(...): has calls to draw_physical_quantity(), some_related_physical_quantity(), along with axis labels, annotations, legends, and pylab.cla() 4) some_figure(...): has multiple panels with calls to pylab.subplot(), pylab.clf(), some_plot_a(), some_plot_b(), etc. Sometimes layers 2 and 3 are combined because I'm lazy if layer 2 would really be just a single call to pylab.plot. Please remember that I'm not writing these down because I think they're so great that everyone needs to know about them. I'm hoping that people will respond with much better ideas that I can adopt for myself. Thanks, Greg
Hello, I'm trying to resize a matplotlib figure window as part of an interactive IPython session. I occasionally draw plots that have strong opinions about the size or aspect ratio of the plotting window, and I'd like to be able to just put those preferences into the function that draws the plot. I can do this: In [96]: gcf().set_size_inches(15,15); draw() But then I'm in the awkward position that the canvas doesn't fit inside the window and only a small part of the plot is visible. If I touch the corner of the window with the mouse, then the canvas immediately resizes to the size of the window, destroying my desired size or aspect ratio. After a little googling and digging around in the matplotlib objects, I was able to do this: gcf().canvas._tkcanvas.master.geometry("800x800") which does successfully resize the plotting window, but violates all pretense of hiding the details of the backends from the plotting code. I had hoped that once I figured out how to do this the ugly way then grepping the matplotlib source tree for "geometry" would lead me to the "right" way to do this. Alas, that strategy didn't work. I'm using version 0.99.1.1 with the TkAgg backend. Thanks, Greg
Robert Kern wrote: > On 2009年09月14日 13:49 PM, Gökhan Sever wrote: > >> On Mon, Sep 14, 2009 at 12:30 PM, <jas...@cr... >> <mailto:jas...@cr...>> wrote: >> >> I tried the following (most output text is deleted): >> >> In [1]: ob1=[1,1,2,2,1,2,4,3,2,2,2,3,4,5,6,7,8,9,7,6,4,5,5] >> In [2]: import matplotlib.pyplot as >> plt >> In [3]: >> plt.figure() >> In [4]: >> plt.boxplot(ob1) >> In [5]: >> plt.savefig('test.png') >> In [6]: import >> scipy.stats >> In [7]: >> scipy.stats.scoreatpercentile(ob1,75) >> Out[7]: 5.5 >> >> >> Note that the 75th percentile is 5.5. R agrees with this calculation. >> However, in the boxplot, the top of the box is around 6, not 5.5. Isn't >> the top of the box supposed to be at the 75th percentile? >> >> Thanks, >> >> Jason >> >> -- >> Jason Grout >> >> >> From matplotlib/lib/matplotlib/axes.py >> >> You can see how matplotlib calculating percentiles. And yes it doesn't >> conform with scipy's scoreatpercentile() >> >> >> # get median and quartiles >> q1, med, q3 = mlab.prctile(d,[25,50,75]) >> >> I[36]: q1 >> O[36]: 2.0 >> >> I[37]: med >> O[37]: 4.0 >> >> I[38]: q3 >> O[38]: 6.0 >> >> >> Could this be due to a rounding? I don't know, but I am curious to hear >> the explanations for this discrepancy. >> > > prctile does not handle the case where the exact percentile lies between two > items. scoreatpercentile does. > Fixed in r8039.
Estaré ausente de la oficina desde el Vie 18/12/2009 y no volveré hasta el Mar 24/08/2010 . Ésta es una respuesta automática para avisar del cambio de correo electrónico. A partir de ahora todos los correos deben ser remitidos a ang...@in... en lugar de a esta dirección de correo. Lamento las molestias. ____________________________________________________ This is an automated reply. My email address has changed and messages sent to this address will no longer arrive. Please take notice of my new email address: ang...@in.... Sorry for any inconvenience this may cause. Angela Rivera Campos Space Enviroment and Effects Laboratory National Institute for Aerospace Technology - INTA Ctra. Ajalvir Km. 4 28850 Torrejón de Ardoz - Madrid - Spain Tel: +34 91 520 65 51 Fax: +34 91 520 20 43 e-mail: ang...@in... ********************************************************************************************** IMPORTANT: The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error, please notify the system manager or the sender immediately and do not disclose the contents to anyone or make copies thereof. *** eSafe scanned this email for viruses, vandals, and malicious content. *** **********************************************************************************************
Thank you very much for your answer! I post the full solution to anyone else maybe need it: try: conn = psycopg2.connect("dbname='...' user='...' host='127.0.0.1' password='....'"); except: print "I am unable to connect to the database" curs = conn.cursor() ........ code to create image/graph....... #canvas contains graph import StringIO data=StringIO.StringIO() canvas.print_figure(data, dpi=150, format="png") sql = "update table set image=%s;" curs.execute(sql,(encoded_data,)) conn.commit() 2009年12月19日 Jae-Joon Lee <lee...@gm...> > On Fri, Dec 18, 2009 at 3:06 AM, Panagiotis Kontaxis <pko...@gm...> > wrote: > > I found only the figure.savefig() function that saves figure's image only > as > > a filename in the filesystem and not in a local variable. > > > > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.savefig > > savefig can take any file-like object, not just a file name. > > Check your matplotlib version, and upgrade if you can. > > Regards, > > -JJ >