Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 256e906

Browse files
committed
Only send ratio if needed
1 parent 68cdfa9 commit 256e906

File tree

1 file changed

+3
-1
lines changed
  • lib/matplotlib/backends/web_backend

1 file changed

+3
-1
lines changed

lib/matplotlib/backends/web_backend/mpl.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ mpl.figure = function(figure_id, websocket, ondownload, parent_element) {
6060
this.ws.onopen = function () {
6161
fig.send_message("supports_binary", {value: fig.supports_binary});
6262
fig.send_message("send_image_mode", {});
63-
fig.send_message("set_dpi_ratio", {'dpi_ratio': fig.ratio});
63+
if (fig.ratio != 1) {
64+
fig.send_message("set_dpi_ratio", {'dpi_ratio': fig.ratio});
65+
}
6466
fig.send_message("refresh", {});
6567
}
6668

0 commit comments

Comments
 (0)