1

How can I achieve the same font style and plot style as in the screenshot?

enter image description here

\documentclass[border=10pt]{standalone}

\usepackage{verbatim}

\usepackage{pgfplots}
\pgfplotsset{width=7cm,compat=1.8}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
    ybar,
    enlargelimits=0.15,
    legend style={at={(0.5,-0.15)},
      anchor=north,legend columns=-1},
    ylabel={\#participants},
    symbolic x coords={tool8,tool9,tool10},
    xtick=data,
    nodes near coords,
    nodes near coords align={vertical},
    ]
\addplot coordinates {(tool8,7) (tool9,9) (tool10,4)};
\addplot coordinates {(tool8,4) (tool9,4) (tool10,4)};
\addplot coordinates {(tool8,1) (tool9,1) (tool10,1)};
\legend{used,understood,not understood}
\end{axis}
\end{tikzpicture}
\end{document}
1

Well, the font looks a bit like \bfseries\sffamily, and you can define your own bar cycle list for the colors.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\definecolor{curlyblue}{RGB}{39,26,115}
\definecolor{curlygreen}{RGB}{48,172,140}   
\pgfplotsset{width=7cm,compat=1.8}
\pgfplotsset{
    /pgfplots/bar cycle list/.style={/pgfplots/cycle list={
    {black,fill=curlyblue,mark=none},
{black,fill=curlygreen,mark=none},
{black,fill=yellow,mark=none},
}, }}

\begin{document}
\begin{tikzpicture}[font=\sffamily\bfseries]
\begin{axis}[
    ybar,
    enlargelimits=0.25,
    legend style={at={(0.5,-0.15)},
      anchor=north,legend columns=-1},
    ylabel={\#participants},
    symbolic x coords={tool8,tool9,tool10},
    xtick=data,
    nodes near coords,
    nodes near coords align={vertical},
    ]
\addplot coordinates {(tool8,7) (tool9,9) (tool10,4)};
\addplot coordinates {(tool8,4) (tool9,4) (tool10,4)};
\addplot coordinates {(tool8,1) (tool9,1) (tool10,1)};
\legend{used,understood,not understood}
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

If you want the legend inside the plot, set legend columns to one and make the plot a bit larger.

\documentclass[border=10pt]{standalone}
\usepackage{pgfplots}
\definecolor{curlyblue}{RGB}{39,26,115}
\definecolor{curlygreen}{RGB}{48,172,140}   
\pgfplotsset{width=9cm,compat=1.8}
\pgfplotsset{
    /pgfplots/bar cycle list/.style={/pgfplots/cycle list={
    {black,fill=curlyblue,mark=none},
{black,fill=curlygreen,mark=none},
{black,fill=yellow,mark=none},
}, }}

\begin{document}
\begin{tikzpicture}[font=\sffamily\bfseries]
\begin{axis}[
    ybar,
    enlargelimits=0.25,
    legend style={at={(0.75,0.95)},
      anchor=north,legend columns=1},
    ylabel={\#participants},
    symbolic x coords={tool8,tool9,tool10},
    xtick=data,
    nodes near coords,
    nodes near coords align={vertical},
    ]
\addplot coordinates {(tool8,7) (tool9,9) (tool10,4)};
\addplot coordinates {(tool8,4) (tool9,4) (tool10,4)};
\addplot coordinates {(tool8,1) (tool9,1) (tool10,1)};
\legend{used,understood,not understood}
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

2
  • 1
    @NaveganTeX Yes. You need to make the plot a bit larger to fit it.
    – user194703
    Oct 1 '19 at 16:57
  • Thank you very much! It looks fantastic!
    – NaveganTeX
    Oct 1 '19 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.