@@ -494,7 +494,7 @@ class GLPlotFrame(object):
494
494
# Margins used when plot frame is not displayed
495
495
_NoDisplayMargins = _Margins (0 , 0 , 0 , 0 )
496
496
497
- def __init__ (self , marginRatios , foregroundColor , gridColor ):
497
+ def __init__ (self , marginRatios , foregroundColor , gridColor , font : qt . QFont ):
498
498
"""
499
499
:param List[float] marginRatios:
500
500
The ratios of margins around plot area for axis and labels.
@@ -503,6 +503,7 @@ def __init__(self, marginRatios, foregroundColor, gridColor):
503
503
:type foregroundColor: tuple with RGBA values ranging from 0.0 to 1.0
504
504
:param gridColor: color used for grid lines.
505
505
:type gridColor: tuple RGBA with RGBA values ranging from 0.0 to 1.0
506
+ :param font: Font used by the axes label
506
507
"""
507
508
self ._renderResources = None
508
509
@@ -517,6 +518,7 @@ def __init__(self, marginRatios, foregroundColor, gridColor):
517
518
self ._grid = False
518
519
self ._size = 0.0 , 0.0
519
520
self ._title = ""
521
+ self ._font : qt .QFont = font
520
522
521
523
self ._devicePixelRatio = 1.0
522
524
self ._dpi = 92
@@ -730,7 +732,7 @@ def _buildVerticesAndLabels(self):
730
732
labels .append (
731
733
Text2D (
732
734
text = self .title ,
733
- font = qt . QApplication . instance (). font () ,
735
+ font = self . _font ,
734
736
color = self ._foregroundColor ,
735
737
x = xTitle ,
736
738
y = yTitle ,
@@ -816,7 +818,7 @@ def renderGrid(self):
816
818
817
819
818
820
class GLPlotFrame2D (GLPlotFrame ):
819
- def __init__ (self , marginRatios , foregroundColor , gridColor ):
821
+ def __init__ (self , marginRatios , foregroundColor , gridColor , font : qt . QFont ):
820
822
"""
821
823
:param List[float] marginRatios:
822
824
The ratios of margins around plot area for axis and labels.
@@ -825,9 +827,9 @@ def __init__(self, marginRatios, foregroundColor, gridColor):
825
827
:type foregroundColor: tuple with RGBA values ranging from 0.0 to 1.0
826
828
:param gridColor: color used for grid lines.
827
829
:type gridColor: tuple RGBA with RGBA values ranging from 0.0 to 1.0
828
-
830
+ :param font: Font used by the axes label
829
831
"""
830
- super (GLPlotFrame2D , self ).__init__ (marginRatios , foregroundColor , gridColor )
832
+ super (GLPlotFrame2D , self ).__init__ (marginRatios , foregroundColor , gridColor , font )
831
833
self .axes .append (
832
834
PlotAxis (
833
835
self ,
0 commit comments