Adding Tick Marks at Origin in Mathematica Plot?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 9K views
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.