# How to modify plot on click?

**URL:** https://discourse.julialang.org/t/how-to-modify-plot-on-click/95419
**Category:** General Usage
**Tags:** plot
**Created:** [March 2, 2023, 12:34am UTC](https://discourse.julialang.org/t/how-to-modify-plot-on-click/95419 "2023-03-02T00:34:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Alseidon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alseidon/32/207775_2.png) [@Alseidon](https://discourse.julialang.org/u/Alseidon)
#### Post date: [March 2, 2023, 12:34am UTC](https://discourse.julialang.org/t/how-to-modify-plot-on-click/95419/1 "2023-03-02T00:34:16Z")

</div>

The other day, I saw a research presenting a graph where he added points where he clicked and did arbitrary logic on them upon adding them (to be precise, it was a Poincaré section, and adding a point computed and showed its orbit). I know he used pgplot5 with C, but I’ve been trying to replicate this in Julia since then, without success. I couldn’t get the PGPlot.jl or PGFPlotX.jl examples to work, and the closest I could get was with PlotlyJS and this example [Click events in Julia](https://plotly.com/julia/click-events/) However, there it seems like only clicking on existing data would work; I could not click on an empty space to add a point there. I could do a scatter mesh to cover the plane, but that is a bit tedious; do you know any way to properly reproduce the target behaviour?

PS: note that this is my first time with any of those packages, so I may be missing obvious solutions; sorry in advance for that!
