Adding Tick Marks at Origin in Mathematica Plot?

In summary, the individual was having trouble adding a tick mark at the origin of a plot in Mathematica and sought advice. After providing their current command and realizing there was a mistake in the parenthesis, they were able to fix the issue by adjusting the PlotRange and starting the plot at 0. They also noted that this is mentioned as a possible issue in the "ticks" help section.
  • #1
NeoDevin
334
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
  • #2
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"}}}
 
  • #3
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.
 
  • #4
Ah. Then the problem is the PlotRange-> All. Try putting in your own limits:
PlotRange->{{0,10},{0,10}}
 
  • #5
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.
 
  • #6
That worked, thanks.
 

1. How do I customize tick marks on a Mathematica graph?

To customize the tick marks on a Mathematica graph, you can use the Ticks option in the Plot function. This allows you to specify the range of tick marks and their labels, as well as their style and placement.

2. Can I change the orientation of tick marks on a graph in Mathematica?

Yes, you can change the orientation of tick marks on a graph in Mathematica by using the TickOrientation option in the Frame or FrameTicks functions. This allows you to specify whether the tick marks should be horizontal, vertical, or diagonal.

3. How do I add minor tick marks to a Mathematica graph?

To add minor tick marks to a Mathematica graph, you can use the MinorTicks option in the Plot function. This allows you to specify the number and spacing of minor ticks, as well as their style and placement.

4. Is it possible to remove tick marks from a Mathematica graph?

Yes, it is possible to remove tick marks from a Mathematica graph by using the Ticks or FrameTicks options with an empty list, or by using the TickStyle or FrameTickStyle options with None. This will remove all tick marks from the graph.

5. Can I change the number or spacing of tick marks on a logarithmic scale graph in Mathematica?

Yes, you can change the number or spacing of tick marks on a logarithmic scale graph in Mathematica by using the ScalingFunctions option in the Plot function. This allows you to specify a custom scaling function that will determine the placement of tick marks on the logarithmic scale.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
877
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
957
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
692
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
17K
Back
Top