Show plots in the Plots pane and in an interactive backend simultaneously
See original GitHub issueThe plot panel is useful but I have a few problems with it:
- The images are saved by default as low quality
png
. I would prefersvg
and therefore need to:
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('svg')
before plotting. I think it would be nice to have a setting in the plot widget to choose one of 'png', 'retina', 'jpeg', 'svg', 'pdf'
.
- The images are not shown if the backend is interactive (For example qt5). I think it would be great if there was a button to change the backend between inline and interactive, and if the interactive backend plots where shown in the widget. This works by:
%matplotlib qt5
from IPython.core.display import display
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot()
ax.plot([1, 2, 4])
display(fig)
But this also displays the plot inline. One implementation could patch the figure show
method and get the image data by:
%matplotlib qt5
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot()
ax.plot([1, 2, 4])
format = get_ipython().kernel.shell.display_formatter.format
format_dict, md_dict = format(fig)
and then send format_dict
by the comm channel.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (10 by maintainers)
Top Results From Across the Web
Plots — Spyder 5 documentation
The Plots pane shows the static figures and images created during your session. It will show you plots from the IPython Console, produced...
Read more >Spyder 4 Plots Pane Not Displaying - Stack Overflow
I have ensured that the backend is set to Inline but the pane still does not show up. Code. Console. Settings. If anyone...
Read more >Visualisation and plotting with Matplotlib - wradlib
It provides the basis for ωradlib's entire visualisation module, and is typically used together with NumPy - which is the other major ωradlib...
Read more >Matplotlib plots in PyQt5, embedding charts in ... - Python GUIs
Many other Python libraries — such as seaborn and pandas— make use of the Matplotlib backend for plotting. These plots can be embedded...
Read more >Tutorial - Julia Plots
The plot is displayed in a plot pane, a stand-alone window or the browser, depending on the environment and backend (see below). If...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can do the communication with the kernel: