scientific_comp_projects/CODE/[python]thesis_old_scripts/hyperbolic.py

30 lines
815 B
Python

# -*- coding: utf-8 -*-
"""
Created on Tue Apr 10 18:31:49 2018
@author: Armando
"""
import numpy as np
import matplotlib.pyplot as plt
lim = 8
size = 5.6
fig, ax = plt.subplots(figsize=(size, size))
xs = np.linspace(-lim, lim, 1000)
ax.plot(xs, np.sinh(xs), label="y = sinh(x)",
color="#b30000", linestyle="-", linewidth=2)
ax.plot(xs, np.cosh(xs), label="y = cosh(x)",
color="#00b300", linestyle="--", linewidth=2)
ax.plot(xs, np.tanh(xs-5), label="y = tanh(x)",
color="#0000b3", linestyle=":", linewidth=2)
ax.set_xlim(-lim, lim)
ax.set_ylim(-lim, lim)
ax.set_xticks([-1, 0, 1])
ax.set_yticks([-1, 0, 1])
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.grid("on")
ax.legend(loc="lower right")
fig.tight_layout()
fig.savefig("sinh_cosh_tanh.svg", transparent=True)