[教學] 互動式圖片 - annotation
網誌好讀版:https://link.medium.com/PqnZuEWspU
在進行資料的視覺化時,我們很常會使用散佈圖來呈現,但是當我們想要知道圖片上特定
的點其背後所代表的資料、圖像時,我們除了從座標去回推之外,可以透過hover
annotation的方式來更直觀的讓使用者了解到該資料中所蘊含之資訊。
簡單來說,該功能就是使用matplotlib.pyplot畫圖,當滑鼠游標經過該資料點時,於其
周圍顯示出該資料點之資訊。
文章中最主要的核心,是使用了matplotlib中的Event connections相關功能。
官方的範例:
annotation
https://matplotlib.org/1.5.1/examples/pylab_examples/demo_annotation_box.html
event connections
https://matplotlib.org/users/event_handling.html
當初在寫這個功能時,沒有什麼中文資料可以參考,寫這篇文章旨在回饋網路社會。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.113.76.101
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1550499744.A.4D5.html
推
02/19 10:01,
5年前
, 1F
02/19 10:01, 1F
推
02/19 10:21,
5年前
, 2F
02/19 10:21, 2F
→
02/19 13:03,
5年前
, 3F
02/19 13:03, 3F
推
02/19 20:38,
5年前
, 4F
02/19 20:38, 4F
推
02/20 02:39,
5年前
, 5F
02/20 02:39, 5F
→
02/20 04:01,
5年前
, 6F
02/20 04:01, 6F
推
02/21 11:35,
5年前
, 7F
02/21 11:35, 7F
→
02/21 16:13,
5年前
, 8F
02/21 16:13, 8F