title: Absolute positions in mpld3 graphs
body: <p>I'm trying to define a custom plugin for <a href="https://mpld3.github.io/" rel="nofollow noreferrer"><code>mpld3</code></a>, and I'm struggling with positions. More particularly, by default, SVG generated by <code>mpld3</code> come with <code>Move</code> and <code>Zoom</code> buttons, which change the view of the graph. When I was trying to display things (like text), I stumbled upon a strange behavior where positions are set <strong>relatively</strong> to the current view. It means that if I display a text next to a point <code>A(10,10)</code> and then move the view, the point will still be at <code>(10,10)</code> but the text will move because its position is relative to the current view.</p>
  <p>So I wanted to think again and start with a minimal example which should work : <a href="https://mpld3.github.io/examples/mouse_position.html" rel="nofollow noreferrer">this example</a> from the <code>mpld3</code> documentation. In the demo, you can see the behavior I want : positions are absolute (when you move the view, cursor position is set according to the grid).<a href="https://i.stack.imgur.com/BoAZJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BoAZJ.png" alt="enter image description here" /></a>.</p>
  <p>But if I copy-paste the <strong>exact same code</strong> in Pycharm and execute it, positions are relative to the view which is even more strange : <a href="https://i.stack.imgur.com/z8fqL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/z8fqL.png" alt="enter image description here" /></a></p>
  <p>My guess is it's a <em>version</em> problem. I don't know which versions are used in the hosted demo example. I use <code>mpld3==0.5.1</code>, <code>matplotlib==3.2.1</code> and <code>numpy==1.19.2</code>.</p>
  <p>Do you have an idea so I can manage to deal with <strong>absolute</strong> positions like in the example ?</p>