Ticks no showing url in svg

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Ticks no showing url in svg

Jose Manuel
I am trying to extend the example in
https://github.com/matplotlib/matplotlib/blob/master/examples/misc/hyperlinks_sgskip.py
to deal with hyperlinks in the ticks, but I am failing miserabily.

My test code for matplotlib 2.1.0 is:

import matplotlib as mpl
mpl.use('SVG')
import matplotlib.pyplot as plt

f = plt.figure()
ax = f.gca()
s = plt.scatter([1, 2, 3], [4, 5, 6])
s.set_urls(['http://www.bbc.co.uk/news', 'http://www.google.com', None])
for tick, pos, label in ax.yaxis.iter_ticks():
    tick.set_url('http://www.python.org')
    print(tick.get_url(), pos, label)
f.savefig('scatter.svg')

I get:

http://www.python.org 3.75 3.75
http://www.python.org 4.0 4.00
http://www.python.org 4.25 4.25
.....
http://www.python.org 6.25 6.25

But, the svg file generated has nothing of the ticks links:
> grep python scatter.svg

...while it does for the scatter plot links, for instance:
 > egrep google scatter.svg
    <a xlink:href="http://www.google.com">

Am I missing something to make this work?

Many thanks in advance for any hint!
Jose
_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users