本文整理汇总了Python中matplotlib.backends.backend_qt4agg.NavigationToolbar2QT.setIconSize方法的典型用法代码示例。如果您正苦于以下问题:Python NavigationToolbar2QT.setIconSize方法的具体用法?Python NavigationToolbar2QT.setIconSize怎么用?Python NavigationToolbar2QT.setIconSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.backends.backend_qt4agg.NavigationToolbar2QT
的用法示例。
在下文中一共展示了NavigationToolbar2QT.setIconSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MplWidgetT
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import setIconSize [as 别名]
class MplWidgetT(QtGui.QWidget):
def __init__(self, parent = None):
QtGui.QWidget.__init__(self, parent)
self.canvas = MplCanvas()
self.ntb = NavigationToolbar(self.canvas, self)
self.ntb.setIconSize(QtCore.QSize(16, 16))
self.vbl = QtGui.QVBoxLayout()
self.vbl.addWidget(self.canvas)
self.vbl.addWidget(self.ntb)
self.setLayout(self.vbl)
示例2: processing
# 需要导入模块: from matplotlib.backends.backend_qt4agg import NavigationToolbar2QT [as 别名]
# 或者: from matplotlib.backends.backend_qt4agg.NavigationToolbar2QT import setIconSize [as 别名]
def processing(self):
self.button_processing.hide()
filename1 = QtGui.QFileDialog.getOpenFileName(self, "Open File", "Users/jessicaabreu")
acq, data, headers = fp.open_c3d_data(str(filename1[0]))
split_labels, split_tracks = fp.split_wrong_tracks_by_gradient(data, headers, acq.GetAnalogFrequency())
new_tracks, new_labels = fp.join_equivalent_tracks(split_tracks, split_labels, acq.GetAnalogFrequency())
viewer = BiomecViewer(new_tracks, new_labels)
viewer_widget = viewer.edit_traits(parent=self, kind='subpanel').control
self.layout().addWidget(viewer_widget, 2, 1)
# making checkbox and plots
figurex = plt.figure()
canvasx = FigureCanvas(figurex)
toolbarx = NavigationToolbar(canvasx, None)
toolbarx.setIconSize(QtCore.QSize(12, 12))
toolbarx.setStyleSheet("background-color: #C0C0C0 ")
ax_x = figurex.add_subplot(111)
ax_x.cla()
plt.xlabel('Time (s)', fontsize=10)
plt.ylabel('Position (mm)', fontsize=10)
canvasx.draw()
figurey = plt.figure()
canvasy = FigureCanvas(figurey)
toolbary = NavigationToolbar(canvasy, None)
toolbary.setIconSize(QtCore.QSize(12, 12))
toolbary.setStyleSheet("background-color: #C0C0C0 ")
ax_y = figurey.add_subplot(111)
ax_y.cla()
plt.xlabel('Time (s)', fontsize=10)
plt.ylabel('Position (mm)', fontsize=10)
canvasy.draw()
figurez = plt.figure()
canvasz = FigureCanvas(figurez)
toolbarz = NavigationToolbar(canvasz, None)
toolbarz.setIconSize(QtCore.QSize(12, 12))
toolbarz.setStyleSheet("background-color: #C0C0C0 ")
ax_z = figurez.add_subplot(111)
ax_z.cla()
plt.xlabel('Time (s)', fontsize=10)
plt.ylabel('Position (mm)', fontsize=10)
canvasz.draw()
check_box = QtGui.QGroupBox("Plot Tracks")
check_box_layout = QtGui.QGridLayout()
check_box.setLayout(check_box_layout)
for i in range(len(new_labels)):
column = i / 5
line = i % 5
check_item = QtGui.QCheckBox(new_labels[i])
check_item.setStyleSheet("font-size: 8px; font-weight: normal")
check_item.stateChanged.connect(self.wrapper_plot(ax_x, ax_y, ax_z, new_tracks[i, :, :],
new_labels[i], check_item, figurex,
figurey, figurez, canvasx, canvasy,
canvasz, acq
))
check_box_layout.addWidget(check_item, line, column)
plot_layout = QtGui.QVBoxLayout()
plot_layout.addWidget(canvasx)
plot_layout.addWidget(toolbarx)
plot_layout.addWidget(canvasy)
plot_layout.addWidget(toolbary)
plot_layout.addWidget(canvasz)
plot_layout.addWidget(toolbarz)
self.layout().addWidget(check_box, 1, 2)
self.layout().addLayout(plot_layout, 2, 2)
self.button_processing_labeling.show()
self.button_processing_labeling.clicked.connect(lambda: self.processing_labeling(new_tracks, new_labels, filename1[0], acq))
self.button_save.show()
self.button_save.clicked.connect(lambda: self.save(new_tracks, new_labels, filename1[0], acq, "pre_processed"))