In [1]:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
In [2]:
%matplotlib widget
Načtení dat z excelu pomocí pandas¶
In [3]:
df = pd.read_excel('TR01_03.xlsx', skiprows=10, usecols='B:G')
df
Out[3]:
In [4]:
fig, ax = plt.subplots()
force = -df['Fv']
ax.plot(-df['pr'], force)
ax.plot(-df['st'], force, label='st')
force_max_idx = np.argmax(force)
force_max = force.iloc[force_max_idx]
pr_force_max = -df['pr'].iloc[force_max_idx]
ax.plot(pr_force_max, force_max, 'ro')
ax.annotate(f'[{pr_force_max:.3f}, {force_max:.3f}]', (pr_force_max + 1, force_max + 10), color='red')
ax.set_xlabel('průhyb')
ax.set_ylabel('síla');
In [5]:
fig, ax = plt.subplots()
ax.plot(df['T1'], -df['Fv'], label='T1')
ax.plot(df['T2'], -df['Fv'], label='T2')
ax.set_xlabel('přetvoření')
ax.set_ylabel('síla')
ax.legend(loc='best');
In [ ]: