How to Plot in a new window in DataSpell?


By default, JetBrains DataSpell shows plots inline in Python Console.

Any Idea How to Change this Behavior and Show Plots in a New Window?  

Any help will be appreciated. Thanks in advance.



To change the behavior of jetbrains dataspell and show plots in a new wimdow insted of nine in the python console , you can modify the matplotlib backend setting. Here's how you can do it:

  1. Open your Python myccpay script or interactive session in JetBrains DataSpell.
  2. Import the matplotlib library at the beginning of your script
  3. Add the following code before creating any plots to set the backend to display plots in a separate window:
  4. Create your plots as usual using plt functions, and they will now open in a new window instead of being displayed inline in the Python Console.



Try This

Open Settings/Preferences: In JetBrains DataSpell, go to "File" -> “Settings" on Windows/Linux or "DataSpell" -> "Preferences" on macOS.

Navigate to Python settings: In the settings/preferences window, navigate to "Python” under the "Project" section.

Configure Python interpreter: Choose the Python interpreter you are using for your project. You’ll see an option for "Show plots in tool window" or a similar setting.

Change the plot display option: Look for an option related to the display of plots, and change it to "Show plots in a new window" or a similar option. The wording might vary slightly depending on the version of JetBrains DataSpell.

Apply and save: After making the changes, click "Apply" or "OK" to save your settings.


Please sign in to leave a comment.