Title: colorbar set_ticklabels - text properties not working · Issue #20296 · matplotlib/matplotlib · GitHub
Open Graph Title: colorbar set_ticklabels - text properties not working · Issue #20296 · matplotlib/matplotlib
X Title: colorbar set_ticklabels - text properties not working · Issue #20296 · matplotlib/matplotlib
Description: Bug report Bug summary Unable to set label color or other text properties Code for reproduction from mpl_toolkits.axes_grid1.inset_locator import inset_axes fig, ax = plt.subplots(figsize=(5,6),dpi=200) #hiding the axis numbers ax.axes.x...
Open Graph Description: Bug report Bug summary Unable to set label color or other text properties Code for reproduction from mpl_toolkits.axes_grid1.inset_locator import inset_axes fig, ax = plt.subplots(figsize=(5,6),dpi...
X Description: Bug report Bug summary Unable to set label color or other text properties Code for reproduction from mpl_toolkits.axes_grid1.inset_locator import inset_axes fig, ax = plt.subplots(figsize=(5,6),dpi...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/20296
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"colorbar set_ticklabels - text properties not working","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nUnable to set label color or other text properties\r\n\r\n**Code for reproduction**\r\n\r\n from mpl_toolkits.axes_grid1.inset_locator import inset_axes\r\n\r\n fig, ax = plt.subplots(figsize=(5,6),dpi=200)\r\n \r\n #hiding the axis numbers\r\n ax.axes.xaxis.set_visible(False)\r\n ax.axes.yaxis.set_visible(False)\r\n \r\n #setting the axis dimensions\r\n ax.set_xlim((-250, 250))\r\n ax.set_ylim((422.5, -47.5))\r\n \r\n #setting the background color as black ('k') for a better visualization\r\n ax.set_facecolor('k')\r\n fig.set_facecolor('k')\r\n\r\n cbaxes = inset_axes(ax, width=\"5%\", \r\n height=\"50%\", \r\n loc='lower left',\r\n bbox_to_anchor=(.7, 0.07, 5, .08),\r\n bbox_transform=ax.transAxes,\r\n borderpad=0,\r\n )\r\n bar_palette = mpl.cm.inferno\r\n bar = mpl.colorbar.ColorbarBase(cbaxes, cmap=bar_palette, orientation='horizontal')\r\n \r\n # creating ticks \r\n bar.set_ticks([0,1])\r\n bar.set_ticklabels(ticklabels=['Low', 'High'], color='white')\r\n \r\n\r\n**Actual outcome**\r\nTypeError: set_ticklabels() got an unexpected keyword argument 'color'\r\n\r\n**Expected outcome**\r\nI need the labels to be white because the background is black\r\n **_IMPORTANT_**\r\n If you put 'white' instead of 'k' in **ax.set_facecolor('k')** and remove color='white' from **bar.set_ticklabels** \r\n you can see that the labels are properly created, but they are black and apparently there is no way to make them \r\n change.\r\n\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Mac OS Big Sur\r\n * Matplotlib version: 3.4.0 \r\n * Matplotlib backend : module://ipykernel.pylab.backend_inline\r\n * Python version: 3.9.2\r\n\r\n\r\nThanks to anyone who can help!","author":{"url":"https://github.com/trafra99","@type":"Person","name":"trafra99"},"datePublished":"2021-05-24T21:11:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/20296/matplotlib/issues/20296"}
| 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:1cb680a3-21dc-9b24-a620-82d36d9e4c24 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C69C:21C8FC:1060A3:165ACA:6A5259DB |
| html-safe-nonce | 2c50e4dfe1d099b0c5e2af28c01ee026d9393d0f69e790b1e14c26eada830553 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNjlDOjIxQzhGQzoxMDYwQTM6MTY1QUNBOjZBNTI1OURCIiwidmlzaXRvcl9pZCI6IjM1MTk4OTMwMjg0ODY2NjY3MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d75f59c78ace8d83da84246b907e777cc88b2a31038f811edb6b8436ed19ae72 |
| hovercard-subject-tag | issue:900011005 |
| 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/20296/issue_layout |
| twitter:image | https://opengraph.githubassets.com/64a7b3a1a2ac3d3561c06563c270ed52cc9c5a6eef0bd6200776e8fd39d66920/matplotlib/matplotlib/issues/20296 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/64a7b3a1a2ac3d3561c06563c270ed52cc9c5a6eef0bd6200776e8fd39d66920/matplotlib/matplotlib/issues/20296 |
| og:image:alt | Bug report Bug summary Unable to set label color or other text properties Code for reproduction from mpl_toolkits.axes_grid1.inset_locator import inset_axes fig, ax = plt.subplots(figsize=(5,6),dpi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trafra99 |
| 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