dpraz commited on
Commit
cb77a5a
1 Parent(s): e23c6e7

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +7 -8
functions.py CHANGED
@@ -9,7 +9,6 @@ from matplotlib.ticker import FormatStrFormatter
9
  import seaborn as sns
10
  from sklearn import linear_model
11
 
12
-
13
  def update_table(coordx,coordy,coordz,plotting_df):
14
  plotting_df = plotting_df[plotting_df['type'] != "User"]
15
  xx=plotting_df.columns[3]
@@ -73,14 +72,14 @@ def plot(plotting_df,x_vals, y_vals, z_vals):
73
  min_z = temp_xyz[z_vals].min()
74
  max_z = temp_xyz[z_vals].max()
75
  #3D plot:
76
- markers={'Chon': 'circle', 'Iron': 'x', 'Acho': 'square', 'Plan': 'square', 'CAIs': 'diamond', 'User':'circle', 'CI':'circle'}
77
- fig0= px.scatter_3d(data_frame=temp_xyz,x=x_vals,y=y_vals, z=z_vals , color='class', color_discrete_map={'CC':'blue','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
78
  hover_data={'class': False, 'type':False})
79
  fig0.update_layout(template="none", showlegend=True, legend=dict(y=0.0, itemsizing="constant",title=""), modebar=dict(orientation='h'))#margin=dict(l=50, r=50, b=50, t=50),
80
  fig0.update_traces(marker=dict(size=5, line=dict(color='white', width=4)))
81
  fig0.update_traces(selector=dict(marker_color='#FFEF00'), marker=dict(line_color='black'))
82
  #x vs y:
83
- fig01=px.scatter(temp_xy,x=x_vals,y=y_vals, color='class',color_discrete_map={'CC':'blue','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
84
  hover_data={'class': False, 'type':False}, error_x=x_errors, error_y=y_errors)
85
  fig01.update_layout(template="simple_white", showlegend=True, legend=dict(title='',y=1.0, xanchor="right",x=0.2, bgcolor='rgba(0,0,0,0)'), modebar=dict(orientation='h'))
86
  fig01.update_traces(marker=dict(size=9, line=dict(color='white', width=1)), error_x_width=0,error_y_width=0)
@@ -101,7 +100,7 @@ def plot(plotting_df,x_vals, y_vals, z_vals):
101
  legend = plt.gca().get_legend()
102
  legend.set_title('')
103
  #y vs z:
104
- fig02=px.scatter(temp_yz,x=y_vals,y=z_vals, color='class',color_discrete_map={'CC':'blue','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type',symbol_map=markers, hover_name='group',
105
  hover_data={'class': False, 'type':False},
106
  error_x=y_errors, error_y=z_errors)
107
  fig02.update_layout(template="simple_white", showlegend=True, legend=dict(title='',y=1.0, xanchor="right",x=0.2, bgcolor='rgba(0,0,0,0)'), modebar=dict(orientation='h'))
@@ -122,7 +121,7 @@ def plot(plotting_df,x_vals, y_vals, z_vals):
122
  legend = plt.gca().get_legend()
123
  legend.set_title('')
124
  #z vs x:
125
- fig03=px.scatter(temp_zx,x=z_vals,y=x_vals, color='class',color_discrete_map={'CC':'blue','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
126
  hover_data={'class': False, 'type':False},
127
  error_x=z_errors,error_y=x_errors)
128
  fig03.update_layout(template="simple_white", showlegend=True, legend=dict(title='',y=1.0, xanchor="right",x=0.2, bgcolor='rgba(0,0,0,0)'), modebar=dict(orientation='h'))
@@ -464,8 +463,8 @@ def plot_3D_reg(plotting_df,reg_df,x_vals, y_vals, z_vals,CC_reg,NC_reg):
464
  temp_xyz = pd.concat([temp_xyz, row.to_frame().T])
465
  temp_xyz.reset_index(drop=True, inplace=True)
466
  #3D plot:
467
- markers={'Chon': 'circle', 'Iron': 'x', 'Acho': 'square', 'Plan': 'square', 'CAIs': 'diamond', 'User':'circle', 'CI':'circle'}
468
- fig0= px.scatter_3d(data_frame=temp_xyz,x=x_vals,y=y_vals, z=z_vals , color='class', color_discrete_map={'CC':'blue','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
469
  hover_data={'class': False, 'type':False})
470
  fig0.update_layout(template="none", showlegend=True, legend=dict(y=0.0, itemsizing="constant",title=""), modebar=dict(orientation='h'))
471
  fig0.update_traces(marker=dict(size=5, line=dict(color='white', width=4)))
 
9
  import seaborn as sns
10
  from sklearn import linear_model
11
 
 
12
  def update_table(coordx,coordy,coordz,plotting_df):
13
  plotting_df = plotting_df[plotting_df['type'] != "User"]
14
  xx=plotting_df.columns[3]
 
72
  min_z = temp_xyz[z_vals].min()
73
  max_z = temp_xyz[z_vals].max()
74
  #3D plot:
75
+ markers={'Chon': 'circle', 'Iron': 'x', 'Acho': 'square', 'Plan': 'square', 'CAIs': 'diamond', 'User':'circle'}#, 'CI':'circle'
76
+ fig0= px.scatter_3d(data_frame=temp_xyz,x=x_vals,y=y_vals, z=z_vals , color='class', color_discrete_map={'CC':'blue','CI':'#a4dded','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
77
  hover_data={'class': False, 'type':False})
78
  fig0.update_layout(template="none", showlegend=True, legend=dict(y=0.0, itemsizing="constant",title=""), modebar=dict(orientation='h'))#margin=dict(l=50, r=50, b=50, t=50),
79
  fig0.update_traces(marker=dict(size=5, line=dict(color='white', width=4)))
80
  fig0.update_traces(selector=dict(marker_color='#FFEF00'), marker=dict(line_color='black'))
81
  #x vs y:
82
+ fig01=px.scatter(temp_xy,x=x_vals,y=y_vals, color='class',color_discrete_map={'CC':'blue','CI':'#a4dded','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
83
  hover_data={'class': False, 'type':False}, error_x=x_errors, error_y=y_errors)
84
  fig01.update_layout(template="simple_white", showlegend=True, legend=dict(title='',y=1.0, xanchor="right",x=0.2, bgcolor='rgba(0,0,0,0)'), modebar=dict(orientation='h'))
85
  fig01.update_traces(marker=dict(size=9, line=dict(color='white', width=1)), error_x_width=0,error_y_width=0)
 
100
  legend = plt.gca().get_legend()
101
  legend.set_title('')
102
  #y vs z:
103
+ fig02=px.scatter(temp_yz,x=y_vals,y=z_vals, color='class',color_discrete_map={'CC':'blue','CI':'#a4dded','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type',symbol_map=markers, hover_name='group',
104
  hover_data={'class': False, 'type':False},
105
  error_x=y_errors, error_y=z_errors)
106
  fig02.update_layout(template="simple_white", showlegend=True, legend=dict(title='',y=1.0, xanchor="right",x=0.2, bgcolor='rgba(0,0,0,0)'), modebar=dict(orientation='h'))
 
121
  legend = plt.gca().get_legend()
122
  legend.set_title('')
123
  #z vs x:
124
+ fig03=px.scatter(temp_zx,x=z_vals,y=x_vals, color='class',color_discrete_map={'CC':'blue','CI':'#a4dded','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
125
  hover_data={'class': False, 'type':False},
126
  error_x=z_errors,error_y=x_errors)
127
  fig03.update_layout(template="simple_white", showlegend=True, legend=dict(title='',y=1.0, xanchor="right",x=0.2, bgcolor='rgba(0,0,0,0)'), modebar=dict(orientation='h'))
 
463
  temp_xyz = pd.concat([temp_xyz, row.to_frame().T])
464
  temp_xyz.reset_index(drop=True, inplace=True)
465
  #3D plot:
466
+ markers={'Chon': 'circle', 'Iron': 'x', 'Acho': 'square', 'Plan': 'square', 'CAIs': 'diamond', 'User':'circle'}#, 'CI':'circle'
467
+ fig0= px.scatter_3d(data_frame=temp_xyz,x=x_vals,y=y_vals, z=z_vals , color='class', color_discrete_map={'CC':'blue','CI':'#a4dded','NC':'red','Other':'green','NA':'#FFEF00'},symbol='type', symbol_map=markers, hover_name='group',
468
  hover_data={'class': False, 'type':False})
469
  fig0.update_layout(template="none", showlegend=True, legend=dict(y=0.0, itemsizing="constant",title=""), modebar=dict(orientation='h'))
470
  fig0.update_traces(marker=dict(size=5, line=dict(color='white', width=4)))