|
From: Gökhan S. <gok...@gm...> - 2009-07-09 02:01:11
|
Hello,
I am using axes_grid toolkit to create multiple axes. The labels' colors are
nicely being updated, however size or fontsize has no effect on the
resulting figure :( Are they functional, or is it something wrong with my
implementation? Oh also I couldn't make the grids switched on my figures.
Here is the snippet that I use:
fig = plt.figure(1)
host = SubplotHost(fig, 111)
fig.add_subplot(host)
par = host.twinx()
host.set_xlabel("Time [sfm]", size=50)
host.set_ylabel("DMT CCN Concentration [#/cm^3]", fontsize=20)
par.set_ylabel("Supersaturation [%]", fontsize=20)
p1, = host.plot(Time, dccnConc, label="dccnConc")
p2, = host.plot(Time, dccnConAmb, label="dccnConAmb")
p3, = host.plot(Time, dccnConSTP, label="dccnConSTP")
p4, = par.plot(Time, dccnSS, label="dccnSS")
p5, = par.plot(Time, dccnSS_Amb, label="dccnSS_Amb")
host.axis["left"].label.set_color(p1.get_color())
par.axis["right"].label.set_color(p5.get_color())
host.axis["left"].label.set_label(p1.get_label())
host.legend()
plt.show()
These are my current system properties:
Linux 2.6.27.19-170.2.35.fc10.i686.PAE (Fedora 11)
Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
IPython 0.10.bzr.r1174 (with --pylab)
and a very recent Matplotlib svn version.
Thanks.
--
Gökhan
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-07-09 02:47:39
|
axes_grid toolkit uses slightly customized version of axes and
different kind of artists are used to draw ticks and ticklabels, and
some of the commands from original mpl do not work.
But not changing fontsize and not showing up gridlines are things that
should be fixed (I'll work on these in a few days).
Meanwhile, there are workarounds.
For fontsize, try to directly set the font size of the label object.
Unfortunately, the padding between the label and the axis get messed
up, and you need to adjust the padding manually.
host.axis["bottom"].label.set_size(30)
host.axis["bottom"].LABELPAD=10
For grid, it is a bit more tricky.
host.xaxis.set_visible(True)
host.yaxis.set_visible(True)
host.xaxis.get_label().set_visible(False)
host.yaxis.get_label().set_visible(False)
for a in host.xaxis.majorTicks + host.yaxis.majorTicks:
a.gridOn=True
a.tick1On=False
a.tick2On=False
a.label1On=False
a.label2On=False
I hope these workarounds are useful.
Thanks for reporting the problems and I;ll try to fix them soon.
Regards,
-JJ
On Wed, Jul 8, 2009 at 10:00 PM, Gökhan SEVER<gok...@gm...> wrote:
> Hello,
>
> I am using axes_grid toolkit to create multiple axes. The labels' colors are
> nicely being updated, however size or fontsize has no effect on the
> resulting figure :( Are they functional, or is it something wrong with my
> implementation? Oh also I couldn't make the grids switched on my figures.
>
> Here is the snippet that I use:
>
> fig = plt.figure(1)
> host = SubplotHost(fig, 111)
> fig.add_subplot(host)
> par = host.twinx()
> host.set_xlabel("Time [sfm]", size=50)
> host.set_ylabel("DMT CCN Concentration [#/cm^3]", fontsize=20)
> par.set_ylabel("Supersaturation [%]", fontsize=20)
>
> p1, = host.plot(Time, dccnConc, label="dccnConc")
> p2, = host.plot(Time, dccnConAmb, label="dccnConAmb")
> p3, = host.plot(Time, dccnConSTP, label="dccnConSTP")
> p4, = par.plot(Time, dccnSS, label="dccnSS")
> p5, = par.plot(Time, dccnSS_Amb, label="dccnSS_Amb")
>
> host.axis["left"].label.set_color(p1.get_color())
> par.axis["right"].label.set_color(p5.get_color())
>
> host.axis["left"].label.set_label(p1.get_label())
> host.legend()
> plt.show()
>
>
> These are my current system properties:
>
> Linux 2.6.27.19-170.2.35.fc10.i686.PAE (Fedora 11)
> Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
> IPython 0.10.bzr.r1174 (with --pylab)
> and a very recent Matplotlib svn version.
>
> Thanks.
>
> --
> Gökhan
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to $100,000 in prizes! For a limited time,
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
|
|
From: Gökhan S. <gok...@gm...> - 2009-07-09 04:40:53
|
On Wed, Jul 8, 2009 at 9:47 PM, Jae-Joon Lee <lee...@gm...> wrote:
> axes_grid toolkit uses slightly customized version of axes and
> different kind of artists are used to draw ticks and ticklabels, and
> some of the commands from original mpl do not work.
> But not changing fontsize and not showing up gridlines are things that
> should be fixed (I'll work on these in a few days).
> Meanwhile, there are workarounds.
>
> For fontsize, try to directly set the font size of the label object.
> Unfortunately, the padding between the label and the axis get messed
> up, and you need to adjust the padding manually.
>
> host.axis["bottom"].label.set_size(30)
> host.axis["bottom"].LABELPAD=10
>
> For grid, it is a bit more tricky.
>
> host.xaxis.set_visible(True)
> host.yaxis.set_visible(True)
> host.xaxis.get_label().set_visible(False)
> host.yaxis.get_label().set_visible(False)
> for a in host.xaxis.majorTicks + host.yaxis.majorTicks:
> a.gridOn=True
> a.tick1On=False
> a.tick2On=False
> a.label1On=False
> a.label2On=False
>
> I hope these workarounds are useful.
> Thanks for reporting the problems and I;ll try to fix them soon.
> Regards,
>
> -JJ
>
>
>
>
> On Wed, Jul 8, 2009 at 10:00 PM, Gökhan SEVER<gok...@gm...>
> wrote:
> > Hello,
> >
> > I am using axes_grid toolkit to create multiple axes. The labels' colors
> are
> > nicely being updated, however size or fontsize has no effect on the
> > resulting figure :( Are they functional, or is it something wrong with my
> > implementation? Oh also I couldn't make the grids switched on my figures.
> >
> > Here is the snippet that I use:
> >
> > fig = plt.figure(1)
> > host = SubplotHost(fig, 111)
> > fig.add_subplot(host)
> > par = host.twinx()
> > host.set_xlabel("Time [sfm]", size=50)
> > host.set_ylabel("DMT CCN Concentration [#/cm^3]", fontsize=20)
> > par.set_ylabel("Supersaturation [%]", fontsize=20)
> >
> > p1, = host.plot(Time, dccnConc, label="dccnConc")
> > p2, = host.plot(Time, dccnConAmb, label="dccnConAmb")
> > p3, = host.plot(Time, dccnConSTP, label="dccnConSTP")
> > p4, = par.plot(Time, dccnSS, label="dccnSS")
> > p5, = par.plot(Time, dccnSS_Amb, label="dccnSS_Amb")
> >
> > host.axis["left"].label.set_color(p1.get_color())
> > par.axis["right"].label.set_color(p5.get_color())
> >
> > host.axis["left"].label.set_label(p1.get_label())
> > host.legend()
> > plt.show()
> >
> >
> > These are my current system properties:
> >
> > Linux 2.6.27.19-170.2.35.fc10.i686.PAE (Fedora 11)
> > Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38)
> > IPython 0.10.bzr.r1174 (with --pylab)
> > and a very recent Matplotlib svn version.
> >
> > Thanks.
> >
> > --
> > Gökhan
> >
> >
> ------------------------------------------------------------------------------
> > Enter the BlackBerry Developer Challenge
> > This is your chance to win up to $100,000 in prizes! For a limited time,
> > vendors submitting new applications to BlackBerry App World(TM) will have
> > the opportunity to enter the BlackBerry Developer Challenge. See full
> prize
> > details at: http://p.sf.net/sfu/Challenge
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
>
Jae-Joon,
Your suggested work-arounds worked like a charming. See my before and after
plots at the given links:
http://img34.imageshack.us/img34/3899/dccnplot1.png
http://img27.imageshack.us/img27/6274/dccnplot2.png
I have one tiny question left working on these figures; that is: how to make
mathtext font and a regular label font at the same size?
For instance:
host.set_ylabel(r"DMT CCN Concentration [ #/$cm^3$]")
but as it is seen from the figure they look a bit weird.
Thank you.
PS: I am glad I could add a little bit into this great piece of
visualization toolkit.
--
Gökhan
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-07-10 04:08:26
|
On Thu, Jul 9, 2009 at 12:40 AM, Gökhan SEVER<gok...@gm...> wrote: > I have one tiny question left working on these figures; that is: how to make > mathtext font and a regular label font at the same size? > > For instance: > > host.set_ylabel(r"DMT CCN Concentration [ #/$cm^3$]") > > but as it is seen from the figure they look a bit weird. My guess is that this is the default behavior of tex rendering, but i may be wrong. If you want bigger mathtext, I think you need to use tex command, but again, i'm not sure and I hope someone else answer this. -JJ |
|
From: Gökhan S. <gok...@gm...> - 2009-07-10 15:04:57
|
On Thu, Jul 9, 2009 at 11:08 PM, Jae-Joon Lee <lee...@gm...> wrote: > On Thu, Jul 9, 2009 at 12:40 AM, Gökhan SEVER<gok...@gm...> > wrote: > > I have one tiny question left working on these figures; that is: how to > make > > mathtext font and a regular label font at the same size? > > > > For instance: > > > > host.set_ylabel(r"DMT CCN Concentration [ #/$cm^3$]") > > > > but as it is seen from the figure they look a bit weird. > > My guess is that this is the default behavior of tex rendering, but i > may be wrong. > If you want bigger mathtext, I think you need to use tex command, but > again, i'm not sure and I hope someone else answer this. > > -JJ > I am studying the example given here: http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex and changing the related parameters in my matplotlibrc file. However still couldn't find the right combination to make the texts and math symbols look similar. Any suggestion? -- Gökhan |
|
From: Michael D. <md...@st...> - 2009-07-10 15:15:47
|
Gökhan SEVER wrote: > Your suggested work-arounds worked like a charming. See my before and > after plots at the given links: > > http://img34.imageshack.us/img34/3899/dccnplot1.png > http://img27.imageshack.us/img27/6274/dccnplot2.png > > I have one tiny question left working on these figures; that is: how > to make mathtext font and a regular label font at the same size? > > For instance: > > host.set_ylabel(r"DMT CCN Concentration [ #/$cm^3$]") > > but as it is seen from the figure they look a bit weird. > It will be impossible to get these two fonts appearing as the same size, but you can make the math rendering use the same font as the rest of the text by setting "mathtext.default" to "regular" (assuming "text.usetex" is False). Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Gökhan S. <gok...@gm...> - 2009-07-10 15:19:32
|
On Fri, Jul 10, 2009 at 10:15 AM, Michael Droettboom <md...@st...>wrote: > Gökhan SEVER wrote: > >> Your suggested work-arounds worked like a charming. See my before and >> after plots at the given links: >> >> http://img34.imageshack.us/img34/3899/dccnplot1.png >> http://img27.imageshack.us/img27/6274/dccnplot2.png >> >> I have one tiny question left working on these figures; that is: how to >> make mathtext font and a regular label font at the same size? >> >> For instance: >> >> host.set_ylabel(r"DMT CCN Concentration [ #/$cm^3$]") >> >> but as it is seen from the figure they look a bit weird. >> >> It will be impossible to get these two fonts appearing as the same size, > but you can make the math rendering use the same font as the rest of the > text by setting "mathtext.default" to "regular" (assuming "text.usetex" is > False). > > Mike > > -- > Michael Droettboom > Science Software Branch > Operations and Engineering Division > Space Telescope Science Institute > Operated by AURA for NASA > > Thanks Mike. This was what I been looking for. Now the unit and the actual text label looks much nicer. Is this information available somewhere on the documentation? If not I may add... -- Gökhan |