LaTeX
.The trouble with most LaTeX documentations is that they're extremely heavy, and their examples are too often "out of this world". I'm having difficulties in finding the proper setup to add a linear regression line, and to customize the markers, and the tick numbers. Here's a MWE to work with :
Code: Select all
\documentclass[11pt,letterpaper,twoside]{article}
\usepackage[total={6.5in,10in},left=1in,top=0.5in,includehead,includefoot]{geometry}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
Some cute data graphic :
\begin{center}
\begin{tikzpicture}
\begin{axis}[
height=9cm,
width=9cm,
grid=both,
tick align=inside,
minor tick num=3,
major tick style={black,thin},
minor tick style={black},
major grid style={color=gray!60,densely dashed},
minor grid style={color=gray!50,densely dotted},
tick label style={font=\footnotesize},
label style={font=\normalsize},
xlabel=$X$,
ylabel=$Y$,
title={Some title},
xtick={-1, 0, 1, 2, 3, 4, 5},
ytick={-1, 0, 1, 2, 3, 4, 5, 6}
]
\addplot[blue,mark=*,mark size=1.10,only marks,error bars/.cd,x dir=both,y dir=both,x explicit,y explicit]
coordinates {
(0, 0) +- (0.1, 0.4)
(0.5, 1) +- (0.4, 0.2)
(1, 2) +- (0.2, 0.4)
(1.55, 3.25) +- (0.15, 0.3)
(2, 5) +- (0.3, 0.3)};
\end{axis}
\end{tikzpicture}
\end{center}
\end{document}
2. How to show its equation (with many digits)? and to change its "X" and "Y" symbols? (so the equation is using exactly the same symbols as on the axis).
3. How to add more digits to the tick label numbers, on the two axis? Writing 0.0, 1.0, ... in the code do nothing.
4. How to change the marker's color, and the error bars color separately? For example the markers in blue, and all the error bars in red?