I am trying to make an interactive plot a bit more useful. I started by adding my own format_coords
function to show me the data in the plot rather than the mouse position.
The plots grew in complexity, and now there are numerous series in the plot. The formatted coordinates (one value for each series) no longer fits in the tool bar any longer. I did some things to work around this problem( adding spaces and newlines), but it's just ugly and difficult to read.
Is there a way to create an external window that isn't in the matplotlib figure in which I could use to display the current data where the mouse pointer is?
I've seen a number of things about using matplotlib within another application (e.g. How can I create a frontend for matplotlib?), but I want to go the other direction, if possible.
I don't want to create a whole new application, but I do want to create a frame with a column/grid of name: value pairs that get updated any time format_coord
gets called.
Is such a thing possible (and feasible)?
ADDENDUM
I'm primarily plotting ordinary numerical data as lines ('.-'
). In order to get to the correct data inside format_coord
, I set some (custom) attributes of the axes object, though for a simple example, this would not be necessary. The data could look like this:
Timestamp Axis0.ActualPosition Axis0.ActualVelocity
1000 639699159 -146323.0 -323
1001 639699160 -146646.0 -323
1002 639699161 -146969.0 -323
1003 639699162 -147295.0 -326
1004 639699163 -147624.0 -329
... ... ...
1095 639699254 -177474.0 -328
1096 639699255 -177803.0 -329
1097 639699256 -178132.0 -329
1098 639699257 -178460.0 -328
1099 639699258 -178787.0 -327
I imagine the "reporting" window to look something like this:
I'd prefer to be able to apply some formatter function to the values, which is what I'm currently doing inside my format_coord
function. My current code has all that, it's just creating and handling the other window that I don't know how to do.
The button(s) at the bottom of the window would be extra cool, because they'd allow me to do some useful stuff, but they're not essential to the problem that having this external window would solve.
I expect that the data in the extra dialog/frame would get updated every time format_coord
is invoked.