Architecture & Engine
The core rendering engine of geoplot-themes is not actually Python—it's R.
When you call gpt.plot_map_r(), the package performs the following pipeline:
- Python Validation: It validates your inputs, file paths, and color codes in Python.
- R Script Generation: It dynamically generates a temporary R script (
.Rfile) containing customizedggplot2code tailored to your exact specifications. - Execution: It spawns an R subprocess using
subprocess.run, running the generated script. - Output: The R engine reads your shapefiles and rasters using
sfandterra, builds theggplotobject, applies the requested theme, and saves a.pngdirectly to your disk.
Required R Packages
For this to work, your system must have R installed and added to your PATH. The package will automatically attempt to install the following CRAN packages if they are missing:
ggplot2sfterraggspatialggnewscaleggrepelpatchwork
