Skip to content

Commit ea170f2

Browse files
authored
Update SpecNec_executable_streamlit.py
1 parent 088aa6d commit ea170f2

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

fun_SPEC_NEC/SpecNec_executable_streamlit.py

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -176,23 +176,28 @@
176176
Sae = Sae[:, 0]
177177
Sai = Sai[:, 0]
178178

179+
180+
o1, o2 = st.columns([1,5])
181+
with p1:
182+
st.metric(label='Max Sae', value=np.max(Sae), delta='g')
183+
st.metric(label='Max Sai', value=np.max(Sai), delta='g')
184+
with p2:
185+
fig1, ax1 = plt.subplots(figsize=(16/1.5, 9/1.5))
186+
187+
ax1.plot(Tie, Sae, color=(0, 0, 1), marker='+', markersize=0, markerfacecolor='w',
188+
markeredgewidth=0, linewidth=1.0, alpha=0.5,linestyle = '-',label= f'Sa_elastic')
189+
ax1.plot(Tie, Sai, color=(0, 0, 0), marker='+', markersize=0, markerfacecolor='w',
190+
markeredgewidth=0, linewidth=1.5, alpha=0.7,linestyle = '--',label= f'Sa_inelastic')
191+
ax1.set_xlim([Tie[0], (max(Tie))])
192+
ax1.set_ylim([0, (max(Sae)*1.05)])
193+
plt.title('UHS [NEC-SE-DS-2015]', fontsize=10, color=(0, 0, 1))
194+
plt.xlabel('Period (T) [s]', rotation=0, fontsize=10, color=(0, 0, 0))
195+
plt.ylabel('Max Response Acceleration (Sa) [g]', rotation=90, fontsize=10, color=(0, 0, 0))
196+
legend = plt.legend(fontsize=10)
197+
legend.get_frame().set_edgecolor('none')
198+
ax1.grid(which='both', axis='x', alpha=0.5)
179199

180-
fig1, ax1 = plt.subplots(figsize=(16/1.5, 9/1.5))
181-
182-
ax1.plot(Tie, Sae, color=(0, 0, 1), marker='+', markersize=0, markerfacecolor='w',
183-
markeredgewidth=0, linewidth=1.0, alpha=0.5,linestyle = '-',label= f'Sa_elastic')
184-
ax1.plot(Tie, Sai, color=(0, 0, 0), marker='+', markersize=0, markerfacecolor='w',
185-
markeredgewidth=0, linewidth=1.5, alpha=0.7,linestyle = '--',label= f'Sa_inelastic')
186-
ax1.set_xlim([Tie[0], (max(Tie))])
187-
ax1.set_ylim([0, (max(Sae)*1.05)])
188-
plt.title('UHS [NEC-SE-DS-2015]', fontsize=10, color=(0, 0, 1))
189-
plt.xlabel('Period (T) [s]', rotation=0, fontsize=10, color=(0, 0, 0))
190-
plt.ylabel('Max Response Acceleration (Sa) [g]', rotation=90, fontsize=10, color=(0, 0, 0))
191-
legend = plt.legend(fontsize=10)
192-
legend.get_frame().set_edgecolor('none')
193-
ax1.grid(which='both', axis='x', alpha=0.5)
194-
195-
st.pyplot(fig1)
200+
st.pyplot(fig1)
196201

197202

198203
st.markdown('##### 📊 **Response Spectra [Elastic and Inelastic]**')

0 commit comments

Comments
 (0)