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}
  • 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
  • 1
    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

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


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

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.