Fix projection 3d for old matplotlib versions

This commit is contained in:
Eric Teunis de Boone 2022-11-22 09:38:24 +01:00
parent 6e18dca9c2
commit 22a54da1c8

View file

@ -10,6 +10,7 @@ in a continuous fashion
if __name__ == "__main__": if __name__ == "__main__":
import numpy as np import numpy as np
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mylib.fft import direct_fourier_transform from mylib.fft import direct_fourier_transform
@ -60,7 +61,7 @@ if __name__ == "__main__":
freq_cmap = cmap(freq_norm(test_freqs)) freq_cmap = cmap(freq_norm(test_freqs))
try: try:
# Amplitudes Histogram # Amplitudes Histogram
if False: if True:
fig = plt.figure() fig = plt.figure()
ax = fig.add_subplot(projection='3d') ax = fig.add_subplot(projection='3d')
ax.set_xlabel("Amplitude") ax.set_xlabel("Amplitude")
@ -145,7 +146,7 @@ if __name__ == "__main__":
ax.plot(tmp_test_freqs, func_amps, ls='dotted', color=l[0].get_color()) ax.plot(tmp_test_freqs, func_amps, ls='dotted', color=l[0].get_color())
# Amplitudes figure # Amplitudes figure
if not True: if True:
fig, ax = plt.subplots() fig, ax = plt.subplots()
ax.set_ylabel("Amplitude") ax.set_ylabel("Amplitude")
ax.set_xlabel("Frequency") ax.set_xlabel("Frequency")