forked from Sharpie/RTikZDevice
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
When the plot is generated as an image in RStudio, the legend text fits perfectly but when exported to TikZ the legend size is too
small to fit. Here is the plot generated by R:

This is the TikZ image generated in a latex document:

Changing the width of the export does not fix the problem:

Here is the R code:
library(tikzDevice)
set.seed(10)
tikz('prueba.tex', width = 3, height = 3)
colores = c("blue", "red", "green", "purple", "orange")
x = runif(5, min = 10, max = 17)
y = 3000*x + 30000
plot(x, y,
xlab = "Educación (Años)",
pch = 20,
col = colores,
ylab = "Renta (€)",
xlim=c(10, 17),
ylim=c(3000*10 + 30000,3000*17 + 30000),
bty = "L")
legend(x = "bottomright",
legend = c("Ciudad 1", "Ciudad 2", "Ciudad 3", "Ciudad 4", "Ciudad 5"),
pch = c(20,20,20,20,20),
col = colores)
dev.off()
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels