Hello,I was curious whether there is any way to make a second y-axis that is scaled differently from the first. I am doing PK/PD modeling and it's usual to plot two dependent variables vs time, but only one should be on a log scale. Appreciate the time!
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Mar 21, 2018, at 8:02 AM, neil.christo...@gmail.com wrote:
Hello,
I was curious whether there is any way to make a second y-axis that is scaled differently from the first. I am doing PK/PD modeling and it's usual to plot two dependent variables vs time, but only one should be on a log scale. Appreciate the time!
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
HI Neil,It might help if you were able to provide an example that illustrates the plot you are trying to create.A word of caution though - two y-axes (and especially one that is scaled differently) are typically frowned (even scowled?) upon in the ggplot2 world for very good reason. These types of plots can be very misleading. A common accepted usage is plotting data with two different units on each axis (think feet and metres; Celsius and Fahrenheit). From what you are describing, you might be trying to do something that falls into the former category.ggplot2 offers extremely flexible methods for faceting that might be appropriate here.HTH,Sam
On Wed, Mar 21, 2018 at 8:02 AM, <neil.christo...@gmail.com> wrote:
Hello,I was curious whether there is any way to make a second y-axis that is scaled differently from the first. I am doing PK/PD modeling and it's usual to plot two dependent variables vs time, but only one should be on a log scale. Appreciate the time!
--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
There is a command for a second axis - I haven’t used it in a awhile but it looks something like this:
scale_x_continuous(sec.axis = sec_axis(trans = ~.*0.01361+0.51380, name = "Event Time",breaks = c(0.00, 0.25,0.50,0.75,1.0)), name = "Postnatal day”,breaks = c(0,5,10,15,20,30,45,160))
Good luck.
Alex
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
To unsubscribe: email ggplot2+unsubscribe@googlegroups.com
More options: http://groups.google.com/group/ggplot2
---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+unsubscribe@googlegroups.com.
One Yaxis in linear and one in log scale?