1

I have set up an external monitor that is connected to my laptop, so when I'm working I primarily use the external monitor for writing code. Now, when I generate a plot using matplotlib it always appears on my laptop and not on the external monitor from which I am working on and where I use VS code and the terminal.

After some research I have found this post where a work around was suggested using plt.switch_backend('QT4Agg') which works fine, however I receive the depreciation warning that matplotlib.backends.backend_qt4agg backend was deprecated in Matplotlib 3.3 and will be removed two minor releases later. (I am using Matplotlib version 3.4.2 and Python 3.9.2 on a MacBook Pro with macOS Big Sur version 11.1)

Is there a way I can "tell" matplotlib to show the plot on my external monitor instead of my main monitor in a simple way? For example something like: plt.show(on_external_screen=True)? Or is there another work around for newer versions of matplotlib?

eldorado
  • 97
  • 9
  • Does this answer your question? [Update/Refresh matplotlib plots on second monitor](https://stackoverflow.com/questions/27861916/update-refresh-matplotlib-plots-on-second-monitor) – medium-dimensional Jun 13 '22 at 19:47
  • 1
    no, this is actually the answer where I've found the work around that I mentioned in my post. I mean, yes it does work, but `backend_qt4agg` was depreciated and will be removed from future versions of matplotlib, so my problem is only temporarily solved using this work around. – eldorado Jun 13 '22 at 23:26

1 Answers1

1

Probably not a direct solution, but a workaround I've found for this is to use your external monitor as main display (Settings->Displays->External monitor->Use as main display).

I haven't been able to tell any side effects to doing that in my experience, so that's what I'm using until they fix it from python's end.

albo
  • 21
  • 4