0

As you can see in the image, the height of the boxplot in y-direction is unreasonably huge. How can I adjust that?

Settings:

\documentclass[final, english, ngerman, a4paper, 12pt, numbers=noenddot,
cd=true,
cdfont=false,cdfont=nohead,cdfont=nodin,
cdmath=false,
cdhead=false,
cdfoot=true,
cdcover=monochrome,
cdgeometry=asymmetric,
declaration=heading,
declaration=notoc,
abstract=heading
]
\usepackage{tikz,pgfplots}
    \pgfplotsset{compat=newest}
    \usepgfplotslibrary{statistics}
    \pgfplotsset{
        my boxplot style/.style={
            boxplot,
            draw=black,
            solid,
            fill=white,
            mark=*,
            every mark/.append style={
                fill=white,
            },
        },
    }

Tikzpicture in the document:

\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}[scale=0.85]
  \begin{axis}
    [
    xlabel={Abweichung},
    xlabel style={below},
    ylabel style={above},
    yticklabels={,,}
    ]
    \addplot+[draw=black,my boxplot style,
    boxplot prepared={
      median=0.0728,
      upper quartile=0.1,
      lower quartile=0,
      upper whisker=0.25,
      lower whisker=-0.13
    },
    ] coordinates {
    (1,0.5)
    (1,-0.3)
    (1,0.2857)
    };
  \end{axis}
\end{tikzpicture}
\end{figure}

\end{document}

enter image description here

Thank you in advance!

3
  • 1
    Welcome to TeX.SE! Can you please make your given code snippet be compilable, then we do not have to guess what you are doing ...
    – Mensch
    Nov 5, 2021 at 12:22
  • Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Nov 5, 2021 at 12:34
  • Just for future reference, please look at: tex.meta.stackexchange.com/questions/228/… Nov 5, 2021 at 12:44

1 Answer 1

1
\documentclass[border=1 cm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepgfplotslibrary{statistics}
\pgfplotsset{
        my boxplot style/.style={
            boxplot,
            draw=black,
            solid,
            fill=white,
            mark=*,
            every mark/.append style={
                fill=white,
            },
        },
    }

\begin{document}
\begin{tikzpicture}
\begin{axis}[
yticklabels=\empty,
y post scale=0.3,
]
\addplot+[draw=black, my boxplot style,
boxplot prepared={
      median=0.0728,
      upper quartile=0.1,
      lower quartile=0,
      upper whisker=0.25,
      lower whisker=-0.13
},
] coordinates {(1,0.5) (1,-0.3) (1,0.2857)};
\end{axis}
\end{tikzpicture}
\end{document}

Box plot with lower height

1
  • Thank you very much!!
    – mado_xx
    Nov 5, 2021 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .