Title: phantom axis in eps images despite having set invisible axis in matplotlib · Issue #2580 · matplotlib/matplotlib · GitHub
Open Graph Title: phantom axis in eps images despite having set invisible axis in matplotlib · Issue #2580 · matplotlib/matplotlib
X Title: phantom axis in eps images despite having set invisible axis in matplotlib · Issue #2580 · matplotlib/matplotlib
Description: This is a replicate of a question I posted on stackoverflow, where you can find the screenshots of the two figure file I mentioned below. http://stackoverflow.com/questions/19761335/phantom-axis-in-eps-images-despite-having-set-invisible...
Open Graph Description: This is a replicate of a question I posted on stackoverflow, where you can find the screenshots of the two figure file I mentioned below. http://stackoverflow.com/questions/19761335/phantom-axis-in...
X Description: This is a replicate of a question I posted on stackoverflow, where you can find the screenshots of the two figure file I mentioned below. http://stackoverflow.com/questions/19761335/phantom-axis-in...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/2580
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"phantom axis in eps images despite having set invisible axis in matplotlib","articleBody":"This is a replicate of a question I posted on stackoverflow, where you can find the screenshots of the two figure file I mentioned below.\n\nhttp://stackoverflow.com/questions/19761335/phantom-axis-in-eps-images-despite-having-set-invisible-axis-in-matplotlib\n\nI managed to put those line in my matplotlib code\n\n```\nax.spines['top'].set_visible(False)\nax.spines['right'].set_visible(False)\nax.spines['left'].set_visible(False)\n```\n\nin hopes of hiding the top, right, and left axes in the saved images. They worked fine in png images, but in the saved eps files, there are still boundaries (not sure whether they are axes) on the left and the top (the right axis indeed disappeared).\n\nI just did several tests with the following minimal working example, it turns out the axes will be invisible even in eps outputs if I either 1) turn off rasterization in eps; or 2) turn off manual settings on xticks and xticklabels\n\nHowever, both above features are what I absolutely need to keep in the eps output, so, any solutions? \n\nMatplotlib version: 1.3.1, python 2.7.5, under Debian Jesse.\n\n```\nimport matplotlib.pyplot as plt\nimport numpy as np\n# setting up fig and ax\nfig = plt.figure(figsize=(12,6))\nax = fig.add_axes([0.00,0.10,0.90,0.90])\n# translucent vertical band as the only subject in the figure\n# note the zorder argument used here\nax.axvspan(2014.8, 2017.8, color=\"DarkGoldenRod\", alpha=0.3, zorder=-1)\n# setting up axes\nax.set_xlim(2008, 2030)\nax.set_ylim(-2, 2)\n# if you toggle this to False, the axes are hidden\nif True :\n # manually setting ticks\n ticks = np.arange(2008, 2030, 2)\n ax.set_xticks(ticks)\n ax.set_xticklabels([r\"$\\mathrm{\" + str(r) + r\"}$\" for r in ticks], fontsize=26, rotation=30)\n ax.get_xaxis().tick_bottom()\n ax.set_yticks([]) \n# hide all except for the bottom axes\nax.spines['top'].set_visible(False)\nax.spines['right'].set_visible(False)\nax.spines['left'].set_visible(False)\n# if you toggle this to False, the axes are hidden\nif True :\n # this is to make sure the rasterization works.\n ax.set_rasterization_zorder(0)\n# save into eps and png separately\nfig.savefig(\"test.eps\", papertype=\"a4\", format=\"eps\", bbox_inches='tight', pad_inches=0.1, dpi=None)\nfig.savefig(\"test.png\", papertype=\"a4\", format=\"png\", bbox_inches='tight', pad_inches=0.1, dpi=None)\n```\n","author":{"url":"https://github.com/nye17","@type":"Person","name":"nye17"},"datePublished":"2013-11-06T06:43:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/2580/matplotlib/issues/2580"}
| 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:1786c3d1-2128-4545-7f85-e6e6e0dc068f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBD0:1187B3:27400E7:35B2C5A:6A53B95A |
| html-safe-nonce | a49a0f971811199d9cd938e5eeb853eb3acd39fa2ce74195d6f1851d1b616df4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkQwOjExODdCMzoyNzQwMEU3OjM1QjJDNUE6NkE1M0I5NUEiLCJ2aXNpdG9yX2lkIjoiMjMxMTc0OTM3MjcxMzYxMzY1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6f50b4e96690c3a3925a7784d6c365d5672df93107868511eee3355a8f6ce803 |
| hovercard-subject-tag | issue:22176034 |
| 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/2580/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2e882a0e81fd21ab5e46ec9ad97443ac986052381bf856f0ae6cdce233d720a7/matplotlib/matplotlib/issues/2580 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2e882a0e81fd21ab5e46ec9ad97443ac986052381bf856f0ae6cdce233d720a7/matplotlib/matplotlib/issues/2580 |
| og:image:alt | This is a replicate of a question I posted on stackoverflow, where you can find the screenshots of the two figure file I mentioned below. http://stackoverflow.com/questions/19761335/phantom-axis-in... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nye17 |
| 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