Closed dvdrbls closed 5 years ago
hey, thank you!
Yes, ggsave()
let's you export an image as a pdf as well. See: https://ggplot2.tidyverse.org/reference/ggsave.html
In order to work with generativeart
, add thedevice
-paramter to the generate_plot()
function like this:
ggplot2::ggsave(plot, filename = paste0(IMG_PATH, file_name), width = 6, height = 6, device = "pdf")
Does this help?
Best, Katharina
Thank you, I am a beginner and barely able to understand the code most of the time, it gives me an error, can you help? Thanks
`library(generativeart) library(ggplot2)
IMG_DIR <- "img/" IMG_SUBDIR <- "everything/" IMG_SUBDIR2 <- "handpicked/" IMG_PATH <- paste0(IMG_DIR, IMG_SUBDIR)
LOGFILE_DIR <- "logfile/" LOGFILE <- "logfile.csv" LOGFILE_PATH <- paste0(LOGFILE_DIR, LOGFILE)
generativeart::setup_directories(IMG_DIR, IMG_SUBDIR, IMG_SUBDIR2, LOGFILE_DIR)
my_formula <- list( x = quote(runif(1, -6, 1) x_i^4 - sin(y_i^1)), y = quote(runif(1, -1, 1) y_i^1 - cos(x_i^4)) )
generativeart::generate_img(formula = my_formula, nr_of_img = 1, polar = FALSE) ggplot2::ggsave(plot, my_formula = paste0(IMG_PATH, file_name), width = 6, height = 6, device = "pdf")`
Hey,
I updated the package and you can now choose the filtetype in the main function. The default is png
, but you can choose a pdf like this:
generativeart::generate_img(formula = my_formula, nr_of_img = 1, polar = FALSE, filetype="pdf")
Update/Reinstall the package and then it works
Thank you! This is so great
Thank you for this awesome library, the images are so beautiful, is there an option to create pdfs instead of png files?
Thanks again, David