You need to go to TeXShop/Preferences
and add the --shell-escape
option to the Engine
tab as shown here:
After restarting TeXShop, selecting LaTeX
from the pull down will automatically have the --shell-escape
option enabled.
Alternatively you can also create you own .engine
files. An example of this is at Problems with implementing glossary.engine in TeXShop. As egreg commented, with your own custom engine it is clear to you that are enabling --shell-escape
, especially if you name it something like LaTeX w ShellEscape
.
This will enable --shell-escape
but you still need to ensure that you indded have gnuplot
installed. As I mentioned in an earlier answer at Generating graphs with gnuplot (Gnuplot, LaTeX and tkz-fct) you should have a look at this gnuplot tutorial and ensure that gnuplot is working.
You can use the error bar
functionality and combine two \addplot
commands to achieve this.
Here are two styles, min max
and avg avgopen
that you can apply to two \addplot
commands to generate the plots like so:
\pgfplotstableread{
Time AvgOpen Avg Min Max
0 7 8 5 10
1 8 7 6 11
2 6 10 5 15
3 8 9 4 10
}\datatable
\begin{tikzpicture}
\begin{axis}[only marks]
\addplot [min max] table {\datatable};
\addplot [avg avgopen] table {\datatable};
\end{axis}
Full code:
\documentclass{article}
\usepackage{pgfplots, pgfplotstable}
\begin{document}
\pgfplotsset{
min max/.style={
mark=empty,
error bars/.cd,
y dir=plus,
y explicit,
error mark=empty,
/pgfplots/table/.cd,
x=Time,
y=Min,
y error expr=\thisrow{Max}-\thisrow{Min}
},
avg avgopen/.style={
mark=-, mark size=4pt, mark options={xshift=-4pt},
error bars/.cd,
y dir=plus,
y explicit,
error mark=|,
error bar style={draw opacity=0,xshift=4pt},
error mark options={draw opacity=1, mark size=4pt},
/pgfplots/table/.cd,
x=Time,
y=AvgOpen,
y error expr=\thisrow{Avg}-\thisrow{AvgOpen}
}
}
\pgfplotstableread{
Time AvgOpen Avg Min Max
0 7 8 5 10
1 8 7 6 11
2 6 10 5 15
3 8 9 4 10
}\datatable
\begin{tikzpicture}
\begin{axis}[only marks]
\addplot [min max] table {\datatable};
\addplot [avg avgopen] table {\datatable};
\end{axis}
\end{tikzpicture}
\end{document}
Best Answer
Disregarding the recommendations to not use this kind of diagram, it's fairly straightforward to draw those kinds of things, just a matter of drawing some
arc
s. I didn't try matching the colors, or making any sort of nice interface.