I have a plot with an image, which is created with the below code, and renders as the top plot in the image below. If I decide part of the plot contains unnecessary data, how do I crop this out such that it renders like the second plot below? Also, it's important that the aspect ratio of the image is not distorted.
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xlabel={x axis},ylabel={y axis},
xtick distance=1,ytick distance=1,
width=10cm,height=4.44062cm,
enlargelimits=false,
scale only axis=true,
tick align=outside,]
\addplot graphics[xmin=0, xmax=5, ymin=0, ymax=5] {Images/test};
\end{axis}
\end{tikzpicture}
\end{document}