# Meerdere grafieken samen in 3D import matplotlib.pyplot as plt import numpy as np from matplotlib.collections import PolyCollection def polygon_under_graph (x, y): return [(x[0], 0.), *zip (x, y), (x[-1], 0.)] ax = plt.figure (figsize = (8, 8)).add_subplot (projection = "3d") c = 299792458 h = 6.62607 / 10**34 k = 1.380649 / 10**23 Temp = [4230, 4790, 5000, 5470, 5980, 6300, 6980] x = np.logspace (-7, -5.6, 100) lambdas = range (0, 7) xywaarden = [polygon_under_graph (x, 2 * np.pi * c**2 * h / (x**5 * (np.exp (c * h / (x * k * Temp[L])) - 1))) for L in lambdas] facecolors = plt.colormaps['hsv'] (np.linspace (0, 0.75, 7)) ax.add_collection3d (PolyCollection (xywaarden, facecolors = facecolors, alpha = 0.9), zs = lambdas, zdir = 'y') ax.set (xlim = (10**(-7), 10**(-5.6)), ylim = (0, 6), zlim = (0, 2.2 * 10**14), xlabel = "x 10^-6", zlabel = "x 10^14") plt.show ()