Using this code to try and plot the slope fields for xy' - y = 0 (which is y = cx) and there's a clear lack of symmetry on both sides.
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[declare function={f(\x,\y)=\y/\x;}]
\def\xmax{3} \def\xmin{-3}
\def\ymax{3} \def\ymin{-3}
\def\nx{15}
\def\ny{15}
\pgfmathsetmacro{\hx}{(\xmax-\xmin)/\nx}
\pgfmathsetmacro{\hy}{(\ymax-\ymin)/\ny}
\foreach \i in {0,...,\nx}
\foreach \j in {0,...,\ny}{
\pgfmathsetmacro{\yprime}{f({\xmin+\i*\hx},{\ymin+\j*\hy})}
\draw[blue,shift={({\xmin+\i*0.4},{\ymin+\j*0.4})}]
(0,0)--($(0,0)!2mm!(.1,.1*\yprime)$);
}
\draw[->] (\xmin-.5,0)--(\xmax+.5,0) node[below right] {$x$};
\draw[->] (0,\ymin-.5)--(0,\ymax+.5) node[above left] {$y$};
\draw (current bounding box.north) node[above]
{Slope field of \quad $y'=x+y$.};
\end{tikzpicture}
\end{document}
Taken from here
I was able to use this to draw what I wanted, but I don't like the output. Also I really want to know why the code I posted is not symmetric. I even typed it up in python to try and figure it out:
xmax = 3
xmin = -3
ymax = 3
ymin = -3
nx = 15
ny = 15
hx = (xmax - xmin)/nx
hy = (ymax - ymin)/ny
for i in range(0, nx+1):
for j in range(0, ny+1):
yprime = (xmin+(i*hx))/(ymin+(j*hy))
if -1 == yprime or yprime == 1:
print((xmin+(i*hx)))
print((ymin+(j*hy)))
print("xmin", xmin,"i", i,"hx", hx,"ymin", ymin,"j", j,"hy", hy)
print ("yprime ", yprime)
It didn't help, but maybe it would be useful for someone else.

