0

I am trying to see how good LaTeX is.

Can someone show me whether graphics like this.

Thank you due to copyright complains removed the figure.

Ricky
  • 11
  • 1
  • 10
    Yes, LaTeX can do this. Show us what you've tried so far. – Werner Aug 20 '13 at 05:48
  • 4
    Did you have a look at Plotting bell shaped curve in TikZ-PGF and Linked Q's , Incase you find something more specific issues please update your Q – texenthusiast Aug 20 '13 at 05:50
  • If you are completely unfamiliar with the TeX world, take a look at TeXample.net's section on plotting. – jon Aug 20 '13 at 06:11
  • @werner, beginner will try to do. i think if i can figure out how to draw the three graphs separaterly good. but the problem will be to actually get the dotted lines correct and the position of the labelling. it's gonna be an experience i hope that nobody answers the question coz i wanna see how far i can get myself. one thing that i believe is not easy are the arrows. would a tabular approach work for imposing the arrows underneath the respective graphs ? probably yes. a wild guess. – Ricky Aug 20 '13 at 07:14
  • @Ricky: It can all be done by either tikz (and friends) or pstricks (and friends). – Werner Aug 20 '13 at 07:15
  • @Ricky: The question texenthusiast linked to is a good starting point, it shows how to plot a function and and add the vertical lines. – Jake Aug 20 '13 at 07:17
  • 2
    Nondescript title – The Unfun Cat Aug 20 '13 at 07:49
  • 1
    @TheUnfunCat I changed the title from “design question” to the current one. You can edit the question (or propose an edit) with a better title. Do you have a suggestion? – Qrrbrbirlbel Aug 20 '13 at 08:10
  • @Ricky Regarding correct placement of the dashed lines, this may help you. – jub0bs Aug 20 '13 at 11:16
  • Are you looking to make skewed bell curves? I ask because you are closed and the answer is for a normal bell curve. – dustin Aug 20 '13 at 14:27

1 Answers1

1

As other people mentioned, you could use tikz, it has a great manual.

You could also draw the picture with Matlab and use matlab2tikz to generate latex code. Below is an example that draws three sub-figures and a legend.

\documentclass[a4paper,11pt]{article}

\usepackage[margin=1.5cm]{geometry}

\usepackage{pgfplots}
%\usepackage{tikz}
%\usetikzlibrary{plotmarks}

\begin{document}

\begin{figure*}[t!]
\centering
%\vspace{-0.6cm}
% This file was created by matlab2tikz v0.4.0.
% Copyright (c) 2008--2013, Nico Schlömer <nico.schloemer@gmail.com>
% All rights reserved.
% 
% The latest updates can be retrieved from
%   http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz
% where you can also make suggestions and rate matlab2tikz.
% 
% 
% 
\begin{tikzpicture}

\begin{axis}[%
width=7cm,
height=5cm,
scale only axis,
xmin=0.9,
xmax=3.1,
xtick={1,2,3},
xticklabels={5,10,20},
ymin=0.2,
ymax=0.489263081879195,
ylabel={y label bla bla},
name=plot1
]
\addplot [
color=blue,
solid,
mark size=3.3pt,
mark=triangle,
mark options={solid,,rotate=180},
forget plot
]
table[row sep=crcr]{
1 0.290207259060403\\
2 0.288066603131991\\
};
\addplot [
color=green,
solid,
mark size=5.0pt,
mark=o,
mark options={solid},
forget plot
]
table[row sep=crcr]{
1 0.302183970469799\\
2 0.294949917673378\\
3 0.285995259955257\\
};
\addplot [
color=red,
solid,
mark size=5.0pt,
mark=asterisk,
mark options={solid},
forget plot
]
table[row sep=crcr]{
2 0.295317844295302\\
3 0.294641009395973\\
};
\addplot [
color=blue,
dashed,
mark size=3.3pt,
mark=triangle,
mark options={solid,,rotate=180},
forget plot
]
table[row sep=crcr]{
1 0.278730545861298\\
2 0.277802096644295\\
};
\addplot [
color=green,
dashed,
mark size=5.0pt,
mark=o,
mark options={solid},
forget plot
]
table[row sep=crcr]{
1 0.280238520805369\\
2 0.285091444295302\\
3 0.277355641163311\\
};
\addplot [
color=red,
dashed,
mark size=5.0pt,
mark=asterisk,
mark options={solid},
forget plot
]
table[row sep=crcr]{
2 0.279342850111857\\
3 0.267745444295302\\
};
\addplot [
color=black,
dash pattern=on 1pt off 3pt on 3pt off 3pt,
line width=1.5pt,
forget plot
]
table[row sep=crcr]{
1 0.207873194630872\\
2 0.207873194630872\\
3 0.207873194630872\\
};
\addplot [
color=black,
dotted,
line width=1.5pt,
forget plot
]
table[row sep=crcr]{
1 0.469263081879195\\
2 0.469263081879195\\
3 0.469263081879195\\
};
\end{axis}

\begin{axis}[%
xshift=0.5cm,
width=7cm,
height=5cm,
scale only axis,
xmin=0.9,
xmax=3.1,
xtick={1,2,3},
xticklabels={5,10,20},
ymin=0,
ymax=6,
ylabel={y label bla bla},
at=(plot1.right of south east),
anchor=left of south west
]
\addplot [
color=blue,
solid,
mark size=3.3pt,
mark=triangle,
mark options={solid,,rotate=180},
forget plot
]
table[row sep=crcr]{
1 3.0579222\\
2 3.27228546666667\\
};
\addplot [
color=green,
solid,
mark size=5.0pt,
mark=o,
mark options={solid},
forget plot
]
table[row sep=crcr]{
1 3.678485\\
2 1.78462153333333\\
3 0.132394466666667\\
};
\addplot [
color=red,
solid,
mark size=5.0pt,
mark=asterisk,
mark options={solid},
forget plot
]
table[row sep=crcr]{
2 0.335520333333333\\
3 0.106502666666667\\
};
\addplot [
color=blue,
dashed,
mark size=3.3pt,
mark=triangle,
mark options={solid,,rotate=180},
forget plot
]
table[row sep=crcr]{
1 5.1519882\\
2 2.3329078\\
};
\addplot [
color=green,
dashed,
mark size=5.0pt,
mark=o,
mark options={solid},
forget plot
]
table[row sep=crcr]{
1 2.875987\\
2 2.722576\\
3 0.268442533333333\\
};
\addplot [
color=red,
dashed,
mark size=5.0pt,
mark=asterisk,
mark options={solid},
forget plot
]
table[row sep=crcr]{
2 0.1976194\\
3 0.0553086666666667\\
};
\addplot [
color=black,
dash pattern=on 1pt off 3pt on 3pt off 3pt,
line width=1.5pt,
forget plot
]
table[row sep=crcr]{
1 4.34113352673945\\
2 4.34113352673945\\
3 4.34113352673945\\
};
\end{axis}

\begin{axis}[%
width=7cm,
height=5cm,
scale only axis,
xmin=0.9,
xmax=3.1,
xtick={1,2,3},
xticklabels={5,10,20},
xlabel={x label bla},
ymin=0,
ymax=20,
ylabel={y label bla},
at=(plot1.below south west),
anchor=above north west,
legend style={at={(1.4,0.5)},anchor=west,draw=black,fill=white,legend cell align=left}
]
\addplot [
color=blue,
solid,
mark size=3.3pt,
mark=triangle,
mark options={solid,,rotate=180}
]
table[row sep=crcr]{
1 19.8\\
2 18.7333333333333\\
};
\addlegendentry{curve 1};

\addplot [
color=green,
solid,
mark size=5.0pt,
mark=o,
mark options={solid}
]
table[row sep=crcr]{
1 15\\
2 13.4\\
3 14.2666666666667\\
};
\addlegendentry{curve 2};

\addplot [
color=red,
solid,
mark size=5.0pt,
mark=asterisk,
mark options={solid}
]
table[row sep=crcr]{
2 11.8666666666667\\
3 11.5333333333333\\
};
\addlegendentry{curve 3};

\addplot [
color=blue,
dashed,
mark size=3.3pt,
mark=triangle,
mark options={solid,,rotate=180}
]
table[row sep=crcr]{
1 16.2666666666667\\
2 17.2\\
};
\addlegendentry{curve 4};

\addplot [
color=green,
dashed,
mark size=5.0pt,
mark=o,
mark options={solid}
]
table[row sep=crcr]{
1 12.1333333333333\\
2 11.9333333333333\\
3 13.4\\
};
\addlegendentry{curve 5};

\addplot [
color=red,
dashed,
mark size=5.0pt,
mark=asterisk,
mark options={solid}
]
table[row sep=crcr]{
2 10.8666666666667\\
3 10.7333333333333\\
};
\addlegendentry{curve 6};

\addplot [
color=black,
dash pattern=on 1pt off 3pt on 3pt off 3pt,
line width=1.5pt
]
table[row sep=crcr]{
1 14\\
2 14\\
3 14\\
};
\addlegendentry{some curve};

\addplot [
color=black,
dotted,
line width=1.5pt
]
table[row sep=crcr]{
1 2\\
2 2\\
3 2\\
};
\addlegendentry{some other curve};

\end{axis}
\end{tikzpicture}%
\caption{Caption goes here}
\label{fig:some_label}
\end{figure*}

\end{document}
David Carlisle
  • 757,742
Konstantin
  • 111
  • 2
  • 2
    Hi Konstantin, welcome to the site! The code you posted doesn't really seem to answer the question. Maybe you could edit your answer to show how to recreate the images posted in the question (from the comments, it seems like the author is mainly struggling with the vertical lines marking the mean/mode/median, and with the large arrows underneath the figures). – Jake Aug 20 '13 at 07:54