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

urls are ignored when rendering a QuadMesh to SVG #12392

Open
Labels
backend: svgkeepItems to be ignored by the “Stale” Github Action
@pingyeh

Description

@pingyeh

Bug report

Bug summary

I've passedurls arg in theAxes.pcolormesh() method to set URLs in a QuadMesh, but when I save it to SVG the URLs are missing.

I traced it to theRendererBase.draw_quad_mesh() method which passes[None] as the urls argument toself.draw_path_collection().

Code for reproduction

importnumpyasnpimportmatplotlib.pyplotaspltnan=np.nandata=np.array([[nan,4,nan], [2,7,5], [nan,8,nan]])links=np.array([[nan,'http://abc.com/',nan],                  ['http://cnn.com/','http://nbc.com/','http://cbs.com/'],                  [nan,'http://nytimes.com',]])fig=plt.figure()ax=plt.gca()mesh=ax.pcolormesh(data,urls=links)fig.savefig('/tmp/test_links.svg')

Actual outcome

$ fgrep http /tmp/test_link.svg   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><!-- Created with matplotlib (http://matplotlib.org/) --><svg height="288pt" version="1.1" viewBox="0 0 432 288" width="432pt" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

Expected outcome

The URLs are inserted into the quadmesh element like this:

<g>  <a xlink:href="url"> <path> /* the path */ </path> </a>  <a xlink:href="url"> <path> /* the path */ </path> </a></g>

Matplotlib version

  • Operating system: Linux
  • Matplotlib version: 2.2.2
  • Matplotlib backend (print(matplotlib.get_backend())): module://ipykernel.pylab.backend_inline, but SVG is what I care about
  • Python version: 3.5.3
  • Jupyter version (if applicable): 4.4.0
  • Other libraries:

matplotlib is installed in a virtualenv with pip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend: svgkeepItems to be ignored by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp