Title: bbox_inches='tight' clips figure.suptitle · Issue #688 · matplotlib/matplotlib · GitHub
Open Graph Title: bbox_inches='tight' clips figure.suptitle · Issue #688 · matplotlib/matplotlib
X Title: bbox_inches='tight' clips figure.suptitle · Issue #688 · matplotlib/matplotlib
Description: In ipython for the qtconsole and notebook, we send inline figures using fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight') as seen here. However, this produces truncated figure titles. Consider this code: f, ax = plt.subp...
Open Graph Description: In ipython for the qtconsole and notebook, we send inline figures using fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight') as seen here. However, this produces truncated figure titl...
X Description: In ipython for the qtconsole and notebook, we send inline figures using fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight') as seen here. However, this produces truncated fig...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/688
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bbox_inches='tight' clips figure.suptitle","articleBody":"In ipython for the qtconsole and notebook, we send inline figures using\n\n```\nfig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight')\n```\n\nas seen [here](https://github.com/ipython/ipython/blob/master/IPython/core/pylabtools.py#L104).\n\nHowever, this produces truncated figure titles. Consider this code:\n\n``` python\nf, ax = plt.subplots()\nax.plot(rand(100))\nax.set_title('Axis title')\nf.suptitle('Figure title');\n```\n\nwhich produces this in the notebook:\n\n\n\nA slightly more complicated example, using basemap, not only truncates the title but also all the x and y labels. We show it here for reference, but as @jswhit (basemap author) pointed out over email, basemap labels are located at arbitrary positions and so it's harder for matplotlib to take them into consideration.\n\n``` python\nfrom mpl_toolkits.basemap import Basemap\n\nlon0, lat0, lon1, lat1 = (84.38, 26.22, 88.9, 29.8)\nresolution = 'i'\n\nparallels = np.linspace(lat0, lat1, 5)\nmeridians = np.linspace(lon0, lon1, 5)\n\nf, ax = plt.subplots()\nm = Basemap(lon0, lat0, lon1, lat1, resolution=resolution, ax=ax)\nm.drawcountries(color=(1,1,0)) # country boundaries in pure yellow\nm.drawrivers(color=(0,1,1)) # rivers in cyan\nm.bluemarble() # NASA bluemarble image\nm.drawmeridians(meridians, labels=[0,0,0,1], fmt='%.2f')\nm.drawparallels(parallels, labels=[1,0,0,0], fmt='%.2f')\nf.suptitle('The Himalayas');\n```\n\n\n\nWhile we noticed this in the notebook, the problem will be present for any figure saving operation that supports `bbox_inches='tight'`. \n\nAs discussed in the [mailing list thread about this problem](http://sourceforge.net/mailarchive/forum.php?thread_name=CAHAreOqGuUEKXbbRWVxPgkd25WM4GkTdGbUB7x-aK%3DGD%3DAvYHg%40mail.gmail.com\u0026forum_name=matplotlib-devel), mpl should probably use the position of 'official' artists such figure suptitles in the computation of the bounding box.\n","author":{"url":"https://github.com/fperez","@type":"Person","name":"fperez"},"datePublished":"2012-01-29T20:19:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/688/matplotlib/issues/688"}
| 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:c861afa2-3ae7-552a-c5c3-fb58e9350ffe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D2FC:2F7FEE:17A56FE:1FF01CF:6A546D63 |
| html-safe-nonce | 730ada58697704ed39f0ac07c3f35f7f1398bd8a6c370cc384c23c6e98a3cfd3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkZDOjJGN0ZFRToxN0E1NkZFOjFGRjAxQ0Y6NkE1NDZENjMiLCJ2aXNpdG9yX2lkIjoiODY2MTQ0MDk1MDI0NDI0MDczOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 386cd519e4e3366a48ead54b8e27e0a7d256690ec4529337798af6cc0411c925 |
| hovercard-subject-tag | issue:3013127 |
| 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/688/issue_layout |
| twitter:image | https://opengraph.githubassets.com/efaf042859f12b8c8bb75ac1d45578471b77e039987c8d4b76c28af9724e0911/matplotlib/matplotlib/issues/688 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/efaf042859f12b8c8bb75ac1d45578471b77e039987c8d4b76c28af9724e0911/matplotlib/matplotlib/issues/688 |
| og:image:alt | In ipython for the qtconsole and notebook, we send inline figures using fig.canvas.print_figure(bytes_io, format=fmt, bbox_inches='tight') as seen here. However, this produces truncated figure titl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fperez |
| 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 | 6d28624802c2f7d9500239dd6870ed7031b7353b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width