xmin, xmax, ymin, ymax = xdata.min(), xdata.max(), ydata.min(), ydata.max() g = lambda x, y: func1(res_lsq.x, x, y)**2 X, Y = np.meshgrid(np.linspace(xmin-0.2, xmax+0.2, 1000), np.linspace(ymin-0.2, ymax+0.2, 1000)) Z = g(X, Y) # heavy computations.... # plotting the result plt.contourf(X, Y, np.log(Z), levels=[-10,-8]) plt.gca().scatter(xdata, ydata) plt.colorbar() plt.show()
How to plot implicit functions (with two variables) in scipy python using matplotlib?
Messages In This Thread |
How to plot implicit functions (with two variables) in scipy python using matplotlib? - by Jay_Nerella - May-09-2019, 09:48 PM
RE: How to plot implicit functions (with two variables) in scipy python using matplotlib? - by scidam - May-11-2019, 01:17 AM
|
Users browsing this thread: 2 Guest(s)