How can I increase the length of plot tick marks? Here is a small example:
r <- as.POSIXct(round(range(time), "mins"))
plot(time, x, t="l", xaxt = "n")
axis.POSIXct(1, at = seq(r[1], r[2], by = "min"), format = "%H:%M:%S")
which gives
As you can see, all the ticks are the same size. Is there a way to automatically increase the length of those ticks that are signed?
To make longer subplot tick marks in matplotlib, we can use tick_params() method for minor and major ticks length and width.
If you want your tick to be longer and thicker, you can increase both the length AND thickness of the tick marks with the TickLength and LineWidth properties of the axes. ax. TickLength = [k, k]; % Make tick marks longer.
To increase the width of axes tick (both X-axis and Y-axis at the same time) using ggplot2 in R, we can use theme function with axis. ticks argument where we can set element_line argument size to a larger value.
Ticks are the values used to show specific points on the coordinate axis. It can be a number or a string. Whenever we plot a graph, the axes adjust and take the default ticks. Matplotlib's default ticks are generally sufficient in common situations but are in no way optimal for every plot.
When creating a very specific axis layout, you typically need to add the axis after drawing the plot. Since you didn't have a reproducible example, I've created my own data set.
Create a plot, but don't display the axis
plot(1:10, axes=FALSE, frame=TRUE)
Add in the x-scale. In this example, values 1,2,3, ...., 10. The argument tck
specifies the tick length:
##The tck value should be smaller here
axis(1, 1:10, tck=-0.05)
Now add in an additional scale for "in-between" values. I've set labels=""
, so we don't print any values:
axis(1, seq(0.5, 9.5, 1), labels=rep("", 10), tck=-0.01)
This gives:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With