Skip to content
Advertisement

How to Plot Implicit Equation in Python

I want to Plot V(y axis) vs t(x axis) graph using the below equation at 5 different values of L(shown below)

L= [5,10,15,20,25]

b=0.0032

Equation, (b*V*0.277*t) – (b*L) = log(1+b*V*0.277*t)

code output will be as shown in figure Expected Outcome

Advertisement

Answer

While sympy exposes the plot_implicit function, the results are far from good. We can use Numpy and Matplotlib to achieve our goal.

The basic idea is that your equation can be written as LHS - RHS = 0. So, we can create contour plots and select the level 0. But contour plots uses colormaps, so we will have to create solid colormaps:

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement