-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
First Push for Trisurf Plots #453
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
Conversation
HECK YEAH! These are looking great. Can't wait to replace the mammoth 🐘 we have here: |
@@ -1425,6 +1425,12 @@ def return_figure_from_figure_or_data(figure_or_data, validate_figure): | |||
_DEFAULT_INCREASING_COLOR = '#3D9970' # http://clrs.cc | |||
_DEFAULT_DECREASING_COLOR = '#FF4136' | |||
|
|||
DEFAULT_PLOTLY_COLORS = ['rgb(31, 119, 180)', 'rgb(255, 127, 14)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐄 This should go to the top of the file. The above constants should have been at the top as well.
@Kully Looking amazing! Mostly small comments about style and organization. Ping me when tests are up for another review! |
…ith Python 2, 3.3 and 3.4
In python 3 `map` is a generator, `list()` it!
…nto Trisurf_Plots
@theengineear @jackparmer @cldougl @chriddyp Final something with no errors. Thanks a lot to Andrew for helping me out with this last night. |
Great! I'll take a peek today! |
'showbackground': True, | ||
'zerolinecolor': 'rgb(255, 255, 255)'}}, | ||
'title': 'Trisurf Plot', | ||
'width': 800}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😿 Can you reformat this? You could even save on indentation by defining it at the top of the file or something. For example, this would be much better:
{
'data': [
{
'facecolor': ['rgb(143.0, 123.0, 97.000000000000014)',
'rgb(255.0, 127.0, 14.000000000000007)',
'rgb(143.0, 123.0, 97.000000000000014)',
'rgb(31.0, 119.0, 180.0)',
'rgb(143.0, 123.0, 97.000000000000014)',
'rgb(31.0, 119.0, 180.0)',
'rgb(143.0, 123.0, 97.000000000000014)',
'rgb(255.0, 127.0, 14.000000000000007)'],
'i': [3, 1, 1, 5, 7, 3, 5, 7],
'j': [1, 3, 5, 1, 3, 7, 7, 5],
'k': [4, 0, 4, 2, 4, 6, 4, 8],
'name': '',
'type': 'mesh3d',
'x': np.array([-1., 0., 1., -1., 0., 1., -1., 0., 1.]),
'y': np.array([-1., -1., -1., 0., 0., 0., 1., 1., 1.]),
'z': np.array([ 1., -0., -1., -0., 0., 0., -1., 0., 1.])
},
{
'line': {'color': 'rgb(50, 50, 50)', 'width': 1.5},
'mode': 'lines',
'type': 'scatter3d',
'x': [-1.0, 0.0, 0.0, -1.0, None, 0.0, -1.0, -1.0, 0.0, None, 0.0,
1.0, 0.0, 0.0, None, 1.0, 0.0, 1.0, 1.0, None, 0.0, -1.0, 0.0,
0.0, None, -1.0, 0.0, -1.0, -1.0, None, 1.0, 0.0, 0.0, 1.0,
None, 0.0, 1.0, 1.0, 0.0, None],
'y': [0.0, -1.0, 0.0, 0.0, None, -1.0, 0.0, -1.0, -1.0, None, -1.0,
0.0, 0.0, -1.0, None, 0.0, -1.0, -1.0, 0.0, None, 1.0, 0.0,
0.0, 1.0, None, 0.0, 1.0, 1.0, 0.0, None, 0.0, 1.0, 0.0, 0.0,
None, 1.0, 0.0, 1.0, 1.0, None],
'z': [-0.0, -0.0, 0.0, -0.0, None, -0.0, -0.0, 1.0, -0.0, None,
-0.0, 0.0, 0.0, -0.0, None, 0.0, -0.0, -1.0, 0.0, None, 0.0,
-0.0, 0.0, 0.0, None, -0.0, 0.0, -1.0, -0.0, None, 0.0, 0.0,
0.0, 0.0, None, 0.0, 0.0, 1.0, 0.0, None]
}
],
'layout': {
'height': 800,
'scene': {'aspectratio': {'x': 1, 'y': 1, 'z': 1},
'xaxis': {'backgroundcolor': 'rgb(230, 230, 230)',
'gridcolor': 'rgb(255, 255, 255)',
'showbackground': True,
'zerolinecolor': 'rgb(255, 255, 255)'},
'yaxis': {'backgroundcolor': 'rgb(230, 230, 230)',
'gridcolor': 'rgb(255, 255, 255)',
'showbackground': True,
'zerolinecolor': 'rgb(255, 255, 255)'},
'zaxis': {'backgroundcolor': 'rgb(230, 230, 230)',
'gridcolor': 'rgb(255, 255, 255)',
'showbackground': True,
'zerolinecolor': 'rgb(255, 255, 255)'}},
'title': 'Trisurf Plot',
'width': 800
}
}
Still looking good to me! Ping me when you're all finished and I'll give it a final review. |
It would be great to do a sanity check making sure this http://moderndata.plot.ly/visualizing-56-ply-files-in-python/ Is custom surface coloring handled? https://plot.ly/python/3d-surface-coloring/ On Tue, May 10, 2016 at 9:59 AM, Andrew notifications@github.com wrote:
|
No, custom coloring isn't handled yet, but I can add. I can check the PLT files as well. |
@jackparmer It's more than working... =D |
Awesome - Beethoven in the house! Last thing we need is support for custom On Tue, May 10, 2016 at 1:52 PM, Adam Kulidjian notifications@github.com
|
Makes sense and I'm on it. |
@jackparmer @theengineear @cldougl I have added the option to write a function dist_func(x, y, z) and input that into the Trisurf function. A couple notes: |
AH! That's why you don't need the special
Okie dokie. |
No new notes from me, I think there are a few code comments in https://github.com/plotly/plotly.py/pull/453/files that were not addressed but nothing major. Not gonna block this one --> 💃 |
@jackparmer @theengineear @cldougl
This is the PR for create_trisurf() in FigureFactory.
The functionality so far is this: it takes arrays x, y and z (the vertices of the points) which are to be created outside the function. This requires a _import numpy _and from scipy.spatial import Delaunay in the notebook.
It looks pretty cool right now. Like the scatterplotmatrix, you can enter a Plotly colorscale name in colorscale= to get your heatmap as a function of the z-coordinate. Or you can opt to enter a list of 2 rgb tuples (or normalized rgb tuples, where each coordinate is between 0 and 1).
I also included a doc string which outputs some cool looking plots.
Things I need to do:
-add tests (which I can do now!)
-potential **kwargs
Bring forth your comments!