1

Is it possible to omit the short ticks when using annotation_logticks? I.e., I want only the ticks for 10 and 5, not the 1 ticks.

I tried setting short=unit(0,"cm"). However, the short ticks still show up as dots.

If it is not possible with annotation_logticks are there other ways to achieve this?

Example:

library(ggplot2)
library(grid)
library(scales)
tikz("test.pdf",standAlone=TRUE,12,3)
ggplot(data=data, aes(x=step,y=opsPerSecond,fill=hidx)) +   
        geom_bar(position="dodge", stat="identity") +
        scale_y_continuous(
                trans = log10_trans(),
                breaks = trans_breaks("log10", function(x) 10^x),
                labels = trans_format("log10", math_format(10^.x))
        ) +
        annotation_logticks(sides="lr",short=unit(0,"cm"))

Here is a picture of the problem: enter image description here

As you see, the dots on the axis are still visible, even with short=unit(0,"cm")!

PS: I use the tikz engine as output.

4

1 回答 1

0

我曾经iris重现您的问题,似乎解决方案是

annotation_logticks(sides="lr", short = unit(NA, "cm"))
于 2014-12-22T09:27:04.657 回答