作者brad0315 (Mortis)
看板Python
标题[教学] 互动式图片 - annotation
时间Mon Feb 18 22:22:19 2019
网志好读版:
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://webptt.com/cn.aspx?n=bbs/Python/M.1550499744.A.4D5.html
1F:推 keikei5566: 谢谢大大分享 02/19 10:01
2F:推 cutekid: 推喔,猫狗分辨的分享也很棒喔(Y) 02/19 10:21
3F:→ brad0315: 感谢支持!回馈网路 02/19 13:03
4F:推 fleurami: 谢谢分享! 02/19 20:38
5F:推 uukoQAQ: 谢谢分享 02/20 02:39
6F:→ os653: 感谢分享!!! 02/20 04:01
7F:推 cia1099: 请问大大影片中用的python IDE是什麽啊? 02/21 11:35
8F:→ brad0315: 你说的应该是我自己用PyQt5写的GUI 02/21 16:13