Hi Stephen,

Because coord_trans() does all the work of plotting the original values on the tranformed scale. See ?coord_trans. To quote: "The difference between transforming the scales and transforming the coordinate system is that scale transformation occurs BEFORE statistics, and coordinate transformation afterwards."

# After
require(ggplot2)
data(diamonds)
# Three ways of doing transformating in ggplot:
# * by transforming the data
qplot(log10(carat), log10(price), data=diamonds)
# * by transforming the scales
qplot(carat, price, data=diamonds, log="xy")
qplot(carat, price, data=diamonds) + scale_x_log10() + scale_y_log10()
# * by transforming the coordinate system:
qplot(carat, price, data=diamonds) + coord_trans(x = "log10", y = "log10")

Michael

On Sep 5, 2009, at 9:01 PM, stephen sefick wrote:

why not transform the y-data?

On Sat, Sep 5, 2009 at 8:03 PM, Michael Kubovy<kub...@virginia.edu> wrote:
Hi,

Does anyone know how to do a coord_trans() in which the y-axis is tranformed
into (for example) -1000/y?

Stephen Sefick



_____________________________
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
      McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766
WWW:    http://www.people.virginia.edu/~mk9y/

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to