File size: 1,030 Bytes
b6bb10d
74fa2db
 
3dd6bc7
b6bb10d
7e8181a
b6bb10d
9cc36bf
 
acda87d
b6bb10d
68e81c3
7e8181a
68e81c3
 
b6bb10d
13d9703
 
b6bb10d
7e8181a
acda87d
253d316
acda87d
e00d336
7e8181a
b6bb10d
7e8181a
b6bb10d
7e8181a
 
 
 
 
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
import streamlit as st, pandas as pd, numpy as np
import my_static_tools as mst
st.html(mst.STYLE_CORRECTION)

import plotly.figure_factory as ff
import plotly.graph_objs as go

st.sidebar.markdown("# ПРИМЕР : интерактивные графики на Plotly plotly.graph_objs 📊")

n = 80 # 200
# Add histogram data
x1 = np.random.randn(n) # - 2
x2 = np.random.randn(n)
x3 = np.random.randn(n) # + 2
x4 = np.random.randn(n)

# https://discuss.streamlit.io/t/update-3d-scatter-plot-without-resetting-view/20686
my_uirevision = "qwerty"

figure = {
    "data": [go.Scatter3d(z=x1, y=x2, x=x3, mode='markers',
        marker=dict(color=x4, size=4, opacity=0.5) # , colorscale='Viridis'
    )],
    "layout": go.Layout(margin=dict(l=0, r=0, b=0, t=0), height=750, uirevision=my_uirevision)
}

st.plotly_chart(figure)

# 1
#hist_data = [x1, x2, x3]
#group_labels = ['Group 1', 'Group 2', 'Group 3']
#fig = ff.create_distplot(hist_data, group_labels, bin_size=[.1, .25, .5])
#st.plotly_chart(fig, use_container_width=True)