2

I have the following data & I'm trying to display a plot similar to the screenshot

items,section_1,section_2,section_3,section_4
10,82,42,38,22
20,38,24,20,63
30,44,49,39,40
40,58,48,47,47
50,58,45,59,41

Graph

  • 1
    It would be helpful if you composed a fully compilable MWE including \documentclass and the appropriate packages that sets up the problem, and shows what you have tried. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – ferahfeza Apr 7 '14 at 21:44
  • Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – Reinstate Monica - M. Schröder Apr 7 '14 at 21:45
9

No MWE no explanation :)

\documentclass{standalone}
\usepackage{pgfplotstable}
\begin{document}
\pgfplotstableread[col sep=comma]{
items,section_1,section_2,section_3,section_4
10,82,42,38,22
20,38,24,20,63
30,44,49,39,40
40,58,48,47,47
50,58,45,59,41
}\mytable
\begin{tikzpicture}
\begin{axis}
\pgfplotsinvokeforeach{1,...,4}{
\addplot table[x=items,y=section_#1]{\mytable};
}
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

  • 1
    No explanation, no up-vote :) (Of course, I'm kidding, I already up-voted). – Gonzalo Medina Apr 7 '14 at 23:08

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.