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) |
|
Margherita Vittone wiersma wrote: > HI, > i am making a scatter plot and i simply use defaults for tick formatting etc; > when i plot the data the plot show on the x axis a multiplier scaling with scintific notation; > i would like to get rid of it , the data looks like this: > > values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47 > -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52 > -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52 > ......] > > values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52, > -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47, > -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55, > -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58, > ....] > > > and when the plot is shown as in the the attachement it show the scintific notation > at the x scale. If it were just a matter of scientific notation, you would be able to use the ticklabel_format Axes method with style='plain' to turn it off. The real problem, though, is that an offset is being used. With mpl from svn, you can also turn that off with the ticklabel_format() function or method, but with released versions you need something a little more arcane, e.g. import pyplot as plt plt.scatter(values5, values6) ax = plt.gca() ax.xaxis.set_major_formatter(plt.ScalarFormatter(useOffset=False)) #ax.xaxis.set_major_locator(plt.MaxNLocator(nbins=6, steps=[1,2,5,10])) plt.draw() The commented-out line reduces the number of tick marks; you may want to do this because without the offset, the tick labels can get a bit long and crowded. Eric > > Any input is appreciated. Thank you much > bye for now > > Margherita > > > > > ------------------------------------------------------------------------ > > HI, > i am making a scatter plot and i simply use defaults for tick formatting etc; > when i plot the data the plot show on the x axis a multiplier scaling with scintific notation; > i would like to get rid of it , the data looks like this: > > values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47 > -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52 > -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52 > ......] > > values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52, > -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47, > -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55, > -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58, > ....] > > > and when the plot is shown as in the the attachement it show the scintific notation > at the x scale. > > Any input is appreciated. Thank you much > bye for now > > Margherita > > > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
HI, i am making a scatter plot and i simply use defaults for tick formatting etc; when i plot the data the plot show on the x axis a multiplier scaling with scintific notation; i would like to get rid of it , the data looks like this: values5 = [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47 -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52 -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52 ......] values6 = [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52, -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47, -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55, -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58, ....] and when the plot is shown as in the the attachement it show the scintific notation at the x scale. Any input is appreciated. Thank you much bye for now Margherita
The following works for me. from pylab import * plot([1,2,3], linestyle='dashed', label='foo') legend() show() Can you be more specific about how you create the error? Mike Carlos Grohmann wrote: > Hi all, > > I'm wirking on a wxpython app, and I realized that the legend of a > matplotlib plot only works with solid lines. If I change the > linestyles to dashed, dotted or dashdot, it gives an error: > > Traceback (most recent call last): > File "/home/guano/Arbeit/Stout/StereoPanel.py", line 551, in PlotChecked > self.stereoCanvas.draw() > File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_wxagg.py", > line 59, in draw > FigureCanvasAgg.draw(self) > File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", > line 314, in draw > self.figure.draw(self.renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, > in draw_wrapper > draw(artist, renderer, *kl) > File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 774, in draw > for a in self.axes: a.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, > in draw_wrapper > draw(artist, renderer, *kl) > File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1721, in draw > a.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, > in draw_wrapper > draw(artist, renderer, *kl) > File "/usr/lib/pymodules/python2.6/matplotlib/legend.py", line 386, in draw > self._legend_box.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw > c.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw > c.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw > c.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw > c.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 488, in draw > c.draw(renderer) > File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, > in draw_wrapper > draw(artist, renderer, *kl) > File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 535, in draw > drawFunc(renderer, gc, tpath, affine.frozen()) > File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 874, > in _draw_lines > self._lineFunc(renderer, gc, path, trans) > File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 925, > in _draw_dashed > renderer.draw_path(gc, path, trans) > File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", > line 98, in draw_path > self._renderer.draw_path(gc, path, transform, rgbFace) > TypeError: float() argument must be a string or a number > > > > This happens for Line2D and for LineCollection as well. > > TIA > > Carlos > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi all, I'm wirking on a wxpython app, and I realized that the legend of a matplotlib plot only works with solid lines. If I change the linestyles to dashed, dotted or dashdot, it gives an error: Traceback (most recent call last): File "/home/guano/Arbeit/Stout/StereoPanel.py", line 551, in PlotChecked self.stereoCanvas.draw() File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_wxagg.py", line 59, in draw FigureCanvasAgg.draw(self) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 314, in draw self.figure.draw(self.renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *kl) File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 774, in draw for a in self.axes: a.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *kl) File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1721, in draw a.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *kl) File "/usr/lib/pymodules/python2.6/matplotlib/legend.py", line 386, in draw self._legend_box.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw c.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw c.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw c.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw c.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 488, in draw c.draw(renderer) File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in draw_wrapper draw(artist, renderer, *kl) File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 535, in draw drawFunc(renderer, gc, tpath, affine.frozen()) File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 874, in _draw_lines self._lineFunc(renderer, gc, path, trans) File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 925, in _draw_dashed renderer.draw_path(gc, path, trans) File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", line 98, in draw_path self._renderer.draw_path(gc, path, transform, rgbFace) TypeError: float() argument must be a string or a number This happens for Line2D and for LineCollection as well. TIA Carlos -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano Linux User #89721 ________________ Can’t stop the signal.
On Fri, Apr 30, 2010 at 1:55 AM, Eric Firing <ef...@ha...> wrote: > > I don't see this in the version as I changed it in svn r8282. Are you sure > you installed and built from svn after I made the change? Using the > attached script, I get the two attached (gzipped) eps files. The first with > transparent=True, has no fill operations other than for generation of the > glyphs; the second differs from the first in having two extra fill > operations, one for the axes patch, the other for the figure patch. > It looks like I messed up my install. On top of that, when I was testing this second time, I was not bothering to create the ps (from latex) and just using my OS's default EPS viewer to verify that transparency was working---the problem was that Evince displays images on a white background rather than on some distinguishing background to let me know that it is a transparent image. Sorry for the noise, its definitely working in r8282.
Michael Droettboom wrote: > I wasn't aware of these fonts -- we may want to consider distributing > them with matplotlib instead (assuming the licensing makes sense) as it > would greatly simplify the mathtext code. Of course, that's a project I > may not have time for right now. > On further looking into these fonts, it seems they're not appropriate at the moment. They are missing a number of math-related symbols (such as infinity, for example). They are worth keeping an eye on, because they have a much better and more open framework for being built vs. the Bakoma fonts which are essentially "closed-source" though free for redistribution. (i.e. it makes it a lot harder to fix problems in them). Given the time, I may look into what it would take to start adding these new symbols. > I'll look into the case-sensitivity issue -- I'm not sure why that is > the case. > This has now been fixed in SVN. Mike > Mike > > Tony S Yu wrote: > >> On Apr 29, 2010, at 10:43 PM, Tony S Yu wrote: >> >> >>> On Apr 29, 2010, at 6:09 PM, Michael Droettboom wrote: >>> >>> >>>> Those Computer Modern fonts (specifically the Bakoma distribution of >>>> them that matplotlib includes) use a custom character set mapping >>>> where many of the characters are in completely arbitrary locations. >>>> For regular text, matplotlib expects a regular Unicode font >>>> (particularly to get the minus sign). Since cmr10 doesn't have a >>>> standard encoding, it just won't work. >>>> >>> Hey Mike, >>> >>> Thanks for your reply. That makes sense. >>> >>> An alternative work around (I presume) would be to install >>> the computer modern unicode fonts >>> <http://sourceforge.net/projects/cm-unicode/files/> (I made sure to >>> install the ttf version). However, I'm having trouble getting MPL to >>> find the fonts. >>> >>> The installed font is listed when calling >>> `mpl.font_manager.OSXInstalledFonts()`, but it's not found when >>> calling `mpl.font_manager.findfont` (with various names that would >>> make sense: cmunrm, CMU Serif, etc.) >>> >>> Any ideas on what I'm doing wrong? >>> >> Sorry, I meant to reply to the list. >> >> After clearing the fontlist cache, I was able to get this fix working. >> >> Just to summarize: >> >> * download unicode version of computer modern fonts >> (http://sourceforge.net/projects/cm-unicode/files/)---make sure to get >> the ttf version >> >> * clear out the fontlist cache (rm ~/.matplotlib/fontList.cache) >> >> * add the following to ~/matplotlib/matplotlibrc: >> >> font.family: serif >> font.serif: CMU Serif >> >> * alternatively, you could leave the default as sans serif and use the >> computer modern sans serif (unicode version): >> >> font.sans-serif: CMU Sans Serif >> >> These changes produce plots where the size of normal text matches that >> of mathtext. >> >> Thanks for you help, Mike! >> >> -Tony >> >> > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi Jae-Joon This method is also great and it's working with plt.subplot: from pylab import * subplot(221) subplot(222) subplot(223) subplot(224) plot([0.5, 0.5], [0, 1], color='lightgreen', lw=5,transform=gcf().transFigure, clip_on=False) plot([0, 1], [0.5, 0.5], color='lightgreen', lw=5,transform=gcf().transFigure, clip_on=False) Thank you very much Regards, Maxime On 04/30/2010 04:02 PM, Jae-Joon Lee wrote: > You may do this without creating an extra axes (ax0). > Try something like > > ax4.plot([0.5, 0.5], [0, 1], color='lightgreen', lw=5, > transform=gcf().transFigure, clip_on=False) > > Regards, > > -JJ > > > On Fri, Apr 30, 2010 at 3:56 AM, Matthias Michler > <Mat...@gm...> wrote: > >> On Wednesday 28 April 2010 15:07:21 Maxime Bois wrote: >> >>> Hi all, >>> >>> I have created a figure with 4 subplots (2x2) and I want to separate >>> them with a vertical and horizontal lines (see the green lines on my >>> figure edited by Gimp) but I don't know if it's possible (I haven't find >>> any example of that). >>> >>> I am using Python 2.5.4 and matplotlib version 0.99.0 >>> >>> Thanks, >>> Maxime >>> >> Hi Maxime, >> >> I hope my example works for you. Please note: I used plt.axes instead of >> plt.subplot, although both generate an Axes instance, the latter doesn't >> support overlapping axes. >> >> Kind regards, >> Matthias >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
On Thu, Apr 29, 2010 at 12:40 PM, acoffeemug <joa...@gm...> wrote: > Does anyone know a good fix for this? Preferably one which doesn't involve > manual resizing? http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels While example in the link try to make a room for ticklable, a same can be done with a label. If you don't mind your figure size slightly changed, you may try savefig("yourfilename", bbox_inches="tight") Regards, -JJ
You may do this without creating an extra axes (ax0). Try something like ax4.plot([0.5, 0.5], [0, 1], color='lightgreen', lw=5, transform=gcf().transFigure, clip_on=False) Regards, -JJ On Fri, Apr 30, 2010 at 3:56 AM, Matthias Michler <Mat...@gm...> wrote: > On Wednesday 28 April 2010 15:07:21 Maxime Bois wrote: >> Hi all, >> >> I have created a figure with 4 subplots (2x2) and I want to separate >> them with a vertical and horizontal lines (see the green lines on my >> figure edited by Gimp) but I don't know if it's possible (I haven't find >> any example of that). >> >> I am using Python 2.5.4 and matplotlib version 0.99.0 >> >> Thanks, >> Maxime > > Hi Maxime, > > I hope my example works for you. Please note: I used plt.axes instead of > plt.subplot, although both generate an Axes instance, the latter doesn't > support overlapping axes. > > Kind regards, > Matthias > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
I wasn't aware of these fonts -- we may want to consider distributing them with matplotlib instead (assuming the licensing makes sense) as it would greatly simplify the mathtext code. Of course, that's a project I may not have time for right now. I'll look into the case-sensitivity issue -- I'm not sure why that is the case. Mike Tony S Yu wrote: > > On Apr 29, 2010, at 10:43 PM, Tony S Yu wrote: > >> >> On Apr 29, 2010, at 6:09 PM, Michael Droettboom wrote: >> >>> Those Computer Modern fonts (specifically the Bakoma distribution of >>> them that matplotlib includes) use a custom character set mapping >>> where many of the characters are in completely arbitrary locations. >>> For regular text, matplotlib expects a regular Unicode font >>> (particularly to get the minus sign). Since cmr10 doesn't have a >>> standard encoding, it just won't work. >> >> Hey Mike, >> >> Thanks for your reply. That makes sense. >> >> An alternative work around (I presume) would be to install >> the computer modern unicode fonts >> <http://sourceforge.net/projects/cm-unicode/files/> (I made sure to >> install the ttf version). However, I'm having trouble getting MPL to >> find the fonts. >> >> The installed font is listed when calling >> `mpl.font_manager.OSXInstalledFonts()`, but it's not found when >> calling `mpl.font_manager.findfont` (with various names that would >> make sense: cmunrm, CMU Serif, etc.) >> >> Any ideas on what I'm doing wrong? > > Sorry, I meant to reply to the list. > > After clearing the fontlist cache, I was able to get this fix working. > > Just to summarize: > > * download unicode version of computer modern fonts > (http://sourceforge.net/projects/cm-unicode/files/)---make sure to get > the ttf version > > * clear out the fontlist cache (rm ~/.matplotlib/fontList.cache) > > * add the following to ~/matplotlib/matplotlibrc: > > font.family: serif > font.serif: CMU Serif > > * alternatively, you could leave the default as sans serif and use the > computer modern sans serif (unicode version): > > font.sans-serif: CMU Sans Serif > > These changes produce plots where the size of normal text matches that > of mathtext. > > Thanks for you help, Mike! > > -Tony > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi Matthias, This is exactly what I wanted to do (excepted for the colors of the lines which are quite horrible :-) ) Thanks a lot Cheers, Maxime On 04/30/2010 09:56 AM, Matthias Michler wrote: > On Wednesday 28 April 2010 15:07:21 Maxime Bois wrote: > >> Hi all, >> >> I have created a figure with 4 subplots (2x2) and I want to separate >> them with a vertical and horizontal lines (see the green lines on my >> figure edited by Gimp) but I don't know if it's possible (I haven't find >> any example of that). >> >> I am using Python 2.5.4 and matplotlib version 0.99.0 >> >> Thanks, >> Maxime >> > Hi Maxime, > > I hope my example works for you. Please note: I used plt.axes instead of > plt.subplot, although both generate an Axes instance, the latter doesn't > support overlapping axes. > > Kind regards, > Matthias > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
T J wrote: > On Wed, Apr 28, 2010 at 12:22 PM, Eric Firing <ef...@ha...> wrote: >> It's a bug, made more confusing by the trickery that is done when printing a >> figure. DPI, facecolor, and edgecolor that are set for a figure object are >> used only for screen display, and are overridden when the figure is saved. >> The overriding values can be supplied to the savefig call or via rcParams. >> >> I think I have fixed the bug in svn, so that "transparent" will work as >> advertised. In addition, I made a change so that even with >> transparent=True, if you supply facecolor and/or edgecolor to the savefig >> call, those values should be used for the figure patch when the figure is >> saved. This might be useful if you want to keep the line around the figure, >> for example. >> > > This still does not work for me. I dug around a bit and found an > issue. Figure.savefig() sets the 'edgecolor' and 'facecolor' of the > axis patches but delegates the patches of the figure to the actual > print command. It does this by setting the edgecolor and facecolor > values in the kwargs dict. However, self.canvas.print_figure() > expects edgecolor and facecolor as args, not kwargs. So > print_figure() uses the default value: 'w' instead of 'none'. This is > a bit inconsistent, it seems, especially b/c the PS backend (which is > called after print_figure()) expects facecolor and edgecolor as > kwargs. I don't see this in the version as I changed it in svn r8282. Are you sure you installed and built from svn after I made the change? Using the attached script, I get the two attached (gzipped) eps files. The first with transparent=True, has no fill operations other than for generation of the glyphs; the second differs from the first in having two extra fill operations, one for the axes patch, the other for the figure patch. When I use your transeps.tex, run latex, and then dvips, the resulting ps file (also gzipped and attached) has the figure with a red background, sitting on a white page. I presume this is what you expect, and so the figure and axes really are transparent. Eric > > I went ahead and changed this, hoping it'd fix the issue, but it does > not. At least now, I can see that the edgecolor and facecolor are > both set to 'none' all the way until self.figure.draw(renderer) is > called. So somehow, the draw() command is unaffected by this still. > > What next? > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On Wed, Apr 28, 2010 at 12:22 PM, Eric Firing <ef...@ha...> wrote: > > It's a bug, made more confusing by the trickery that is done when printing a > figure. DPI, facecolor, and edgecolor that are set for a figure object are > used only for screen display, and are overridden when the figure is saved. > The overriding values can be supplied to the savefig call or via rcParams. > > I think I have fixed the bug in svn, so that "transparent" will work as > advertised. In addition, I made a change so that even with > transparent=True, if you supply facecolor and/or edgecolor to the savefig > call, those values should be used for the figure patch when the figure is > saved. This might be useful if you want to keep the line around the figure, > for example. > This still does not work for me. I dug around a bit and found an issue. Figure.savefig() sets the 'edgecolor' and 'facecolor' of the axis patches but delegates the patches of the figure to the actual print command. It does this by setting the edgecolor and facecolor values in the kwargs dict. However, self.canvas.print_figure() expects edgecolor and facecolor as args, not kwargs. So print_figure() uses the default value: 'w' instead of 'none'. This is a bit inconsistent, it seems, especially b/c the PS backend (which is called after print_figure()) expects facecolor and edgecolor as kwargs. I went ahead and changed this, hoping it'd fix the issue, but it does not. At least now, I can see that the edgecolor and facecolor are both set to 'none' all the way until self.figure.draw(renderer) is called. So somehow, the draw() command is unaffected by this still. What next?
On Apr 29, 2010, at 11:51 PM, Tony S Yu wrote: > > On Apr 29, 2010, at 10:43 PM, Tony S Yu wrote: > >> >> On Apr 29, 2010, at 6:09 PM, Michael Droettboom wrote: >> >>> Those Computer Modern fonts (specifically the Bakoma distribution of them that matplotlib includes) use a custom character set mapping where many of the characters are in completely arbitrary locations. For regular text, matplotlib expects a regular Unicode font (particularly to get the minus sign). Since cmr10 doesn't have a standard encoding, it just won't work. >> >> >> Hey Mike, >> >> Thanks for your reply. That makes sense. >> >> An alternative work around (I presume) would be to install the computer modern unicode fonts (I made sure to install the ttf version). However, I'm having trouble getting MPL to find the fonts. >> >> The installed font is listed when calling `mpl.font_manager.OSXInstalledFonts()`, but it's not found when calling `mpl.font_manager.findfont` (with various names that would make sense: cmunrm, CMU Serif, etc.) >> >> Any ideas on what I'm doing wrong? > > Sorry, I meant to reply to the list. > > After clearing the fontlist cache, I was able to get this fix working. > > Just to summarize: > > * download unicode version of computer modern fonts (http://sourceforge.net/projects/cm-unicode/files/)---make sure to get the ttf version > > * clear out the fontlist cache (rm ~/.matplotlib/fontList.cache) > > * add the following to ~/matplotlib/matplotlibrc: > > font.family: serif > font.serif: CMU Serif > > * alternatively, you could leave the default as sans serif and use the computer modern sans serif (unicode version): > > font.sans-serif: CMU Sans Serif > > These changes produce plots where the size of normal text matches that of mathtext. > > Thanks for you help, Mike! > > -Tony > Umm, ... last email on this topic, I promise. Is there any reason the font family rc parameter is case sensitive, while the findfont input is case insensitive? In other words, replacing > font.serif: CMU Serif with > font.serif: cmu serif does not work. On the other hand, both of the following work: >>> mpl.font_manager.findfont('cmu serif') >>> mpl.font_manager.findfont('CMU Serif') This caused me problems when debugging my earlier font troubles. Best, -Tony
On Apr 29, 2010, at 10:43 PM, Tony S Yu wrote: > > On Apr 29, 2010, at 6:09 PM, Michael Droettboom wrote: > >> Those Computer Modern fonts (specifically the Bakoma distribution of them that matplotlib includes) use a custom character set mapping where many of the characters are in completely arbitrary locations. For regular text, matplotlib expects a regular Unicode font (particularly to get the minus sign). Since cmr10 doesn't have a standard encoding, it just won't work. > > > Hey Mike, > > Thanks for your reply. That makes sense. > > An alternative work around (I presume) would be to install the computer modern unicode fonts (I made sure to install the ttf version). However, I'm having trouble getting MPL to find the fonts. > > The installed font is listed when calling `mpl.font_manager.OSXInstalledFonts()`, but it's not found when calling `mpl.font_manager.findfont` (with various names that would make sense: cmunrm, CMU Serif, etc.) > > Any ideas on what I'm doing wrong? Sorry, I meant to reply to the list. After clearing the fontlist cache, I was able to get this fix working. Just to summarize: * download unicode version of computer modern fonts (http://sourceforge.net/projects/cm-unicode/files/)---make sure to get the ttf version * clear out the fontlist cache (rm ~/.matplotlib/fontList.cache) * add the following to ~/matplotlib/matplotlibrc: font.family: serif font.serif: CMU Serif * alternatively, you could leave the default as sans serif and use the computer modern sans serif (unicode version): font.sans-serif: CMU Sans Serif These changes produce plots where the size of normal text matches that of mathtext. Thanks for you help, Mike! -Tony
> -----Original Message----- > From: melons [mailto:xi...@cc...] > Sent: Wednesday, April 28, 2010 5:14 AM > To: mat...@li... > Subject: [Matplotlib-users] How to set constant y-axis scale value > > > Hello, > > I am quite new in matplotlib, I am now facing a quite simple problem but > have no idea to solve. I just want set the y axis scale to value 100, > which > means in the image, the y axis is always of scale 100, because the points > in > my image indicates the percentage value(for example, 20%, 87%) which will > never exceed 100. > > So, How to set the y axis scale to constant value 100 ?? It's really hard > to > find a answer from internet. Give this a shot: # ---- import matplotlib.pyplot as plt import numpy as np x = np.arange(20) y = np.random.randn(20) y = y/y.max() * 100 fig = plt.figure() ax = fig.add_subplot(111) ax.plot(x,y,'ko', mfc='none') # you can do this: ax.set_ylim([0,100]) # or something like this: ax.set_ylim(ymin=0, ymax=100) plt.show()
i want to display the value for each date , now i have 3 date value , but in chart it cannot show the value, in chart can show 12,45,67 Thanks source figure(2) x=[4,5,6] y=[12,45,67] line,= plt.plot(x,y,label="aaa",color="red",linewidth=1,linestyle='|dashed', marker='o',c='b') xticks(arange(13), calendar.month_name[0:13], rotation=11) plt.ylabel("WDR",fontsize=12, color='r') plt.title("Price",fontsize=16, color='r') plt.xlim(1,12) plt.ylim(1,100,1) plt.grid(True) plt.legend() -- View this message in context: http://old.nabble.com/how-to-display-value-for-each-date-in-line-chart-or-pie-chart--%28show-y-axis%27s-value%29-tp28406803p28406803.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Those Computer Modern fonts (specifically the Bakoma distribution of them that matplotlib includes) use a custom character set mapping where many of the characters are in completely arbitrary locations. For regular text, matplotlib expects a regular Unicode font (particularly to get the minus sign). Since cmr10 doesn't have a standard encoding, it just won't work. You could get around this by overriding the default formatter to use a different symbol for the minus sign. See this example for an example of overriding the formatter: http://matplotlib.sourceforge.net/examples/pylab_examples/major_minor_demo1.html#pylab-examples-major-minor-demo1 Mike On 04/29/2010 03:33 PM, Tony S Yu wrote: > There was a recent thread about the font sizes > <http://old.nabble.com/mathtext-is-smaller-than-regular-text-ts28374364.html> not > matching up between regular text and math text. I decided I'd try to > get matching font sizes by using computer modern as the default font, > so I added the following to my matplotlibrc file: > > font.family: serif > font.serif: cmr10 > > This fixes the font size issue, but for some reason, MPL's minus sign > seems to be using a character not defined by the computer modern fonts > (see y-axis in attached image). > > Is there a fix for this missing character? > > Best, > -Tony > > P.S. I'm using the cmr10 fonts provided by MPL (confirmed by using the > findfont function). > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
melloncx wrote: > Hello, > > I am quite new in matplotlib, I am now facing a quite simple problem but > have no idea to solve. I just want set the y axis scale to value 100, which > means in the image, the y axis is always of scale 100, because the points in > my image indicates the percentage value(for example, 20%, 87%) which will > never exceed 100. > > So, How to set the y axis scale to constant value 100 ?? It's really hard to > find a answer from internet. If you are using the pyplot interface, then maybe what you want is the ylim function: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.ylim Eric
Hi there I found that the error is related to legend! If I disable self.plotaxes.legend(bbox_to_anchor=(0.95, 0.95), loc=2, prop=FontProperties(size='small'),numpoints=1) I can change the linestyles and it works like a charm, but if I turn on that line again... just errors. can anyone think of something? best Carlos On Wed, Apr 28, 2010 at 09:46, Michael Droettboom <md...@st...> wrote: > I can't reproduce the error on 0.99. Can you provide a complete script that > reproduces the error? > > Mike > > Carlos Grohmann wrote: >> >> I've been trying to change the linestyles in a LineCollection, but >> without any success... >> >> If I'm using: >> col = collections.LineCollection(listXY, linewidths=circwdt, >> colors=circcol, linestyle='solid', label=plabel) >> >> it works fine, but anything other than 'solid' gives me an error when >> the code calls FigureCanvasAgg.draw(self) (it is a wxpython app): >> >> Traceback (most recent call last): >> File "/home/guano/Arbeit/Stout/StereoPanel.py", line 552, in PlotChecked >> self.stereoCanvas.draw() >> File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_wxagg.py", >> line 59, in draw >> FigureCanvasAgg.draw(self) >> File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", >> line 314, in draw >> self.figure.draw(self.renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, >> in draw_wrapper >> draw(artist, renderer, *kl) >> File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 774, in >> draw >> for a in self.axes: a.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, >> in draw_wrapper >> draw(artist, renderer, *kl) >> File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1721, in >> draw >> a.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, >> in draw_wrapper >> draw(artist, renderer, *kl) >> File "/usr/lib/pymodules/python2.6/matplotlib/legend.py", line 386, in >> draw >> self._legend_box.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in >> draw >> c.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in >> draw >> c.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in >> draw >> c.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in >> draw >> c.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 488, in >> draw >> c.draw(renderer) >> File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, >> in draw_wrapper >> draw(artist, renderer, *kl) >> File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 535, in >> draw >> drawFunc(renderer, gc, tpath, affine.frozen()) >> File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 874, >> in _draw_lines >> self._lineFunc(renderer, gc, path, trans) >> File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 925, >> in _draw_dashed >> renderer.draw_path(gc, path, trans) >> File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py", >> line 98, in draw >> _path >> self._renderer.draw_path(gc, path, transform, rgbFace) >> TypeError: float() argument must be a string or a number >> >> >> >> >From the MPL docs, I see that i should be able to use other linestyles: >> >> >> http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collections.LineCollection >> >> linestyles [ ‘solid’ | ‘dashed’ | ‘dashdot’ | ‘dotted’ ] >> a string or dash tuple. The dash tuple is: >> >> >> >> I'm using MPL 0.99.0 in Ubuntu Karmic (9.10) >> >> tks >> >> >> > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano Linux User #89721 ________________ Can’t stop the signal.
There was a recent thread about the font sizes not matching up between regular text and math text. I decided I'd try to get matching font sizes by using computer modern as the default font, so I added the following to my matplotlibrc file: font.family: serif font.serif: cmr10 This fixes the font size issue, but for some reason, MPL's minus sign seems to be using a character not defined by the computer modern fonts (see y-axis in attached image). Is there a fix for this missing character? Best, -Tony P.S. I'm using the cmr10 fonts provided by MPL (confirmed by using the findfont function).
You can set the rcParam svg.embed_char_paths to False. Mike On 04/29/2010 01:43 PM, Ariel Rokem wrote: > Hi everyone, > > Is there any way to get a svg output of a matplotlib, with the fonts > not embedded as vector graphic? That is, is there any way to make a > figure, such that a vector image editing program (such as Adobe > Illustrator) would recognize the text as text and would allow editing > of the text, changing the font and resizing the font size? > > Cheers, > > Ariel > > -- > Ariel Rokem > Helen Wills Neuroscience Institute > University of California, Berkeley > http://argentum.ucbso.berkeley.edu/ariel > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hi everyone, Is there any way to get a svg output of a matplotlib, with the fonts not embedded as vector graphic? That is, is there any way to make a figure, such that a vector image editing program (such as Adobe Illustrator) would recognize the text as text and would allow editing of the text, changing the font and resizing the font size? Cheers, Ariel -- Ariel Rokem Helen Wills Neuroscience Institute University of California, Berkeley http://argentum.ucbso.berkeley.edu/ariel
Hi, I have tried to make a plot using the twinx() method to get different left and right scales in the same plot. The plot looks fine, but the y labels end up outside the figure. The same problem can be seen in the example from the matplot homepage: http://matplotlib.sourceforge.net/examples/api/two_scales.html Here the y labels 'exp' and 'sin' are outside the plot. Does anyone know a good fix for this? Preferably one which doesn't involve manual resizing? I use ipython with -pylab to generate the plots. Best regards, Jóan Petur -- View this message in context: http://old.nabble.com/Labels-end-up-outside-figure-tp28402985p28402985.html Sent from the matplotlib - users mailing list archive at Nabble.com.
I don't see this here (on the wx Buttons in the mathtext_wx.py example, at least). What are you using to display this bitmap? It may be a premultiplied/nonpremultiplied alpha problem. Are you using the code I attached, or setting the red channel to the text image as well? Mike On 04/29/2010 12:19 PM, Cédrick FAURY wrote: > Thank you for your answer, Mike. > > It works fine, but I don't understand why there is grey points around > the letters ... (see attached image) > > > Cédrick > > Le 29/04/2010 15:17, Michael Droettboom a écrit : >> There is no direct way, but since you can get a numpy array of the >> text bitmap, you can do whatever modifications you want to it. For >> example, the following is a modification of the mathtext_to_wxbitmap >> function in mathtext_wx that takes an rgb tuple as an argument: >> >> def mathtext_to_wxbitmap(s, rgb): >> ftimage, depth = mathtext_parser.parse(s, 150) >> x = ftimage.as_array() >> # Create an RGBA array for the destination, w x h x 4 >> rgba = np.zeros((x.shape[0], x.shape[1], 4), dtype=np.uint8) >> # set the RGB components to the constant value passed in >> rgba[:,:,0:3] = rgb >> # set the A component to the shape of the text >> rgba[:,:,3] = x >> >> return wx.BitmapFromBufferRGBA( >> ftimage.get_width(), ftimage.get_height(), >> rgba.tostring()) >> >> Mike >> >> On 04/29/2010 02:28 AM, Cédrick FAURY wrote: >>> Hello, >>> >>> Is it possible to get colored bitmaps (instead of black ones) with the >>> MathTextParser when it is used as shown in the mathtext_wx.py >>> example ?? >>> >>> Thanks by advance for your help. >>> >>> Best regards, >>> Cédrick FAURY >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >