case1 = la.distributions.Case(load_params, mat_props)      # instantiate a User Input Case Object through distributions
case1.apply(single_geo)
case1.plot(normalized=False)

case1.plot(normalized=True, grayscale=True)

"""
Explanation: This file is forked from Demo - Academic 0.1.3.ipynb. All cells above this level are hidden in readthedocs by the nbsphinx extension. 
Quick View
Here is a brief gallery of some stress distribution plots produced from LamAna.
Single Geometry Plots
We can plot stress distributions for a single laminate as a function of height, d or normalized thicknesses, k (default).
End of explanation
"""


case1.plot(annotate=True, colorblind=True, inset=True)

"""
Explanation: We can superimpose insets and adjust the colors for publications quality.
End of explanation
"""


title = 'Stress Distributions of HA/PSu for Multiple Geometries'
multiple_geos = [
    '350-400-500',  '400-200-800', '200-200-1200', '200-100-1400',
    '100-100-1600', '100-200-1400', '300-400-600'
]

case2 = la.distributions.Case(load_params, mat_props)      # instantiate a User Input Case Object through distributions
case2.apply(multiple_geos)

case2.plot(title, colorblind=True, annotate=True)

"""
Explanation: Multiple Geometry Plots
With normalized layers, we can superimpose multiple stress distributions fpr laminates different geometries.  Data for multiple laminates are encapsulated in a Case object.
End of explanation
"""


case2.plot(title, colorblind=True, annotate=True, separate=True)

"""
Explanation: These distributions can be separated as desired into a panel of various plots.
End of explanation
"""


# Setup a list of geometry strings
const_total = [
    '350-400-500',  '400-200-800', '200-200-1200',
    '200-100-1400', '100-100-1600', '100-200-1400'
]

# Setup cases
cases1 = la.distributions.Cases(
    const_total, load_params=load_params, mat_props=mat_props,
    model='Wilson_LT', ps=[2, 3]
) 

cases1.plot(extrema=False)

"""
Explanation: Halfplots
The following has not been fully implemented yet, but demonstrates several multi-plots of tensile data. Each plot shows some pattern of interest, for example:  

(a) constant total thickness; varied layer thicknesses
(b) constant outer layer
(c) constant inner layer
(d) constant middle layer


Panels of multi-plots are possible with a Cases object, a container for several Case objects.
End of explanation
"""


case1

case1.model

case1.LMs

"""
Explanation: Data Analysis
Using a prior case, we can analyze the data calculations based on a given theorical model.
End of explanation
"""


#df = case1.frames
df = case1.frames[0]
df
#df.style                                                   # pandas 0.17.1, css on html table
#df.style.bar(subset=['stress_f (MPa/N)', 'strain'], color='#d65f5f')

"""
Explanation: Data for each laminate is contained in a pandas DataFrame, a powerful data structure for data analysis.
End of explanation
"""


