maximusdooku
maximusdooku

Reputation: 5522

How can I make the legend numbers and text in bold?

I am plotting 2 rasters using this:

spplot(r, colorkey = list(space = "bottom", height = 1)) + 
  spplot(merged, cex=0.5, col.regions="green") 
grid.text('Test', y=unit(0.025, "npc"), 
          rot=360, x=unit(0.5, "npc")) 

How can I make the following things in bold and/or increase the size - a) Tick Numbers b) Legend Title

enter image description here

Upvotes: 1

Views: 2258

Answers (2)

Z.Lin
Z.Lin

Reputation: 29085

For the tick numbers, try adding font = 2?

colorkey = list(space = "bottom", height = 1, labels = list(font = 2))

Damiano Fantini's solution works for me for the legend title.

Upvotes: 3

Damiano Fantini
Damiano Fantini

Reputation: 1975

I am unsure about this answer. But, would setting the gp argument work in this case?

grid.text('Test', y=unit(0.025, "npc"), 
          rot=360, x=unit(0.5, "npc"),
          gp=gpar(fontsize = 20, fontface="bold"))

Upvotes: 4

Related Questions