Skip to content

UI scale level is different when running from interpreter than from script #15674

Closed
@tonyxwz

Description

@tonyxwz

Bug report

Bug summary

When run interactively from python console or ipython, the size of the ui (buttons) and figure dpi are normal. However, if the same code is placed in a script and called from console or IDE (vscode), the zoom level is much larger.

I suspect it is related to my screen resolution (2160x1440)

Code for reproduction

Just first create a script and paste the following code inside, then run the code line by line in ipython.

import numpy as np
import matplotlib.pyplot as plt

fig, axes = plt.subplots(1, 2)

n = np.arange(100)
axes[0].plot(n, np.sin(n))

axes[1].plot(n, np.tanh(n))

plt.show()

Actual outcome

If your screen has high dpi, you should see two figures with different zoom levels.

image

Expected outcome
The zoom level should be the same.

Matplotlib version

  • Operating system: windows 10x64
  • Matplotlib version: 3.1.1
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32, default channel
  • Jupyter version (if applicable):
  • Other libraries: numpy 1.16.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions