本稿ではJuliaによるmatplotlibを使ったインタラクティブプロット(Multi Cursor編)について紹介します.
基本的には本家サイトにあるmatplotlib.widgetsのサンプルソースの移植版です.
multi_cursor.jl
#Translated from python to julia (reffer to https://matplotlib.org/examples/widgets/multicursor.html)
#Julia v0.6.2
#PyCall v3.6.4
using PyCall
using PyPlot
const MultiCursor = matplotlib[:widgets][:MultiCursor]
t = 0:0.01:2.0
s1 = sin.(2*π*t)
s2 = sin.(4*π*t)
fig = figure()
ax1 = fig[:add_subplot](211)
ax1[:plot](t, s1)
ax2 = fig[:add_subplot](212, sharex=ax1)
ax2[:plot](t, s2)
multi = MultiCursor(fig[:canvas], (ax1, ax2), color="r", lw=1)
show()