import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import Thermobar as pt
out=pt.import_excel('Opx_Liq_Example.xlsx', sheet_name="Paired_Opx_Liq")
my_input=out['my_input']
Liqs=out['Liqs']
Opxs=out['Opxs']
opx_comps=pt.calculate_orthopyroxene_components(opx_comps=Opxs)
fig, tax = pt.plot_px_classification(figsize=(10, 5))
fig, tax = pt.plot_px_classification(figsize=(6,5), cut_in_half=False)
fig, tax = pt.plot_px_classification(figsize=(10, 5), labels=True,
fontsize_component_labels=12,
fontsize_axes_labels=20)
fig, tax = pt.plot_px_classification(figsize=(10, 5), labels=True, fontsize_component_labels=12,
major_grid=True)
fig, tax = pt.plot_px_classification(figsize=(10, 5), labels=True, fontsize_component_labels=12,
major_grid=True, minor_grid=True)
fig, tax = pt.plot_px_classification(figsize=(10, 5), fontsize_component_labels=12,
major_grid=True, minor_grid=True)
## Calculate your data in terms of ternary axes
px_points = pt.tern_points(
opx_comps["Fs_Simple_MgFeCa_Opx"], opx_comps["Wo_Simple_MgFeCa_Opx"], opx_comps["En_Simple_MgFeCa_Opx"])
tax.scatter(
px_points,
edgecolor="k",
marker="^",
facecolor="red",
label='Label1',
s=90
)
<AxesSubplot:>
fig, tax = pt.plot_px_classification(figsize=(12, 5), fontsize_component_labels=12,
major_grid=True, minor_grid=True)
## Calculate your data in terms of ternary axes
px_points = pt.tern_points(
opx_comps["Fs_Simple_MgFeCa_Opx"], opx_comps["Wo_Simple_MgFeCa_Opx"], opx_comps["En_Simple_MgFeCa_Opx"])
tax.scatter(
px_points,
c=opx_comps["Cr2O3_Opx"],
vmin=np.min(opx_comps["Cr2O3_Opx"]),
vmax=np.max(opx_comps["Cr2O3_Opx"]),
s=100,
edgecolor="k",
marker="^",
cmap="hot",
colormap="hot",
colorbar=True,
cb_kwargs={"shrink": 0.5, "label": "Cr$_2$O$_3$ content"},
)
fig.savefig('Pyroxene_Class.png', dpi=200)