I am trying to scale my image to fit in a slide, but when I scale the text in it doesn't scale too.
\documentclass{beamer}
%\setbeamercolor{titlelike}{parent=structure,bg=cyan} %background color
%\setbeamercolor{titlelike}{parent=structure,fg=blue} %colore titoli
%\setbeamercolor{titlelike}{parent=structure,fg=yellow,bg=cyan} %colore e background in un comando
\usepackage{tikz}
\usepgflibrary{arrows.meta}
\usetikzlibrary{calc,quotes,angles}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{groupplots}
\usetikzlibrary{calc}
\usepackage{xcolor}
\definecolor{cobalt}{rgb}{0.0, 0.28, 0.67}
\setbeamercolor{titlelike}{parent=structure,fg=cobalt}
\usepackage{tikz}
\usepackage{subcaption}
\usepgflibrary{arrows.meta}
\usetikzlibrary{calc,quotes,angles}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{groupplots}
\usetikzlibrary{calc} %rido
\setbeamercolor{itemize item}{fg=cobalt} % all frames will have cobalt bullets
\setbeamersize{text margin left=5mm,text margin right=5mm} %margini
%\usebackgroundtemplate{\includegraphics[width=\paperwidth]{logo.jpeg}}
\title{\textbf{title }}
\author{name}
\institute[VFU] % (optional)
{
\inst{1}%
thesis\
uni
\and
\inst{2}%
prof1\
pro2
}
\date[VLC 2013] % (optional)
{Lmarch}
\titlegraphic{\includegraphics[height=1.5cm]{logo.jpeg}}
\begin{document}
\maketitle
\begin{frame}
\frametitle{Turbo-compressore}
\begin{figure}[h]
\centering
\begin{tikzpicture}
%Compressore e Plenum
\draw [thick] (0,4)--(1,4)--(1,5.5)--(3,5)--(3,4)--(3.2,4)--(3.2,5.5)--(7,5.5)--(7,4);
\draw [thick] (0,3)--(1,3)--(1,1.5)--(3,2)--(3,3)--(3.2,3)--(3.2,1.5)--(7,1.5)--(7,3);
%Motore e Turbina
\draw [thick] (7,4)--(7.5,4)--(7.5,4.5)--(10,4.5)--(10,4)--(10.2,4)--(10.2,5)--(12.2,5.5)--(12.2,4)--(13.2,4);
\draw [thick] (7,3)--(7.5,3)--(7.5,2.5)--(10,2.5)--(10,3)--(10.2,3)--(10.2,2)--(12.2,1.5)--(12.2,3)--(13.2,3);
%Gancio
\draw [thick] (2,1.75)--(2,1)--(11.2,1)--(11.2,1.75);
%Valvola Throttle
\draw [thick] (6.8,4)--(7.2,3);
\draw [thick] (6.8,3)--(7.2,4);
\draw [thick] (6.8,3)--(7.2,3);
\draw [thick] (6.8,4)--(7.2,4);
%Scritte
\node[text width=3cm] at (2.5,0.5) {Compressore};
\node[text width=3cm] at (6,0.5) {Plenum};
%\node[text width=1cm] at (6.8,3) {Throttle};
\node[text width=3cm] at (9.4,0.5) {Motore};
\node[text width=3cm] at (12,0.5) {Turbina};
\node[text width=3cm] at (3.6,3.6) {$m_{in},T_{in}$};
\node[text width=3cm] at (3.4,4.5) {$p_c$};
%\node[text width=3cm] at (2.5,4.5) {$T_{in}$};
\node[text width=3cm] at (5.8,5) {$V_p,\rho_p,p_p$};
\node[text width=3cm] at (9,3.6) {$m_{out},T_p$};
\draw [->] (2.5,3.2)--(3.5,3.2);
\draw [->] (7.7,3.2)--(8.7,3.2);
\end{tikzpicture}
\caption{\textit{Modellazione sistema di turbo-compressione}}
\label{fig:sistema_turbo_compressione}
\end{figure}
\end{frame}
\end{document}