Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

weird behavior of show command

Hi The code

f(x,y)=x^3-x^2 + y^2;print f
g1 = contour_plot(f(x,y),(x,-2,2),(y,-2,2),contours=20,fill=False,cmap='spectral')
show(g1)

produces a plot with a hyperbolic point. On my computer, repeating this

show(g1)

yields a different plot

The purpose was to show this together with gradient field

f(x,y)=(x+2)^2/(y^2+ (x-1/2)^2) ;print f
g1 = contour_plot(f(x,y),(x,-2,6),(y,-2,4),contours=[1/10,1/2,4/5,1,2,3],cmap='spectral',fill=False)
df=f.gradient()
show(df)
g2 = plot_vector_field(df,(x,-2,2),(y,-2,2))

This doesn't work, since the first plot is incorrect show(g1+g2)