Skip to content

Unadulterated plot

4 messages · Patrizio Frederic, James Nicolson, Duncan Murdoch

#
good point! Provide your own set of x,y,z co-ords, mine are pretty big
but you can use any.

library(akima)

fr3d = data.frame(x,y,z)
xtrp <- interp(fr3d$x,fr3d$y,fr3d$z,linear=FALSE,extrap=TRUE,duplicate=
"strip") 

op <- par(ann=FALSE, mai=c(0,0,0,0))
filled.contour(xtrp$x, xtrp$y, xtrp$z, asp = 0.88402366864, col =
rev(rainbow(28,start=0, end=8/12)), n = 40)
par(op)

I tried all these settings too (none of them made a difference)...
usr=c(0,845,0,747), mfcol=c(1,1), mfrow=c(1,1),
oma=c(0,0,0,0),omi=c(0,0,0,0), plt=c(1,1,1,1)

Regards
James
Peter Alspach wrote:
#
James,
as I previously told you in my broken  English, probably the function
you're looking for is not filled.contour but image and contour
The following code makes exactly what you ask for

data(akima)
akima
akima.smooth <-
 with(akima, interp(x, y, z, xo=seq(0,25, length=500),
                    yo=seq(0,20, length=500)))
op <- par(ann=FALSE, mai=c(0,0,0,0))
image  (akima.smooth, main = "interp(<akima data>, *) on finer grid")
contour(akima.smooth, add = TRUE,drawlabels=F)

cheers

Patrizio

2009/2/19 James Nicolson <jlnicolson at gmail.com>:
#
To All,

I'm using R 2.8.1. I have attached two images, one shows what I get and
the other shows what I want. All I want is the plotting region. Surely
there must be a way of plotting individual regions/components in R?

Patrizio, I prefer filled.contour() for my data. I still have the same
problem (a legend to the right) if I use image() then contour()!

Regards,
James

ps. No need for apologies Simon :D I'm grateful for any assistance
fruitless or not.
Patrizio Frederic wrote:
#
James Nicolson wrote:
I don't see why you'd get a legend in that case.  But it's hard to get 
the contour lines to match the colour changes
when using image with contour, so I can see why you might prefer 
filled.contour.

I think you're going to have to edit filled.contour to do what you 
want.  It's not too hard:  just comment out the code that sets up the 
layout, then everything until just before the second plot.new().  Insert 
par(mar=c(0,0,0,0)), and you'll get a filled contour plot with no margins.

Duncan Murdoch