I'm trying to create maps using python lets-plot and save them to file - note that I am running this on Databricks and not sure if that is relevant to this issue.
When I run the code below:
!pip install lets-plot
from lets_plot import *
LetsPlot.setup_html(offline=True)
p = ggplot() + ggsize(700, 400)
p = p + geom_livemap()
ggsave(p, f"livemap.png")
I get the error 'The SVG size is undefined'
With the error raised in the code block below:
lib/python3.10/site-packages/cairosvg/surface.py:209, in Surface.init(self, tree, output, dpi, parent_surface, parent_width, parent_height, scale, output_width, output_height, background_color, map_rgba, map_image) 204 self.cairo, self.width, self.height = self._create_surface( 205 width * self.device_units_per_user_units, 206 height * self.device_units_per_user_units) 208 if 0 in (self.width, self.height): --> 209 raise ValueError('The SVG size is undefined') 211 self.context = cairo.Context(self.cairo)
Any help would be much appreciated.