Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added colorbar label #4930

Merged
merged 16 commits into from Jan 31, 2021
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/4930.feature.rst
@@ -0,0 +1 @@
Colorbar in `sunpy.map.GenericMap.peek` now has a unit label.
4 changes: 3 additions & 1 deletion sunpy/map/mapbase.py
Expand Up @@ -2052,7 +2052,9 @@ def peek(self, draw_limb=False, draw_grid=False,
pad = 0.12 # Pad to compensate for ticks and axes labels
else:
pad = 0.05 # Default value for vertical colorbar
figure.colorbar(im, pad=pad)
colorbar_label = str(self.unit) if self.unit is not None else ""
figure.colorbar(im, pad=pad).set_label(colorbar_label,
rotation=0, labelpad=-50, y=-0.02, size=12)
nabobalis marked this conversation as resolved.
Show resolved Hide resolved

if draw_limb:
self.draw_limb(axes=axes)
Expand Down
10 changes: 5 additions & 5 deletions sunpy/tests/figure_hashes_mpl_332_ft_261_astropy_403.json
Expand Up @@ -6,12 +6,12 @@
"sunpy.map.tests.test_plotting.test_plot_aia171": "1e5435af7bb854d47ebeabf354350f27bf989325aa5d77b930bdcdb043ce25df",
"sunpy.map.tests.test_plotting.test_plot_rotated_aia171": "06ed44d872a6e1e5ec2dd6a522ee81f68a2c8420dea1bc7491bc64d9e3d3e147",
"sunpy.map.tests.test_plotting.test_plot_aia171_clip": "241cb73a89ca5d80b9eb673e6e0fda97b842b38be3ea3f25c06e2f8aeb6a4dfc",
"sunpy.map.tests.test_plotting.test_peek_aia171": "bbff0c076e8e21d6d888898d2952183cadc25fdbd81fce808602ed51aab1cbbe",
"sunpy.map.tests.test_plotting.test_peek_grid_aia171": "711b826471e6a7e65c56fe49bb203ebcdbc084a31b94146ebec1cada65e04806",
"sunpy.map.tests.test_plotting.test_peek_grid_spacing_aia171": "23d3c95df35606cef4dc9392796412412ba06382f21203fc9b28754b713889ea",
"sunpy.map.tests.test_plotting.test_peek_limb_aia171": "9d083f30fda1aed9436e7b81b3d689d97a39db0cb2fc13e382a93dfe20be518b",
"sunpy.map.tests.test_plotting.test_peek_aia171": "66b8e96ed6c074e87ff328a9154f4dbd32c11cb9d3f83f692c47ddd2946eefe1",
"sunpy.map.tests.test_plotting.test_peek_grid_aia171": "1aa43c4ea9f3f16b0680e7679a81b5a25fb8f40d2cc2f212f0268599f349be55",
"sunpy.map.tests.test_plotting.test_peek_grid_spacing_aia171": "852dfebc9713bfc5ad991d27505b90df58bbb91f45bfc0bc0128d41a531681e8",
"sunpy.map.tests.test_plotting.test_peek_limb_aia171": "450dde954bab41a0a20f7895364a24622117925638468e8eb1db3ebee0ab370e",
"sunpy.map.tests.test_plotting.test_draw_grid_aia171": "5d7221e2d43aefffc4ef30b020fb7207b8d7f42dc5fd97dea25a6d351b7c5cc7",
"sunpy.map.tests.test_plotting.test_peek_grid_limb_aia171": "65de3e3b99ddeea2a27ebc6c65cd2d2296e08d2f0ed188599a469728b002fd2b",
"sunpy.map.tests.test_plotting.test_peek_grid_limb_aia171": "7dd97105cd9590374e4bbfcfa4f5c37666f9640e32db7086ce97e31c63e1966d",
"sunpy.map.tests.test_plotting.test_plot_aia171_nowcsaxes": "6e9cdda3aa9ed603f4be536634543ce8c1a6718b79aed57f850a187f8150446e",
"sunpy.map.tests.test_plotting.test_rectangle_aia171_width_height": "455246d338564add5be94c1dc0ff5740a90d21d8ef7da9f392ba3a01237ef5b8",
"sunpy.map.tests.test_plotting.test_rectangle_aia171_top_right": "455246d338564add5be94c1dc0ff5740a90d21d8ef7da9f392ba3a01237ef5b8",
Expand Down
10 changes: 5 additions & 5 deletions sunpy/tests/figure_hashes_mpl_dev_ft_261_astropy_dev.json
Expand Up @@ -6,12 +6,12 @@
"sunpy.map.tests.test_plotting.test_plot_aia171": "1e5435af7bb854d47ebeabf354350f27bf989325aa5d77b930bdcdb043ce25df",
"sunpy.map.tests.test_plotting.test_plot_rotated_aia171": "d07b653c762bf20478ea33e9712e4eacd7bd0a0fc8dbe16964e8b4374f40120d",
"sunpy.map.tests.test_plotting.test_plot_aia171_clip": "241cb73a89ca5d80b9eb673e6e0fda97b842b38be3ea3f25c06e2f8aeb6a4dfc",
"sunpy.map.tests.test_plotting.test_peek_aia171": "c19f20b06e6a2fb721f7d3fc9fd60653fdc73454bcd8dbbc0637ba29187008b8",
"sunpy.map.tests.test_plotting.test_peek_grid_aia171": "303f622c0c15cf5613a15c6dccb52953a52f3acb52a42f5e11c8a64a4b493086",
"sunpy.map.tests.test_plotting.test_peek_grid_spacing_aia171": "349b964410d2935abb65f8cf98ba7450fe7da53c50f2c632b5b080efc93d36f0",
"sunpy.map.tests.test_plotting.test_peek_limb_aia171": "a9c991bcc89fb2901437cd72f6b5bf82a3f7c2b5d5486c81acb217b1ba95f1e4",
"sunpy.map.tests.test_plotting.test_peek_aia171": "66b8e96ed6c074e87ff328a9154f4dbd32c11cb9d3f83f692c47ddd2946eefe1",
"sunpy.map.tests.test_plotting.test_peek_grid_aia171": "1aa43c4ea9f3f16b0680e7679a81b5a25fb8f40d2cc2f212f0268599f349be55",
"sunpy.map.tests.test_plotting.test_peek_grid_spacing_aia171": "852dfebc9713bfc5ad991d27505b90df58bbb91f45bfc0bc0128d41a531681e8",
"sunpy.map.tests.test_plotting.test_peek_limb_aia171": "450dde954bab41a0a20f7895364a24622117925638468e8eb1db3ebee0ab370e",
"sunpy.map.tests.test_plotting.test_draw_grid_aia171": "5d7221e2d43aefffc4ef30b020fb7207b8d7f42dc5fd97dea25a6d351b7c5cc7",
"sunpy.map.tests.test_plotting.test_peek_grid_limb_aia171": "58247a0ca97e3a453bd3a78d15feb391767de6c7fd7e4940bd081db1b0f4faaa",
"sunpy.map.tests.test_plotting.test_peek_grid_limb_aia171": "7dd97105cd9590374e4bbfcfa4f5c37666f9640e32db7086ce97e31c63e1966d",
"sunpy.map.tests.test_plotting.test_plot_aia171_nowcsaxes": "6e9cdda3aa9ed603f4be536634543ce8c1a6718b79aed57f850a187f8150446e",
"sunpy.map.tests.test_plotting.test_rectangle_aia171_width_height": "455246d338564add5be94c1dc0ff5740a90d21d8ef7da9f392ba3a01237ef5b8",
"sunpy.map.tests.test_plotting.test_rectangle_aia171_top_right": "455246d338564add5be94c1dc0ff5740a90d21d8ef7da9f392ba3a01237ef5b8",
Expand Down