Hello everyone,
thanks everyone for this super interesting framework where even coding noobs like me can get things done
A while back I came accross an issue with the anvil-uplink mpl_util package that still persists so I thought I would report it.
I am creating some plots using matplotlib in the backend and pass them to the frontend using the anvil.mpl_util.plot_image(filename = 'my_interesting_plot.png')
method. I would like to provide a custom filename so that the plots could be downloaded easily without having to rename each of them individually.
According to the documentation Anvil Docs | anvil.mpl_util I should be able to provide a custom filename parameter, however whenever I provide a filename, the app throws an exception
TypeError: print_figure() got multiple values for argument 'filename'
The anvil.mpl_util
somehow provides a filename already. I tried inspecting the object returned by the save_fig() method. There is a get_name method, which when run yields a plot.png string, but this one cannot be set or changed.
Would it be possible to provide a custom filename to the plot_image() method somehow so that I can download the file without having to overwrite each filename manually?
To confirm this test I updated anvil-uplink from 4.0 to the latest 4.1 version.
Thanks a lot for having a look,
Petr
edit: I updated the anvil.mpl_util.plot_image method with the filename parameter example