mais precisão no barplot pgfplots

mais precisão no barplot pgfplots

Gostaria de alterar o gráfico para mostrar que 14.047 é menor que 15, mais precisão decimal

\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}

Responder1

Você pode alterar a altura do gráfico e os limites do eixo y para "ampliar" os dados. Fiz o gráfico com 18cm de altura, com ymin=8,5 e ymax=19. Isso mostra sua diferença.

No entanto, esta pode não ser a melhor solução. Dado o pequeno tamanho da diferença, você pode considerar explicar os dados em seu texto ou representá-los de forma diferente, talvez com valores no gráfico.

\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}

informação relacionada