Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyQtGraph when show in a different screen misalign axis

Does anyone have any idea how to fix this? On my desktop screen this is how the plot looks like:

Plot on desktop screen

However once I drag the graph to my monitor the points become misaligned and the axis is not complete. Plot on monitor screen

like image 689
binverted Avatar asked Oct 29 '25 15:10

binverted


1 Answers

I recently had the same issue and for me it was related to using screens with a resolution > 1920x1080. In my case (using Windows) the problem could be solved with:

import platform
import ctypes
if platform.system()=='Windows' and int(platform.release()) >= 8:   
    ctypes.windll.shcore.SetProcessDpiAwareness(True)

other possible fixes are QApplication.setAttribute(Qt.AA_EnableHighDpiScaling) and os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1".

There are even more possible solutions, as for example here.

like image 99
fischmalte Avatar answered Oct 31 '25 04:10

fischmalte



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!