TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

May I know how to draw the graph as shown below? enter image description here

below is a code I have try but with look and feel that is quite far away from the example:

    legend pos=north west,
\addplot plot coordinates {
(2, 48)
(5, 11520)
(6, 61440)
(7, 315392)

\addplot plot coordinates {
(2, 37)
(3, 275)
(5, 9953)
(6, 55387)
(7, 297786)

\addplot plot coordinates {
(2, 43)
(4, 1421)
(5, 7256)
(6, 37561)

\legend{Unreduced, Symmetric, Asymmetric}
share|improve this question
Which detail is the problem? – percusse Nov 19 '12 at 15:33
The look and feel of the graph is the problem. I am not sure pgf plot can achieve that – william007 Nov 19 '12 at 15:36
Can you provide the data or the functions for this? Looks like this is something that can be done via pgfplots. – percusse Nov 19 '12 at 15:37
@william007 So give us what you've come up with already and then we can advise you on how to fix up the look and feel. (Which is so vague a term, it's not clear it's useful.) – Alan Munn Nov 19 '12 at 15:37
If you can add a minimal working example (MWE) we can work on it and give you a sufficient answer. But you should not expect us to setup a complete problem from scratch. Answering the questions are fun but setting up the problems are not. The main answer is using a semilogyaxis environment. – percusse Nov 19 '12 at 15:56
up vote 6 down vote accepted

pgfplots relies extensively on key=value system. So initially it's a little frustrating to find the correct key. However, the basics are very easy to set up. For this particular example, there are various options that you have to set to match the given figure. Here is a starter :

% http://tex.stackexchange.com/questions/50313/everymath-and-set-font-for-math

\begin{semilogyaxis}[title=\textbf{QWS Dataset},
    legend pos=outer north east,xtick={1,...,10},
        scaled ticks=false,
        log ticks with fixed point,
        ylabel = Computation Time (msec),
        xlabel = Number of Service Candidates Per Class
\addplot plot coordinates {(2, 48)(3,336)(4,2048)(5, 11520)(6, 61440)(7,1315392)};
\addplot plot coordinates {(2, 37)(3, 275)(4,1726)(5, 9953)(6, 55387)(7, 297786)};
\addplot plot coordinates {(2, 43)(3,252)(4, 1421)(5, 7256)(6, 37561)(7,81679)};
\legend{Unreduced, Symmetric, Asymmetric}

enter image description here

share|improve this answer
Thanks, have some further question here: tex.stackexchange.com/questions/83379/… – william007 Nov 19 '12 at 17:27

Pgfplot can do exactly the same look & fell; it's just a matter of parameters...

I suggest you to search in the manual for the terms logarithmic plots and semilogyaxis in order to draw your y axis.

For the markers and the colors, I suggest you to read the chapter Markers, Linestyle, (Background-) Colors and Colormaps

Edit: manual of pgfplots

share|improve this answer
Which manual that you are mentioning? – william007 Nov 19 '12 at 16:14
The manual of pgfplot, mirror.ctan.org/graphics/pgf/contrib/pgfplots/doc/pgfplots.pdf – Lionel MANSUY Nov 19 '12 at 16:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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