How to choose the numbers shown on the axes of a plot in mathemetica?

后端 未结 3 1040
傲寒
傲寒 2020-12-18 13:18

I have already checked all the examples and settings in the Mathematica documentation center, but couldn\'t find any example on how to choose the numbers that will be shown

3条回答
  •  庸人自扰
    2020-12-18 13:24

    Ticks also accepts a function, which will save you the trouble of listing the points manually or having to change the max value each time. Here's an example:

    xTickFunc[min_, max_] := 
     Table[{i, i, 0.02}, {i, Ceiling[min/Pi] Pi, Floor[max/Pi] Pi, Pi}]
    Plot[Sinc[x], {x, -5 Pi, 5 Pi}, Ticks -> {xTickFunc, Automatic}, 
     PlotRange -> All]
    

    enter image description here

    If you want more flexibility in customizing your ticks, you might want to look into LevelScheme.

提交回复
热议问题