Consider we have an autonomous differential equation
$$\dfrac{dy}{dt}=f(y)$$
and we need to draw a slope field using the information from this graph:

I know how to sketch this by hand, but I am trying to sketch it using a software and I want to know if it was possible to know what is the equation $f(y)$ from just looking at this graph. All I can see is that we have four equilibrium points: $y=-4$, $y=-2$, $y=1$ and $y=4$.
And we can also tell for what values of $y$ the function $f(y)$ is either positive or negative.
I tried $$f(y)=(y+4)(y+2)(y-1)(y-4)$$ but it did not give me the correct slope field. Would it be possible to figure the equation of $f(y)$ out? Or is the only way to sketch it is by hand?
If all you have is this graph, then it would be impossible to be sure one has the right formula. Since the derivative is not continuous, it would look like
if $x<2$ then $f(x)=\;$some nonlinear function if $x>2$ then $f(x)=ax+b$