Skip to content

Instantly share code, notes, and snippets.

@arvsrao
Created March 2, 2025 16:02
Show Gist options
  • Save arvsrao/11c3dfae9e301de0cee8ac63a43c45b3 to your computer and use it in GitHub Desktop.
Save arvsrao/11c3dfae9e301de0cee8ac63a43c45b3 to your computer and use it in GitHub Desktop.
a script for ploting multiple implicitly defined functions on the same plot.
from sympy import plot_implicit, symbols, Eq, And
x, y = symbols('x y')
p1 = plot_implicit(Eq(x - y, 0), (x, -5, 5), (y, -5, 5), show=False, line_color='blue', linewidth=1000)
p2 = plot_implicit(Eq(x + y, 0), (x, -5, 5), (y, -5, 5), show=False, line_color='red', linewidth=55)
p3 = plot_implicit(Eq(y, 1), (x, -5, 5), (y, -5, 5), show=False, line_color='green', linewidth=1000)
#p3 = plot_implicit(Eq(2*x - y, 0), (x, -5, 5), (y, -5, 5), show=False, line_color='green', linewidth=1000)
p1.append(p2[0])
p1.append(p3[0])
p1.show()
@arvsrao
Copy link
Author

arvsrao commented Mar 2, 2025

The plot generated by this script is shown below and can also be seen on my blog

figure1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment