Skip to content
Advertisement

obtaining a single plot of two contour lines matplotlib

I am making a program that interpolates the points of some level curves, but when it comes to graphing, I am obtaining two individual graphs of the two level curves and not a single graph.

JavaScript

I would like to get this output:

enter image description here

Advertisement

Answer

You need to declare plt.figure() only once, outside of the for loop. Inside the for loop you add elements to the plot. Finally, outside of the loop you set axis labels and show the plot.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement