![子浮點標籤](https://rvso.com/image/266411/%E5%AD%90%E6%B5%AE%E9%BB%9E%E6%A8%99%E7%B1%A4.png)
我正在製作一個包含 30 個無花果、5 行 6 列的圖形。我想做的是:在圖的每一行的開頭我想寫一些文本,但我希望它是垂直而不是水平的。對於列,我想編寫一個文字並將其分組為每兩列,因此例如在第 1 列和第 2 列的頂部寫入 data1 ,該資料將位於兩列之間的中心。這對我來說真的很難。
該圖解釋了我想在紅色標記中放置文字的地方做什麼
這是我的程式碼範例:
\begin{figure*}[t]
\centering
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_no_of_levels}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_entropy}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_mean}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x640_Sensor_Lights_On_1000mm-pgms/x640_Sensor_Lights_On_1000mm-pgms_no_of_levels}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x640_Sensor_Lights_On_1000mm-pgms/x640_Sensor_Lights_On_1000mm-pgms_entropy}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x640_Sensor_Lights_On_1000mm-pgms/x640_Sensor_Lights_On_1000mm-pgms_mean}}\\
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_no_of_levels}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_entropy}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}
\subfloat[]{\includegraphics[width=.33\linewidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}
\caption{aaa}
\label{fig:rulascore}
\end{figure*}
更新:
我已經更新了“下面”的程式碼,但沒有出現任何內容,如圖所示
使用的程式碼:
\begin{figure*}
\centering
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image11)
{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_no_of_levels}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image12)
{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_entropy}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image13)
{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_no_of_levels}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image14)
{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_entropy}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image15)
{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_no_of_levels}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image16)
{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_entropy}};
\end{tikzpicture}}\\
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image21)
{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_no_of_levels}};
\end{tikzpicture}}\hfill
\subfloat[]{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_entropy}}\hfill
\subfloat[]{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_no_of_levels}}\hfill
\subfloat[]{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_entropy}}\hfill
\subfloat[]{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_no_of_levels}}\hfill
\subfloat[]{\includegraphics[trim=2cm 7cm 2cm 7cm, clip=true,width=.15\linewidth]{../Hussein/MatFiles/interference/1500/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms/x320_Sensor_Lights_On_1500mm_with_interference_distance_1100-pgms_entropy}}
\caption{aaa}
\label{fig:rulascore}
\end{figure*}
\begin{tikzpicture}[remember picture,overlay]
\node[above] at ( $ (image11.north)!0.5!(image12.north) $ ) {some text goes here};
\node[above] at ( $ (image13.north)!0.5!(image14.north) $ ) {some text goes here};
\node[above] at ( $ (image15.north)!0.5!(image16.north) $ ) {some text goes here};
\node[rotate=90,yshift=10pt] at (image11.west) {some text};
\node[rotate=90,yshift=10pt] at (image21.west) {some text};
\end{tikzpicture}
答案1
這是一種使用的可能性TikZ
;這個想法是將第一行和第一列的每個圖形放置在命名節點內,然後使用這些節點來放置文字:
\documentclass{article}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\usepackage{tikz}
\usetikzlibrary{calc}
\tikzset{
mynode/.style={anchor=south west,inner sep=0,outer sep=0pt}}
\begin{document}
\begin{figure*}
\centering
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image11)
{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_no_of_levels}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image12)
{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_entropy}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image13)
{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/k640_Sensor_Lights_On_1000mm-pgms/k640_Sensor_Lights_On_1000mm-pgms_mean}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image14)
{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x640_Sensor_Lights_On_1000mm-pgms/x640_Sensor_Lights_On_1000mm-pgms_no_of_levels}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image15)
{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x640_Sensor_Lights_On_1000mm-pgms/x640_Sensor_Lights_On_1000mm-pgms_entropy}};
\end{tikzpicture}}\hfill
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image16)
{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x640_Sensor_Lights_On_1000mm-pgms/x640_Sensor_Lights_On_1000mm-pgms_mean}};
\end{tikzpicture}}\\
\subfloat[]{%
\begin{tikzpicture}[remember picture]
\node[mynode] (image21)
{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_no_of_levels}};
\end{tikzpicture}}\hfill
\subfloat[]{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_entropy}}\hfill
\subfloat[]{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}\hfill
\subfloat[]{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}\hfill
\subfloat[]{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}\hfill
\subfloat[]{\includegraphics[width=.15\textwidth]{../Hussein/MatFiles/Lights/x320_Sensor_Lights_On_1000mm-pgms/x320_Sensor_Lights_On_1000mm-pgms_mean}}
\caption{aaa}
\label{fig:rulascore}
\end{figure*}
\begin{tikzpicture}[remember picture,overlay]
\node[above] at ( $ (image11.north)!0.5!(image12.north) $ ) {some text goes here};
\node[above] at ( $ (image13.north)!0.5!(image14.north) $ ) {some text goes here};
\node[above] at ( $ (image15.north)!0.5!(image16.north) $ ) {some text goes here};
\node[rotate=90,yshift=10pt] at (image11.west) {some text};
\node[rotate=90,yshift=10pt] at (image21.west) {some text};
\end{tikzpicture}
\end{document}
此demo
選項graphicx
簡單地將實際圖形替換為黑色矩形;做不是在您的實際文件中使用該選項。
與問題沒有直接關係,但您的圖像對於文字區域寬度來說太寬(或者您可能正在使用編寫兩列文件?);無論如何,我將寬度從 更改為0.33\linewidth
並0.15\textwidth
用於\hfill
均勻地分隔每行中的數字(當然,您可以恢復這些更改)。此外,[t]
的選項figure
可能過於嚴格;我從我的例子中抑制了它。