xlim と ylim の値を指定したいグラフをプロットします! しかし、それは機能しません。これが私が使用している機能です:
DensityPlotF <- function (xx, plotname)
{
library(RColorBrewer)
library(latticeExtra)
library(lattice)
lattice.options(default.theme = standard.theme(color = FALSE))
cols <- colorRampPalette(brewer.pal(11, "RdBu"))
ppi <- 300
png(filename = plotname, width=6*ppi, height=6*ppi, res=ppi)
print(levelplot(xx$rho ~ xx$r + xx$z, panel = panel.levelplot.points, col.regions = cols, xlab="R (Å)", ylab="z (Å)", xlim=c(0,10.0), ylim=c(-30,30)))
dev.off()
}
cl2d <- read.table("cl_2d.dat", header=TRUE)
colnames(cl2d) <- c("r", "z", "rho")
DensityPlotF(cl2d, "cl2d.png")
.dat ファイルは次のようになります。
#r z rho
6.500000e+00 -4.250000e+01 3.397767e-01
6.500000e+00 -4.200000e+01 3.246126e-01
6.500000e+00 -4.150000e+01 3.301116e-01
6.500000e+00 -4.100000e+01 3.289452e-01
6.500000e+00 -4.050000e+01 3.264456e-01
xlim と ylim を設定した後、プロットが変に見えます。プロット内の列をまとめて (つまり、連続的に) 表示する簡単な方法はありますか?