【发布时间】:2014-11-10 15:31:22
【问题描述】:
如何将下面的代码更改为:
- 符号后的下标(例如,在 LaTeX 中为 $\alpha_R$、$\beta_R$、$\gamma_R$)
- “日志”和符号之间的空格(尝试按照建议放置“~”,但没有成功)
这是Plotting axis labels with Greek symbols from a vector 和Subscripts in plots in R 的混合问题。
# vector of symbols to go in graphs
symbol_list <- c("alpha", "beta", "gamma");
set.seed(1234);
count <- 1;
for (symbol in symbol_list){
# random data
x <- runif(10, 0,1);
y <- runif(10, 0,1);
png(paste0("test",count,".png"));
# make graph with different symbol in x label at each iteration
plot(x,y, xlab=parse(text = paste("log *",symbol)));
dev.off();
count <- count+1;
}
【问题讨论】:
标签: r loops plot symbols subscript