1

I'm working with anonymization and the GDA-Score. For a paper I wanted to make the following plots:

enter image description here

Can someone help me getting such a coordinate system with charts? So far I was only able to get a chart diagram in a box using tikz and pgfplots without a y-axis separating two areas. I also looked into the documentation, but that didn't help me. This is my first time creating charts (I only created function plots so far), and I hope I will learn something!

2
  • Any meaning for the numbers in your diagram? – Black Mild Jun 4 at 11:50
  • It's important, that they are there, but they do not affect the size of the bar. – Titanlord Jun 4 at 12:03
2

One simple way is drawing as it is. I hope the code is self-explained.

enter image description here

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
\foreach \i/\j/\col/\lw/\itextB/\itextA in {
    1/2/cyan/7mm/0.94/Conf,
    2/2/cyan/7mm/1.00/Prob,
    3/2/gray/7mm/0.00/Know,
    4/1.5/gray/7mm/16.00/Work,
    5/2/gray/7mm/1.00/Susc,
    -.9/1.7/red/18mm/0.06/Combined
}{
\draw[color=\col,line width=\lw] (\i-.3,0)--+(90:-\j);
\path 
(\i-.3,0)   node[above=1mm,scale=.9]{\itextA}
(\i-.3,-\j) node[above,scale=.7]{\itextB};      
}
\draw[thick] (-3,0)--(5.5,0) 
(0,-2) node[below]{bad} -- (0,2) node[above]{good};
\end{tikzpicture}
\end{document}
2
  • Ah I see, you simply skipped pgfplots and just did it in tikz. I thought it would be easier with pgfplots, but thats also very good. Thank you for the answer! – Titanlord Jun 4 at 14:57
  • 1
    @Titanlord I see that pgfplots is powerful. However, it is too hard for me to remember a lot of option names, so I often use basic commands of plain TikZ. – Black Mild Jun 4 at 18:35

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.