From 5eb99eebf39624671f076126b8cc2a8ad017397a Mon Sep 17 00:00:00 2001 From: Vidya Date: Tue, 16 Feb 2021 11:07:44 +0530 Subject: [PATCH] Set 'ax' with plt.axes Define 'ax' before setting the title to remove "name 'ax' is not defined" error. --- Chapter05/5. scatter_plots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter05/5. scatter_plots.py b/Chapter05/5. scatter_plots.py index 7525160..80f617e 100644 --- a/Chapter05/5. scatter_plots.py +++ b/Chapter05/5. scatter_plots.py @@ -31,8 +31,8 @@ # show this as a 3D plot fig = plt.figure() plt.suptitle("Latitude, Temperature, and Elevation in 2019") -ax.set_title('Three D') ax = plt.axes(projection='3d') +ax.set_title('Three D') ax.set_xlabel("Elevation") ax.set_ylabel("Latitude") ax.set_zlabel("Avg Temp")