Hi all,
I have a function in my library (running on a Digital Ocean droplet connected to Anvil) that creates and returns a matplotlib figure. Is it possible to send back this figure as an image?
The code on the digital ocean droplet is
@anvil.server.callable
def do_cpt_to_img(file) -> Dict:
s_utf8 = file.get_bytes().decode("utf-8")
cpt = Cpt.from_string(s_utf8)
return cpt.plot() # will return a matplotlib figure
And I would like to return this to be used as an image on a page like;
self.image.source = anvil.server.call('do_cpt_to_img', cpt_file)
Thanks in advance,
Rob