Skip to content

Commit 88bce69

Browse files
author
wjm41
committed
Added 3D scatter plot to complex examples
1 parent 1871244 commit 88bce69

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

complex_examples.ipynb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,45 @@
5454
"df_esol['y_true'] = df_esol['measured log solubility in mols per litre']\n"
5555
]
5656
},
57+
{
58+
"cell_type": "markdown",
59+
"metadata": {},
60+
"source": [
61+
"## 3D Scatter Plots"
62+
]
63+
},
64+
{
65+
"cell_type": "markdown",
66+
"metadata": {},
67+
"source": [
68+
"The default coordinates settings don't work with 3D scatter plots so you will need to set `show_coords=False` and manually put in the coordinates into `caption_cols`.\n",
69+
"\n"
70+
]
71+
},
72+
{
73+
"cell_type": "code",
74+
"execution_count": null,
75+
"metadata": {},
76+
"outputs": [],
77+
"source": [
78+
"fig_3d = px.scatter_3d(df_esol, \n",
79+
" x=\"y_pred\", \n",
80+
" y=\"y_true\", \n",
81+
" z=\"Molecular Weight\", \n",
82+
" width=1000,\n",
83+
" height=800)\n",
84+
"\n",
85+
"app_3d = molplotly.add_molecules(\n",
86+
" fig=fig_3d,\n",
87+
" df=df_esol,\n",
88+
" smiles_col=\"smiles\",\n",
89+
" caption_cols=[\"y_pred\", \"y_true\", \"Molecular Weight\"],\n",
90+
" show_coords=False,\n",
91+
")\n",
92+
"\n",
93+
"app_3d.run_server(mode=\"inline\", port=8703, height=850)\n"
94+
]
95+
},
5796
{
5897
"cell_type": "markdown",
5998
"metadata": {},

0 commit comments

Comments
 (0)