Spaces:
Sleeping
Sleeping
File size: 1,822 Bytes
e88abf9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
import solara
import seaborn as sns
import plotly.express as px
from utils import selected_template
@solara.component
def TreeD():
with solara.Column(gap="20px", align = "stretch") as main:
solara.Markdown(f"#3D Scatter Plots")
flights = sns.load_dataset("flights")
# Create a 3D scatter plot using flight data
fig1 = px.scatter_3d(flights, x='year', y='month', z='passengers', color='year',
opacity=0.7,
width=800, height=400,
template=selected_template.value)
# solara.Markdown(f"#### Use Box plot to compare different variables ")
solara.Markdown("""
```python
flights = sns.load_dataset("flights")
# Create a 3D scatter plot using flight data
fig1 = px.scatter_3d(flights, x='year', y='month', z='passengers', color='year',
opacity=0.7, width=800, height=400)
```
"""
)
solara.FigurePlotly(fig1)
# With a scatter matrix we can compare changes when comparing column data
fig2 = px.line_3d(flights, x='year', y='month', z='passengers', color='year',template=selected_template.value)
solara.Markdown(f"#3D Line Plots")
solara.Markdown("""
```python
# With a scatter matrix we can compare changes when comparing column data
fig2 = px.line_3d(flights, x='year', y='month', z='passengers', color='year')
```
"""
)
solara.FigurePlotly(fig2)
return main
|