tags:

views:

241

answers:

1

I'm trying to make a graph of a table and graph it in log space.

First of all, plot(dat) gives me the grid of graphs

Second of all, plot(dat, log="xy") gives me the correct plots of data in log space

However, plot(dat, log="xy") ruins the main diagonal's labels of names(dat)

R version 2.11.0

Sample Data:

           cold cold_control drought_1 drought_2 drought_control_1 drought_control_2   pollen
locusA  1.586772     2.681969  2.158070  0.565037          3.012266          3.673228 0.000000
locusB  0.000000     0.000000  0.063385  0.000000          0.000000          0.000000 0.000000
locusC  0.000000     0.000000  0.000000  0.000000          0.000000          0.000000 0.049587
locusD 66.811446   142.196072 74.329916 35.878431        106.071526        150.266891 0.000000
locusE 10.310947     6.489778 20.680820 31.699902         19.353401         21.345744 0.033246
locusF 26.928376    11.339193 21.226212 24.858953         10.085712         15.587217 0.412588

Also, I get these warnings with log="xy"

1: In xy.coords(x, y, xlabel, ylabel, log) : 2 x values <= 0 omitted from logarithmic plot

2: In xy.coords(x, y, xlabel, ylabel, log) : 2 y values <= 0 omitted from logarithmic plot

3: In xy.coords(x, y, xlabel, ylabel, log) : 2 x values <= 0 omitted from logarithmic plot

4: In xy.coords(x, y, xlabel, ylabel, log) : 2 y values <= 0 omitted from logarithmic plot

5: In axis(side = side, at = at, labels = labels, ...) : "log" is not a graphical parameter

6: In plot.xy(xy.coords(x, y), type = type, ...) : "log" is not a graphical parameter

A: 

You should use xlog=TRUE, ylog=TRUE, instead of log="xy". The names will show up and the log is not a graphical parameter warnings will disappear.

Anyway you have some 0 values, and you cannot plot log(0), that's the reason of the other warnings

nico
When I use `xlog` and `ylog`, Nothing happens to the graph. I also tried to set `xlog` and `ylog` with `par` but nothing happens.
ACEnglish
@ACEnglish: Forget the first part of my answer, I was going by memory... It's really strange, but `xlog` and `ylog` are listed in `?par` but `log` is not, although it is listed in `?plot.default`.I'm not sure why they don't work anyways... I'll let you know if I find out.
nico