Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Mathematica Graph Tick Marks

  1. Nov 10, 2009 #1
    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.
     
  2. jcsd
  3. Nov 10, 2009 #2

    Hepth

    User Avatar
    Gold Member

    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"}}}
     
  4. Nov 10, 2009 #3
    Yes, that's what I had, sorry. I made the mistake when copying into here.
     
  5. Nov 11, 2009 #4

    Hepth

    User Avatar
    Gold Member

    Ah. Then the problem is the PlotRange-> All. Try putting in your own limits:
    PlotRange->{{0,10},{0,10}}
     
  6. Nov 11, 2009 #5

    Hepth

    User Avatar
    Gold Member

    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.
     
  7. Nov 11, 2009 #6
    That worked, thanks.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Mathematica Graph Tick Marks
Loading...