Matplotlib pane - relationship between size and dpi

Today I have upgraded panel from 0.13.1 to 0.14.1 and I have found a strange behavior with Matplotlib pane. I don’t know if it is a bug or if it is just me that I don’t understand it… The following two screenshots have been created by running the same code. Only the dpi keyword argument was used on Matplotlib pane instantiation.

This was created with panel 0.13.1

This was created with panel 0.14.1

Screenshot 2022-11-28 at 22-41-30 Panel Application

The results are reproducible by playing with the example found on this documentation page.

What I’m trying to understand is:

  • what is the relationship between dpi and pane size?
  • If I increase the pane width to 800, the picture starts to get blurry. In fact, by opening the picture on a new browser window I see that it has a width of only 640px. How can I get a crisp picture?
  • Does dpi actually do something?

Hi @Davide_sd

Could you please put in the code to reproduce? The reference guide does not producere the same app with widgets.


Thanks Marc for joining the thread. After some digging I found that something must have changed with recent versions of Matplotlib. I’ve opened an issue here.

1 Like