PyPlot
랩
감사하기 matplotlib, 및하기 matplotlib는 이벤트 처리를 지원합니다. matplotlib event handling docs here을 읽으십시오. 이것은 첫 번째 예제의 모든 기능이 Julia로 번역 된 것입니다. [PyCall
문서] 2을 참조하여 pyobject[:symbol]
구문에 대해 읽어 보시기 바랍니다.
julia> using PyPlot
julia> fig=figure()
PyPlot.Figure(PyObject <matplotlib.figure.Figure object at 0x1159d3f90>)
julia> function onclick(event)
println(event)
println((event[:xdata],event[:ydata],event[:x],event[:y]))
end
onclick (generic function with 1 method)
julia> fig[:canvas][:mpl_connect]("button_press_event",onclick)
6
julia> PyObject <matplotlib.backend_bases.MouseEvent object at 0x131d5d110>
(nothing, nothing, 385, 388.0)
PyObject <matplotlib.backend_bases.MouseEvent object at 0x131d5d410>
(nothing, nothing, 365, 256.0)
PyObject <matplotlib.backend_bases.MouseEvent object at 0x131d5d3d0>
(nothing, nothing, 429, 337.0)
마지막 여섯 줄은 나에게서 무작위로 나타나는 빈 그림을 클릭하는 것입니다. "개체 따기"섹션을 살펴 보는 것이 좋습니다.