Graphics, Figures & TablesScatterplot: label axis & line for mean of each axis

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Tempowo
Posts: 7
Joined: Tue Nov 15, 2016 4:18 pm

Scatterplot: label axis & line for mean of each axis

Post by Tempowo »

Hello all :-)

I have found this code below:

Code: Select all

\begin{tikzpicture}
\begin{axis}[%
scatter/classes={%
    a={mark=o,draw=black}}]
\addplot[scatter,only marks,%
    scatter src=explicit symbolic]%
table[meta=label] {
x y label
-1 1.3 a
1 4.3 a
2 5.1 a
3 5.7 a
4 6.3 a
5 6.8 a

    };
\end{axis}
\end{tikzpicture}

I have one question: How can I label the axes? An how can I indicate the mean of each axis with a line in the diagram?

Many greetings :)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
User avatar
Stefan Kottwitz
Site Admin
Posts: 10316
Joined: Mon Mar 10, 2008 9:44 pm

Scatterplot: label axis & line for mean of each axis

Post by Stefan Kottwitz »

Hello,

simply add these option to the axis:

xlabel = Text on x axis,
ylabel = Text on x axis,


Stefan
LaTeX.org admin
Post Reply