Graphics, Figures & TablesHow to add text near expression in tikzpicture

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Safari8331
Posts: 11
Joined: Wed May 17, 2017 5:34 pm

How to add text near expression in tikzpicture

Post by Safari8331 »

Is there option to add text near \addplot option. So I can write like y=x^2 + 2 or something like that? Can you help me liek this, or you need example of my code?
Last edited by Safari8331 on Sat May 27, 2017 2:12 pm, edited 2 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

How to add text near expression in tikzpicture

Post by Stefan Kottwitz »

Yes, please post the code. You could post data as attachment here (perhaps with .txt file name extension), or dummy data, or empty plots. But code for the diagram with axes is needed, otherwise we don't know how it's made at all, such as by the TikZ data visualization or using pgfplots.

Stefan
LaTeX.org admin
Safari8331
Posts: 11
Joined: Wed May 17, 2017 5:34 pm

How to add text near expression in tikzpicture

Post by Safari8331 »

I cant post it, they are too big for upload. But I have x coordinate from 0-50, and y from 0 to -150. If is that what you are looking for?
Last edited by Safari8331 on Sat May 27, 2017 2:15 pm, edited 2 times in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

How to add text near expression in tikzpicture

Post by Stefan Kottwitz »

Here's a way how you can print text in the picture based on the coordinates - put a node with axis cs coordinates before \end{axis}:

Code: Select all

\node at (axis cs: 40,-120) {(S1-S15)};
Stefan
LaTeX.org admin
Safari8331
Posts: 11
Joined: Wed May 17, 2017 5:34 pm

How to add text near expression in tikzpicture

Post by Safari8331 »

Thanks a lot mate
Post Reply