# Trying to plot (x**2+y**2-1)**3-x**2*x**3 using matplotlib

###### Posted By: Anonymous

Help would be appreciated, as I can’t find a way to do anything similiar.

## Solution

You can create a contour plot with only a contour line at `z == 0`

:

```
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1.5, 1.5, 200)
y = np.linspace(-1.5, 1.5, 200)
z = (x ** 2 + y[:, np.newaxis] ** 2 - 1) ** 3 - x ** 2 * y[:, np.newaxis] ** 3
plt.contour(x, y, z, [0])
plt.axis('equal')
plt.show()
```

###### Answered By: Anonymous

### Related Articles

- Generating a PNG with matplotlib when DISPLAY is undefined
- Use a loop to plot n charts Python
- Matplotlib scatter plot legend
- Change line width of lines in matplotlib pyplot legend
- Setting Different Bar color in matplotlib Python
- Adding a legend to PyPlot in Matplotlib in the…
- why is plotting with Matplotlib so slow?
- finding the k nearest neighbours
- Plotting a fast Fourier transform in Python
- Draw a line between points in a 2D histogram
- Scatter plot and Color mapping in Python
- Matplotlib 2 Subplots, 1 Colorbar
- Real time plotting in matplotlib from a numpy array
- warning about too many open figures
- Creating lowpass filter in SciPy - understanding…
- plot a circle with pyplot
- _tkinter.TclError: no display name and no $DISPLAY…
- Format y axis as percent
- Plotting in a non-blocking way with Matplotlib
- Is there a function in python that can easily plot…
- numpy matrix vector multiplication
- Matplotlib imshow: Color of NaN changes when change…
- How do I tell Matplotlib to create a second (new)…
- Unexpected end of JSON input while parsing
- When to use cla(), clf() or close() for clearing a…
- opencv can't extract biggest contour in image
- ValueError: x and y must be the same size when try…
- How to plot vectors in python using matplotlib
- How to set xlim and ylim for a subplot in matplotlib
- Tkinter GUI in for loop
- 3D Rotation of a camera using its own, new axes
- Matplotlib - How to plot a high resolution graph?
- making matplotlib scatter plots from dataframes in…
- Create 3D Plot (not surface, scatter), where colour…
- How can I set the 'backend' in matplotlib in Python?
- Generating matplotlib graphs without a running X server
- In CSS Flexbox, why are there no "justify-items" and…
- Changing the "tick frequency" on x or y axis in matplotlib?
- How can I set the aspect ratio in matplotlib?
- How to put the legend out of the plot
- How to remove frame from matplotlib (pyplot.figure…
- How to get multiplier string of scientific notation…
- How can I plot with 2 different y-axes?
- What is the difference between Numpy's array() and…
- Reference - What does this regex mean?
- TypeError: Invalid dimensions for image data when…
- Removing white space around a saved image in matplotlib
- Reduce left and right margins in matplotlib plot
- IndexError: index 1 is out of bounds for axis 0 with…
- How to fix Python Numpy/Pandas installation?
- Moving matplotlib legend outside of the axis makes…
- Change grid interval and specify tick labels in Matplotlib
- Scatter plots in Pandas/Pyplot: How to plot by category
- How to extract only brain part in center in MRI image?
- What do hjust and vjust do when making a plot using ggplot?
- Possible to make labels appear when hovering over a…
- How to make IPython notebook matplotlib plot inline
- Converting between datetime, Timestamp and datetime64
- matplotlib does not show my drawings although I call…
- How to implement band-pass Butterworth filter with…
- What makes the different performances between…
- How to set x axis values in matplotlib python?
- Setting Y limit of matplotlib range automatically
- How to normalize probability distribution values in…
- Python - how to label an additional axis / colorbar
- multiple plot in one figure in Python
- multiple axis in matplotlib with different scales
- plotting confidence interval for linear regression…
- Peak-finding algorithm for Python/SciPy
- How do I remove single children in a tree?
- Python equivalent to 'hold on' in Matlab
- Content is not allowed in Prolog SAXParserException
- The data points in the beeswarm plot produced using…
- Octave using 'for' statement to show two animations…
- matplotlib: plot multiple columns of pandas data…
- how to correctly display the integral on the graph?
- Named colors in matplotlib
- sympy Maximum-Likelihood: clarification of script from book
- Dynamically updating plot in matplotlib
- How to show matplotlib plots in python
- Set Colorbar Range in matplotlib
- matplotlib colorbar for scatter
- Matplotlib color according to class labels
- Gaussian fit for Python
- How to make several plots on a single page using matplotlib?
- vertical & horizontal lines in matplotlib
- Customise my own colour palette and use in geopandas map
- How to use colormap in subplots?
- Secondary axis with twinx(): how to add to legend?
- ImportError: No module named matplotlib.pyplot
- Matplotlib: ValueError: x and y must have same first…
- How to plot a wide dataframe with colors and…
- How to show two figures using matplotlib?
- plot different color for different categorical…
- How to adjust the size of y axis labels only in R?
- How can I show figures separately in matplotlib?
- Plotting a 3D array second by second without…
- including regression coefficient and pvalue in the ggplot2
- Use of "extend" in a contourf plot with a discrete…
- Installation Issue with matplotlib Python

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.