Title: matplotlib dev: What happened to figure.dpi ? · Issue #19928 · matplotlib/matplotlib · GitHub
Open Graph Title: matplotlib dev: What happened to figure.dpi ? · Issue #19928 · matplotlib/matplotlib
X Title: matplotlib dev: What happened to figure.dpi ? · Issue #19928 · matplotlib/matplotlib
Description: This morning, we got a new error testing against matplotlib dev. Example log at https://app.circleci.com/pipelines/github/astropy/astropy/4691/workflows/582b72af-3420-4af5-a185-f0e41601edfd/jobs/86623 _______________________ test_no_nump...
Open Graph Description: This morning, we got a new error testing against matplotlib dev. Example log at https://app.circleci.com/pipelines/github/astropy/astropy/4691/workflows/582b72af-3420-4af5-a185-f0e41601edfd/jobs/86...
X Description: This morning, we got a new error testing against matplotlib dev. Example log at https://app.circleci.com/pipelines/github/astropy/astropy/4691/workflows/582b72af-3420-4af5-a185-f0e41601edfd/jobs/86...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19928
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"matplotlib dev: What happened to figure.dpi ?","articleBody":"This morning, we got a new error testing against matplotlib dev. Example log at https://app.circleci.com/pipelines/github/astropy/astropy/4691/workflows/582b72af-3420-4af5-a185-f0e41601edfd/jobs/86623\r\n\r\n```\r\n_______________________ test_no_numpy_warnings[contours] _______________________\r\n\r\nignore_matplotlibrc = None\r\ntmpdir = local('/tmp/pytest-of-root/pytest-0/test_no_numpy_warnings_contour0')\r\ngrid_type = 'contours'\r\n\r\n @pytest.mark.parametrize('grid_type', ['lines', 'contours'])\r\n def test_no_numpy_warnings(ignore_matplotlibrc, tmpdir, grid_type):\r\n ax = plt.subplot(1, 1, 1, projection=WCS(TARGET_HEADER))\r\n ax.imshow(np.zeros((100, 200)))\r\n ax.coords.grid(color='white', grid_type=grid_type)\r\n \r\n with pytest.warns(None) as warning_lines:\r\n\u003e plt.savefig(tmpdir.join('test.png').strpath)\r\n\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/astropy/visualization/wcsaxes/tests/test_misc.py:80: \r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/pyplot.py:956: in savefig\r\n fig.canvas.draw_idle() # need this if 'transparent=True' to reset colors\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/backend_bases.py:2058: in draw_idle\r\n self.draw(*args, **kwargs)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py:406: in draw\r\n self.figure.draw(self.renderer)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/artist.py:74: in draw_wrapper\r\n result = draw(artist, renderer, *args, **kwargs)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/artist.py:51: in draw_wrapper\r\n return draw(artist, renderer, *args, **kwargs)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/figure.py:2727: in draw\r\n renderer, self, artists, self.suppressComposite)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/image.py:132: in _draw_list_compositing_images\r\n a.draw(renderer)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/astropy/visualization/wcsaxes/core.py:459: in draw\r\n super().draw(renderer, **kwargs)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/artist.py:51: in draw_wrapper\r\n return draw(artist, renderer, *args, **kwargs)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/_api/deprecation.py:421: in wrapper\r\n return func(*inner_args, **inner_kwargs)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/axes/_base.py:3102: in draw\r\n mimage._draw_list_compositing_images(renderer, self, artists)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/image.py:132: in _draw_list_compositing_images\r\n a.draw(renderer)\r\n../../.tox/py37-test-image-mpldev/lib/python3.7/site-packages/matplotlib/artist.py:51: in draw_wrapper\r\n return draw(artist, renderer, *args, **kwargs)\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\nself = \u003cmatplotlib.collections.PathCollection object at 0x7f51ca1ac128\u003e\r\nrenderer = \u003cmatplotlib.backends.backend_agg.RendererAgg object at 0x7f51cc0a0ef0\u003e\r\n\r\n @artist.allow_rasterization\r\n def draw(self, renderer):\r\n\u003e self.set_sizes(self._sizes, self.figure.dpi)\r\nE AttributeError: 'NoneType' object has no attribute 'dpi'\r\n```\r\n\r\n# bisect attempt\r\n\r\nd49696aba62820ce4bab41ae4a8508743e39a0e4 is the first bad commit\r\n\r\n```\r\ncommit d49696aba62820ce4bab41ae4a8508743e39a0e4\r\nAuthor: Jody Klymak \u003c...\u003e\r\nDate: Sun Mar 14 14:08:50 2021 -0700\r\n\r\n New doc gallery for plot_types\r\n\r\n```\r\n\r\n# Update: I don't think this is true actually... I have no idea what is going on\r\n\r\nI think I traced it to https://github.com/astropy/astropy/blob/796b585f989319b766979df2110e0b4fa94a43a1/astropy/visualization/mpl_style.py#L63 . However, I am not sure if I should simply remove this setting or there is a new way to set it. Any advise would be greatly appreciated. Thanks!\r\n\r\n```python\r\n# Version 1 astropy plotting style for matplotlib\r\nastropy_mpl_style_1 = {\r\n # ...\r\n # Other\r\n 'savefig.dpi': 72,\r\n}\r\n```","author":{"url":"https://github.com/pllim","@type":"Person","name":"pllim"},"datePublished":"2021-04-09T14:21:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/19928/matplotlib/issues/19928"}
| 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:ffd992c0-0e19-7002-e95a-d999b3e5f041 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C27C:12A1BB:1D29CD:27897F:6A528699 |
| html-safe-nonce | 9a3a3ed1152c997cc06fcdb2b9fec2923658ad69c918df2ec91e0d8dbd76e634 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjdDOjEyQTFCQjoxRDI5Q0Q6Mjc4OTdGOjZBNTI4Njk5IiwidmlzaXRvcl9pZCI6IjY5Njc3NDk5ODY0MDE5OTMyMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3d6ee042e71aca5a079855209812ea7764f9eecf1f0e290c38bb8321ac260917 |
| hovercard-subject-tag | issue:854571830 |
| 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/19928/issue_layout |
| twitter:image | https://opengraph.githubassets.com/331b8fbeb6b8f4f2d03e16a183edb0aad32f9db0f825dc9b5cad9f4d2f90ddbc/matplotlib/matplotlib/issues/19928 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/331b8fbeb6b8f4f2d03e16a183edb0aad32f9db0f825dc9b5cad9f4d2f90ddbc/matplotlib/matplotlib/issues/19928 |
| og:image:alt | This morning, we got a new error testing against matplotlib dev. Example log at https://app.circleci.com/pipelines/github/astropy/astropy/4691/workflows/582b72af-3420-4af5-a185-f0e41601edfd/jobs/86... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pllim |
| 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