Layout mit black optimiert
This commit is contained in:
parent
3a5e413150
commit
c309746ad3
@ -1,6 +1,6 @@
|
||||
#%%
|
||||
# %%
|
||||
# Import required libraries
|
||||
import numpy as np # Numerical operations and array handling
|
||||
import numpy as np # Numerical operations and array handling
|
||||
import matplotlib.pyplot as plt # Plotting library
|
||||
|
||||
# Initialize figure counter and line width for all plots
|
||||
@ -21,32 +21,32 @@ colors = {
|
||||
# LaTeX label, and assigned color
|
||||
plots = [
|
||||
{
|
||||
"x_0": 0.,
|
||||
"x_E": 2.,
|
||||
"x_0": 0.0,
|
||||
"x_E": 2.0,
|
||||
"N": 2,
|
||||
"f": lambda x: 0.4 * x + 1,
|
||||
"label": r"$f(x) = 0.4\,x + 1$",
|
||||
"color": colors["deep blue"],
|
||||
},
|
||||
{
|
||||
"x_0": -2.,
|
||||
"x_E": 2.,
|
||||
"x_0": -2.0,
|
||||
"x_E": 2.0,
|
||||
"N": 129,
|
||||
"f": lambda x: x ** 2,
|
||||
"f": lambda x: x**2,
|
||||
"label": r"$f(x) = x^2$",
|
||||
"color": colors["orange"],
|
||||
},
|
||||
{
|
||||
"x_0": -6.,
|
||||
"x_E": 2.,
|
||||
"x_0": -6.0,
|
||||
"x_E": 2.0,
|
||||
"N": 129,
|
||||
"f": lambda x: 2 ** x,
|
||||
"f": lambda x: 2**x,
|
||||
"label": r"$f(x) = 2^x$",
|
||||
"color": colors["green"],
|
||||
},
|
||||
{
|
||||
"x_0": 0.01,
|
||||
"x_E": 10.,
|
||||
"x_E": 10.0,
|
||||
"N": 129,
|
||||
"f": lambda x: np.log(x) / np.log(10),
|
||||
"label": r"$f(x) = \log_{10}(x)$",
|
||||
@ -75,7 +75,6 @@ for plot in plots:
|
||||
# Generate evenly spaced x values over the specified domain
|
||||
x_data = np.linspace(plot["x_0"], plot["x_E"], plot["N"])
|
||||
|
||||
|
||||
# Evaluate the function at each x point
|
||||
y_data = plot["f"](x_data)
|
||||
|
||||
@ -106,4 +105,4 @@ for plot in plots:
|
||||
plt.legend()
|
||||
|
||||
# Display all figures
|
||||
plt.show()
|
||||
plt.show()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user