DCE
DCE

Reputation: 11

Problem with setting scale for ternary plot

I have this code:

library(ggtern)

data()
Coal

ggtern(data = Coal, aes(x = Reflectance, y = `H/O`, z = `O/C`)) +
  geom_point(aes(color = Feedstock), size = 3) +
  theme_rgbw()

ternary plot

Since the highest number in my dataset is 4.41 and the lowest is 0.010, I would like to change scaling.

I have tried this but it doesn't work:

Tlim(c(min(Coal$`O/C`), max(Coal$`O/C`))) +  # Adjust Z-axis limits
  Rlim(c(min(Coal$Reflectance), max(Coal$Reflectance))) +  # Adjust X-axis limits
  Llim(c(min(Coal$`H/O`), max(Coal$`H/O`)))

Here is the data I'm trying to plot:

Feedstock   Reflectance   H/O    O/C
wheat straw     0,20    0,120   0,976
wheat straw     0,72    0,040   0,380
wheat straw     1,44    0,041   0,369
wheat straw     2,03    0,033   0,309
wheat straw     2,99    0,020   0,273
wheat straw     3,88    0,012   0,183
sycamore wood   0,20    0,114   0,837
sycamore wood   0,84    0,054   0,333
sycamore wood   1,52    0,035   0,237
sycamore wood   2,17    0,026   0,153
sycamore wood   3,51    0,021   0,124
sycamore wood   3,90    0,010   0,091
peanut shells   0,20    0,136   0,588
peanut shells   0,77    0,064   0,390
peanut shells   1,43    0,043   0,233
peanut shells   2,37    0,027   0,133
peanut shells   3,62    0,017   0,104
peanut shells   4,41    0,010   0,076

Upvotes: 1

Views: 47

Answers (0)

Related Questions