本文整理汇总了Python中AnyQt.QtGui.QFont.pixelSize方法的典型用法代码示例。如果您正苦于以下问题:Python QFont.pixelSize方法的具体用法?Python QFont.pixelSize怎么用?Python QFont.pixelSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnyQt.QtGui.QFont
的用法示例。
在下文中一共展示了QFont.pixelSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from AnyQt.QtGui import QFont [as 别名]
# 或者: from AnyQt.QtGui.QFont import pixelSize [as 别名]
def __init__(self):
super().__init__()
self.results = None
self.classifier_names = []
self.colors = []
self._curve_data = {}
box = gui.vBox(self.controlArea, "Plot")
tbox = gui.vBox(box, "Target Class")
tbox.setFlat(True)
self.target_cb = gui.comboBox(
tbox, self, "target_index", callback=self._on_target_changed,
contentsLength=8)
cbox = gui.vBox(box, "Classifiers")
cbox.setFlat(True)
self.classifiers_list_box = gui.listBox(
cbox, self, "selected_classifiers", "classifier_names",
selectionMode=QtWidgets.QListView.MultiSelection,
callback=self._on_classifiers_changed)
gui.checkBox(box, self, "display_convex_hull",
"Show lift convex hull", callback=self._replot)
self.plotview = pg.GraphicsView(background="w")
self.plotview.setFrameStyle(QtWidgets.QFrame.StyledPanel)
self.plot = pg.PlotItem(enableMenu=False)
self.plot.setMouseEnabled(False, False)
self.plot.hideButtons()
pen = QPen(self.palette().color(QPalette.Text))
tickfont = QFont(self.font())
tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))
axis = self.plot.getAxis("bottom")
axis.setTickFont(tickfont)
axis.setPen(pen)
axis.setLabel("P Rate")
axis = self.plot.getAxis("left")
axis.setTickFont(tickfont)
axis.setPen(pen)
axis.setLabel("TP Rate")
self.plot.showGrid(True, True, alpha=0.1)
self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)
self.plotview.setCentralItem(self.plot)
self.mainArea.layout().addWidget(self.plotview)
示例2: __init__
# 需要导入模块: from AnyQt.QtGui import QFont [as 别名]
# 或者: from AnyQt.QtGui.QFont import pixelSize [as 别名]
def __init__(self):
super().__init__()
self.results = None
self.classifier_names = []
self.perf_line = None
self.colors = []
self._curve_data = {}
self._plot_curves = {}
self._rocch = None
self._perf_line = None
box = gui.vBox(self.controlArea, "Plot")
tbox = gui.vBox(box, "Target Class")
tbox.setFlat(True)
self.target_cb = gui.comboBox(
tbox, self, "target_index", callback=self._on_target_changed,
contentsLength=8)
cbox = gui.vBox(box, "Classifiers")
cbox.setFlat(True)
self.classifiers_list_box = gui.listBox(
cbox, self, "selected_classifiers", "classifier_names",
selectionMode=QListView.MultiSelection,
callback=self._on_classifiers_changed)
abox = gui.vBox(box, "Combine ROC Curves From Folds")
abox.setFlat(True)
gui.comboBox(abox, self, "roc_averaging",
items=["Merge Predictions from Folds", "Mean TP Rate",
"Mean TP and FP at Threshold", "Show Individual Curves"],
callback=self._replot)
hbox = gui.vBox(box, "ROC Convex Hull")
hbox.setFlat(True)
gui.checkBox(hbox, self, "display_convex_curve",
"Show convex ROC curves", callback=self._replot)
gui.checkBox(hbox, self, "display_convex_hull",
"Show ROC convex hull", callback=self._replot)
box = gui.vBox(self.controlArea, "Analysis")
gui.checkBox(box, self, "display_def_threshold",
"Default threshold (0.5) point",
callback=self._on_display_def_threshold_changed)
gui.checkBox(box, self, "display_perf_line", "Show performance line",
callback=self._on_display_perf_line_changed)
grid = QGridLayout()
ibox = gui.indentedBox(box, orientation=grid)
sp = gui.spin(box, self, "fp_cost", 1, 1000, 10,
callback=self._on_display_perf_line_changed)
grid.addWidget(QLabel("FP Cost:"), 0, 0)
grid.addWidget(sp, 0, 1)
sp = gui.spin(box, self, "fn_cost", 1, 1000, 10,
callback=self._on_display_perf_line_changed)
grid.addWidget(QLabel("FN Cost:"))
grid.addWidget(sp, 1, 1)
sp = gui.spin(box, self, "target_prior", 1, 99,
callback=self._on_display_perf_line_changed)
sp.setSuffix("%")
sp.addAction(QAction("Auto", sp))
grid.addWidget(QLabel("Prior target class probability:"))
grid.addWidget(sp, 2, 1)
self.plotview = pg.GraphicsView(background="w")
self.plotview.setFrameStyle(QFrame.StyledPanel)
self.plot = pg.PlotItem(enableMenu=False)
self.plot.setMouseEnabled(False, False)
self.plot.hideButtons()
pen = QPen(self.palette().color(QPalette.Text))
tickfont = QFont(self.font())
tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))
axis = self.plot.getAxis("bottom")
axis.setTickFont(tickfont)
axis.setPen(pen)
axis.setLabel("FP Rate (1-Specificity)")
axis = self.plot.getAxis("left")
axis.setTickFont(tickfont)
axis.setPen(pen)
axis.setLabel("TP Rate (Sensitivity)")
self.plot.showGrid(True, True, alpha=0.1)
self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0), padding=0.05)
self.plotview.setCentralItem(self.plot)
self.mainArea.layout().addWidget(self.plotview)
示例3: _init_ui
# 需要导入模块: from AnyQt.QtGui import QFont [as 别名]
# 或者: from AnyQt.QtGui.QFont import pixelSize [as 别名]
#.........这里部分代码省略.........
self.toolActions = QActionGroup(self)
self.toolActions.setExclusive(True)
self.toolButtons = []
for i, (name, tooltip, tool, icon) in enumerate(self.TOOLS):
action = QAction(
name, self,
toolTip=tooltip,
checkable=tool.checkable,
icon=QIcon(icon),
)
action.triggered.connect(partial(self.set_current_tool, tool))
button = QToolButton(
iconSize=QSize(24, 24),
toolButtonStyle=Qt.ToolButtonTextUnderIcon,
sizePolicy=QSizePolicy(QSizePolicy.MinimumExpanding,
QSizePolicy.Fixed)
)
button.setDefaultAction(action)
self.toolButtons.append((button, tool))
toolsBox.layout().addWidget(button, i / 3, i % 3)
self.toolActions.addAction(action)
for column in range(3):
toolsBox.layout().setColumnMinimumWidth(column, 10)
toolsBox.layout().setColumnStretch(column, 1)
undo = self.undo_stack.createUndoAction(self)
redo = self.undo_stack.createRedoAction(self)
undo.setShortcut(QKeySequence.Undo)
redo.setShortcut(QKeySequence.Redo)
self.addActions([undo, redo])
self.undo_stack.indexChanged.connect(lambda _: self.invalidate())
gui.separator(tBox)
indBox = gui.indentedBox(tBox, sep=8)
form = QFormLayout(
formAlignment=Qt.AlignLeft,
labelAlignment=Qt.AlignLeft,
fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow
)
indBox.layout().addLayout(form)
slider = gui.hSlider(
indBox, self, "brushRadius", minValue=1, maxValue=100,
createLabel=False
)
form.addRow("Radius:", slider)
slider = gui.hSlider(
indBox, self, "density", None, minValue=1, maxValue=100,
createLabel=False
)
form.addRow("Intensity:", slider)
self.btResetToInput = gui.button(
tBox, self, "Reset to Input Data", self.reset_to_input)
self.btResetToInput.setDisabled(True)
gui.rubber(self.controlArea)
gui.auto_commit(self.left_side, self, "autocommit",
"Send")
# main area GUI
viewbox = PaintViewBox(enableMouse=False)
self.plotview = pg.PlotWidget(background="w", viewBox=viewbox)
self.plotview.sizeHint = lambda: QSize(200, 100) # Minimum size for 1-d painting
self.plot = self.plotview.getPlotItem()
axis_color = self.palette().color(QPalette.Text)
axis_pen = QPen(axis_color)
tickfont = QFont(self.font())
tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))
axis = self.plot.getAxis("bottom")
axis.setLabel(self.attr1)
axis.setPen(axis_pen)
axis.setTickFont(tickfont)
axis = self.plot.getAxis("left")
axis.setLabel(self.attr2)
axis.setPen(axis_pen)
axis.setTickFont(tickfont)
if not self.hasAttr2:
self.plot.hideAxis('left')
self.plot.hideButtons()
self.plot.setXRange(0, 1, padding=0.01)
self.mainArea.layout().addWidget(self.plotview)
# enable brush tool
self.toolActions.actions()[0].setChecked(True)
self.set_current_tool(self.TOOLS[0][2])
self.set_dimensions()
示例4: add_main_layout
# 需要导入模块: from AnyQt.QtGui import QFont [as 别名]
# 或者: from AnyQt.QtGui.QFont import pixelSize [as 别名]
def add_main_layout(self):
self.data = None
self.preprocessors = None
self.learner = None
self.scatterplot_item = None
self.plot_item = None
self.x_label = 'x'
self.y_label = 'y'
box = gui.vBox(self.controlArea, "Variables")
self.x_var_model = itemmodels.VariableListModel()
self.comboBoxAttributesX = gui.comboBox(
box, self, value='x_var_index', label="Input: ",
orientation=Qt.Horizontal, callback=self.apply, contentsLength=12)
self.comboBoxAttributesX.setSizePolicy(
QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
self.comboBoxAttributesX.setModel(self.x_var_model)
gui.doubleSpin(
gui.indentedBox(box),
self, "polynomialexpansion", 0, 10,
label="Polynomial expansion:", callback=self.apply)
gui.separator(box, height=8)
self.y_var_model = itemmodels.VariableListModel()
self.comboBoxAttributesY = gui.comboBox(
box, self, value="y_var_index", label="Target: ",
orientation=Qt.Horizontal, callback=self.apply, contentsLength=12)
self.comboBoxAttributesY.setSizePolicy(
QSizePolicy.MinimumExpanding, QSizePolicy.Fixed)
self.comboBoxAttributesY.setModel(self.y_var_model)
gui.rubber(self.controlArea)
# main area GUI
self.plotview = pg.PlotWidget(background="w")
self.plot = self.plotview.getPlotItem()
axis_color = self.palette().color(QPalette.Text)
axis_pen = QPen(axis_color)
tickfont = QFont(self.font())
tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))
axis = self.plot.getAxis("bottom")
axis.setLabel(self.x_label)
axis.setPen(axis_pen)
axis.setTickFont(tickfont)
axis = self.plot.getAxis("left")
axis.setLabel(self.y_label)
axis.setPen(axis_pen)
axis.setTickFont(tickfont)
self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0),
disableAutoRange=True)
self.mainArea.layout().addWidget(self.plotview)
示例5: add_main_layout
# 需要导入模块: from AnyQt.QtGui import QFont [as 别名]
# 或者: from AnyQt.QtGui.QFont import pixelSize [as 别名]
def add_main_layout(self):
self.data = None
self.learner = None
self.scatterplot_item = None
self.plot_item = None
self.x_label = 'x'
self.y_label = 'y'
self.rmse = ""
self.mae = ""
self.regressor_name = self.default_learner_name
# info box
info_box = gui.vBox(self.controlArea, "Info")
self.regressor_label = gui.label(
widget=info_box, master=self,
label="Regressor: %(regressor_name).30s")
gui.label(widget=info_box, master=self,
label="Mean absolute error: %(mae).6s")
gui.label(widget=info_box, master=self,
label="Root mean square error: %(rmse).6s")
box = gui.vBox(self.controlArea, "Variables")
self.x_var_model = itemmodels.VariableListModel()
self.comboBoxAttributesX = gui.comboBox(
box, self, value='x_var_index', label="Input: ",
orientation=Qt.Horizontal, callback=self.apply,
maximumContentsLength=15)
self.comboBoxAttributesX.setModel(self.x_var_model)
self.expansion_spin = gui.doubleSpin(
gui.indentedBox(box),
self, "polynomialexpansion", 0, 10,
label="Polynomial expansion:", callback=self.apply)
gui.separator(box, height=8)
self.y_var_model = itemmodels.VariableListModel()
self.comboBoxAttributesY = gui.comboBox(
box, self, value="y_var_index", label="Target: ",
orientation=Qt.Horizontal, callback=self.apply,
maximumContentsLength=15)
self.comboBoxAttributesY.setModel(self.y_var_model)
properties_box = gui.vBox(self.controlArea, "Properties")
self.error_bars_checkbox = gui.checkBox(
widget=properties_box, master=self, value='error_bars_enabled',
label="Show error bars", callback=self.apply)
gui.rubber(self.controlArea)
# main area GUI
self.plotview = pg.PlotWidget(background="w")
self.plot = self.plotview.getPlotItem()
axis_color = self.palette().color(QPalette.Text)
axis_pen = QPen(axis_color)
tickfont = QFont(self.font())
tickfont.setPixelSize(max(int(tickfont.pixelSize() * 2 // 3), 11))
axis = self.plot.getAxis("bottom")
axis.setLabel(self.x_label)
axis.setPen(axis_pen)
axis.setTickFont(tickfont)
axis = self.plot.getAxis("left")
axis.setLabel(self.y_label)
axis.setPen(axis_pen)
axis.setTickFont(tickfont)
self.plot.setRange(xRange=(0.0, 1.0), yRange=(0.0, 1.0),
disableAutoRange=True)
self.mainArea.layout().addWidget(self.plotview)