I'm having an issue with my code. I will be trying to eliminate variables from a system of simultaneous equations and just trying to plot 2 of them. In the simplest example, I am hoping the following will plot the line $y = x$:
ContourPlot[Eliminate[{x == z, z == y}, z], {x, -5, 5}, {y, -5, 5}]
But it just returns the blank square. What is the syntax for actually plotting the correct $x, y$ points that solve the equation?
Eliminate[{x == z, z == y}, z]
which givesy = x
, which is certainly not in any form appropriate forContourPlot
. $\endgroup$ContourPlot[ Eliminate[{x == z, z == y}, z] // Evaluate, {x, -5, 5}, {y, -5, 5}]
$\endgroup$ContourPlot
holds the code (does not let it evaluate) and inspects theHead[]
of the code to determine what sort of contour plot will be constructed. TheHead
in your case isEliminate
, and it does not know what to do with it. Hence, @cvgmt's solution. $\endgroup$