The title says it all. I have a tikzplot. I have a legend. And I have some content that is too big for the legend box. Please help. This is my code:
\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}%
[
xmin=-7,
xmax=7,
axis x line=bottom,
ymax=7,
axis y line=middle,
axis x line=middle,
domain=-7:7,
legend style={at={(0.7,0.9)}} ,
ylabel=$y$,
xlabel=$x$,
]
\addplot[red,mark=none]{(x>=0)*x};
\legend{$ f(x)=\left\{\begin{array}{lll}
0 & \text { for } & x<0 \\
x & \text { for } & x \geq 0
\end{array}\right.$}
\end{axis}
\end{tikzpicture}
\end{figure}