axis segment breaks

23 views
Skip to first unread message

microbedr

unread,
Jul 16, 2010, 7:24:15 AM7/16/10
to ggplot2
I would like to introduce segment breaks into the x-axis of a plot I
have generated. The x-axis is a continuous scale, say,
c(-1000:1000). I would like to have the left segment of the scale be
c(-1000:-500) and occupy only say, 5% of the physical length of the x-
axis, and then have the right segment occupy the remaining 95% of the
x-axis length with the range c(100:1000). Often you see these plots
with a break denoted as "-/ /-". Can anyone assist me here?

Thanks so much, Joel

Hadley Wickham

unread,
Jul 16, 2010, 7:38:15 AM7/16/10
to microbedr, ggplot2
Hi Joel,

This is not currently possible in ggplot2. I'm ambivalent about this
type of display. You can get something very similar with facetting if
you really want to do it.

Hadley

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

microbedr

unread,
Jul 16, 2010, 7:48:51 AM7/16/10
to ggplot2
Thanks for your prompt response. I'm plotting a response vs.
log10(dose) where one of the concentrations is zero (the rest are,
say, 3,10,30,100,300). I've been setting the 0 concentration to 0.1
be able to visualize the response and then introducing the "-//-"
breaks I mentioned using a gui software package to generate figures
for display. I was hoping to accomplish the same task and stay within
R. Any suggestions from anyone on how to accomplish what I would like
to do would be appreciated. Thanks again, Joel

Hadley Wickham

unread,
Jul 16, 2010, 7:50:42 AM7/16/10
to microbedr, ggplot2
It's hard to offer concrete advise without seeing the data, but given
the amount of manipulation you're doing to the x-axis, have you
considered making concentration a factor?

Hadley

Dennis Murphy

unread,
Jul 16, 2010, 1:53:28 PM7/16/10
to microbedr, ggplot2
Hi:

I tend to agree with Hadley about the wisdom of using breaks in a plot, but there is a function to do this sort of thing in the plotrix package.

RSiteSearch('break plot axis')

scared up the function axis.break() in plotrix as the first hit. I presume it's meant for base graphics, though.

HTH,
Dennis

Reply all
Reply to author
Forward
0 new messages