Title: 'QuadContourSet' object has no attribute 'set_visible' or 'set_animated' · Issue #6139 · matplotlib/matplotlib · GitHub
Open Graph Title: 'QuadContourSet' object has no attribute 'set_visible' or 'set_animated' · Issue #6139 · matplotlib/matplotlib
X Title: 'QuadContourSet' object has no attribute 'set_visible' or 'set_animated' · Issue #6139 · matplotlib/matplotlib
Description: matplotlib/1.5.1 python3/3.5.1 osx 10.11.3 Installation using homebrew. The following code gives me an error 'QuadContourSet' object has no attribute 'set_visible' I added a workaround (http://stackoverflow.com/questions/23070305/how-can...
Open Graph Description: matplotlib/1.5.1 python3/3.5.1 osx 10.11.3 Installation using homebrew. The following code gives me an error 'QuadContourSet' object has no attribute 'set_visible' I added a workaround (http://stac...
X Description: matplotlib/1.5.1 python3/3.5.1 osx 10.11.3 Installation using homebrew. The following code gives me an error 'QuadContourSet' object has no attribute 'set_visible' I added a workaro...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/6139
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"'QuadContourSet' object has no attribute 'set_visible' or 'set_animated'","articleBody":"matplotlib/1.5.1\npython3/3.5.1\nosx 10.11.3\nInstallation using homebrew.\n\nThe following code gives me an error 'QuadContourSet' object has no attribute 'set_visible'\nI added a workaround (http://stackoverflow.com/questions/23070305/how-can-i-make-an-animation-with-contourf) and it worked for version 1.3.1 of matplotlib but with matplotlib version 1.5.1 I get the error 'QuadContourSet' object has no attribute 'set_animated'. Adding extra code similar to that for 'set_visible' makes the code work again.\nI would expect the code to work without the Bug fix code snippets included.\n\n```\n#! coding=utf-8\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\nimport numpy as np\nimport types\n\n#################################################################\n## Bug fix for Quad Contour set not having attribute 'set_visible'\n\n\ndef setvisible(self,vis):\n for c in self.collections: c.set_visible(vis)\ndef setanimated(self,ani):\n for c in self.collections: c.set_animated(ani)\n####################################################################\n\nfig = plt.figure()\n\n# Some 2D geo arrays to plot (time,lat,lon)\ndata = np.random.random_sample((20,90,360))\nlat = range(len(data[0,:,0]))\nlon = range(len(data[0,0,:]))\nlons,lats = np.meshgrid(lon,lat)\n\n# ims is a list of lists, each row is a list of artists to draw in the\n# current frame; here we are animating three artists, the image and 2 \n# annotatons (title), in each frame\nims = []\nfor i in range(len(data[:,0,0])):\n t_step = int(i)\n im = plt.contourf(lons,lats,data[i,:,:])\n text = 'title=' + str(i)\n te = plt.text(90,90,str(text))\n an = plt.annotate(str(text), xy=(0.45, 1.05), xycoords='axes fraction')\n #################################################################\n ## Bug fix for Quad Contour set not having the attributes\n ## 'set_visible' and 'set_animated'\n # ** uncomment the following 2 lines to make the code work:**\n# im.set_visible = types.MethodType(setvisible,im)\n# im.set_animated = types.MethodType(setanimated,im)\n im.axes = plt.gca()\n im.figure = fig\n ####################################################################\n ims.append([im,te,an])\n\n#ani = animation.ArtistAnimation(fig, ims, interval=70,repeat_delay=1000, blit=False)\nani = animation.ArtistAnimation(fig, ims)\n## For saving the animation we need ffmpeg binary:\n#FFwriter = animation.FFMpegWriter()\n#ani.save('basic_animation.mp4', writer = FFwriter)\nplt.show()\n```\n","author":{"url":"https://github.com/fabrivelas","@type":"Person","name":"fabrivelas"},"datePublished":"2016-03-10T10:00:22.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/6139/matplotlib/issues/6139"}
| 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:ce1d6e26-0468-d53a-e88e-f5db479ae372 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9CFE:15E3B:71DF60:98E082:6A5303F7 |
| html-safe-nonce | 9771d03a1da641789aa7b2299625527ac12628bcd8b62c62d50b7e27fa464d2c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Q0ZFOjE1RTNCOjcxREY2MDo5OEUwODI6NkE1MzAzRjciLCJ2aXNpdG9yX2lkIjoiNzc2OTkwMTE4NjY1Mjc2NzIyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | faddd1293d7b9434bed0c7cb22ed5b9d7edac02679aa58ed1d008cab7439c60e |
| hovercard-subject-tag | issue:139840330 |
| 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/6139/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aa933404cd1b552e6f487706713c8314cb0f97ea199469276b018613e1c4477e/matplotlib/matplotlib/issues/6139 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aa933404cd1b552e6f487706713c8314cb0f97ea199469276b018613e1c4477e/matplotlib/matplotlib/issues/6139 |
| og:image:alt | matplotlib/1.5.1 python3/3.5.1 osx 10.11.3 Installation using homebrew. The following code gives me an error 'QuadContourSet' object has no attribute 'set_visible' I added a workaround (http://stac... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fabrivelas |
| 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