[R] [FORGED] change text size on a graphics

Jim Lemon drjimlemon at gmail.com
Tue Jul 21 10:39:33 CEST 2015


Hi Carol,
You can use "hist" to get the counts in each interval, but try
"barplot" to get the larger bar labels:

barpos<-barplot(hist.result$counts,space=0)
barlabels(barpos,hist.result$counts+0.1,hist.result$counts,
 prop=1,border=NA,cex=2)
axis(1,at=1:6-0.5,labels=paste(hist.result$breaks[1:6],
 hist.result$breaks[2:7],sep="-"))

You can't just send any old argument to any old function. At best you
get an error message, often you just get nonsense.

Jim


On Tue, Jul 21, 2015 at 5:56 PM, carol white <wht_crl at yahoo.com> wrote:
> Hi,
> I use hist.
>
> If I use
> hist.result = hist(c(14,20,9,31,17), plot = F)
> plot(hist.result, labels = T, cex = 2)
> #doesn't increase the font size of all text on the plot: axis annotation,
> axis labels, count labels on top of the bars
>
> plot(hist.result, labels = T, cex.axis = 2, cex.label = 2, cex.main = 2)
> # how to increase the size of count labels that are displayed on the top of
> the bars by labels = T?
> Regards,
>
>
> On Tuesday, July 21, 2015 9:45 AM, Jim Lemon <drjimlemon at gmail.com> wrote:
>
>
> Hi Carol,
> If you are using the "barlabels" function in the plotrix package, just
> add the usual "cex" argument to the call. Using the first example in
> the help page:
>
> heights<-c(14,20,9,31,17)
> barpos<-barplot(heights,main="A redundant bar plot")
> barlabels(barpos,heights+1,prop=1,cex=1.5)
>
> Jim
>
>
> On Tue, Jul 21, 2015 at 7:23 AM, Rolf Turner <r.turner at auckland.ac.nz>
> wrote:
>> On 21/07/15 08:24, carol white via R-help wrote:
>>>
>>> Hi,How is it possible to increase the size of a histogram labels
>>> (displayed on the top of the bars)? I thought that if I use cex > 1,
>>> it will increase all text size on a plot (axis labels, axis
>>> annotation, title of the graphics and histogram labels) which I want
>>> but it doesn't.
>>
>>
>> ***What*** labels "displayed on the top of the bars"???  I don't see any
>> such labels when I plot a histogram.
>>
>> Reproducible example?
>>
>> And please don't post in HTML.
>>
>> cheers,
>>
>> Rolf Turner
>>
>> --
>> Technical Editor ANZJS
>> Department of Statistics
>> University of Auckland
>> Phone: +64-9-373-7599 ext. 88276
>
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>>
>> and provide commented, minimal, self-contained, reproducible code.
>
>
>



More information about the R-help mailing list