Need help with 2D contour

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Need help with 2D contour

rguyboy
Hello, I've got a list of (x,y,z) data I want to plot a 2D contour plot.

However, the contours looks awful. I spent lots of time trying to get smoothed
contours.

Please, see attached file. How can I get the z values smoothed?

Output

Data:
.5 -1.25 10.2804
6.5404 -1.25 10.4907
6.58081 -1.25 10.8087
6.62121 -1.25 10.4686
6.66162 -1.25 10.506
6.70202 -1.25 10.3084
6.74242 -1.25 9.68256
6.78283 -1.25 9.41229
6.82323 -1.25 9.43078
6.86364 -1.25 9.62408
6.90404 -1.25 9.23871
6.94444 -1.25 9.4298
6.98485 -1.25 9.42173
7.02525 -1.25 9.45413
7.06566 -1.25 9.2722
7.10606 -1.25 9.02645
7.14646 -1.25 9.29053
etc




Script

options(device = png)
mat <- read.table("bla2",header=TRUE,col.names=c("x", "y", "z"))
library(latticeExtra)

col.l <- colorRampPalette(c('blue', 'cyan', 'green', 'yellow', 'orange', 'red'))
col.divs<-15
levelplot(z ~ x * y, mat,
                cex.axis=4, cex.lab=4, contour=TRUE, cuts=30, col.regions=col.l,
                at=seq(from=0,to=9,length=col.divs),
                scales=list(x=list(at=seq(6,9,1), cex=2), y=list(at=seq(-1,1,0.2), cex=2),z=list(cex=2)),
                xlab=list(label=expression(xi[1] ~ "Distance from membrane center (Å)"),cex=2),
                ylab=list(label=expression(xi[2] ~ "Distance from Z-axis (Å)"),cex=2),
                main="FES 2D ISO")
dev.copy(png,'FES_ISO_2D.png')

mat

dev.off()


Desired output style
Desired output style




bla2.bla2


script.R