I\'m trying to generate some fractals and have a question regarding the margins with ggplot in R. I\'m using the following code to generate the fractals.
lib
I was able to get rid of the white border by setting negative plot margins and setting the axis titles to NULL
. I've marked the edits in the code below.
p = ggplot(data=df, aes(V1, V2, color=cl[V3]))+
geom_point() +
theme(panel.background=element_blank(),
panel.grid.major=element_blank(),
panel.grid.minor=element_blank(),
panel.margin = unit(c(0, 0, 0, 0), "cm"),
axis.ticks=element_blank(),
axis.text.x=element_blank(),
axis.text.y=element_blank(),
axis.title.x=element_blank(),
axis.title.y=element_blank(),
plot.background = element_rect(fill = "transparent",colour = NA),
plot.margin = unit(c(-1, -1.2, -1.2, -1.5), "cm"), # Edited code
legend.position = 'none') +
labs(x=NULL, y=NULL) # New code