Zero near origin of coordinates

Click For Summary
In Mathematica, the default behavior does not display the zero tick label at the origin of coordinate plots, which is confirmed by the documentation stating that tick labels at the origin are not shown. Users can work around this limitation by using the Epilog option to manually add the zero label at the origin. Two suggested methods include using `Epilog -> Text[0, {0, 0}, {2, -1.5}]` or `Epilog -> Style[Text[0], Background -> White]` in the plot command. This approach allows for better visual representation by placing the zero label directly at the origin. Overall, these techniques provide a solution for displaying the zero label effectively in plots.
sukharef
Messages
54
Reaction score
0
Hello!

If you do a plot in Mathematica,

for example

Plot[Sin[x], {x, -, 2 Pi}]

804c9e884652.jpg


it won't put zero near origin of coordinates. So how can do it ? I tryed actually AxesOrigin or smth like that, but it didn't help me.

Thanks!
 
Physics news on Phys.org
The http://reference.wolfram.com/mathematica/ref/Ticks.html#ES_6_" says "A tick label on the axes origin is not displayed" even when the ticks are manually set. I think they did this because there's no nice place to really place the origin tick - unless you place it right on top of the origin.

If you want 0 at the origin try something like

Plot[Sin[x], {x, -2 Pi, 2 Pi}, Epilog -> Text[0, {0, 0}, {2, -1.5}]]

or

Plot[Sin[x], {x, -2 Pi, 2 Pi}, Epilog -> Style[Text[0], Background -> White]]
 
Last edited by a moderator:
Simon_Tyler said:
The http://reference.wolfram.com/mathematica/ref/Ticks.html#ES_6_" says "A tick label on the axes origin is not displayed" even when the ticks are manually set. I think they did this because there's no nice place to really place the origin tick - unless you place it right on top of the origin.

If you want 0 at the origin try something like

Plot[Sin[x], {x, -2 Pi, 2 Pi}, Epilog -> Text[0, {0, 0}, {2, -1.5}]]

or

Plot[Sin[x], {x, -2 Pi, 2 Pi}, Epilog -> Style[Text[0], Background -> White]]

Thanks!
 
Last edited by a moderator:

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K