本文整理汇总了Python中matplotlib.backend_bases.key_press_handler函数的典型用法代码示例。如果您正苦于以下问题:Python key_press_handler函数的具体用法?Python key_press_handler怎么用?Python key_press_handler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了key_press_handler函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: on_key_event
def on_key_event(self, event):
if event.key == 'a':
ax = event.inaxes
ax.set_autoscalex_on(True)
ax.set_autoscaley_on(True)
else:
key_press_handler(event, self.canvas, self.toolbar)
开发者ID:azonalon,项目名称:pymeasure,代码行数:7,代码来源:liveplot.py
示例2: on_key_press
def on_key_press(self, event):
#绑定键盘事件到画布和工具栏
key_press_handler(event, self.canvas, self.toolbar)
if event.key == "enter":
self.data.get_homo()
elif event.key == "N":
self.emit(QtCore.SIGNAL("play_next()"))
开发者ID:tankebuaa,项目名称:Calibration,代码行数:7,代码来源:mplcanvas.py
示例3: on_key_event
def on_key_event(self, event):
print('you pressed %s'%event.key)
key_press_handler(event, self.canvas, self.toolbar)
if event.key in ['q','escape']: # Use (some) unassigned buttons to quit
print('--> Program quit')
self.root.quit()
self.root.destroy() # this is necessary on Windows to prevent
开发者ID:nikolajkiel,项目名称:nikolaj,代码行数:7,代码来源:SN_curves.py
示例4: on_key_press
def on_key_press(self, event):
from matplotlib.backend_bases import key_press_handler
print("you pressed", event.key)
# implement the default mpl key press events described at
# http://matplotlib.org/users/navigation_toolbar.html
key_press_handler(event, self.canvas, self.mpl_toolbar)
开发者ID:goerz,项目名称:mgplottools,代码行数:7,代码来源:mpl.py
示例5: on_key_event
def on_key_event(self, event):
"""
@param event:
@return
"""
print('you pressed %s' % event.key)
key_press_handler(event, self.canvas, self.toolbar)
开发者ID:tuckerowens,项目名称:eCLAM,代码行数:8,代码来源:PlotWindow.py
示例6: on_key_press
def on_key_press(self, event):
print('Plot pressed', event.key)
# implement the default mpl key press events described at
# http://matplotlib.org/users/navigation_toolbar.html#navigation-keyboard-shortcuts
try:
key_press_handler(event, self.canvas, self.mpl_toolbar)
except:
pass
开发者ID:marcosscholl,项目名称:essa,代码行数:8,代码来源:plot.py
示例7: on_key_press
def on_key_press(self, event):
# sometimes mpl has a weird ideas what oo-programing is.
# any could overwrite method by my self
# no fullscreen unless self is a window!
if event.key == "t":
self.toolbar.toggle()
elif event.key not in rcParams["keymap.fullscreen"]:
key_press_handler(event, self.canvas, self.toolbar)
开发者ID:rhoef,项目名称:mpl-qtdemo,代码行数:9,代码来源:figurewidgets.py
示例8: on_key_press
def on_key_press(self, event):
if event.key == 'a' or event.key == "alt+a" and event.inaxes:
ax = event.inaxes
ax.relim()
l = 1.1*max(abs(ax.dataLim.y0), abs(ax.dataLim.y1))
ax.set_ylim(-l,l)
ax.figure.canvas.draw()
else:
key_press_handler(event, event.canvas, self.toolbar)
开发者ID:zhangwise,项目名称:ae,代码行数:9,代码来源:AEViewer.py
示例9: on_key_press
def on_key_press(self, event):
# print 'Matplotlib-> you pressed:' + str(event.key)
# implement the default mpl key press events described at
# http://matplotlib.org/users/navigation_toolbar.html#navigation-
# keyboard-shortcuts
try:
from matplotlib.backend_bases import key_press_handler
key_press_handler(event, self.canvas, self.mpl_toolbar)
except:
print("key_press_handler import failed. -old matplotlib version.")
开发者ID:gpilab,项目名称:core-nodes,代码行数:10,代码来源:Matplotlib_GPI.py
示例10: on_key_press
def on_key_press(self, event):
key_press_handler(event, self.canvas, self.mpl_toolbar)
if event.key == 'a':
command = commands.AddIonsToTable([self._picked_ion], self._analyses_model)
self._undo_stack.push(command)
if event.key == 'r':
command = commands.AddIonsToTable([self._picked_ion], self._analyses_model)
self._undo_stack.push(command)
command = commands.SelectMethod(self._picked_ion, 'Manual', self._analyses_model, self._methods_view_model)
self._undo_stack.push(command)
self._span_selector = SpanSelector(self.ax,self.on_span_select,'horizontal', minspan=0.0001, span_stays=True, rectprops=dict(alpha=0.5))
QApplication.setOverrideCursor(QCursor(Qt.IBeamCursor))
开发者ID:tanosaur,项目名称:massreproduction,代码行数:15,代码来源:plots.py
示例11: canvas_key_press
def canvas_key_press(self, event):
key_press_handler(event, self.canvas, self.mpl_toolbar)
if event.key == 'ctrl+q':
self._close()
elif event.key in mpl.rcParams['keymap.home']:
self.xlim = self.ylim = None
self.draw()
elif event.key == 'ctrl+x':
self.set_xlim(draw=False)
elif event.key == 'ctrl+y':
self.set_ylim(draw=False)
elif event.key == 'ctrl+l':
self.draw()
self.xlogscale = self.axes.get_xscale()
self.ylogscale = self.axes.get_yscale()
开发者ID:pbiczo,项目名称:vimconfig,代码行数:15,代码来源:plotinteract.py
示例12: on_key_event
def on_key_event(event):
#Flecha de abajo
if event.key==D:
global state
global a
global b
global x
x = x
if state==5:
state=0
else:
state=state+1
graficar(x)
#Flecha de arriba
elif event.key==U:
global state
global a
global b
global x
x = x
if state==0:
state=5
else:
state=state-1
graficar(x)
#Flecha derecha
elif event.key==R:
global a
global b
global x
if x>=700:
x=700
else:
x = x + 10
graficar(x)
#Flecha Izquierda
elif event.key==L:
global a
global b
global x
if x<=200:
x=200
else:
x = x - 10
graficar(x)
else:
pass
key_press_handler(event, canvas, toolbar)
开发者ID:ingelectronicadj,项目名称:FisicaConPython,代码行数:48,代码来源:concentracionDePortadoresIntrinsecos.py
示例13: keyPressEvent
def keyPressEvent(self, event):
""" Catch key events so that they can be passed on to the matplotlib
toolbar. """
try:
key_press_handler(event, self.canvas, self.toolbar)
except AttributeError:
# Attribute errors seem to occur when a key is pressed while the
# mouse is outside of the figure area:
#
# AttributeError: 'QKeyEvent' object has no attribute 'inaxes'
#
# This exception may be safely ignored.
pass
except Exception as e:
print(e)
raise e
开发者ID:gkunter,项目名称:coquery,代码行数:16,代码来源:visualization.py
示例14: tracer_key_handler
def tracer_key_handler( self, event ) :
if event.key == 'p' or event.key == ' ' :
self.pause()
elif event.key == 'b' :
self.band()
elif event.key == 'd' :
self.save_data()
elif event.key == 'a' :
event.inaxes.abscissa.set_visible( not event.inaxes.abscissa.get_visible() )
self.canvas.draw()
else :
try :
key_press_handler( event, self.canvas, self )
except NameError :
pass
开发者ID:Bouty92,项目名称:Tracer,代码行数:16,代码来源:tracer.py
示例15: on_key
def on_key(self,event):
"""to change scale from linear to logaritm
Home/Reset h or r or home
Back c or left arrow or backspace
Forward v or right arrow
Pan/Zoom p
Zoom-to-rect o
Save ctrl + s
Toggle fullscreen ctrl + f
Close plot ctrl + w
Constrain pan/zoom to x axis hold x when panning/zooming with mouse
Constrain pan/zoom to y axis hold y when panning/zooming with mouse
Preserve aspect ratio hold CONTROL when panning/zooming with mouse
Toggle grid g when mouse is over an axes
Toggle x axis scale (log/linear) L or k when mouse is over an axes
Toggle y axis scale (log/linear) l when mouse is over an axes
"""
key_press_handler(event, self.canvas, self.toolbar)
开发者ID:tschoonj,项目名称:PrestoPronto,代码行数:18,代码来源:utility.py
示例16: on_key_press
def on_key_press(self, event):
'''
当按下回车键,计算一个H;按下SHift+n,处理下一副图像
'''
key_press_handler(event, self.canvas, self.toolBar)# 绑定mpl按键到画布和工具栏
if event.key is "enter":
# 计算H
if self.data.nCorner > 2:
print("Compute H...")
self.data.solve_homography()
#print(self.data.nCorner + 1, self.data.corners)
else:
print("Not enough corners!")
# 初始化单应的角点列表数据
self.data.init_corners()
print(">>> click the cross point on same circle OR play next image.")
elif event.key is "N":
print(event.key)
self.emit(QtCore.SIGNAL("play_next()"))
开发者ID:tankebuaa,项目名称:Calibration,代码行数:19,代码来源:__init__.py
示例17: on_key_press
def on_key_press(event):
#Matplotlib Toolbar keybindings:
key_press_handler(event, canvas, toolbar)
开发者ID:nfroehberg,项目名称:GlazerLab_KStat,代码行数:4,代码来源:KStat_peak_height_interactive.py
示例18: on_key_event
def on_key_event(event):
print 'event is ', event
key_press_handler(event, canvas, toolbar)
开发者ID:siddharth05,项目名称:imagine,代码行数:3,代码来源:rectest.py
示例19: on_key_event
def on_key_event(event):
key_press_handler(event, canvas, toolbar)
开发者ID:imichaelnorris,项目名称:Python-Science-Guis,代码行数:2,代码来源:entropy.py
示例20: on_key_press
def on_key_press(event):
print("you pressed {}".format(event.key))
key_press_handler(event, canvas, toolbar)
开发者ID:adnanb59,项目名称:matplotlib,代码行数:3,代码来源:embedding_in_tk_sgskip.py
注:本文中的matplotlib.backend_bases.key_press_handler函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论