[Tex/LaTex] Change the height of minipage in the figure environment

graphics

How can I change the height of the minipage in the figure envirment? Since I tried it so \includegraphics[width=.6, height=0.8\linewidth]{img/moovit_4} and I got this error
! Illegal unit of measure (pt inserted).
How can I put code here? it is not like stackoverflow, I can not see the icon right to the image icon in the header. I used these quotation marks“

\begin{figure}[H]
\centering
\begin{minipage}{.5\textwidth}
  \centering
  \includegraphics[width=.5\linewidth]{img/moovit_2}
  \captionof{figure}{A figure}
  \label{fig:test1}
\end{minipage}%
\begin{minipage}{.5\textwidth}
  \centering
  \includegraphics[width=.6, height=.8\linewidth]{img/moovit_4}
  \captionof{figure}{Another figure}
  \label{fig:test2}
\end{minipage}
\end{figure}

Best Answer

As @sigur has already pointed out in a comment, you need to adjust the way you specify the width of the second image. You may also want to align the minipages in a way that both captions are at the same level; this can be done, e.g., by setting the location specifier [b] for the two minipage environments.

A separate comment: Since the two minipages occur inside a float of type figure, it's not necessary to write \captionof{figure}{...}; the simpler \caption{...} will do too. Finally, the first \centering statement (right after \begin{figure}[H]) is redundant since the two minipages occupy the full width of the textblock -- nothing there to center, really.

enter image description here

\documentclass{article}
\usepackage[demo]{graphicx} % omit 'demo' option in real document
\usepackage{caption} 
\usepackage{float}   % for "H" location specifier
\begin{document}
\begin{figure}[H]
%%\centering  %% redundant
\begin{minipage}[b]{.5\textwidth}
  \centering
  \includegraphics[width=.5\linewidth]{img/moovit_2}
  \caption{A figure}
  \label{fig:test1}
\end{minipage}%
\begin{minipage}[b]{.5\textwidth}
  \centering
  \includegraphics[width=.6\linewidth, height=.8\linewidth]{img/moovit_4}
  \caption{Another figure}
  \label{fig:test2}
\end{minipage}
\end{figure}
\end{document}