FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Wired internal DPI scaling · Issue #19826 · matplotlib/matplotlib · GitHub

Repository navigation

Wired internal DPI scaling  #19826

Closed
Closed

Description

Bug report

Bug summary

When the DPI value is set (e.g. when creating a new figure) it seems to be internally multiplied by 1355.

Code for reproduction

import matplotlib.pyplot as plt
fig = plt.figure(dpi=100)
print(f"Actual set dpi value = {fig.dpi}")

Actual outcome

$> python minimal_example.py 
Actual set dpi value = 135500.0

Expected outcome
The set dpi value of the figure should be 100.

Matplotlib version

  • Operating system: ($> uname -srvmpio) Linux 5.8.0-48-generic Math prime #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • Matplotlib version (import matplotlib; print(matplotlib.__version__)): 3.3.4
  • Matplotlib backend (print(matplotlib.get_backend())): Qt5Agg
  • Python version: 3.8.8

installed matplotlib with

conda install matplotlib

Activity

  1. jklymak commented on Mar 30, 2021

    Member

    Try:

    import matplotlib.pyplot as plt
    fig = plt.figure(dpi=100)
    print(f"Actual set dpi value = {fig._dpi, fig.dpi, fig._original_dpi, fig.canvas._dpi_ratio}")

    somehow your _devicePixelRatioF is getting set to 1355. For my machine it is 2, so I get

    Actual set dpi value = (200.0, 200.0, 100, 2.0)
    

    I'm not particularly sure what to do here, except maybe improve the docs...

  2. anushkrishnav commented on Apr 20, 2021

    Contributor

    I would like to work on this issue

  3. timhoffm commented on Apr 20, 2021

    Member

    @anubhavshrimal go for it. The behavior wrt. scaling should probably be documented both at the Figure.dpi property and at the `Figure(..., dpi=...) parameter.

  4. anubhavshrimal commented on Apr 21, 2021

    Contributor

    @anubhavshrimal go for it. The behavior wrt. scaling should probably be documented both at the Figure.dpi property and at the `Figure(..., dpi=...) parameter.

    Hey, sorry but I think you meant to tag @anushkrishnav :)

  5. github-actions commented on Dec 6, 2023

    This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

  6. oscargus commented on Dec 6, 2023

    Member

    I think that this can be closed(?). At least _dpi_ratio does not exist in the code base anymore...

  7. tacaswell commented on Dec 7, 2023

    Member

    I'm going to close this. There has been a bunch of work on dpi related issues that has squashed most of the bugs piecemeal and @QuLogic has on-going work to hopefully systematically fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL