activityHistogram change axis font size not working

16 views
Skip to first unread message

Jennifer McFarlane

unread,
Feb 15, 2023, 8:16:29 PM2/15/23
to camtrapR
Hi, 

I am making an activity histogram and want to change the font sizes of the labels and axis. I read in the documentation that you can you use arguments from the hist function, of which cex.main and cex.lab work however when I use cex.axis to change the axis size it doesn't change anything and I am not sure why. Also, I don't know if there is an argument for changing the font size of the number of records under the main title?

speciesactivity_3<-"Lagidium viscacia"

activityHistogram(recordTable = species,
                  allSpecies = FALSE,    #only want to plot one species
                  speciesCol = "species",
                  recordDateTimeCol = "timestamp",
                  species = speciesactivity_3,
                  cex.main= 2.0,
                  cex.lab=2.0,
                  cex.axis=2.0,
                  writePNG = TRUE,
                  plotDirectory = datdir)

Any clues would be great,
Jennifer

Juergen Niedballa

unread,
Mar 8, 2023, 1:42:49 AM3/8/23
to camtrapR
Hi,
it works for me:
activityHistogram (recordTable = recordTableSample,
                    species     = species4activity,
                    allSpecies = FALSE, 
                    cex.main= 2.0,
                    cex.lab=2.0,
                    cex.axis=2.0)

I don't know why it fails for you.

The text under the main title is hard-coded and can't be changed. To have a more customizable plot I'd suggest using ggplot2 instead.

Basic example:
data(recordTableSample)
recordTableSample$Time <- lubridate::hms(recordTableSample$Time)
ggplot(recordTableSample, mapping = aes(x = Time)) + geom_histogram() + scale_x_time()
ff7805ed-4dfd-4ab6-a829-b5b38495f777.png
c17ec2aa-9613-461c-8d08-0dd4d7934570.png
Reply all
Reply to author
Forward
0 new messages