Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <a href="https://stackoverflow.com/search?q=matplotlib+interactive+svg">stackoverflow search</a> finds an <a href="https://stackoverflow.com/questions/8994357/want-to-make-static-svg-plot-from-matplotlib-interactive-via-the-browser/10542968#10542968">answer</a> to this which points to an <a href="http://matplotlib.org/examples/user_interfaces/svg_histogram.html" rel="nofollow noreferrer">example on matplotlib.org</a>. Assuming that the user will open this file in a web browser, this should work. If he opens it with Inkscape or a static SVG viewer, then there's no way to give him an interactive experience. You could of course also upload the chart and send him a link. This would probably be most convenient and make sure he views it in a browser.</p> <p>Alternatively, consider using <a href="http://d3js.org/" rel="nofollow noreferrer">d3.js</a> instead of matplotlib. It uses JavaScript generated SVG and has amazing charting features. It might be easier to add the desired interactive behavior to those.</p> <p>A quick solution for displaying information when the mouse hovers above some element is using the <code>&lt;title&gt;</code> element in SVG. The content of any <code>&lt;title&gt;</code> element will be displayed as a tootlip on hover. See <a href="http://tinkerbin.com/LkHSyW9j" rel="nofollow noreferrer">this example</a>:</p> <pre><code>&lt;svg xmlns="http://www.w3.org/2000/svg" width="1000" height="150"&gt; &lt;rect width="50" height="50"&gt; &lt;title&gt;This is a rectangle&lt;/title&gt; &lt;/rect&gt; &lt;circle cx="75" cy="75" r="25"&gt; &lt;title&gt;This is a circle&lt;/title&gt; &lt;/circle&gt; &lt;text y="120"&gt; &lt;tspan&gt;Move your mouse over the&lt;/tspan&gt; &lt;tspan x="0" dy="20"&gt;elements to see the title text.&lt;/tspan&gt; &lt;/text&gt; &lt;/svg&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload