I have 7 *.txt files each with 2 columns of data thus:
time(mins) contacts
3.25 8
1.166666667 4
3.2 6
3.2 7
2.25 8
5.466666667 12
2.25 3
2.166666667 7
I'd like to plot them in separate scatter plots (via TikZ or other at your discretion) but on the same page. I've exported excel versions and they look somewhat unprofessional. Can you point me in the right direction, or a push to get started?
I'd also like to put on a linear regression line with its equation and R^2 value. I can provide both but I see in How do I draw a scatterplot with a function plot? it's possible to do it automatically.
an MWE:
\begin{tikzpicture}[only marks, y=.5cm]
\draw plot[mark=*,xshift=-6cm] file {data/ScatterPlotExampleData.data};
\draw[->,xshift=-6cm] (6,0) -- coordinate (x axis mid) (17,0);
\draw[->,xshift=-6cm] (6,0) -- coordinate (y axis mid)(6,27);
\foreach \x in {6,8,10,12,14,16}
\draw [xshift=-6cm](\x cm,1pt) -- (\x cm,-3pt)
node[anchor=north] {$\x$};
\foreach \y/\ytext in {0/0,2.5/5000,5/10000,7.5/15000,10/20000,12.5/25000}
\draw (1pt,\y cm) -- (-3pt,\y cm) node[anchor=east] {$\ytext$};
\node[below=1cm] at (x axis mid) {Education};
\node[left=2cm,rotate=90] at (y axis mid) {Income};
\end{tikzpicture}
Equally this matlab2tikzlooks interesting
pgfplotsdoesn't actually do linear regression but fits a line through extreme points, is this correct? – HCAI Mar 13 '13 at 19:11