From 2a205d43afbaf6e6e86b965f2602121eb3bc0394 Mon Sep 17 00:00:00 2001 From: Chrystal Chern <52893467+chrystalchern@users.noreply.github.com> Date: Tue, 18 Jun 2024 23:51:36 -0700 Subject: [PATCH] support mountain range and requirements --- pyproject.toml | 3 ++- src/mdof/utilities/printing.py | 13 +++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ea529c9..b4087ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,8 @@ dependencies = [ "control", "sdof", # "opensees", - "quakeio" + "quakeio", + "ipykernel" ] classifiers = [ diff --git a/src/mdof/utilities/printing.py b/src/mdof/utilities/printing.py index ec8d4c5..9c839b5 100644 --- a/src/mdof/utilities/printing.py +++ b/src/mdof/utilities/printing.py @@ -3,13 +3,6 @@ from matplotlib import pyplot as plt import plotly.graph_objects as go -try: - import scienceplots - plt.style.use(["poster"])# ,"science", "notebook"]) -except ImportError: - pass -except OSError: - plt.style.use("notebook") nln = "\n" @@ -110,7 +103,7 @@ def plot_models(models, Tn, zeta): # fig.suptitle("Spectral Quantity Prediction with System Identification",fontsize=17) -def plot_io(inputs, outputs, t, title=None, ylabels=("inputs","outputs"), axtitles=(None,None), **options): +def plot_io(inputs, outputs, t, title=None, xlabels=("time (s)", "time (s)"), ylabels=("inputs","outputs"), axtitles=(None,None), **options): fig, ax = options.get('figax', plt.subplots(1,2,figsize=options.get('figsize',(10,3)),constrained_layout=True,sharey=options.get('sharey',(ylabels[0]==ylabels[1]))) ) @@ -119,7 +112,7 @@ def plot_io(inputs, outputs, t, title=None, ylabels=("inputs","outputs"), axtitl ax[0].plot(t,inputs[i,:],label=f"input {i+1}") else: ax[0].plot(t,inputs) - ax[0].set_xlabel("time (s)", fontsize=15) + ax[0].set_xlabel(xlabels[0], fontsize=15) ax[0].set_ylabel(ylabels[0], fontsize=15) ax[0].set_title(axtitles[0], fontsize=15) if len(outputs.shape) > 1: @@ -128,7 +121,7 @@ def plot_io(inputs, outputs, t, title=None, ylabels=("inputs","outputs"), axtitl ax[1].legend(fontsize=12, frameon=True, framealpha=0.4, bbox_to_anchor=(1,0,0.5,0.8), loc='upper left') else: ax[1].plot(t,outputs) - ax[1].set_xlabel("time (s)", fontsize=15) + ax[1].set_xlabel(xlabels[1], fontsize=15) ax[1].set_ylabel(ylabels[1], fontsize=15) ax[1].set_title(axtitles[1], fontsize=15) fig.suptitle(title, fontsize=17)