Using Tikz
/ pgfplots
, how can you plot a function with two variables, such as:
|x| + |y| <= 1 / sqrt(2)
?
If the function only had one input,X
, it is easy to plot:
\begin{figure}[!hb]
\centering
\begin{tikzpicture}[scale=1.0]
\begin{axis}
\addplot[domain=-10000:10000, blue, ultra thick] {abs(x)};
\end{axis}
\end{tikzpicture}
\caption{Plot of $\abs(x)$}
\end{figure}
However, the following produces an error
\addplot[domain=-10000:10000, blue, ultra thick] {abs(x) + abs(y) <= 1 / sqrt(2)};
Best Answer
You can use a parametrization (well, two in this case):