如何在图的标题中显示 R^2?

如何在图的标题中显示 R^2?

我需要在图的标题中添加 R^2。

以下是代码:

    \documentclass{report}
    \usepackage[utf8]{inputenc}
    \usepackage{graphicx} % Required for inserting images
    \usepackage{setspace}% for\doublespacing
    \usepackage{indentfirst}% for indent the first line
    \usepackage{longtable}
    \usepackage{textalpha} 
    \usepackage{ragged2e}
     \usepackage[T1]{fontenc} % <-- new
    \usepackage{xltabular} 
    \usepackage{amsmath}
    \begin{document}

    
    \begin{figure}[ht]
    \begin{center}
    \includegraphics{Correlation.jpg}
    \caption{The correlation between behavior test results and corticosterone (CORT). A. Correlation between sucrose preference and baseline CORT in the LT cohort (R2 = 0.06, \textit{F} (1, 75) = 4.86, \textit{p} < 0.05). B. Correlation between sucrose preference and recovery CORT in the LT cohort (R2 = 0.12, \textit{F }(1, 75) = 9.93, \textit{p} < 0.05). C. Correlation between sociability ratio (R2 = 0.16, \textit{F} (1, 75) = 14.72, \textit{p} < 0.01) and recovery CORT in the LT cohort. LSR line: Least Squares Regression Line.}
    \label{Correlation.jpg}
   \end{center}
   \end{figure}
   \end{document}

我理想的结果应该是照片中上标2的R:

在此处输入图片描述

答案1

它确实有效,正如我所评论的:

并一直使用数学模式,即删除\textit等等。

在此处输入图片描述

    \documentclass{report}
    \usepackage[utf8]{inputenc}
    \usepackage[draft]{graphicx} % Required for inserting images
%    \usepackage{setspace}% for\doublespacing
%    \usepackage{indentfirst}% for indent the first line
%    \usepackage{longtable}
%    \usepackage{textalpha} 
%    \usepackage{ragged2e}
     \usepackage[T1]{fontenc} % <-- new
%    \usepackage{xltabular} 
    \usepackage{amsmath}
    \begin{document}

    
    \begin{figure}[ht]
    \begin{center}
    \includegraphics{Correlation.jpg}
    \caption{The correlation between behavior test results and corticosterone (CORT). A. Correlation between sucrose preference and baseline CORT in the LT cohort ($R^2 = 0.06$, \textit{F} (1, 75) = 4.86, \textit{p} < 0.05). B. Correlation between sucrose preference and recovery CORT in the LT cohort (R2 = 0.12, \textit{F }(1, 75) = 9.93, \textit{p} < 0.05). C. Correlation between sociability ratio (R2 = 0.16, \textit{F} (1, 75) = 14.72, \textit{p} < 0.01) and recovery CORT in the LT cohort. LSR line: Least Squares Regression Line.}
    \label{Correlation.jpg}
   \end{center}
   \end{figure}
   \end{document}

相关内容