Title: Why does `set_fontproperties` copy? · Issue #3356 · matplotlib/matplotlib · GitHub
Open Graph Title: Why does `set_fontproperties` copy? · Issue #3356 · matplotlib/matplotlib
X Title: Why does `set_fontproperties` copy? · Issue #3356 · matplotlib/matplotlib
Description: The set_fontproperties method of Text copies the FontProperties instance: if is_string_like(fp): fp = FontProperties(fp) self._fontproperties = fp.copy() this prevents doing stuff like: fnt = FontProperties(family = 'Arial', size = 12) #...
Open Graph Description: The set_fontproperties method of Text copies the FontProperties instance: if is_string_like(fp): fp = FontProperties(fp) self._fontproperties = fp.copy() this prevents doing stuff like: fnt = FontP...
X Description: The set_fontproperties method of Text copies the FontProperties instance: if is_string_like(fp): fp = FontProperties(fp) self._fontproperties = fp.copy() this prevents doing stuff like: fnt = FontP...
Mail addresses
notifications@github.com
notifications@github.com
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3356
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Why does `set_fontproperties` copy?","articleBody":"The `set_fontproperties` method of `Text` copies the `FontProperties` instance:\n\n```\nif is_string_like(fp):\n fp = FontProperties(fp)\n self._fontproperties = fp.copy()\n```\n\nthis prevents doing stuff like:\n\n```\nfnt = FontProperties(family = 'Arial', size = 12)\n\n# Make titles share the same font properties\naxes.set_xlabel('xlabel', fontproperties = fnt)\naxes.set_ylabel('ylabel', fontproperties = fnt)\naxes.set_title('Title', fontproperties = fnt)]\n\n# But a change in the font object is not reflected in the text properties..\nfnt.set_family('Times New Roman')\nfnt.set_size(14)\n```\n\nIdeally, I would have the `fontproperties` attribute of `Text` be a reference to a `FontProperties` instance and leave it up to the user to decide whether they need a copy or not?\n","author":{"url":"https://github.com/JamesRamm","@type":"Person","name":"JamesRamm"},"datePublished":"2014-08-09T07:21:10Z","url":"https://github.com/matplotlib/matplotlib/issues/3356"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:88d0bb6d-a39d-2bae-2504-e5766b34b057 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E27E:395268:21AD7A6:2C7B15B:6B069892 |
| html-safe-nonce | 38be700652872a92a7d508f00dc726334456b1d7c019d47f03f500cfcf14c407 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjdFOjM5NTI2ODoyMUFEN0E2OjJDN0IxNUI6NkIwNjk4OTIiLCJ2aXNpdG9yX2lkIjoiODI4NTYzNzg2MTY4MTA0MzYwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 99397a328d5d56faa3e0dd73d7c742f0bf5b4ece8e3720808b0a4e29f6d23412 |
| hovercard-subject-tag | issue:39880293 |
| 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/3356/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ed1c30abeeea8e035f3cb47fdf0951d40131c08771f05af8dab9cb8d005b9d02/matplotlib/matplotlib/issues/3356 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ed1c30abeeea8e035f3cb47fdf0951d40131c08771f05af8dab9cb8d005b9d02/matplotlib/matplotlib/issues/3356 |
| og:image:alt | The set_fontproperties method of Text copies the FontProperties instance: if is_string_like(fp): fp = FontProperties(fp) self._fontproperties = fp.copy() this prevents doing stuff like: fnt = FontP... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JamesRamm |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a |
| 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 | 6d3909414814ff86ce7da4c51a0f4918a13fb41b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width