1

I am an latex beginner and I got to prepare an presentation in overleaf, i wanted to reuse an diagram from my document which Phave made in texmaker, sadly it doesn't work.

I want to generate an Pareto diagram, like this.

enter image description here

Do you have any suggestion how to do it from scratch?

Thank you in advance for your help!

Bernard
  • 271,350
Phil
  • 13
  • 3
    Hello there! This is Tom from the Overleaf Support Team. Please note that I removed the [tag:overleaf] tag as this is not directly Overleaf-related. One good starting point might be the pgfplots package: https://ctan.org/pkg/pgfplots & https://pgfplots.net/ -- I hope you manage to solve the issue! – yo' May 29 '21 at 19:06
  • 1
    Your question is unclear. I understand that you have made a diagram using LaTeX for your thesis. Now you want to use the same diagram in a presentation (I assume beamer). Is this correct? If yes, then you need IMHO to provide code that demonstrates the problem. BTW, what does Phave mean? – Dr. Manuel Kuehner May 29 '21 at 20:05
  • If you have a picture file (PDF, PNG, JPEG) of the diagram then you can easily include this in a presentation and save a lot of time. – Dr. Manuel Kuehner May 29 '21 at 20:26

1 Answers1

1

Not a complete answer but a start! See here for a related question.

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture} \begin{axis}[ ylabel=# of Errors, xlabel= Error Type, enlargelimits=0.15, ybar, ymin = 0, ymax = 100, xtick=data, nodes near coords, symbolic x coords={3,1,5,4,6,2}, ] \addplot coordinates {(3,50) (1,30) (5,10) (4,5) (6,3) (2,2)}; \end{axis} \end{tikzpicture}

\end{document}

enter image description here

Update

\documentclass{article}

\usepackage{pgfplots}

\begin{document}

\begin{tikzpicture} \begin{axis}[ ylabel=# of Errors, xlabel= Error Type, %enlargelimits=0.15, %ybar, ymin = 0, ymax = 100, xtick=data, %nodes near coords, symbolic x coords={3,1,5,4,6,2}, ] \addplot[ybar, nodes near coords] coordinates {(3,50) (1,30) (5,10) (4,5) (6,3) (2,2)}; % \addplot[draw, mark=*] coordinates {(3,50) (1,80) (5,90) (4,95) (6,98) (2,100)};
\end{axis} \end{tikzpicture}

\end{document}

enter image description here

Remark: I would recommend using a diagram with two y-axes (see also the pgfplots manual Chapter "4.9.11 Two Ordinates (y-axis) or Multiple Axes"), one for the # of errors and one of the percentage. In your example, you conveniently choose the total # of errors to be 100 (%).