本文整理汇总了Python中matplotlib.widgets.CheckButtons方法的典型用法代码示例。如果您正苦于以下问题:Python widgets.CheckButtons方法的具体用法?Python widgets.CheckButtons怎么用?Python widgets.CheckButtons使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.widgets
的用法示例。
在下文中一共展示了widgets.CheckButtons方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initWindow
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def initWindow(self):
if not (self.args.placeOne and self.args.placeTwo):
self.randomBB()
axes().set_aspect('equal', 'datalim')
plt.subplot(2, 2, (1, 2))
plt.subplot(2, 2, (1, 2)).set_aspect('equal')
subplots_adjust(left=0.31)
subplots_adjust(bottom=-0.7)
plt.title('QSR Visualisation')
axcolor = 'lightgoldenrodyellow'
rax = plt.axes([0.03, 0.4, 0.22, 0.45], axisbg=axcolor)
checkBox = CheckButtons(rax, self.qsr_type,(False,False,False,False,False))
checkBox.on_clicked(self.EventClick)
plt.subplot(2, 2, 3)
plt.axis('off')
plt.text(1, 1, (self.__compute_qsr(self.bb1, self.bb2)), family='serif', style='italic', ha='center')
if self.qsr:
self.updateWindow()
plt.show()
示例2: add_checkboxes
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def add_checkboxes(self):
"""
Checkboxes offer the ability to select multiple tags such as Motion, Ghosting Aliasing etc,
instead of one from a list of mutual exclusive rating options (such as Good, Bad, Error etc).
"""
ax_checkbox = plt.axes(cfg.position_checkbox, facecolor=cfg.color_rating_axis)
# initially de-activating all
actives = [False] * len(self.issue_list)
self.checkbox = CheckButtons(ax_checkbox, labels=self.issue_list, actives=actives)
self.checkbox.on_clicked(self.save_issues)
for txt_lbl in self.checkbox.labels:
txt_lbl.set(**cfg.checkbox_font_properties)
for rect in self.checkbox.rectangles:
rect.set_width(cfg.checkbox_rect_width)
rect.set_height(cfg.checkbox_rect_height)
# lines is a list of n crosses, each cross (x) defined by a tuple of lines
for x_line1, x_line2 in self.checkbox.lines:
x_line1.set_color(cfg.checkbox_cross_color)
x_line2.set_color(cfg.checkbox_cross_color)
self._index_pass = self.issue_list.index(cfg.func_mri_pass_indicator)
示例3: create_button
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def create_button(idx_feature):
""" function to built button groups for one feature """
x, y, w, h = get_loc_control(idx_feature)
plt.text(x+w/2, y+h/2+0.01, feature_name[idx_feature], horizontalalignment='center',
transform=plt.gcf().transFigure)
ax_neg = plt.axes((x + w / 8, y, w / 4, h / 2))
b_neg = widgets.Button(ax_neg, '-', hovercolor='0.1')
b_neg.on_clicked(lambda event:
callback.modify_along_feature(event, idx_feature, step_size=-1 * step_size))
ax_pos = plt.axes((x + w *5/8, y, w / 4, h / 2))
b_pos = widgets.Button(ax_pos, '+', hovercolor='0.1')
b_pos.on_clicked(lambda event:
callback.modify_along_feature(event, idx_feature, step_size=+1 * step_size))
ax_lock = plt.axes((x + w * 3/8, y, w / 4, h / 2))
b_lock = widgets.CheckButtons(ax_lock, ['L'], [False])
b_lock.on_clicked(lambda event:
callback.set_feature_lock(event, idx_feature))
return b_neg, b_pos, b_lock
示例4: test_CheckButtons
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def test_CheckButtons():
ax = get_ax()
check = widgets.CheckButtons(ax, ('a', 'b', 'c'), (True, False, True))
assert check.get_status() == [True, False, True]
check.set_active(0)
assert check.get_status() == [False, False, True]
cid = check.on_clicked(lambda: None)
check.disconnect(cid)
示例5: test_check_radio_buttons_image
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def test_check_radio_buttons_image():
get_ax()
plt.subplots_adjust(left=0.3)
rax1 = plt.axes([0.05, 0.7, 0.15, 0.15])
rax2 = plt.axes([0.05, 0.2, 0.15, 0.15])
widgets.RadioButtons(rax1, ('Radio 1', 'Radio 2', 'Radio 3'))
widgets.CheckButtons(rax2, ('Check 1', 'Check 2', 'Check 3'),
(False, True, True))
示例6: add_checkboxes
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def add_checkboxes(self):
"""
Checkboxes offer the ability to select multiple tags such as Motion,
Ghosting, Aliasing etc, instead of one from a list of mutual exclusive
rating options (such as Good, Bad, Error etc).
"""
ax_checkbox = plt.axes(cfg.position_checkbox_t1_mri,
facecolor=cfg.color_rating_axis)
# initially de-activating all
actives = [False] * len(self.issue_list)
self.checkbox = CheckButtons(ax_checkbox, labels=self.issue_list,
actives=actives)
self.checkbox.on_clicked(self.save_issues)
for txt_lbl in self.checkbox.labels:
txt_lbl.set(color=cfg.text_option_color, fontweight='normal')
for rect in self.checkbox.rectangles:
rect.set_width(cfg.checkbox_rect_width)
rect.set_height(cfg.checkbox_rect_height)
# lines is a list of n crosses, each cross (x) defined by a tuple of lines
for x_line1, x_line2 in self.checkbox.lines:
x_line1.set_color(cfg.checkbox_cross_color)
x_line2.set_color(cfg.checkbox_cross_color)
self._index_pass = cfg.t1_mri_default_issue_list.index(cfg.t1_mri_pass_indicator)
示例7: add_checkboxes
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def add_checkboxes(self):
"""
Checkboxes offer the ability to select multiple tags such as Motion,
Ghosting Aliasing etc, instead of one from a list of mutual exclusive
rating options (such as Good, Bad, Error etc).
"""
ax_checkbox = plt.axes(cfg.position_checkbox_t1_mri,
facecolor=cfg.color_rating_axis)
# initially de-activating all
check_box_status = [False] * len(self.issue_list)
self.checkbox = CheckButtons(ax_checkbox, labels=self.issue_list,
actives=check_box_status)
self.checkbox.on_clicked(self.save_issues)
for txt_lbl in self.checkbox.labels:
txt_lbl.set(color=cfg.text_option_color, fontweight='normal')
for rect in self.checkbox.rectangles:
rect.set_width(cfg.checkbox_rect_width)
rect.set_height(cfg.checkbox_rect_height)
# lines is a list of n crosses, each cross (x) defined by a tuple of lines
for x_line1, x_line2 in self.checkbox.lines:
x_line1.set_color(cfg.checkbox_cross_color)
x_line2.set_color(cfg.checkbox_cross_color)
self._index_pass = cfg.defacing_default_issue_list.index(
cfg.defacing_pass_indicator)
示例8: add_checkboxes
# 需要导入模块: from matplotlib import widgets [as 别名]
# 或者: from matplotlib.widgets import CheckButtons [as 别名]
def add_checkboxes(self):
"""
Checkboxes offer the ability to select multiple tags such as Motion, Ghosting Aliasing etc,
instead of one from a list of mutual exclusive rating options (such as Good, Bad, Error etc).
"""
ax_checkbox = plt.axes(cfg.position_rating_checkbox_diffusion,
facecolor=cfg.color_rating_axis)
# initially de-activating all
actives = [False] * len(self.issue_list)
self.checkbox = CheckButtons(ax_checkbox, labels=self.issue_list, actives=actives)
self.checkbox.on_clicked(self.save_issues)
for txt_lbl in self.checkbox.labels:
txt_lbl.set(**cfg.checkbox_font_properties)
# for rect in self.checkbox.rectangles:
# rect.set_width(cfg.checkbox_rect_width_diffusion)
# rect.set_height(cfg.checkbox_rect_height_diffusion)
# lines is a list of n crosses, each cross (x) defined by a tuple of lines
for x_line1, x_line2 in self.checkbox.lines:
x_line1.set_color(cfg.checkbox_cross_color)
x_line2.set_color(cfg.checkbox_cross_color)
self._index_pass = self.issue_list.index(cfg.diffusion_mri_pass_indicator)