I need to be able to control how dense the axis lines are in my chart. I found one online example here that is the closest that I ever found.
Given the sample data:
y <- sample(10, 100, rep=T) x <- rnorm(100) plot(x,y)
Then I get this plot.
The view seems to change with zoom, but the x axis is messed up with -2 showing up a -220. This maybe from the small image, but it happens even when zoomed where all values are visible. The y axis is similar, but it also added unnecessary 0s for whole numbers. What would be better if both the x and y axis values were rotated 90 degrees so adding digits would not cause interference and make the font size smaller to make it fit. (I just noticed that the font size is always the same regardless of zoom) All automatically.
The biggest problem is that in the example I manually set the ranges, which is not something I can do in actual usage. I need some way to automatically set maximum and minimum density of the little ticks and tick labels. Maybe I want a number every 1, but a tick on the x axis every .1. I can use any comment or package if it can do this properly. Most importantly it should be automatic and also work with xts time series data with options for days hours and minutes as needed as dense as possible.
Update: If it helps, I use the plot or ggplot2 to plot many charts in a script and export them to a pdf file. The result is a huge image with 3 to 5 axis lines. This makes the chart very difficult to read accurately. It could fit 100 lines which would be much easier.