Adding Tick Marks at Origin in Mathematica Plot?

Click For Summary

Discussion Overview

The discussion revolves around adding a tick mark at the origin in a Mathematica plot. Participants explore issues related to the syntax of the Ticks option and the effect of PlotRange settings on the visibility of tick marks.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant shares their command for plotting and notes that the tick mark at the origin does not appear.
  • Another participant suggests that the syntax for Ticks may be incorrect and proposes a different structure for defining tick marks.
  • A participant acknowledges the syntax issue but clarifies that it was a mistake made while copying the command.
  • Another participant advises adjusting the PlotRange to specific limits instead of using All, suggesting that this might resolve the issue with the tick mark visibility.
  • It is noted that tick labels at the origin may not display if they are too close to the axis, referencing a possible issue mentioned in the Mathematica help documentation.
  • A participant confirms that adjusting the plot limits resolved their issue with the tick mark at the origin.

Areas of Agreement / Disagreement

Participants generally agree on the importance of correct syntax for the Ticks option and the impact of PlotRange settings on tick mark visibility. However, there is no consensus on a single solution, as different approaches are discussed.

Contextual Notes

Limitations include potential misunderstandings of the Ticks syntax and the specific conditions under which tick marks appear or disappear based on axis proximity.

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
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
3
Views
2K