When the DPI value is set (e.g. when creating a new figure) it seems to be internally multiplied by 1355.
Code for reproduction
importmatplotlib.pyplotaspltfig=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
@anubhavshrimal go for it. The behavior wrt. scaling should probably be documented both at the Figure.dpi property and at the `Figure(..., dpi=...) parameter.
@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 :)
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!
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.
Activity
jklymak commented on Mar 30, 2021
Try:
somehow your _devicePixelRatioF is getting set to 1355. For my machine it is 2, so I get
I'm not particularly sure what to do here, except maybe improve the docs...
anushkrishnav commented on Apr 20, 2021
I would like to work on this issue
timhoffm commented on Apr 20, 2021
@anubhavshrimal go for it. The behavior wrt. scaling should probably be documented both at the Figure.dpi property and at the `Figure(..., dpi=...) parameter.
anubhavshrimal commented on Apr 21, 2021
Hey, sorry but I think you meant to tag @anushkrishnav :)
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!
oscargus commented on Dec 6, 2023
I think that this can be closed(?). At least _dpi_ratio does not exist in the code base anymore...
tacaswell commented on Dec 7, 2023
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.