# how to restrict the tick options to finite number of major and minor ticks

When you plot a data using Listplot, use the following

data=Uncompress[FromCharacterCode@ Flatten[ImageData[Import["https://i.sstatic.net/OiZrp.png"],"Byte"]]] ListPlot[data,Plotrange->Full,Framellabel->{"Length",""},LabelStyle->{FontSize->19},PlotTheme->"Classic",Frame->True,Joined->True,ImageSize->Large,PlotStyle->{Black}]

Then we get a neat graph like this, however, this is not a neat image for any scientific publications, For that, we need to fix Major ticks and minor ticks to a minimum, otherwise, all those minor ticks would distract the attention.

One solution is to write manually, but that is a herculean process. but if you use some other graph plotting softwares, They have the options to control minor ticks and Major ticks.

I am certain that Mathematica also has.Could anyone give me a nice way to control the minor ticks and Major ticks?

For example, in the x-axis, I just need one minor tick in between two major ticks.and y-axis I also need three Major ticks such as 0.35,0.45,0.55 and 0.4 and 0.5 as minor ticks

Comments and previous questions

1) I also have refereed some of the Mathematica questions.

here, where they use Finddivison method, but that would not work here in my y axis, all other minor option does not look very neat.

2) I always need inward ticks.

3) please let me also know, if someone uses Mathematica for publishing scientific papers, how do you make a neat image. Any suggestions for fonts or size of the image etc are welcome.

## 1 Answer

Fine-tune to your needs:

bigTicks = Table[{x, x, {.05, 0}}, {x, 50., 50.5, .1}];
littleTicks = Table[{x, x, {.02, 0}}, {x, 50.05, 50.55, .1}];
Plot[1, {x, 50, 50.5},
Ticks -> {Union[bigTicks, littleTicks], Automatic}]

• @TM90: Try to generalize from the solution. Clearly, you should choose the particular values and increments and Ticks sizes. Everything is there for you to adjust as you will. No one should create the exact solution for the particular case you request. That way you'd learn nothing. Commented Apr 15, 2017 at 1:43
• @ David G, I got your point, Thanks a lot for your answer.
– TM90
Commented Apr 25, 2017 at 11:22