0

I cannot find any indication on how to use the cex parameter when plotting image2D. It seems the cex parameter does not have any effect. I am able to change the font size of the legend and the axis with the specific cex arguments, but I cannot change the plot title font size.

Is there a way to change font size over the plot with just one parameter? And how is the title font size changed?

Werner Hertzog
  • 2,002
  • 3
  • 24
  • 36
Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53
  • 1
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. – MrFlick Jul 18 '18 at 16:19
  • @MrFlick I understand that but this is more a question regarding which parameters control what, the help file for the image2D is incomplete. – Herman Toothrot Jul 18 '18 at 16:22
  • 1
    If you provide a reproducible example, then someone who has never even used that function before can step through the code to see how it works and can tell you exactly how values are set. It helps to see exactly what you are running and testing with rather than making potentially incorrect assumptions. No question benefits from the lack of a reproducible example. – MrFlick Jul 18 '18 at 16:26

1 Answers1

1

You are right, I did not find it in documentation as well. To change title font size you can set the parameter cex.main in image2D. See below:

library(plot3D)
nr <- nrow(volcano)
nc <- ncol(volcano)
image2D(volcano, x = 1:nr, y = 1:nc, lighting = TRUE, 
        main = "volcano", clab = "height, m", cex.main = 3)

Title Font Size Increase

To scale up the font size globally you can change global parameter cex. Please see below:

library(plot3D)
nr <- nrow(volcano)
nc <- ncol(volcano)

prev <- par(cex = 1.7)
image2D(volcano, x = 1:nr, y = 1:nc, lighting = TRUE, 
        main = "volcano", clab = "height, m")

par(prev)

All labels increased

Artem
  • 3,304
  • 3
  • 18
  • 41