@@ -582,7 +582,9 @@ def __init__(self, canvas, parent, coordinates=True):
582
582
def _icon (self , name ):
583
583
if is_pyqt5 ():
584
584
name = name .replace ('.png' , '_large.png' )
585
- return QtGui .QIcon (os .path .join (self .basedir , name ))
585
+ pm = QtGui .QPixmap (os .path .join (self .basedir , name ))
586
+ pm .setDevicePixelRatio (self .canvas ._dpi_ratio )
587
+ return QtGui .QIcon (pm )
586
588
587
589
def _init_toolbar (self ):
588
590
self .basedir = os .path .join (matplotlib .rcParams ['datapath' ], 'images' )
@@ -592,7 +594,7 @@ def _init_toolbar(self):
592
594
self .addSeparator ()
593
595
else :
594
596
a = self .addAction (self ._icon (image_file + '.png' ),
595
- text , getattr (self , callback ))
597
+ text , getattr (self , callback ))
596
598
self ._actions [callback ] = a
597
599
if callback in ['zoom' , 'pan' ]:
598
600
a .setCheckable (True )
@@ -614,7 +616,7 @@ def _init_toolbar(self):
614
616
QtCore .Qt .AlignRight | QtCore .Qt .AlignTop )
615
617
self .locLabel .setSizePolicy (
616
618
QtWidgets .QSizePolicy (QtWidgets .QSizePolicy .Expanding ,
617
- QtWidgets .QSizePolicy .Ignored ))
619
+ QtWidgets .QSizePolicy .Ignored ))
618
620
labelAction = self .addWidget (self .locLabel )
619
621
labelAction .setVisible (True )
620
622
0 commit comments