Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

set_url without effect for instances of Line2D #17336

Closed
Milestone
@dloeckx

Description

@dloeckx

Bug report

Bug summary
Using SVG-backend, set_url does nothing for for instances of Line2D, whereas it works for other objects.

Code for reproduction

frommatplotlibimportpyplotaspltf=plt.figure()s=plt.scatter([1,2,3], [4,5,6])s.set_urls(['http://www.bbc.co.uk/news','http://www.google.com',None])p=plt.plot([1,3], [6,5],linewidth=5,color='green')p[0].set_url('http://www.duckduckgo.com')print(s.get_urls())print(p[0].get_url())importiosvg=io.StringIO()f.savefig(svg,format='svg')assert"http://www.google.com"insvg.getvalue()assert"http://www.duckduckgo.com"insvg.getvalue()

Actual outcome

['http://www.bbc.co.uk/news', 'http://www.google.com', None]http://www.duckduckgo.com---------------------------------------------------------------------------AssertionError                            Traceback (most recent call last)<ipython-input-5-830e26be00ec> in <module>     15      16 assert "http://www.google.com" in svg.getvalue()---> 17 assert "http://www.duckduckgo.com" in svg.getvalue()

When the svg is opened in a browser, the scatter plot is clickable yet the line is not.

Expected outcome

Bothhttp://www.google.com andhttp://www.duckduckgo.com should be present in the svg. When the svg is opened in a browser, the line plot should be clickable as well.

Matplotlib version

  • Operating system: Ubuntu 18.04.3 LTS
  • Matplotlib version: 3.2.1
  • Matplotlib backend: module://ipykernel.pylab.backend_inline
  • Python version: 3.7.6 (conda)
  • Jupyter version (if applicable): 1.2.4
  • Other libraries:

I installed matplotlb and python over conda. Issue remains if I install matplotlib from pip, and run the script from the command line.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp