Title: howto: colorbar in FigureFactory.create_trisurf() · Issue #517 · plotly/plotly.py · GitHub
Open Graph Title: howto: colorbar in FigureFactory.create_trisurf() · Issue #517 · plotly/plotly.py
X Title: howto: colorbar in FigureFactory.create_trisurf() · Issue #517 · plotly/plotly.py
Description: For many applications, a colour bar is essential for visual interpretation, but I couldn't find a parameter or example in the documentation indicating how to add one to a trisurf rendering. Based on the documentation on trisurf, surface ...
Open Graph Description: For many applications, a colour bar is essential for visual interpretation, but I couldn't find a parameter or example in the documentation indicating how to add one to a trisurf rendering. Based o...
X Description: For many applications, a colour bar is essential for visual interpretation, but I couldn't find a parameter or example in the documentation indicating how to add one to a trisurf rendering. Bas...
Opengraph URL: https://github.com/plotly/plotly.py/issues/517
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"howto: colorbar in FigureFactory.create_trisurf()","articleBody":"For many applications, a colour bar is essential for visual interpretation, but I couldn't find a parameter or example in the documentation indicating how to add one to a `trisurf` rendering. Based on the documentation on [trisurf](https://plot.ly/python/trisurf/), [surface coloring](https://plot.ly/python/3d-surface-coloring/) and [meshes](https://plot.ly/python/3d-mesh/), I guessed that adding a colour bar dict into the `Mesh3d` data could do the job, but this was ineffectual. What would be the right way?\n\nBelow is an example for `ipython notebook` using a mesh from the [FAUST](http://faust.is.tue.mpg.de/) dataset, the [trimesh](https://github.com/mikedh/trimesh) library and the default `trisurf` colouring (`z`-value). The line before the last is my failed attempt.\n\n``` python\nimport trimesh\nmesh = trimesh.load_mesh('tr_reg_003.ply')\nx, y, z = mesh.vertices.T\nsize = (mesh.vertices.max(axis=0) - mesh.vertices.min(axis=0)).T\n\nimport plotly.offline as py\nimport plotly.graph_objs as go\nfrom plotly.tools import FigureFactory as ff\npy.init_notebook_mode()\nfig = ff.create_trisurf(\n x=x, y=y, z=z, simplices=mesh.faces, colormap='Viridis',\n aspectratio={'x': size[0], 'y': size[1], 'z': size[2]})\nfig.data[0].update(colorbar=go.ColorBar(title='z'))\npy.iplot(fig)\n```\n\nAlso, an option for `create_trisurf()` setting the aspect ratio based on the mesh extent (as done above manually) would be useful.\n\n","author":{"url":"https://github.com/ntfrgl","@type":"Person","name":"ntfrgl"},"datePublished":"2016-07-05T14:21:09Z","url":"https://github.com/plotly/plotly.py/issues/517"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:a6c6d1f5-e175-7f16-c8ff-246bb4f1473c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C1A:2652DC:17E472B:1E894FC:6B012C67 |
| html-safe-nonce | 95e1971cb81533756f910e628956dfbe95bdf8e5b28d5a8b7addf05af72736a7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzFBOjI2NTJEQzoxN0U0NzJCOjFFODk0RkM6NkIwMTJDNjciLCJ2aXNpdG9yX2lkIjoiMjU3MzM3NTU1MzIxNDE2NDA3MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e0bd8c3ece71809dccd4b79315edbaa78a0354498f0f12772e22f5b4d396ba94 |
| hovercard-subject-tag | issue:163862659 |
| 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/plotly/plotly.py/517/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ea1f7e0606048ceea9d3c58bc7eb39d3130fdf199b08698e714a6a7221815aad/plotly/plotly.py/issues/517 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ea1f7e0606048ceea9d3c58bc7eb39d3130fdf199b08698e714a6a7221815aad/plotly/plotly.py/issues/517 |
| og:image:alt | For many applications, a colour bar is essential for visual interpretation, but I couldn't find a parameter or example in the documentation indicating how to add one to a trisurf rendering. Based o... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ntfrgl |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.py git https://github.com/plotly/plotly.py.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 14579099 |
| octolytics-dimension-repository_nwo | plotly/plotly.py |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14579099 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.py |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width