From 22a54da1c84ac4baed235cc31602cf97a8a68ede Mon Sep 17 00:00:00 2001 From: Eric Teunis de Boone Date: Tue, 22 Nov 2022 09:38:24 +0100 Subject: [PATCH] Fix projection 3d for old matplotlib versions --- fourier/06_direct_fourier.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fourier/06_direct_fourier.py b/fourier/06_direct_fourier.py index e160b1e..cdbaa8e 100644 --- a/fourier/06_direct_fourier.py +++ b/fourier/06_direct_fourier.py @@ -10,6 +10,7 @@ in a continuous fashion if __name__ == "__main__": import numpy as np import matplotlib.pyplot as plt + from mpl_toolkits.mplot3d import Axes3D from mylib.fft import direct_fourier_transform @@ -60,7 +61,7 @@ if __name__ == "__main__": freq_cmap = cmap(freq_norm(test_freqs)) try: # Amplitudes Histogram - if False: + if True: fig = plt.figure() ax = fig.add_subplot(projection='3d') 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()) # Amplitudes figure - if not True: + if True: fig, ax = plt.subplots() ax.set_ylabel("Amplitude") ax.set_xlabel("Frequency")