简体   繁体   English

如何在 Chaco 图中自动适应不同的显示分辨率?

[英]How to automatically accommodate different display resolutions in Chaco plots?

I just upgraded to a new laptop w/ a UHD 4K display.我刚刚升级到配备 UHD 4K 显示屏的新笔记本电脑。 It looks beautiful, but my Chaco plot labels are now illegibly small.它看起来很漂亮,但我的 Chaco 情节标签现在小得难以辨认。 I could solve the problem for myself, by increasing the font size of these labels, but then they would appear too large to people running the same application on standard resolution displays.我可以通过增加这些标签的字体大小来为自己解决这个问题,但是对于在标准分辨率显示器上运行相同应用程序的人来说,它们会显得太大。

How can I automatically detect and adapt to a particular display resolution in my Chaco plotting application?如何在我的 Chaco 绘图应用程序中自动检测并适应特定的显示分辨率?

As per @Alexandre\\ Chabot, below, I do appear to be using Qt 5:根据@Alexandre\\ Chabot,下面,我似乎确实在使用 Qt 5:

$ conda list qt
# packages in environment at C:\Users\capnf\AppData\Local\Continuum\anaconda3\envs\pybert-dev:
#
# Name                    Version                   Build  Channel
pyqt                      5.12.3           py38haa244fe_7    conda-forge
pyqt-impl                 5.12.3           py38h885f38d_7    conda-forge
pyqt5-sip                 4.19.18          py38h885f38d_7    conda-forge
pyqtchart                 5.12             py38h885f38d_7    conda-forge
pyqtwebengine             5.12.1           py38h885f38d_7    conda-forge
qt                        5.12.9               h5909a2a_4    conda-forge

So, how do I "tweak" Qt, to enlarge the font sizes of my Chaco plot index and value axes?那么,我如何“调整”Qt,以放大我的 Chaco 绘图索引和值轴的字体大小?

Or, better yet, how do I "coax" Qt5 into displaying things in a DPI-independent fashion?或者,更好的是,我如何“哄”Qt5 以独立于 DPI 的方式显示内容?

The screen resolution support is not part of Chaco but rather of the backend used to render the UI.屏幕分辨率支持不是 Chaco 的一部分,而是用于呈现 UI 的后端。 I'm going to assume that you're using Qt, and not Wx.我将假设您使用的是 Qt,而不是 Wx。 If it's possible for your project, I recommend upgrading to a Qt version that 5 or greater.如果您的项目可能,我建议升级到 Qt 5 或更高版本。 Qt5 greatly improved the support for high-DPI screens. Qt5 大大改进了对高 DPI 屏幕的支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM