Skip to content
TheChatArchiveThe Chat Archive
o4-mini-2025-04-16· OpenAIHugging Face LMArena Human Preference 140K

For whatever reason, plotting my plots using matplotlib is showing them in a scrollable…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with chatgpt-4o-latest-20250326’s answer.
  1. User

    For whatever reason, plotting my plots using matplotlib is showing them in a scrollable mini window. How can I get them to plot normally?

  2. Assistant

    If you’re getting that little scrollable “preview” pane instead of a normal pop-up window, it usually means Matplotlib is using an inline or IDE‐specific backend. To force it into a standalone window, you can either switch backends or adjust your IDE/notebook settings. Below are the most common fixes:

    1. Pure Python script (eg. python myplot.py)
      • Make sure you’re using an interactive GUI backend, then call plt.show().

      import matplotlib
      # pick one of: 'Qt5Agg', 'TkAgg', 'WXAgg' …
      matplotlib.use('TkAgg')  
      
      import matplotlib.pyplot as plt
      plt.plot([1,2,3,2,1])
      plt.title("Normal pop-up window")
      plt.show()  
      
    2. Jupyter Notebook / JupyterLab
      By default many setups use %matplotlib inline (embeds static images) or JLab’s “Plot Viewer.” To get an external window:

      # in the first cell:
      %matplotlib qt        # for Qt5Agg
      # or
      %matplotlib tk        # for TkAgg
      
      import matplotlib.pyplot as plt
      plt.plot([0,1,0,1])
      plt.show()
      

      If you want to go back to inline:

      %matplotlib inline
      
    3. Spyder
      Spyder’s “Plots” pane will grab your figures by default. To pop them out:
      • Go to Tools → Preferences → IPython console → Graphics → Backend →
      choose “Automatic” or “Qt5” (rather than “Inline”).
      • Restart the console and rerun.

    4. PyCharm
      PyCharm has its own SciView plot window. To force external windows:
      • Settings → Tools → Python Scientific → uncheck “Show plots in tool window”
      • Apply & restart the script.

    5. Checking available backends
      If you’re not sure which GUI backends you have installed:

      import matplotlib
      print(matplotlib.rcsetup.interactive_bk)
      # or
      print(matplotlib.rcsetup.all_backends)
      

    Quick checklist:

    • Switch to a GUI backend (TkAgg, Qt5Agg, …)
    • Call plt.show() after plotting
    • Toggle your IDE/notebook’s “inline” or “scientific” plot settings

    That should restore the familiar, resizable pop-up window for your charts! 🙌

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.