How to set number of minor tick marks for only one but not both the axes?

Viewed 548

Consider the following code:

using Plots
gr()
x = 1:10
y = rand(10)
plot(x, y)
xaxis!(minorticks=10)

which produces the following plot:

enter image description here

There are 10 minor tick marks on both x- and y-axis. I like to set the number of minor tick marks on only the x-axis, leaving the y-axis with no minor ticks. In the same way, I could ask how I could the number of tick marks on the y-axis independently of x-axis.

I appreciate any help. Thanks.

1 Answers

The xminorticks and yminorticks keywords seem to work, e.g.

using Plots
plot(1:10, xminorticks=10)

Plots.jl plot with x minor ticks only

Related