landlab.plot.event_handler¶
Functions to interact with figures that plot Landlab grid data.
- query_grid_on_button_press(event, grid)[source]¶
Print and returns node information using an imshow plot.
This function is triggered when a mouse button is pressed on the matplotlib figure connected by event. Coordinates of grid and its node attributes are queried only when the event location is within the axes of the figure. The node whose attributes are queried is the node at the center of the cell that contains the event coordinates.
This function only works with raster model grids.
- Parameters:
event (matplotlib event) – Event associated with a figure canvas using mpl_connect().
grid (RasterModelGrid) – Grid containing the attributes to print.
- Returns:
Dictionary containing grid query results.
- Return type:
query_results