14.047이 15보다 작고 소수점 정밀도가 더 높음을 표시하도록 그래프를 변경하고 싶습니다.
\documentclass[12pt,a4paper,onecolumn, openright]{report}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{tikz}
% Define bar chart colors
%
\definecolor{bblue}{HTML}{4F81BD}
\definecolor{rred}{HTML}{C0504D}
\definecolor{ggreen}{HTML}{9BBB59}
\definecolor{ppurple}{HTML}{9F4C7C}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width = 0.85*\textwidth,
height = 8cm,
major x tick style = transparent,
y tick label style={
/pgf/number format/fixed
},
ybar=2*\pgflinewidth,
bar width=12pt,
ymajorgrids = true,
ylabel = {\#iterations},
symbolic x coords={topology1,topology2,topology3,topology4,topology5},
xtick = data,
scaled y ticks = false,
enlarge x limits=0.12,
ymin=0,
ymax=20,
legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1},
]
\addplot[style={bblue,fill=bblue,mark=none}]
coordinates {(topology1, 15) (topology2,12) (topology3,11)(topology4, 9) (topology5,9) };
\addplot[style={ppurple,fill=ppurple,mark=none}]
coordinates {(topology1,18.047) (topology2,15.047) (topology3,14.047)(topology4, 12.047) (topology5,12.047)};
\addplot[style={ggreen,fill=ggreen,mark=none}]
coordinates {(topology1,18.047) (topology2,15.047) (topology3,14.047)(topology4, 12.047) (topology5,12.047)};
\legend{MARA-MC,MARA-MMMF,MARA-SPE}
\end{axis}
\end{tikzpicture}
\end{document}
답변1
그래프 높이와 y축 경계를 변경하여 데이터를 "확대"할 수 있습니다. ymin=8.5, ymax=19로 그래프의 높이를 18cm로 만들었습니다. 그것은 당신의 차이점을 보여줍니다.
그러나 이것이 최선의 해결책은 아닐 수도 있습니다. 차이의 크기가 작기 때문에 텍스트의 데이터를 설명하거나 플롯의 값을 사용하여 다르게 표현하는 것을 고려할 수 있습니다.
\documentclass[12pt,a4paper,onecolumn, openright]{report}
\usepackage{xcolor}
\usepackage{pgfplots}
\usepackage{tikz}
% Define bar chart colors
%
\definecolor{bblue}{HTML}{4F81BD}
\definecolor{rred}{HTML}{C0504D}
\definecolor{ggreen}{HTML}{9BBB59}
\definecolor{ppurple}{HTML}{9F4C7C}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width = 0.85*\textwidth,
height = 18cm,
major x tick style = transparent,
y tick label style={
/pgf/number format/fixed
},
ybar=2*\pgflinewidth,
bar width=12pt,
ymajorgrids = true,
ylabel = {\#iterations},
symbolic x coords={topology1,topology2,topology3,topology4,topology5},
xtick = data,
scaled y ticks = false,
enlarge x limits=0.12,
ymin=8.5,
ymax=19,
legend style={at={(0.5,-0.15)}, anchor=north,legend columns=-1},
]
\addplot[style={bblue,fill=bblue,mark=none}]
coordinates {(topology1, 15) (topology2,12) (topology3,11)(topology4, 9) (topology5,9) };
\addplot[style={ppurple,fill=ppurple,mark=none}]
coordinates {(topology1,18.047) (topology2,15.047) (topology3,14.047)(topology4, 12.047) (topology5,12.047)};
\addplot[style={ggreen,fill=ggreen,mark=none}]
coordinates {(topology1,18.047) (topology2,15.047) (topology3,14.047)(topology4, 12.047) (topology5,12.047)};
\legend{MARA-MC,MARA-MMMF,MARA-SPE}
\end{axis}
\end{tikzpicture}
\end{document}