Re: [Matplotlib-users] Ploting f(x;y)=0

 Re: [Matplotlib-users] Ploting f(x;y)=0 From: - 2009-01-29 08:53:38 ```>On Jan 28, 2009, at 8:26 AM, projetmbc@... wrote: > >> I'm looking a solution for ploting relation like f(x;y)=0. > >I usually just contour the function over the region. E.g., > > >>> import numpy as np > >>> import matplotlib.pyplot as plt > >>> x, y = mgrid[-10:10:50j, -10:10:50j] > >>> f = x**3 * y - 3.0 > >>> contour(x, y, f, (0,)) > >The fourth argument to contour is a list of contours to plot, here >only zero. > >-Rob Thanks, this works well with the following minor changes. import numpy as np import matplotlib.pyplot as plt x, y = np.mgrid[-10:10:50j, -10:10:50j] f = x*np.sin(y) + y * np.sin(x) -4.0 plt.contour(x, y, f, (0,)) plt.show() ```

 Re: [Matplotlib-users] Ploting f(x;y)=0 From: - 2009-01-29 08:53:38 ```>On Jan 28, 2009, at 8:26 AM, projetmbc@... wrote: > >> I'm looking a solution for ploting relation like f(x;y)=0. > >I usually just contour the function over the region. E.g., > > >>> import numpy as np > >>> import matplotlib.pyplot as plt > >>> x, y = mgrid[-10:10:50j, -10:10:50j] > >>> f = x**3 * y - 3.0 > >>> contour(x, y, f, (0,)) > >The fourth argument to contour is a list of contours to plot, here >only zero. > >-Rob Thanks, this works well with the following minor changes. import numpy as np import matplotlib.pyplot as plt x, y = np.mgrid[-10:10:50j, -10:10:50j] f = x*np.sin(y) + y * np.sin(x) -4.0 plt.contour(x, y, f, (0,)) plt.show() ```