Skip to content

Commit

Permalink
Merge branch 'chrystalchern:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
claudioperez authored Jun 19, 2024
2 parents f32f06f + 2a205d4 commit 984b026
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ dependencies = [
"control",
"sdof",
# "opensees",
"quakeio"
"quakeio",
"ipykernel"
]

classifiers = [
Expand Down
13 changes: 3 additions & 10 deletions src/mdof/utilities/printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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])))
)
Expand All @@ -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:
Expand All @@ -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)
Expand Down

0 comments on commit 984b026

Please sign in to comment.