|
From: Fabien L. <laf...@gm...> - 2012-08-30 15:50:27
|
Hello, Do you know to change the size of the numbers under the axis? fabien |
|
From: Damon M. <dam...@gm...> - 2012-08-30 15:54:30
|
On Thu, Aug 30, 2012 at 05:50:18PM +0200, Fabien Lafont wrote: > Hello, > > Do you know to change the size of the numbers under the axis? > import matplotlib matplotlib.rcParams['axes.labelsize'] = 12.0 Hope this helps. -- Damon McDougall http://www.damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
|
From: Fabien L. <laf...@gm...> - 2012-08-30 15:58:10
|
There is no effect... 2012/8/30 Damon McDougall <dam...@gm...> > On Thu, Aug 30, 2012 at 05:50:18PM +0200, Fabien Lafont wrote: > > Hello, > > > > Do you know to change the size of the numbers under the axis? > > > > import matplotlib > matplotlib.rcParams['axes.labelsize'] = 12.0 > > Hope this helps. > > -- > Damon McDougall > http://www.damon-is-a-geek.com > B2.39 > Mathematics Institute > University of Warwick > Coventry > West Midlands > CV4 7AL > United Kingdom > |
|
From: Benjamin R. <ben...@ou...> - 2012-08-30 16:05:20
|
On Thu, Aug 30, 2012 at 11:58 AM, Fabien Lafont <laf...@gm...>wrote: > There is no effect... > > > 2012/8/30 Damon McDougall <dam...@gm...> > >> On Thu, Aug 30, 2012 at 05:50:18PM +0200, Fabien Lafont wrote: >> > Hello, >> > >> > Do you know to change the size of the numbers under the axis? >> > >> >> import matplotlib >> matplotlib.rcParams['axes.labelsize'] = 12.0 >> >> Hope this helps. >> >> You want to modify "xtick.labelsize" or "ytick.labelsize". By default, they are "medium", but you can use a number for it as well. "axes.labelsize" effects the axes labels, not the labels for the ticks. Cheers! Ben Root |
|
From: Fabien L. <laf...@gm...> - 2012-08-30 16:53:35
|
Hi,
But how can I do it for every graph and without creating axis?
I've seen this example:
import numpy as npimport matplotlib.pyplot as plt
# plt.figure creates a matplotlib.figure.Figure instancefig =
plt.figure()rect = fig.patch # a rectangle
instancerect.set_facecolor('lightgoldenrodyellow')
ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4])rect =
ax1.patchrect.set_facecolor('lightslategray')
for label in ax1.xaxis.get_ticklabels():
# label is a Text instance
label.set_color('red')
label.set_rotation(45)
label.set_fontsize(16)
I don't manage to use only label.set_fontsize(16). It looks so
complicated.
2012/8/30 Benjamin Root <ben...@ou...>
>
>
> On Thu, Aug 30, 2012 at 11:58 AM, Fabien Lafont <laf...@gm...>wrote:
>
>> There is no effect...
>>
>>
>> 2012/8/30 Damon McDougall <dam...@gm...>
>>
>>> On Thu, Aug 30, 2012 at 05:50:18PM +0200, Fabien Lafont wrote:
>>> > Hello,
>>> >
>>> > Do you know to change the size of the numbers under the axis?
>>> >
>>>
>>> import matplotlib
>>> matplotlib.rcParams['axes.labelsize'] = 12.0
>>>
>>> Hope this helps.
>>>
>>>
> You want to modify "xtick.labelsize" or "ytick.labelsize". By default,
> they are "medium", but you can use a number for it as well.
> "axes.labelsize" effects the axes labels, not the labels for the ticks.
>
> Cheers!
> Ben Root
>
>
|
|
From: Benjamin R. <ben...@ou...> - 2012-08-30 16:59:03
|
On Thu, Aug 30, 2012 at 12:53 PM, Fabien Lafont <laf...@gm...>wrote: > Hi, > > But how can I do it for every graph and without creating axis? > > > We just told you: import matplotlib matplotlib.rcParams['xticks.labelsize'] = 12.0 Whenever a plot is made, it obtains the defaults from the rcParams. Note, if you are changing the rcParams *after* creating a plot, then this would have no effect. Cheers! Ben Root |
|
From: Damon M. <dam...@gm...> - 2012-08-30 17:04:14
|
On Thu, Aug 30, 2012 at 12:04:48PM -0400, Benjamin Root wrote: > On Thu, Aug 30, 2012 at 11:58 AM, Fabien Lafont <laf...@gm...>wrote: > > > There is no effect... > > > > > > 2012/8/30 Damon McDougall <dam...@gm...> > > > >> On Thu, Aug 30, 2012 at 05:50:18PM +0200, Fabien Lafont wrote: > >> > Hello, > >> > > >> > Do you know to change the size of the numbers under the axis? > >> > > >> > >> import matplotlib > >> matplotlib.rcParams['axes.labelsize'] = 12.0 > >> > >> Hope this helps. > >> > >> > You want to modify "xtick.labelsize" or "ytick.labelsize". By default, > they are "medium", but you can use a number for it as well. > "axes.labelsize" effects the axes labels, not the labels for the ticks. > Thanks for that, Ben. Apologies if I caused confusion. -- Damon McDougall http://www.damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
|
From: Fabien L. <laf...@gm...> - 2012-08-30 17:06:25
|
I've tried also but it returns an error:
matplotlib.rcParams['xticks.labelsize'] = 12.0
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 653, in
__setitem__
See rcParams.keys() for a list of valid parameters.' % (key,))
KeyError: 'xticks.labelsize is not a valid rc parameter.See rcParams.keys()
for a list of valid parameters.'
2012/8/30 Damon McDougall <dam...@gm...>
> On Thu, Aug 30, 2012 at 12:04:48PM -0400, Benjamin Root wrote:
> > On Thu, Aug 30, 2012 at 11:58 AM, Fabien Lafont <laf...@gm...
> >wrote:
> >
> > > There is no effect...
> > >
> > >
> > > 2012/8/30 Damon McDougall <dam...@gm...>
> > >
> > >> On Thu, Aug 30, 2012 at 05:50:18PM +0200, Fabien Lafont wrote:
> > >> > Hello,
> > >> >
> > >> > Do you know to change the size of the numbers under the axis?
> > >> >
> > >>
> > >> import matplotlib
> > >> matplotlib.rcParams['axes.labelsize'] = 12.0
> > >>
> > >> Hope this helps.
> > >>
> > >>
> > You want to modify "xtick.labelsize" or "ytick.labelsize". By default,
> > they are "medium", but you can use a number for it as well.
> > "axes.labelsize" effects the axes labels, not the labels for the ticks.
> >
>
> Thanks for that, Ben. Apologies if I caused confusion.
>
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
>
|
|
From: Damon M. <dam...@gm...> - 2012-08-30 17:24:39
|
On Thu, Aug 30, 2012 at 07:06:14PM +0200, Fabien Lafont wrote: > I've tried also but it returns an error: > > matplotlib.rcParams['xticks.labelsize'] = 12.0 > File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 653, in > __setitem__ > See rcParams.keys() for a list of valid parameters.' % (key,)) > KeyError: 'xticks.labelsize is not a valid rc parameter.See rcParams.keys() > for a list of valid parameters.' > It's actually 'xtick.labelsize'. No 's'. -- Damon McDougall http://www.damon-is-a-geek.com B2.39 Mathematics Institute University of Warwick Coventry West Midlands CV4 7AL United Kingdom |
|
From: Fabien L. <laf...@gm...> - 2012-08-30 17:28:46
|
Thanks,
I've found the problem. I use xlabel("name of my axis", size= 30) after
matplotlib.rcParams['xtick.
labelsize'] = 12.0 and it cancel it! Is it possible to have a name on the
axe and matplotlib.rcParams['xticks.
labelsize'] = 12.0 ??
2012/8/30 Damon McDougall <dam...@gm...>
> On Thu, Aug 30, 2012 at 07:06:14PM +0200, Fabien Lafont wrote:
> > I've tried also but it returns an error:
> >
> > matplotlib.rcParams['xticks.labelsize'] = 12.0
> > File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 653,
> in
> > __setitem__
> > See rcParams.keys() for a list of valid parameters.' % (key,))
> > KeyError: 'xticks.labelsize is not a valid rc parameter.See
> rcParams.keys()
> > for a list of valid parameters.'
> >
>
> It's actually 'xtick.labelsize'. No 's'.
>
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
>
|
|
From: Damon M. <dam...@gm...> - 2012-08-30 17:34:41
|
On Thu, Aug 30, 2012 at 07:28:40PM +0200, Fabien Lafont wrote:
> Thanks,
>
> I've found the problem. I use xlabel("name of my axis", size= 30) after
> matplotlib.rcParams['xtick.
> labelsize'] = 12.0 and it cancel it! Is it possible to have a name on the
> axe and matplotlib.rcParams['xticks.
> labelsize'] = 12.0 ??
>
Wait a minute. What exactly are you trying to do?
--
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
|
|
From: Fabien L. <laf...@gm...> - 2012-08-30 17:38:26
|
I'm just trying to plot a graph and add a label to each axis of that graph
and change the labelsize of the ticks.
2012/8/30 Damon McDougall <dam...@gm...>
> On Thu, Aug 30, 2012 at 07:28:40PM +0200, Fabien Lafont wrote:
> > Thanks,
> >
> > I've found the problem. I use xlabel("name of my axis", size= 30) after
> > matplotlib.rcParams['xtick.
> > labelsize'] = 12.0 and it cancel it! Is it possible to have a name on the
> > axe and matplotlib.rcParams['xticks.
> > labelsize'] = 12.0 ??
> >
>
> Wait a minute. What exactly are you trying to do?
>
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
>
|
|
From: Benjamin R. <ben...@ou...> - 2012-08-30 17:44:26
|
On Thu, Aug 30, 2012 at 1:38 PM, Fabien Lafont <laf...@gm...>wrote: > I'm just trying to plot a graph and add a label to each axis of that graph > and change the labelsize of the ticks. > > Could you post your code? What you are describing shouldn't happen. Also, which version of matplotlib are you using? Ben Root |
|
From: Fabien L. <laf...@gm...> - 2012-08-30 17:48:39
|
I just create two vectors from a .txt file and I plot them.
I think I have the latest version of matplotlib. I have at least the
last version of python(x,y)
from pylab import*
import matplotlib
matplotlib.rcParams['xtick.labelsize'] = 20.0
B5= genfromtxt("2012-05-14_RC3D3D2C1_D2D1_m18T_18T_Vg32V_20K.dat", usecols =(2))
RH5 = genfromtxt("2012-05-14_RC3D3D2C1_D2D1_m18T_18T_Vg32V_20K.dat",
usecols =(3))
#plot(B5,RH5,"-o",label = "2012-05-14_RC3D3D2C1_D2D1_m18T_18T_Vg32V_20K.dat")
xlabel(u"$ B (T)$", size= 30)
ylabel(u"$R_H (\Omega)$", size= 30)
grid()
legend()
show()
2012/8/30 Benjamin Root <ben...@ou...>:
>
>
> On Thu, Aug 30, 2012 at 1:38 PM, Fabien Lafont <laf...@gm...>
> wrote:
>>
>> I'm just trying to plot a graph and add a label to each axis of that graph
>> and change the labelsize of the ticks.
>>
>
> Could you post your code? What you are describing shouldn't happen. Also,
> which version of matplotlib are you using?
>
> Ben Root
>
|
|
From: Fabrice S. <si...@lm...> - 2012-08-30 17:58:15
|
Le jeudi 30 août 2012 à 19:48 +0200, Fabien Lafont a écrit : > I just create two vectors from a .txt file and I plot them. > I think I have the latest version of matplotlib. I have at least the > last version of python(x,y) > > > from pylab import* > > import matplotlib > matplotlib.rcParams['xtick.labelsize'] = 20.0 In your matplotlib config file axes.titlesize : 10 # fontsize of the axes title axes.labelsize : 10 # fontsize of the x any y labels (see http://matplotlib.sourceforge.net/users/customizing.html ) |
|
From: Fabien L. <laf...@gm...> - 2012-08-30 18:00:30
|
Actually I just want to do it on that plot not on all my future plot. 2012/8/30 Fabrice Silva <si...@lm...>: > Le jeudi 30 août 2012 à 19:48 +0200, Fabien Lafont a écrit : >> I just create two vectors from a .txt file and I plot them. >> I think I have the latest version of matplotlib. I have at least the >> last version of python(x,y) >> >> >> from pylab import* >> >> import matplotlib >> matplotlib.rcParams['xtick.labelsize'] = 20.0 > > In your matplotlib config file > axes.titlesize : 10 # fontsize of the axes title > axes.labelsize : 10 # fontsize of the x any y labels > (see http://matplotlib.sourceforge.net/users/customizing.html ) > > > |
|
From: Mark L. <bre...@ya...> - 2012-08-30 18:25:59
|
On 30/08/2012 19:00, Fabien Lafont wrote: > Actually I just want to do it on that plot not on all my future plot. > > 2012/8/30 Fabrice Silva <si...@lm...>: >> Le jeudi 30 août 2012 à 19:48 +0200, Fabien Lafont a écrit : >>> I just create two vectors from a .txt file and I plot them. >>> I think I have the latest version of matplotlib. I have at least the >>> last version of python(x,y) >>> >>> >>> from pylab import* >>> >>> import matplotlib >>> matplotlib.rcParams['xtick.labelsize'] = 20.0 >> >> In your matplotlib config file >> axes.titlesize : 10 # fontsize of the axes title >> axes.labelsize : 10 # fontsize of the x any y labels >> (see http://matplotlib.sourceforge.net/users/customizing.html ) >> >> >> > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > I think you're looking for this http://matplotlib.sourceforge.net/users/whats_new.html#tick-params -- Cheers. Mark Lawrence. |
|
From: Fabien L. <laf...@gm...> - 2012-08-31 08:24:08
|
Hi,
I think I was tired yesterday.
matplotlib.rcParams['xtick.labelsize'] = 20.0 works perfectly also
with xlabel("name", size= 30)
Thanks all,
Fabien
2012/8/30 Mark Lawrence <bre...@ya...>:
> On 30/08/2012 19:00, Fabien Lafont wrote:
>> Actually I just want to do it on that plot not on all my future plot.
>>
>> 2012/8/30 Fabrice Silva <si...@lm...>:
>>> Le jeudi 30 août 2012 à 19:48 +0200, Fabien Lafont a écrit :
>>>> I just create two vectors from a .txt file and I plot them.
>>>> I think I have the latest version of matplotlib. I have at least the
>>>> last version of python(x,y)
>>>>
>>>>
>>>> from pylab import*
>>>>
>>>> import matplotlib
>>>> matplotlib.rcParams['xtick.labelsize'] = 20.0
>>>
>>> In your matplotlib config file
>>> axes.titlesize : 10 # fontsize of the axes title
>>> axes.labelsize : 10 # fontsize of the x any y labels
>>> (see http://matplotlib.sourceforge.net/users/customizing.html )
>>>
>>>
>>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>
>
> I think you're looking for this
> http://matplotlib.sourceforge.net/users/whats_new.html#tick-params
>
> --
> Cheers.
>
> Mark Lawrence.
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|