Title: referencing a plot_directive plot does not work · Issue #9346 · matplotlib/matplotlib · GitHub
Open Graph Title: referencing a plot_directive plot does not work · Issue #9346 · matplotlib/matplotlib
X Title: referencing a plot_directive plot does not work · Issue #9346 · matplotlib/matplotlib
Description: Bug report Bug summary A figure created with plot_directive and preceeding label cannot be referenced with :ref: or :numref:. Code for reproduction .. _bar: Testplot -------- .. _foo: .. plot:: import matplotlib.pyplot as plt import nump...
Open Graph Description: Bug report Bug summary A figure created with plot_directive and preceeding label cannot be referenced with :ref: or :numref:. Code for reproduction .. _bar: Testplot -------- .. _foo: .. plot:: imp...
X Description: Bug report Bug summary A figure created with plot_directive and preceeding label cannot be referenced with :ref: or :numref:. Code for reproduction .. _bar: Testplot -------- .. _foo: .. plot:: imp...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/9346
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"referencing a plot_directive plot does not work","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nA figure created with `plot_directive` and preceeding label cannot be referenced with `:ref:` or `:numref:`.\r\n\r\n**Code for reproduction**\r\n\r\n```rst\r\n.. _bar:\r\n\r\nTestplot\r\n--------\r\n\r\n.. _foo:\r\n\r\n.. plot::\r\n\r\n import matplotlib.pyplot as plt\r\n import numpy as np\r\n plt.hist(np.random.randn(1000), 20)\r\n\r\nreference to plot: :ref:`foo` / :numref:`foo`\r\n\t\r\nreference to section: :ref:`bar` / :numref:`bar`\r\n```\r\n\r\n**Actual outcome**\r\n\r\nrendered HTML\r\n\r\n\r\n\r\nLaTeX code\r\n\r\n```latex\r\n\\subsection{Testplot}\r\n\\label{\\detokenize{M01/index:testplot}}\\label{\\detokenize{M01/index:bar}}\\phantomsection\\label{\\detokenize{M01/index:foo}}\r\n\\begin{figure}[H]\r\n\\centering\r\n\r\n\\noindent\\sphinxincludegraphics{{index-1}.pdf}\r\n\\end{figure}\r\n\r\nreference to plot: \\DUrole{xref,std,std-ref}{foo} / \\sphinxcode{foo}\r\n\r\nreference to section: {\\hyperref[\\detokenize{M01/index:bar}]{\\sphinxcrossref{\\DUrole{std,std-ref}{Testplot}}}} / \\hyperref[\\detokenize{M01/index:bar}]{Section \\ref{\\detokenize{M01/index:bar}}}\r\n```\r\n\r\n**Expected outcome**\r\n\r\nThe `foo` references should be links like the `bar` references.\r\n\r\n**Matplotlib version**\r\n * Operating system: Linux 4.10.0-35-generic 39~16.04.1-Ubuntu 16.04.3 LTS SMP x86_64 GNU/Linux\r\n * Matplotlib version: 2.1.0 via pip\r\n * Python version: 3.5.2\r\n * Other libraries: Sphinx (sphinx-build) 1.6.4\r\n\r\n\r\n","author":{"url":"https://github.com/quantenschaum","@type":"Person","name":"quantenschaum"},"datePublished":"2017-10-10T16:56:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/9346/matplotlib/issues/9346"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8f6179a1-0d1d-2366-9186-99d4d6fb8ec7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D0B4:1D00CE:36C506:48C487:6A529059 |
| html-safe-nonce | c744df55f84568d7bb2f65db9869eec7b7a5b55a216fdb19ae4c482436d28489 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMEI0OjFEMDBDRTozNkM1MDY6NDhDNDg3OjZBNTI5MDU5IiwidmlzaXRvcl9pZCI6IjEzMTA3ODM4NDExMDM5NDE3MjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 16ca5dad0126c8ffad8e0e658ab69a87b9e874ea775abf4b83e0d3adb666570f |
| hovercard-subject-tag | issue:264302149 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/9346/issue_layout |
| twitter:image | https://opengraph.githubassets.com/390de8cf70a661be02084a8825c4ea0351862c63364b39000c6f59059dd17935/matplotlib/matplotlib/issues/9346 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/390de8cf70a661be02084a8825c4ea0351862c63364b39000c6f59059dd17935/matplotlib/matplotlib/issues/9346 |
| og:image:alt | Bug report Bug summary A figure created with plot_directive and preceeding label cannot be referenced with :ref: or :numref:. Code for reproduction .. _bar: Testplot -------- .. _foo: .. plot:: imp... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | quantenschaum |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width