Title: [Doc]: alpha setting for annotation `TextArea` · Issue #24390 · matplotlib/matplotlib · GitHub
Open Graph Title: [Doc]: alpha setting for annotation `TextArea` · Issue #24390 · matplotlib/matplotlib
X Title: [Doc]: alpha setting for annotation `TextArea` · Issue #24390 · matplotlib/matplotlib
Description: Bug summary I've been adding annotations following the excellent examples at AnnotationBbox demo, but I'd like to make the text box transparent. From the TextArea docs it looks like my_text_area.set(alpha=x) should work, but it doesn't s...
Open Graph Description: Bug summary I've been adding annotations following the excellent examples at AnnotationBbox demo, but I'd like to make the text box transparent. From the TextArea docs it looks like my_text_area.se...
X Description: Bug summary I've been adding annotations following the excellent examples at AnnotationBbox demo, but I'd like to make the text box transparent. From the TextArea docs it looks like my_text...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/24390
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Doc]: alpha setting for annotation `TextArea`","articleBody":"### Bug summary\n\nI've been adding annotations following the excellent examples at [AnnotationBbox demo](https://matplotlib.org/stable/gallery/text_labels_and_annotations/demo_annotation_box.html#sphx-glr-gallery-text-labels-and-annotations-demo-annotation-box-py), but I'd like to make the text box transparent. From the [TextArea docs](https://matplotlib.org/stable/api/offsetbox_api.html#matplotlib.offsetbox.TextArea.set) it looks like `my_text_area.set(alpha=x)` should work, but it doesn't seem to have any effect.\r\n\r\nPerhaps there is another way to set this that I have missed?\n\n### Code for reproduction\n\n```python\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.offsetbox import TextArea, AnnotationBbox\r\n\r\nimport numpy as np\r\n\r\nrng = np.random.default_rng()\r\n\r\ndata = rng.normal(size=30)\r\n\r\nplt.rcdefaults()\r\n\r\n_ , ax = plt.subplots()\r\nax.hist(data)\r\n\r\noffsetbox = TextArea('Look over there!')\r\noffsetbox.set(alpha=0.3)\r\n\r\nab = AnnotationBbox(offsetbox, (0.8, 0.8),\r\n xybox=(0, 1),\r\n xycoords='axes fraction',\r\n boxcoords='data',\r\n arrowprops=dict(arrowstyle=\"-\u003e\"))\r\n\r\nax.add_artist(ab)\r\n\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\nThe text box should be transparent.\n\n### Additional information\n\nI tried a few versions back to 3.3, but the result was the same.\n\n### Operating system\n\nRHEL7\n\n### Matplotlib Version\n\n3.6.2\n\n### Matplotlib Backend\n\nQtAgg\n\n### Python version\n\n3.8.13\n\n### Jupyter version\n\nN/A\n\n### Installation\n\nconda","author":{"url":"https://github.com/rcomer","@type":"Person","name":"rcomer"},"datePublished":"2022-11-07T14:15:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/24390/matplotlib/issues/24390"}
| 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:c9c13b78-2d4e-ea00-77e8-7f7a178bde92 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB00:1D8CC3:1D08EB:27733A:6A51B666 |
| html-safe-nonce | ed82820d499dd97e3ec3d6498c2af8b06e83da90c2f3aeb0b46c37425b6c0717 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjAwOjFEOENDMzoxRDA4RUI6Mjc3MzNBOjZBNTFCNjY2IiwidmlzaXRvcl9pZCI6IjUxMzM0MjQxNDMyMjQ2NDkzMTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cf856ce40d4ba4b3be1ce00c0e2047b7d849b401b2c0f61a6867b50da1a39e3d |
| hovercard-subject-tag | issue:1438440572 |
| 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/24390/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6b608dc1303c67fa43fcd3948cd7672ddf01e0a8267dc6658018621090efb8a5/matplotlib/matplotlib/issues/24390 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6b608dc1303c67fa43fcd3948cd7672ddf01e0a8267dc6658018621090efb8a5/matplotlib/matplotlib/issues/24390 |
| og:image:alt | Bug summary I've been adding annotations following the excellent examples at AnnotationBbox demo, but I'd like to make the text box transparent. From the TextArea docs it looks like my_text_area.se... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rcomer |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width