久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='Mxk2C'></tfoot>
    1. <legend id='Mxk2C'><style id='Mxk2C'><dir id='Mxk2C'><q id='Mxk2C'></q></dir></style></legend>
      • <bdo id='Mxk2C'></bdo><ul id='Mxk2C'></ul>

        <i id='Mxk2C'><tr id='Mxk2C'><dt id='Mxk2C'><q id='Mxk2C'><span id='Mxk2C'><b id='Mxk2C'><form id='Mxk2C'><ins id='Mxk2C'></ins><ul id='Mxk2C'></ul><sub id='Mxk2C'></sub></form><legend id='Mxk2C'></legend><bdo id='Mxk2C'><pre id='Mxk2C'><center id='Mxk2C'></center></pre></bdo></b><th id='Mxk2C'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Mxk2C'><tfoot id='Mxk2C'></tfoot><dl id='Mxk2C'><fieldset id='Mxk2C'></fieldset></dl></div>

        <small id='Mxk2C'></small><noframes id='Mxk2C'>

        Python 和 Matplotlib 以及鼠標懸停注釋

        Python and Matplotlib and Annotations with Mouse Hover(Python 和 Matplotlib 以及鼠標懸停注釋)
          <tfoot id='gwLUC'></tfoot>

          <small id='gwLUC'></small><noframes id='gwLUC'>

                <tbody id='gwLUC'></tbody>
                <bdo id='gwLUC'></bdo><ul id='gwLUC'></ul>

              • <legend id='gwLUC'><style id='gwLUC'><dir id='gwLUC'><q id='gwLUC'></q></dir></style></legend>
              • <i id='gwLUC'><tr id='gwLUC'><dt id='gwLUC'><q id='gwLUC'><span id='gwLUC'><b id='gwLUC'><form id='gwLUC'><ins id='gwLUC'></ins><ul id='gwLUC'></ul><sub id='gwLUC'></sub></form><legend id='gwLUC'></legend><bdo id='gwLUC'><pre id='gwLUC'><center id='gwLUC'></center></pre></bdo></b><th id='gwLUC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gwLUC'><tfoot id='gwLUC'></tfoot><dl id='gwLUC'><fieldset id='gwLUC'></fieldset></dl></div>

                1. 本文介紹了Python 和 Matplotlib 以及鼠標懸停注釋的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  當我單擊 Basemap Matplotlib Plot 中的一個點時,我目前正在使用此代碼在地圖上彈出注釋.

                  I am currently employing this code to have pop up annotatations on a map when i click on a point in a Basemap Matplotlib Plot.

                  dcc = DataCursor(self.figure.gca())
                  self.figure.canvas.mpl_connect('pick_event',dcc)
                  plot_handle.set_picker(5)
                  self.figure.canvas.draw()
                  
                  class DataCursor(object):
                  
                      import matplotlib.pyplot as plt
                  
                      text_template = 'x: %0.2f
                  y: %0.2f' 
                      x, y = 0.0, 0.0 
                      xoffset, yoffset = -20 , 20
                      text_template = 'A: %s
                  B: %s
                  C: %s'
                  
                  
                      def __init__(self, ax): 
                          self.ax = ax 
                          self.annotation = ax.annotate(self.text_template,  
                                  xy=(self.x, self.y), xytext=(0,0),
                                  textcoords='axes fraction', ha='left', va='bottom', fontsize=10,
                                  bbox=dict(boxstyle='round,pad=0.5', fc='yellow', alpha=1), 
                                  arrowprops=dict(arrowstyle='->', connectionstyle='arc3,rad=0') 
                                  ) 
                          self.annotation.set_visible(False)
                          self.annotation.draggable()
                  
                  
                      def __call__(self, event):
                  
                          self.event = event 
                          self.x, self.y = event.mouseevent.xdata, event.mouseevent.ydata
                  
                          if self.x is not None:
                              glim = pickle.load(open("ListA.py","rb"))
                              tlim = pickle.load(open("ListB.py","rb"))
                              vlim = pickle.load(open("ListC.py","rb"))
                              a = glim[event.ind[0]] # ['Name'][event.ind[0]]
                              b = tlim[event.ind[0]]
                              c = vlim[event.ind[0]]
                              temp_temp=self.text_template % (a, b, c)
                              if temp_temp == self.annotation.get_text() and self.annotation.get_visible(): 
                                  self.annotation.set_visible(False) 
                                  event.canvas.draw() 
                                  return 
                              self.annotation.xy = self.x, self.y
                              self.annotation.set_text(self.text_template % (a, b, c))
                              self.annotation.set_visible(True)
                  
                              event.canvas.draw()
                  

                  我想知道的是,如何使用鼠標懸停而不是單擊某個點來顯示注釋?

                  What I am wondering, is how to show the annotations using mouse hover rather than clicking on a point?

                  我見過motion_notify_event",但是當我在繪圖區域周圍移動鼠標時,代碼似乎出錯了.有什么想法嗎?

                  I have seen "motion_notify_event" but it seems the code gets errors when i move the mouse around the plot area. Any Thoughts?

                  推薦答案

                  看看this question 和 demo:

                  from matplotlib.pyplot import figure, show
                  import numpy as npy
                  from numpy.random import rand
                  
                  
                  if 1: # picking on a scatter plot (matplotlib.collections.RegularPolyCollection)
                  
                      x, y, c, s = rand(4, 100)
                      def onpick3(event):
                          ind = event.ind
                          print 'onpick3 scatter:', ind, npy.take(x, ind), npy.take(y, ind)
                  
                      fig = figure()
                      ax1 = fig.add_subplot(111)
                      col = ax1.scatter(x, y, 100*s, c, picker=True)
                      #fig.savefig('pscoll.eps')
                      fig.canvas.mpl_connect('pick_event', onpick3)
                  
                  show()
                  

                  這篇關于Python 和 Matplotlib 以及鼠標懸停注釋的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)

                    <tbody id='7Znjf'></tbody>

                      <legend id='7Znjf'><style id='7Znjf'><dir id='7Znjf'><q id='7Znjf'></q></dir></style></legend>
                      • <small id='7Znjf'></small><noframes id='7Znjf'>

                          <bdo id='7Znjf'></bdo><ul id='7Znjf'></ul>
                          <i id='7Znjf'><tr id='7Znjf'><dt id='7Znjf'><q id='7Znjf'><span id='7Znjf'><b id='7Znjf'><form id='7Znjf'><ins id='7Znjf'></ins><ul id='7Znjf'></ul><sub id='7Znjf'></sub></form><legend id='7Znjf'></legend><bdo id='7Znjf'><pre id='7Znjf'><center id='7Znjf'></center></pre></bdo></b><th id='7Znjf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7Znjf'><tfoot id='7Znjf'></tfoot><dl id='7Znjf'><fieldset id='7Znjf'></fieldset></dl></div>

                            <tfoot id='7Znjf'></tfoot>
                            主站蜘蛛池模板: 国产激情在线播放 | 色综合av| 黑人一级黄色大片 | 中文字幕亚洲一区 | 欧美一级二级在线观看 | www国产精品| 久久亚洲欧美日韩精品专区 | 亚洲三级在线 | www国产成人免费观看视频,深夜成人网 | 日本黄色免费视频 | 91在线免费视频 | 国产精品久久久久久久久久免费看 | 日韩高清在线观看 | 毛片免费观看视频 | 久久久久国产精品一区 | 日韩成人精品在线观看 | 亚洲一区二区三区久久久 | 2018天天干天天操 | caoporn国产精品免费公开 | 国产精品自拍视频网站 | 中文字幕日韩欧美一区二区三区 | 欧美一区视频在线 | 日韩成人在线观看 | 国产精品美女 | 成人中文字幕av | aaaaaa大片免费看最大的 | 羞羞在线视频 | 91麻豆精品国产91久久久久久 | 国产精品综合视频 | 国产精品99久久久久久久久久久久 | 国产区在线视频 | 久久久亚洲| 日本三级日产三级国产三级 | 狠狠干网站 | 久久精品久久久 | 九九热国产视频 | 精品小视频 | 亚洲精品女优 | 深夜福利影院 | 91精品国产欧美一区二区成人 | 夜夜av|