Mathematica Adding Tick Marks at Origin in Mathematica Plot?

Click For Summary
To add a tick mark at the origin of a plot in Mathematica, ensure the Ticks option is correctly formatted. The initial command had a syntax error in the Ticks specification. The correct format should separate the x and y ticks into distinct lists. If the tick at the origin is not displaying, it may be due to the PlotRange setting. Using PlotRange -> All can suppress tick labels that are too close to the axis. Instead, define your own limits, such as PlotRange -> {{0, 10}, {0, 10}}, to ensure the tick at the origin appears. This adjustment resolved the issue for the user.
NeoDevin
Messages
334
Reaction score
2
I'm trying to add a tick mark at the origin of a plot in mathematica, but seem to be having trouble. Any advice?

My command looks like this right now:
Plot[S[v], {v, 0, 6}, PlotRange -> All, AxesLabel -> {"Voltage", "Current"}, Ticks -> {{{6,V_th},{{0,"0"},{1,I_max}}}]

The tick marks at 6 on the x-axis and 1 on the y-axis show up, labeled properly, but not the one at 0.
 
Physics news on Phys.org
I think the parenthesis are messed up:

Ticks -> {{{6,V_th},{{0,"0"},{1,I_max}}}]

should be?

Ticks -> {{{6,V_th}},{{0,"0"},{1,I_max}}}]If you have Ticks-> {{1,2,3,4,5},{1,2,3,4,5}} it puts them as a list, where all are indexed.
You need a SET(x,y) of each x = SET(tick1,tick2,tick3,...), of each tick1 = SET(location, "label")So like:
{{{x1,"x1"},{x2,"x2"}},{{y1,"y1"},{y2,"y2"}}}
 
Hepth said:
I think the parenthesis are messed up:

Ticks -> {{{6,V_th},{{0,"0"},{1,I_max}}}]

should be?

Ticks -> {{{6,V_th}},{{0,"0"},{1,I_max}}}]

Yes, that's what I had, sorry. I made the mistake when copying into here.
 
Ah. Then the problem is the PlotRange-> All. Try putting in your own limits:
PlotRange->{{0,10},{0,10}}
 
Hmm, it suppresses the character if its too close to the axis.

It actually lists it as a "possible issue" in the "ticks" help:

Possible Issues**(1)
A tick label on the axes origin is not displayed:
but if you start your plot at 0 then it seems to work.
 
That worked, thanks.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 0 ·
Replies
0
Views
615
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
17K
  • · Replies 3 ·
Replies
3
Views
2K