Labelling a point on the x-axis with PGF-TikZ

In summary, to label points on the x-axis using PGF-TikZ, you can use the command \node at (x,y) {label} where x and y are the coordinates of the point and label is the desired text. Additional options can be added to customize the appearance of the label, such as font size, color, and style. Multiple points can be labeled using the \foreach loop and mathematical expressions can be included by enclosing them in $ symbols. It is also possible to label points with both text and symbols by including them in the label separated by a space.
  • #1
ZFurdzik
1
0
TL;DR Summary
labelling a point on x-axix with pgf-tikz
I'm confused about wrote a root of function when plotting here graph with pgf-tikz.
Any help is welcome.
 
Physics news on Phys.org
  • #2
ZFurdzik said:
Summary:: labelling a point on x-axix with pgf-tikz

I'm confused about wrote a root of function when plotting here graph with pgf-tikz.
Any help is welcome.
Welcome to PF.

Can you post a PDF or JPEG screenshot of your plot?

https://en.wikipedia.org/wiki/PGF/TikZ
 
  • Like
Likes Wrichik Basu

FAQ: Labelling a point on the x-axis with PGF-TikZ

How do I label a point on the x-axis with PGF-TikZ?

To label a point on the x-axis with PGF-TikZ, you can use the command "\node" followed by the desired label inside curly braces. Then, specify the x-coordinate of the point using the "at" keyword. For example, "\node at (2,0) {$P$};" would label the point "P" at the x-coordinate 2.

Can I customize the appearance of the label on the x-axis?

Yes, you can customize the appearance of the label on the x-axis by adding options after the label text in the "\node" command. For example, you can change the text color, font size, or add a border by using options such as "color", "font", or "draw".

How do I label multiple points on the x-axis with different labels?

You can label multiple points on the x-axis with different labels by repeating the "\node" command for each point. Make sure to specify the x-coordinate of each point to position the labels correctly. For example, "\node at (2,0) {$P$}; \node at (4,0) {$Q$};" would label two points "P" and "Q" at x-coordinates 2 and 4, respectively.

Can I use mathematical expressions as labels on the x-axis?

Yes, you can use mathematical expressions as labels on the x-axis by enclosing them in "$" symbols. This will allow you to use mathematical symbols and functions in your labels. For example, "\node at (3,0) {$\frac{1}{2}$};" would label a point with the fraction 1/2 at the x-coordinate 3.

How do I remove the default tick marks on the x-axis when labeling points?

To remove the default tick marks on the x-axis when labeling points, you can use the "xtick=\empty" option in your axis environment. This will remove all tick marks on the x-axis, allowing you to only display the labels. Alternatively, you can use the "xticklabels=\empty" option to remove only the tick mark labels while keeping the tick marks themselves.

Similar threads

Replies
3
Views
2K
Replies
1
Views
5K
Replies
8
Views
2K
Replies
6
Views
2K
Replies
2
Views
948
Back
Top