با استفاده از ترکیب محیط subcaptionbox
و دستور resizebox
میتوان خواسته شما را تأمین کرد. چون تعداد شکلها زیاد است برای جلوگیری از شلوغ شدن و سردگمی، یک دستور به اسم subtikzpicture
تعریف کردم که دو تا آرگومان دارد. اولی محتوای caption
است (در صورت وجود) و دومی شکلی که با tikzpicture
رسم شده است. در این دستور یک subcaptionbox
قرار میگیرد که عرض آن یکچهارم عرض متن است و سپس شکل رسمشده با tikzpicture
در resizebox
قرار میگیرد و آن هم به اندازه یکچهارم عرض متن کوچکتر میشود.
\documentclass[12pt]{article}
\usepackage{amsmath,amsthm,amssymb}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage{pgfplots}
\usepackage{graphicx}
\usetikzlibrary{patterns}
\pgfplotsset{compat=1.16}
\usepackage{subcaption}
\newcommand{\subtikzpicture}[2]{%
\subcaptionbox*{\scriptsize#1}[0.25\textwidth]{%
\resizebox{0.25\textwidth}{!}{%
#2%
}}}
\begin{document}
\begin{figure}
\subtikzpicture{
$\tilde{A}=(0.1,0.2,0.3,0.4; 1.0)$\\
$\tilde{B}=(0.1,0.25,0.4;1.0)$
}{
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xmin=0,xmax=3,
ymin=0,ymax=1,
xtick={0.5,1,1.25,1.5,2},
xticklabels={$0.1$,$.2$,$.25$,$.3$,$0.4$},
ytick={0,0.5},
yticklabels={$0$,$1$},
yticklabel style={font=\footnotesize},
every axis x label/.style={at={(ticklabel* cs:1)},anchor=west,},
every axis y label/.style={at={(ticklabel* cs:1)},anchor=south east,},
xlabel=$x$,
ylabel=$y$,
axis on top,
clip=false
]
\draw[dashed,help lines] (1,0.5) |- (1,0);
\draw[dashed,help lines] (1.25,0.5) |- (1.25,0);
\draw[dashed,help lines] (1.5,0.5) |- (1.5,0);
\draw[dashed,help lines] (0,0.5) |- (1,0.5);
\draw [very thick, black] (0.5,0)to (1,0.5)to(1.5,0.5)to(2,0)node [above] {$$};
\draw [ultra thin, black] (0.5,0)to (1.25,0.5)to(2,0)node [above] {$$};
\end{axis}
\end{tikzpicture}}~
\subtikzpicture{
$\tilde{A}=(0.1,0.2,0.3,0.4; 1.0)$\\
$\tilde{B}=(0.1,0.2,0.3,0.4;1.0)$
}{
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xmin=0,xmax=3,
ymin=0,ymax=1,
xtick={0.5,1,1.5,2},
xticklabels={$0.1$,$0.2$,$0.3$,0.4},
ytick={0,0.5},
yticklabels={$0$,$1$},
yticklabel style={font=\footnotesize},
every axis x label/.style={at={(ticklabel* cs:1)},anchor=west,},
every axis y label/.style={at={(ticklabel* cs:1)},anchor=south east,},
xlabel=$x$,
ylabel=$y$,
axis on top,
clip=false
]
\draw[dashed,help lines] (1,0.5) |- (1,0);
\draw[dashed,help lines] (1.5,0.5) |- (1.5,0);
\draw[dashed,help lines] (0,0.5) |- (1,0.5);
\draw [very thick, black] (0.5,0)to (1,0.5)to(1.5,0.5)to(2,0)node [above] {$$};
\end{axis}
\end{tikzpicture}}~
\subtikzpicture{
$\tilde{A}=(0.1,0.2,0.3,0.4; 1.0)$\\
$\tilde{B}=(0.4,0.55,0.55;0.7,1.0)$
}{
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xmin=0,xmax=4,
ymin=0,ymax=1,
xtick={0.5,1,1.5,2,2.5,3,3.5,4},
xticklabels={$.1$,$.2$,$.3$,$.4$,$.5$,$.6$,$.7$,1},
ytick={0,0.5},
yticklabels={$0$,$1$},
yticklabel style={font=\footnotesize},
every axis x label/.style={at={(ticklabel* cs:1)},anchor=west,},
every axis y label/.style={at={(ticklabel* cs:1)},anchor=south east,},
xlabel=$x$,
ylabel=$y$,
axis on top,
clip=false
]
\draw[dashed,help lines] (1,0.5) |- (1,0);
\draw[dashed,help lines] (1.5,0.5) |- (1.5,0);
%\draw[dashed,help lines] (2,0.5) |- (2,0);
\draw[dashed,help lines] (0,0.5) |- (2.75,0.5);
\draw [ultra thin, black] (0.5,0)to (1,0.5)to(1.5,0.5)to(2,0)node [above] {$$};
\draw [very thick, black] (2,0)to (2.75,0.5)to(3.5,0)node [above] {$$};
\draw[dashed,help lines] (2.75,0.5) |- (2.75,0);
\end{axis}
\end{tikzpicture}}~
\subtikzpicture{
$\tilde{A}=(0.1,0.2,0.3,0.4; 1.0)$\\
$\tilde{B}=(0.4,0.5,0.6,0.7;1.0)$
}{
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xmin=0,xmax=4,
ymin=0,ymax=1,
xtick={0.5,1,1.5,2,2.5,3,3.5},
xticklabels={$.1$,$.2$,$.3$,$.4$,$.5$,$.6$,$.7$},
ytick={0,0.5},
yticklabels={$0$,$1$},
yticklabel style={font=\footnotesize},
every axis x label/.style={at={(ticklabel* cs:1)},anchor=west,},
every axis y label/.style={at={(ticklabel* cs:1)},anchor=south east,},
xlabel=$x$,
ylabel=$y$,
axis on top,
clip=false
]
\draw[dashed,help lines] (1,0.5) |- (1,0);
\draw[dashed,help lines] (1.5,0.5) |- (1.5,0);
\draw[dashed,help lines] (0,0.5) |- (2.75,0.5);
\draw [ultra thin, black] (0.5,0)to (1,0.5)to(1.5,0.5)to(2,0)node [above] {$$};
\draw[dashed,help lines] (0,0.5) |- (2.75,0.5);
\draw [very thick, black] (2,0)to (2.5,0.5)to(3,0.5)to(3.5,0)node [above] {$$};
\draw[dashed,help lines] (3,0.5) |- (3,0);
\draw[dashed,help lines] (2.5,0.5) |- (2.5,0);
\end{axis}
\end{tikzpicture}}
\end{figure}
\end{document}