f64 commited on
Commit
b6bb10d
·
1 Parent(s): 3a25d0d
Files changed (1) hide show
  1. pages/6_Plotly.py +22 -0
pages/6_Plotly.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st, pandas as pd, numpy as np
2
+ st.sidebar.markdown("# интерактивные графики на Plotly 📊")
3
+ # remove decoration and popup menu button at top
4
+ st.markdown("<style> header[data-testid='stHeader'] { display:none }", unsafe_allow_html=True)
5
+
6
+ import plotly.figure_factory as ff
7
+
8
+ # Add histogram data
9
+ x1 = np.random.randn(200) - 2
10
+ x2 = np.random.randn(200)
11
+ x3 = np.random.randn(200) + 2
12
+
13
+ # Group data together
14
+ hist_data = [x1, x2, x3]
15
+
16
+ group_labels = ['Group 1', 'Group 2', 'Group 3']
17
+
18
+ # Create distplot with custom bin_size
19
+ fig = ff.create_distplot(hist_data, group_labels, bin_size=[.1, .25, .5])
20
+
21
+ # Plot!
22
+ st.plotly_chart(fig, use_container_width=True)