In [2]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import matplotlib as mpl
import sys
%matplotlib inline
# %config InlineBackend.figure_format = 'svg' #uses high resolution vectorized output
# plt.rcParams['figure.figsize'] = (9, 7)
In [3]:
print('Python: ', sys.version)
print('OS: ',sys.platform)
print('pandas version: ', pd.__version__)
print('matplotlib version: ', mpl.__version__)
In [4]:
df = pd.read_csv('stress_strain_data.csv', sep=',', header=None, skiprows=0)
df.columns = ['strain', 'stress']
df.head()
Out[4]:
In [5]:
df.plot()
Out[5]:
In [6]:
strain = df['strain']
stress = df['stress']
plt.plot(strain,stress)
plt.xlabel('strain')
plt.ylabel('stress')
plt.title('matplotlib')
plt.show()
In [7]:
import altair as alt
# Uncomment/run this line to enable Altair in JupyterLab/nteract:
# alt.enable_mime_rendering()
print("Altair Version: ", alt.__version__)
df.head()
Out[7]:
In [8]:
alt.Chart(df).mark_line().encode(
x='strain',
y='stress'
)
In [9]:
import holoviews as hv
hv.extension('bokeh')
import bokeh
print('holovies version: ', hv.__version__)
print('bokeh version, ', bokeh.__version__)
In [10]:
hv.archive.auto()
scatter = hv.Curve(df, 'strain', 'stress')
scatter
Out[10]:
In [11]:
hv.archive.export()
In [24]:
from bokeh.plotting import figure
from bokeh.resources import CDN
from bokeh.embed import file_html
In [ ]: