制作 3x3 子图,颜色条位于北侧

制作 3x3 子图,颜色条位于北侧

我想让我的九个 (2d) matlab 图在 latex 中显示为 3x3 子图,颜色条位于北侧。我不知道该怎么做,尤其是我将颜色条与图形分开保存为 .eps 图像。任何熟悉 latex 和 matlab 的人,请指导我完成这项工作。谢谢,

答案1

为了只有一张照片

\begin{figure}
\centering
\includegraphics[width=1.00\textwidth]{Picture}
\caption{Alcune litografie di M.~Escher.}
\label{fig:subfig}
\end{figure}

为了两张或更多张图片:9 的情况(3x3)使用 subfig包装。

\begin{figure}
\centering
\subfloat[][\emph{caption pic. 1}.]
{\includegraphics[width=.3\textwidth]{name file pic1}} \quad
\subfloat[][\emph{caption pic. 2}.]
{\includegraphics[width=.3\textwidth]{name file pic2}} \quad
\subfloat[][\emph{caption pic. 3}.]
{\includegraphics[width=.3\textwidth]{name file pic3}} \\
\subfloat[][\emph{caption pic. 4}.]
{\includegraphics[width=.3\textwidth]{name file pic4}} \quad
\subfloat[][\emph{caption pic. 5}.]
{\includegraphics[width=.3\textwidth]{name file pic5}} \quad
\subfloat[][\emph{caption pic. 6}.]
{\includegraphics[width=.3\textwidth]{name file pic6}} \\
\subfloat[][\emph{caption pic. 7}.]
{\includegraphics[width=.3\textwidth]{name file pic7}} \quad
\subfloat[][\emph{caption pic. 8}.]
{\includegraphics[width=.3\textwidth]{name file pic8}} \quad
\subfloat[][\emph{caption pic. 9}.]
{\includegraphics[width=.3\textwidth]{name file pic9}}
\caption{Insert caption.}
\label{fig:subfig}
\end{figure}

对于矢量文件,不要写扩展名(.eps,.pdf,...)

编辑:

从 Matlab 直接到 Tikz

下载matlab2tikz这里. 在 Matlab 上创建你的图形。例如:

rng(0,'twister');
X = randn(50,3);
figure
[H,AX,BigAx,P,PAx] = plotmatrix(X);
set(H(3),'Color','g','Marker','*');
set(P(3),'EdgeColor','k','FaceColor','g');
title(BigAx,'A Comparison of Data Sets');

你获得这张图片

matlab中的图

matlab2tikz之后,您可以从命令窗口启动。您可以写入

matlab2tikz

或添加一些选项(阅读帮助)

matlab2tikz(...)

它使用可编译代码创建一个新的文件 .tex:

\documentclass[]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-2.9,
xmax=4.9,
xtick={-2,0,2,4},
xticklabels={\empty},
ymin=-2.9,
ymax=4.9,
ytick={-2,0,2,4},
yticklabels={\empty},
name=plot6
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
-0.863652821988714  -0.863652821988714  \\
0.0773590911304249  0.0773590911304249  \\
-1.21411704361541   -1.21411704361541   \\
-1.11350074148676   -1.11350074148676   \\
-0.00684932810334806    -0.00684932810334806    \\
1.53263030828475    1.53263030828475    \\
-0.769665913753682  -0.769665913753682  \\
0.371378812760058   0.371378812760058   \\
-0.225584402271252  -0.225584402271252  \\
1.11735613881447    1.11735613881447    \\
-1.08906429505224   -1.08906429505224   \\
0.0325574641649735  0.0325574641649735  \\
0.552527021112224   0.552527021112224   \\
1.10061021788087    1.10061021788087    \\
1.54421189550395    1.54421189550395    \\
0.0859311331754255  0.0859311331754255  \\
-1.49159031063761   -1.49159031063761   \\
-0.742301837259857  -0.742301837259857  \\
-1.06158173331999   -1.06158173331999   \\
2.35045722400204    2.35045722400204    \\
-0.615601881466894  -0.615601881466894  \\
0.748076783703985   0.748076783703985   \\
-0.192418510588264  -0.192418510588264  \\
0.888610425420721   0.888610425420721   \\
-0.764849236567874  -0.764849236567874  \\
-1.40226896933876   -1.40226896933876   \\
-1.4223759250915    -1.4223759250915    \\
0.488193909859941   0.488193909859941   \\
-0.177375156618825  -0.177375156618825  \\
-0.196053487807333  -0.196053487807333  \\
1.41931015064255    1.41931015064255    \\
0.291584373984183   0.291584373984183   \\
0.197811053464361   0.197811053464361   \\
1.58769908997406    1.58769908997406    \\
-0.804465956349547  -0.804465956349547  \\
0.696624415849607   0.696624415849607   \\
0.835088165072682   0.835088165072682   \\
-0.243715140377952  -0.243715140377952  \\
0.215670086403744   0.215670086403744   \\
-1.16584393148205   -1.16584393148205   \\
-1.14795277889859   -1.14795277889859   \\
0.104874716016494   0.104874716016494   \\
0.722254032225002   0.722254032225002   \\
2.58549125261624    2.58549125261624    \\
-0.666890670701386  -0.666890670701386  \\
0.18733102457894    0.18733102457894    \\
-0.0824944253709554 -0.0824944253709554 \\
-1.93302291785099   -1.93302291785099   \\
-0.438966153934773  -0.438966153934773  \\
-1.79467884145512   -1.79467884145512   \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
colormap/jet,
scale only axis,
xmin=-2.9,
xmax=4.9,
xtick={\empty},
ymin=0,
ymax=10,
ytick={\empty}
]

\addplot[area legend,patch,forget plot]
 table[row sep=crcr, point meta=\thisrow{c}] {
x   y   c\\
-1.93302291785099   0   1   \\
-1.93302291785099   3   1   \\
-1.48117150080426   3   1   \\
-1.48117150080426   0   1   \\
-1.48117150080426   0   1   \\
-1.48117150080426   8   1   \\
-1.02932008375754   8   1   \\
-1.02932008375754   0   1   \\
-1.02932008375754   0   1   \\
-1.02932008375754   7   1   \\
-0.577468666710818  7   1   \\
-0.577468666710818  0   1   \\
-0.577468666710818  0   1   \\
-0.577468666710818  6   1   \\
-0.125617249664095  6   1   \\
-0.125617249664095  0   1   \\
-0.125617249664095  0   1   \\
-0.125617249664095  10  1   \\
0.326234167382627   10  1   \\
0.326234167382627   0   1   \\
0.326234167382627   0   1   \\
0.326234167382627   6   1   \\
0.77808558442935    6   1   \\
0.77808558442935    0   1   \\
0.77808558442935    0   1   \\
0.77808558442935    4   1   \\
1.22993700147607    4   1   \\
1.22993700147607    0   1   \\
1.22993700147607    0   1   \\
1.22993700147607    4   1   \\
1.6817884185228 4   1   \\
1.6817884185228 0   1   \\
1.6817884185228 0   1   \\
1.6817884185228 0   1   \\
2.13363983556952    0   1   \\
2.13363983556952    0   1   \\
2.13363983556952    0   1   \\
2.13363983556952    2   1   \\
2.58549125261624    2   1   \\
2.58549125261624    0   1   \\
};

\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-2.9,
xmax=4.9,
ymin=-6.5,
ymax=6.5,
ytick={-5,0,5},
yticklabels={\empty},
name=plot3,
at=(plot6.below south west),
anchor=above north west
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
-0.863652821988714  0.840375529753905   \\
0.0773590911304249  -0.88803208232901   \\
-1.21411704361541   0.100092833139322   \\
-1.11350074148676   -0.544528929990548  \\
-0.00684932810334806    0.303520794649354   \\
1.53263030828475    -0.600326562133734  \\
-0.769665913753682  0.489965321173948   \\
0.371378812760058   0.739363123604474   \\
-0.225584402271252  1.71188778298155    \\
1.11735613881447    -0.194123535758265  \\
-1.08906429505224   -2.13835526943994   \\
0.0325574641649735  -0.839588747336614  \\
0.552527021112224   1.35459432800464    \\
1.10061021788087    -1.07215528838425   \\
1.54421189550395    0.960953869740567   \\
0.0859311331754255  0.124049800003193   \\
-1.49159031063761   1.43669662271894    \\
-0.742301837259857  -1.96089999936503   \\
-1.06158173331999   -0.19769822597415   \\
2.35045722400204    -1.2078454852598    \\
-0.615601881466894  2.90800803072936    \\
0.748076783703985   0.825218894228491   \\
-0.192418510588264  1.37897197791661    \\
0.888610425420721   -1.05818025798736   \\
-0.764849236567874  -0.468615581100624  \\
-1.40226896933876   -0.272469409250187  \\
-1.4223759250915    1.09842461788862    \\
0.488193909859941   -0.277871932787639  \\
-0.177375156618825  0.701541458163284   \\
-0.196053487807333  -2.05181629991115   \\
1.41931015064255    -0.353849997774433  \\
0.291584373984183   -0.823586525156853  \\
0.197811053464361   -1.5770570227992    \\
1.58769908997406    0.507974650905946   \\
-0.804465956349547  0.281984063670556   \\
0.696624415849607   0.0334798822444514  \\
0.835088165072682   -1.33367794342811   \\
-0.243715140377952  1.12749227834159    \\
0.215670086403744   0.350179410603312   \\
-1.16584393148205   -0.299066030332982  \\
-1.14795277889859   0.0228897927516298  \\
0.104874716016494   -0.261995434966092  \\
0.722254032225002   -1.75021236844679   \\
2.58549125261624    -0.28565097159533   \\
-0.666890670701386  -0.831366511567624  \\
0.18733102457894    -0.979206305167302  \\
-0.0824944253709554 -1.156401655664 \\
-1.93302291785099   -0.533557109315987  \\
-0.438966153934773  -2.00263573588306   \\
-1.79467884145512   0.964229422631627   \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-6.5,
xmax=6.5,
ymin=-6.5,
ymax=6.5,
ytick={-5,0,5},
yticklabels={\empty},
name=plot2,
at=(plot3.right of south east),
anchor=left of south west
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
0.840375529753905   0.840375529753905   \\
-0.88803208232901   -0.88803208232901   \\
0.100092833139322   0.100092833139322   \\
-0.544528929990548  -0.544528929990548  \\
0.303520794649354   0.303520794649354   \\
-0.600326562133734  -0.600326562133734  \\
0.489965321173948   0.489965321173948   \\
0.739363123604474   0.739363123604474   \\
1.71188778298155    1.71188778298155    \\
-0.194123535758265  -0.194123535758265  \\
-2.13835526943994   -2.13835526943994   \\
-0.839588747336614  -0.839588747336614  \\
1.35459432800464    1.35459432800464    \\
-1.07215528838425   -1.07215528838425   \\
0.960953869740567   0.960953869740567   \\
0.124049800003193   0.124049800003193   \\
1.43669662271894    1.43669662271894    \\
-1.96089999936503   -1.96089999936503   \\
-0.19769822597415   -0.19769822597415   \\
-1.2078454852598    -1.2078454852598    \\
2.90800803072936    2.90800803072936    \\
0.825218894228491   0.825218894228491   \\
1.37897197791661    1.37897197791661    \\
-1.05818025798736   -1.05818025798736   \\
-0.468615581100624  -0.468615581100624  \\
-0.272469409250187  -0.272469409250187  \\
1.09842461788862    1.09842461788862    \\
-0.277871932787639  -0.277871932787639  \\
0.701541458163284   0.701541458163284   \\
-2.05181629991115   -2.05181629991115   \\
-0.353849997774433  -0.353849997774433  \\
-0.823586525156853  -0.823586525156853  \\
-1.5770570227992    -1.5770570227992    \\
0.507974650905946   0.507974650905946   \\
0.281984063670556   0.281984063670556   \\
0.0334798822444514  0.0334798822444514  \\
-1.33367794342811   -1.33367794342811   \\
1.12749227834159    1.12749227834159    \\
0.350179410603312   0.350179410603312   \\
-0.299066030332982  -0.299066030332982  \\
0.0228897927516298  0.0228897927516298  \\
-0.261995434966092  -0.261995434966092  \\
-1.75021236844679   -1.75021236844679   \\
-0.28565097159533   -0.28565097159533   \\
-0.831366511567624  -0.831366511567624  \\
-0.979206305167302  -0.979206305167302  \\
-1.156401655664 -1.156401655664 \\
-0.533557109315987  -0.533557109315987  \\
-2.00263573588306   -2.00263573588306   \\
0.964229422631627   0.964229422631627   \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
colormap/jet,
scale only axis,
xmin=-6.5,
xmax=6.5,
xtick={\empty},
ymin=0,
ymax=15,
ytick={\empty}
]

\addplot[area legend,patch,forget plot]
 table[row sep=crcr, point meta=\thisrow{c}] {
x   y   c\\
-2.13835526943994   0   1   \\
-2.13835526943994   5   1   \\
-1.63371893942301   5   1   \\
-1.63371893942301   0   1   \\
-1.63371893942301   0   1   \\
-1.63371893942301   4   1   \\
-1.12908260940608   4   1   \\
-1.12908260940608   0   1   \\
-1.12908260940608   0   1   \\
-1.12908260940608   7   1   \\
-0.624446279389148  7   1   \\
-0.624446279389148  0   1   \\
-0.624446279389149  0   1   \\
-0.624446279389149  12  1   \\
-0.119809949372218  12  1   \\
-0.119809949372218  0   1   \\
-0.119809949372218  0   1   \\
-0.119809949372218  7   1   \\
0.384826380644712   7   1   \\
0.384826380644712   0   1   \\
0.384826380644712   0   1   \\
0.384826380644712   6   1   \\
0.889462710661642   6   1   \\
0.889462710661642   0   1   \\
};

\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-6.5,
xmax=6.5,
xtick={-5,0,5},
xticklabels={\empty},
ymin=-2.9,
ymax=4.9,
ytick={-2,0,2,4},
yticklabels={\empty},
name=plot5,
at=(plot2.above north west),
anchor=below south west
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
0.840375529753905   -0.863652821988714  \\
-0.88803208232901   0.0773590911304249  \\
0.100092833139322   -1.21411704361541   \\
-0.544528929990548  -1.11350074148676   \\
0.303520794649354   -0.00684932810334806    \\
-0.600326562133734  1.53263030828475    \\
0.489965321173948   -0.769665913753682  \\
0.739363123604474   0.371378812760058   \\
1.71188778298155    -0.225584402271252  \\
-0.194123535758265  1.11735613881447    \\
-2.13835526943994   -1.08906429505224   \\
-0.839588747336614  0.0325574641649735  \\
1.35459432800464    0.552527021112224   \\
-1.07215528838425   1.10061021788087    \\
0.960953869740567   1.54421189550395    \\
0.124049800003193   0.0859311331754255  \\
1.43669662271894    -1.49159031063761   \\
-1.96089999936503   -0.742301837259857  \\
-0.19769822597415   -1.06158173331999   \\
-1.2078454852598    2.35045722400204    \\
2.90800803072936    -0.615601881466894  \\
0.825218894228491   0.748076783703985   \\
1.37897197791661    -0.192418510588264  \\
-1.05818025798736   0.888610425420721   \\
-0.468615581100624  -0.764849236567874  \\
-0.272469409250187  -1.40226896933876   \\
1.09842461788862    -1.4223759250915    \\
-0.277871932787639  0.488193909859941   \\
0.701541458163284   -0.177375156618825  \\
-2.05181629991115   -0.196053487807333  \\
-0.353849997774433  1.41931015064255    \\
-0.823586525156853  0.291584373984183   \\
-1.5770570227992    0.197811053464361   \\
0.507974650905946   1.58769908997406    \\
0.281984063670556   -0.804465956349547  \\
0.0334798822444514  0.696624415849607   \\
-1.33367794342811   0.835088165072682   \\
1.12749227834159    -0.243715140377952  \\
0.350179410603312   0.215670086403744   \\
-0.299066030332982  -1.16584393148205   \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-6.5,
xmax=6.5,
xtick={-5,0,5},
xticklabels={\empty},
ymin=-6.5,
ymax=6.5,
ytick={-5,0,5},
yticklabels={\empty},
name=plot8,
at=(plot5.above north west),
anchor=below south west
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
0.840375529753905   0.5376671395461 \\
-0.88803208232901   1.83388501459509    \\
0.100092833139322   -2.25884686100365   \\
-0.544528929990548  0.862173320368121   \\
0.303520794649354   0.318765239858981   \\
-0.600326562133734  -1.30768829630527   \\
0.489965321173948   -0.433592022305684  \\
0.739363123604474   0.34262446653865    \\
1.71188778298155    3.57839693972576    \\
-0.194123535758265  2.76943702988488    \\
-2.13835526943994   -1.34988694015652   \\
-0.839588747336614  3.03492346633185    \\
1.35459432800464    0.725404224946106   \\
-1.07215528838425   -0.0630548731896562 \\
0.960953869740567   0.714742903826096   \\
0.124049800003193   -0.204966058299775  \\
1.43669662271894    -0.124144348216312  \\
-1.96089999936503   1.48969760778546    \\
-0.19769822597415   1.40903448980048    \\
-1.2078454852598    1.41719241342961    \\
2.90800803072936    0.671497133608081   \\
0.825218894228491   -1.20748692268504   \\
1.37897197791661    0.717238651328838   \\
-1.05818025798736   1.63023528916473    \\
-0.468615581100624  0.488893770311789   \\
-0.272469409250187  1.03469300991786    \\
1.09842461788862    0.726885133383238   \\
-0.277871932787639  -0.303440924786016  \\
0.701541458163284   0.293871467096658   \\
-2.05181629991115   -0.787282803758638  \\
-0.353849997774433  0.888395631757642   \\
-0.823586525156853  -1.14707010696915   \\
-1.5770570227992    -1.06887045816803   \\
0.507974650905946   -0.809498694424876  \\
0.281984063670556   -2.9442841619949    \\
0.0334798822444514  1.4383802928151 \\
-1.33367794342811   0.325190539456198   \\
1.12749227834159    -0.754928319169703  \\
0.350179410603312   1.37029854009523    \\
0.964229422631627   1.1092732976144 \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-2.9,
xmax=4.9,
xtick={-2,0,2,4},
xticklabels={\empty},
ymin=-6.5,
ymax=6.5,
ytick={-5,0,5},
yticklabels={\empty},
name=plot9,
at=(plot8.left of south west),
anchor=right of south east
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
-0.863652821988714  0.5376671395461 \\
0.0773590911304249  1.83388501459509    \\
-1.21411704361541   -2.25884686100365   \\
-1.11350074148676   0.862173320368121   \\
-0.00684932810334806    0.318765239858981   \\
1.53263030828475    -1.30768829630527   \\
-0.769665913753682  -0.433592022305684  \\
0.371378812760058   0.34262446653865    \\
-0.225584402271252  3.57839693972576    \\
1.11735613881447    2.76943702988488    \\
-1.08906429505224   -1.34988694015652   \\
0.0325574641649735  3.03492346633185    \\
0.552527021112224   0.725404224946106   \\
1.10061021788087    -0.0630548731896562 \\
1.54421189550395    0.714742903826096   \\
0.0859311331754255  -0.204966058299775  \\
-1.49159031063761   -0.124144348216312  \\
-0.742301837259857  1.48969760778546    \\
-1.06158173331999   1.40903448980048    \\
2.35045722400204    1.41719241342961    \\
-0.615601881466894  0.671497133608081   \\
0.748076783703985   -1.20748692268504   \\
-0.192418510588264  0.717238651328838   \\
0.888610425420721   1.63023528916473    \\
-0.764849236567874  0.488893770311789   \\
-1.40226896933876   1.03469300991786    \\
-1.4223759250915    0.726885133383238   \\
0.488193909859941   -0.303440924786016  \\
-0.177375156618825  0.293871467096658   \\
-0.196053487807333  -0.787282803758638  \\
1.41931015064255    0.888395631757642   \\
0.291584373984183   -1.14707010696915   \\
0.197811053464361   -1.06887045816803   \\
1.58769908997406    -0.809498694424876  \\
-0.804465956349547  -2.9442841619949    \\
0.696624415849607   1.4383802928151 \\
0.835088165072682   0.325190539456198   \\
-0.243715140377952  -0.754928319169703  \\
0.215670086403744   1.37029854009523    \\
-1.16584393148205   -1.7115164188537    \\
-1.14795277889859   -0.102242446085491  \\
-1.79467884145512   1.1092732976144 \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-6.5,
xmax=6.5,
xtick={-5,0,5},
xticklabels={\empty},
ymin=-6.5,
ymax=6.5,
name=plot10,
at=(plot9.left of south west),
anchor=right of south east
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
0.5376671395461 0.5376671395461 \\
1.83388501459509    1.83388501459509    \\
-2.25884686100365   -2.25884686100365   \\
0.862173320368121   0.862173320368121   \\
0.318765239858981   0.318765239858981   \\
-1.30768829630527   -1.30768829630527   \\
-0.433592022305684  -0.433592022305684  \\
0.34262446653865    0.34262446653865    \\
3.57839693972576    3.57839693972576    \\
2.76943702988488    2.76943702988488    \\
-1.34988694015652   -1.34988694015652   \\
3.03492346633185    3.03492346633185    \\
0.725404224946106   0.725404224946106   \\
-0.0630548731896562 -0.0630548731896562 \\
0.714742903826096   0.714742903826096   \\
-0.204966058299775  -0.204966058299775  \\
-0.124144348216312  -0.124144348216312  \\
1.48969760778546    1.48969760778546    \\
1.40903448980048    1.40903448980048    \\
1.41719241342961    1.41719241342961    \\
0.671497133608081   0.671497133608081   \\
-1.20748692268504   -1.20748692268504   \\
0.717238651328838   0.717238651328838   \\
1.63023528916473    1.63023528916473    \\
0.488893770311789   0.488893770311789   \\
1.03469300991786    1.03469300991786    \\
0.726885133383238   0.726885133383238   \\
-0.303440924786016  -0.303440924786016  \\
0.293871467096658   0.293871467096658   \\
-0.787282803758638  -0.787282803758638  \\
0.888395631757642   0.888395631757642   \\
1.1092732976144 1.1092732976144 \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
colormap/jet,
scale only axis,
xmin=-6.5,
xmax=6.5,
xtick={\empty},
ymin=0,
ymax=15,
ytick={\empty}
]

\addplot[area legend,patch,forget plot]
 table[row sep=crcr, point meta=\thisrow{c}] {
x   y   c\\
-2.9442841619949    0   1   \\
-2.9442841619949    1   1   \\
-2.29201605182283   1   1   \\
-2.29201605182283   0   1   \\
-2.29201605182283   0   1   \\
-2.29201605182283   2   1   \\
-1.63974794165077   2   1   \\
-1.63974794165077   0   1   \\
-1.63974794165076   0   1   \\
-1.63974794165076   5   1   \\
-0.987479831478699  5   1   \\
-0.987479831478699  0   1   \\
-0.987479831478699  0   1   \\
-0.987479831478699  5   1   \\
-0.335211721306634  5   1   \\
-0.335211721306634  0   1   \\
-0.335211721306633  0   1   \\
-0.335211721306633  10  1   \\
0.317056388865432   10  1   \\
0.317056388865432   0   1   \\
0.317056388865432   0   1   \\
0.317056388865432   14  1   \\
0.969324499037498   14  1   \\
0.969324499037498   0   1   \\
0.969324499037498   0   1   \\
0.969324499037498   8   1   \\
1.62159260920956    8   1   \\
1.62159260920956    0   1   \\
1.62159260920956    0   1   \\
1.62159260920956    2   1   \\
3.57839693972576    0   1   \\
};

\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-6.5,
xmax=6.5,
xtick={-5,0,5},
xticklabels={\empty},
ymin=-2.9,
ymax=4.9,
name=plot7,
at=(plot10.below south west),
anchor=above north west
]
\addplot [color=blue,mark size=2.5pt,only marks,mark=*,mark options={solid},forget plot]
  table[row sep=crcr]{
0.5376671395461 -0.863652821988714  \\
1.83388501459509    0.0773590911304249  \\
-2.25884686100365   -1.21411704361541   \\
0.862173320368121   -1.11350074148676   \\
0.318765239858981   -0.00684932810334806    \\
-1.30768829630527   1.53263030828475    \\
-0.433592022305684  -0.769665913753682  \\
0.34262446653865    0.371378812760058   \\
3.57839693972576    -0.225584402271252  \\
2.76943702988488    1.11735613881447    \\
-1.34988694015652   -1.08906429505224   \\
3.03492346633185    0.0325574641649735  \\
0.725404224946106   0.552527021112224   \\
-0.0630548731896562 1.10061021788087    \\
0.714742903826096   1.54421189550395    \\
-0.204966058299775  0.0859311331754255  \\
-0.124144348216312  -1.49159031063761   \\
1.48969760778546    -0.742301837259857  \\
1.40903448980048    -1.06158173331999   \\
1.41719241342961    2.35045722400204    \\
0.671497133608081   -0.615601881466894  \\
-1.20748692268504   0.748076783703985   \\
0.717238651328838   -0.192418510588264  \\
1.63023528916473    0.888610425420721   \\
0.488893770311789   -0.764849236567874  \\
1.03469300991786    -1.40226896933876   \\
0.726885133383238   -1.4223759250915    \\
-0.303440924786016  0.488193909859941   \\
0.293871467096658   -0.177375156618825  \\
-0.787282803758638  -0.196053487807333  \\
0.888395631757642   1.41931015064255    \\
-1.14707010696915   0.291584373984183   \\
-1.06887045816803   0.197811053464361   \\
-0.809498694424876  1.58769908997406    \\
-2.9442841619949    -0.804465956349547  \\
1.4383802928151 0.696624415849607   \\
0.325190539456198   0.835088165072682   \\
-0.754928319169703  -0.243715140377952  \\
1.37029854009523    0.215670086403744   \\
-1.7115164188537    -1.16584393148205   \\
-0.102242446085491  -1.14795277889859   \\
-0.241447041607358  0.104874716016494   \\
};
\end{axis}

\begin{axis}[%
width=1.47680555555556in,
height=1.16477083333333in,
scale only axis,
xmin=-6.5,
xmax=6.5,
ymin=-6.5,
ymax=6.5,
at=(plot7.below south west),
anchor=above north west
]
\addplot [color=green,mark size=7.5pt,only marks,mark=asterisk,mark options={solid},forget plot]
  table[row sep=crcr]{
0.5376671395461 0.840375529753905   \\
1.83388501459509    -0.88803208232901   \\
-2.25884686100365   0.100092833139322   \\
0.862173320368121   -0.544528929990548  \\
0.318765239858981   0.303520794649354   \\
-1.30768829630527   -0.600326562133734  \\
-0.433592022305684  0.489965321173948   \\
0.34262446653865    0.739363123604474   \\
3.57839693972576    1.71188778298155    \\
2.76943702988488    -0.194123535758265  \\
-1.34988694015652   -2.13835526943994   \\
3.03492346633185    -0.839588747336614  \\
0.725404224946106   1.35459432800464    \\
-0.0630548731896562 -1.07215528838425   \\
0.714742903826096   0.960953869740567   \\
-0.204966058299775  0.124049800003193   \\
-0.124144348216312  1.43669662271894    \\
1.48969760778546    -1.96089999936503   \\
1.40903448980048    -0.19769822597415   \\
1.41719241342961    -1.2078454852598    \\
0.671497133608081   2.90800803072936    \\
-1.20748692268504   0.825218894228491   \\
0.717238651328838   1.37897197791661    \\
1.63023528916473    -1.05818025798736   \\
0.488893770311789   -0.468615581100624  \\
1.03469300991786    -0.272469409250187  \\
0.726885133383238   1.09842461788862    \\
-0.303440924786016  -0.277871932787639  \\
0.293871467096658   0.701541458163284   \\
-0.787282803758638  -2.05181629991115   \\
0.888395631757642   -0.353849997774433  \\
-1.14707010696915   -0.823586525156853  \\
-1.06887045816803   -1.5770570227992    \\
-0.809498694424876  0.507974650905946   \\
-2.9442841619949    0.281984063670556   \\
1.4383802928151 0.0334798822444514  \\
0.325190539456198   -1.33367794342811   \\
-0.754928319169703  1.12749227834159    \\
1.37029854009523    0.350179410603312   \\
-1.7115164188537    -0.299066030332982  \\
};
\end{axis}

\begin{axis}[%
width=4.52083333333333in,
height=3.565625in,
scale only axis,
xmin=0,
xmax=1,
xtick={-5,  0,  5},
ymin=0,
ymax=1,
ytick={-5,  0,  5},
hide axis,
title={A Comparison of Data Sets},
axis x line*=bottom,
axis y line*=left
]
\end{axis}
\end{tikzpicture}%
\end{document}

结果是:

Latex 输出

它并不完美,但您可以轻松修复一些问题。

答案2

subcaption软件包提供了多种方法来实现这一点;其中一种选择是使用环境subfigure

\usepackage{caption}
\usepackage{subcaption}
\begin{figure}
    \centering
    \begin{subfigure}[b]{0.3\textwidth}
            \includegraphics[width=\textwidth]{image1}
            \caption{Caption 1}
            \label{fig:label1}
    \end{subfigure}%
    ~ % spacing or \\ 
    \begin{subfigure}[b]{0.3\textwidth}
            \includegraphics[width=\textwidth]{image2}
            \caption{Caption 2}
            \label{fig:label2}
    \end{subfigure}
    \caption{Caption}\label{fig:label}
\end{figure}

另一种选择是使用表格等来布局您的图像,然后为\subcaption每个图像添加标题。

相关内容