I need to build a tool/add-in for ArcGIS 10 which will display a time distribution plot at the location where mouse is clicked. The TOC consists of results of a simulation at different time instants. For the clicked point, the tool should read-in the output values at different time instants from TOC and plot it as a graph and show it as a pop-up.

So far, I have managed to draw the time distribution graphs for a set of points stored in a shapefile and save it to a working folder with a Python script but couldn't manage to get X,Y coordinates for the clicked point and enter it as input and then display the plot at the end. I have really no idea if Python supports mouse-click events like VB does.

If it is not possible with Python, which other language should I turn to (e.g., VB.net)?


Yes, mouse events are supported in Python add-ins, check the onMouseDown, onMouseDownMap, onMouseUp and onMouseUpMap functions on the Python addin Tool class page.

For a practical example check also this Esri technical article: How To: Capture map coordinates with a mouse click using Python

| improve this answer | |
  • Thanks @GISGe for your answer...I will go through Python add-ins and figure out how to do it...And how will I manage graph in a pop-up? With a messagebox? – ShS Aug 18 '16 at 12:33
  • I thought you had completed this part. What about the Make Graph tool? If you use it in ArcMap it should display the graph as a popup. – GISGe Aug 18 '16 at 12:38
  • never used the Make Graph tool....I've used matplotlib in python to plot the graphs...I wonder if a msgbox can output the created graphs....Thanks for your hint though... – ShS Aug 18 '16 at 13:03
  • @ShS you can't use a msgbox. Use arcpy.Graph() and the arcpy.MakeGraph_management tool. – user2856 Aug 22 '16 at 23:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.