R plot gam 3D surface to show also actual response values The Next CEO of Stack OverflowRough thin-plate spline fitting (thin-plate spline interpolation) in R with mgcvggplot2 geom_rug rescales unused axes - how do I stop this?ggplot confidence bands from gam predict$fit and predict$se.fitR: adding droplines to fitted plane in 3D scatterplot in rgl“Cut out” 3D Surface Plot in RSwapping axes for a 2-predictor GAM in rPredict values from multivariate linear modelR: Plotting “Actual vs. Fitted”How to plot raw and predict values for 2x2x2 time-series in R?Is it possible to specify lower bound in response variable during smooth with gam?R - GAM regressions (mgcv) response curves change shape/direction when adding new variables

How to invert MapIndexed on a ragged structure? How to construct a tree from rules?

Limits on contract work without pre-agreed price/contract (UK)

What benefits would be gained by using human laborers instead of drones in deep sea mining?

Example of a Mathematician/Physicist whose Other Publications during their PhD eclipsed their PhD Thesis

sp_blitzCache results Memory grants

Should I tutor a student who I know has cheated on their homework?

What exact does MIB represent in SNMP? How is it different from OID?

What is the result of assigning to std::vector<T>::begin()?

What can we do to stop prior company from asking us questions?

Does it take more energy to get to Venus or to Mars?

What flight has the highest ratio of time difference to flight time?

How fast would a person need to move to trick the eye?

Interfacing a button to MCU (and PC) with 50m long cable

Is HostGator storing my password in plaintext?

Written every which way

Return the Closest Prime Number

How to start emacs in "nothing" mode (`fundamental-mode`)

Is it possible to search for a directory/file combination?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

Why do professional authors make "consistency" mistakes? And how to avoid them?

What's the best way to handle refactoring a big file?

Why does standard notation not preserve intervals (visually)

Sending manuscript to multiple publishers

Why does the UK parliament need a vote on the political declaration?



R plot gam 3D surface to show also actual response values



The Next CEO of Stack OverflowRough thin-plate spline fitting (thin-plate spline interpolation) in R with mgcvggplot2 geom_rug rescales unused axes - how do I stop this?ggplot confidence bands from gam predict$fit and predict$se.fitR: adding droplines to fitted plane in 3D scatterplot in rgl“Cut out” 3D Surface Plot in RSwapping axes for a 2-predictor GAM in rPredict values from multivariate linear modelR: Plotting “Actual vs. Fitted”How to plot raw and predict values for 2x2x2 time-series in R?Is it possible to specify lower bound in response variable during smooth with gam?R - GAM regressions (mgcv) response curves change shape/direction when adding new variables










0















I'm quite an R newbie and facing the following challange.
I'll share my code here but applied to a different dataframe since I cannot share the original dataframe.
This is my code:



fit = gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)
plot(fit,rug=F,pers=T,theta=45,main="test")


using my company's data, this generates a nice surface with the predicted values on the Z axes.
I would like to add the actual response values as red dots on Z axis so that I could see where predicted values are under/over estimating the actual reponse.
Would you know what parameter I should add to plot in order to do that?
Many thanks










share|improve this question
























  • That's not easy. The plot function uses persp to draw the surface. persp returns enough information to add points, but the plot function doesn't save it.

    – user2554330
    Mar 7 at 16:39











  • This Q&A contains code to guide you how to do this. You need to call predict.gam, perps, trans3d, points and segments. Working with plot.gam is not a good idea because smooth functions are centered, and it would be hard for you to work out the vertical shift correctly.

    – 李哲源
    Mar 7 at 16:54











  • @李哲源 which Q&A are you referring to?

    – Angelo
    Mar 7 at 17:20











  • @Angelo Oh I did not link it! Sorry, here it is: stackoverflow.com/q/52279218/4891738

    – 李哲源
    Mar 7 at 17:28











  • @李哲源: Nice! You should write this up as an answer: I don't think the question is a duplicate of the linked one.

    – user2554330
    Mar 7 at 17:34















0















I'm quite an R newbie and facing the following challange.
I'll share my code here but applied to a different dataframe since I cannot share the original dataframe.
This is my code:



fit = gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)
plot(fit,rug=F,pers=T,theta=45,main="test")


using my company's data, this generates a nice surface with the predicted values on the Z axes.
I would like to add the actual response values as red dots on Z axis so that I could see where predicted values are under/over estimating the actual reponse.
Would you know what parameter I should add to plot in order to do that?
Many thanks










share|improve this question
























  • That's not easy. The plot function uses persp to draw the surface. persp returns enough information to add points, but the plot function doesn't save it.

    – user2554330
    Mar 7 at 16:39











  • This Q&A contains code to guide you how to do this. You need to call predict.gam, perps, trans3d, points and segments. Working with plot.gam is not a good idea because smooth functions are centered, and it would be hard for you to work out the vertical shift correctly.

    – 李哲源
    Mar 7 at 16:54











  • @李哲源 which Q&A are you referring to?

    – Angelo
    Mar 7 at 17:20











  • @Angelo Oh I did not link it! Sorry, here it is: stackoverflow.com/q/52279218/4891738

    – 李哲源
    Mar 7 at 17:28











  • @李哲源: Nice! You should write this up as an answer: I don't think the question is a duplicate of the linked one.

    – user2554330
    Mar 7 at 17:34













0












0








0








I'm quite an R newbie and facing the following challange.
I'll share my code here but applied to a different dataframe since I cannot share the original dataframe.
This is my code:



fit = gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)
plot(fit,rug=F,pers=T,theta=45,main="test")


using my company's data, this generates a nice surface with the predicted values on the Z axes.
I would like to add the actual response values as red dots on Z axis so that I could see where predicted values are under/over estimating the actual reponse.
Would you know what parameter I should add to plot in order to do that?
Many thanks










share|improve this question
















I'm quite an R newbie and facing the following challange.
I'll share my code here but applied to a different dataframe since I cannot share the original dataframe.
This is my code:



fit = gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)
plot(fit,rug=F,pers=T,theta=45,main="test")


using my company's data, this generates a nice surface with the predicted values on the Z axes.
I would like to add the actual response values as red dots on Z axis so that I could see where predicted values are under/over estimating the actual reponse.
Would you know what parameter I should add to plot in order to do that?
Many thanks







r rgl gam






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 20:01









user2554330

10.1k11241




10.1k11241










asked Mar 7 at 15:28









AngeloAngelo

7510




7510












  • That's not easy. The plot function uses persp to draw the surface. persp returns enough information to add points, but the plot function doesn't save it.

    – user2554330
    Mar 7 at 16:39











  • This Q&A contains code to guide you how to do this. You need to call predict.gam, perps, trans3d, points and segments. Working with plot.gam is not a good idea because smooth functions are centered, and it would be hard for you to work out the vertical shift correctly.

    – 李哲源
    Mar 7 at 16:54











  • @李哲源 which Q&A are you referring to?

    – Angelo
    Mar 7 at 17:20











  • @Angelo Oh I did not link it! Sorry, here it is: stackoverflow.com/q/52279218/4891738

    – 李哲源
    Mar 7 at 17:28











  • @李哲源: Nice! You should write this up as an answer: I don't think the question is a duplicate of the linked one.

    – user2554330
    Mar 7 at 17:34

















  • That's not easy. The plot function uses persp to draw the surface. persp returns enough information to add points, but the plot function doesn't save it.

    – user2554330
    Mar 7 at 16:39











  • This Q&A contains code to guide you how to do this. You need to call predict.gam, perps, trans3d, points and segments. Working with plot.gam is not a good idea because smooth functions are centered, and it would be hard for you to work out the vertical shift correctly.

    – 李哲源
    Mar 7 at 16:54











  • @李哲源 which Q&A are you referring to?

    – Angelo
    Mar 7 at 17:20











  • @Angelo Oh I did not link it! Sorry, here it is: stackoverflow.com/q/52279218/4891738

    – 李哲源
    Mar 7 at 17:28











  • @李哲源: Nice! You should write this up as an answer: I don't think the question is a duplicate of the linked one.

    – user2554330
    Mar 7 at 17:34
















That's not easy. The plot function uses persp to draw the surface. persp returns enough information to add points, but the plot function doesn't save it.

– user2554330
Mar 7 at 16:39





That's not easy. The plot function uses persp to draw the surface. persp returns enough information to add points, but the plot function doesn't save it.

– user2554330
Mar 7 at 16:39













This Q&A contains code to guide you how to do this. You need to call predict.gam, perps, trans3d, points and segments. Working with plot.gam is not a good idea because smooth functions are centered, and it would be hard for you to work out the vertical shift correctly.

– 李哲源
Mar 7 at 16:54





This Q&A contains code to guide you how to do this. You need to call predict.gam, perps, trans3d, points and segments. Working with plot.gam is not a good idea because smooth functions are centered, and it would be hard for you to work out the vertical shift correctly.

– 李哲源
Mar 7 at 16:54













@李哲源 which Q&A are you referring to?

– Angelo
Mar 7 at 17:20





@李哲源 which Q&A are you referring to?

– Angelo
Mar 7 at 17:20













@Angelo Oh I did not link it! Sorry, here it is: stackoverflow.com/q/52279218/4891738

– 李哲源
Mar 7 at 17:28





@Angelo Oh I did not link it! Sorry, here it is: stackoverflow.com/q/52279218/4891738

– 李哲源
Mar 7 at 17:28













@李哲源: Nice! You should write this up as an answer: I don't think the question is a duplicate of the linked one.

– user2554330
Mar 7 at 17:34





@李哲源: Nice! You should write this up as an answer: I don't think the question is a duplicate of the linked one.

– user2554330
Mar 7 at 17:34












1 Answer
1






active

oldest

votes


















2














As @李哲源 pointed out in the comments, you shouldn't use plot here, because it's not flexible enough. Here's a version based on the referenced question Rough thin-plate spline fitting (thin-plate spline interpolation) in R with mgcv.



# First, get the fit
library(mgcv)
fit <- gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)

# Now expand it to a grid so that persp will work
steps <- 30
cyl <- with(mtcars, seq(min(cyl), max(cyl), length = steps) )

hp <- with(mtcars, seq(min(hp), max(hp), length = steps) )
newdat <- expand.grid(cyl = cyl, hp = hp)
carb <- matrix(predict(fit, newdat), steps, steps)

# Now plot it
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")

# To add the points, you need the same 3d transformation
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)

# Add segments to show where the points are in 3d
segments(obs$x, obs$y, pred$x, pred$y)


That produces the following plot:



screen shot



You might not want to make predictions so far from the observed data. You can put NA values into carb to avoid that. This code does that:



exclude <- exclude.too.far(rep(cyl,steps), 
rep(hp, rep(steps, steps)),
mtcars$cyl,
mtcars$hp, 0.15) # 0.15 chosen by trial and error
carb[exclude] <- NA
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)
segments(obs$x, obs$y, pred$x, pred$y)


That produces this plot:



screen shot



Finally, you might want to use the rgl package to get a dynamic graph instead. After the same manipulations as above, use this code to do the plotting:



library(rgl)
persp3d(cyl, hp, carb, col="yellow", polygon_offset = 1)
surface3d(cyl, hp, carb, front = "lines", back = "lines")
with(mtcars, points3d(cyl, hp, carb, col = "red"))
with(mtcars, segments3d(rep(cyl, each = 2),
rep(hp, each = 2),
as.numeric(rbind(fitted(fit),
carb))))


Here's one possible view:



screen shot



You can use the mouse to rotate this one if you want to see it from a different angle. One other advantage is that points that should be hidden by the surface really are hidden; in persp, they'll plot on top even if they should be behind it.






share|improve this answer























  • Absolutely fantastic answer. You made my day. Thank you so much

    – Angelo
    Mar 15 at 20:35











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047365%2fr-plot-gam-3d-surface-to-show-also-actual-response-values%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














As @李哲源 pointed out in the comments, you shouldn't use plot here, because it's not flexible enough. Here's a version based on the referenced question Rough thin-plate spline fitting (thin-plate spline interpolation) in R with mgcv.



# First, get the fit
library(mgcv)
fit <- gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)

# Now expand it to a grid so that persp will work
steps <- 30
cyl <- with(mtcars, seq(min(cyl), max(cyl), length = steps) )

hp <- with(mtcars, seq(min(hp), max(hp), length = steps) )
newdat <- expand.grid(cyl = cyl, hp = hp)
carb <- matrix(predict(fit, newdat), steps, steps)

# Now plot it
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")

# To add the points, you need the same 3d transformation
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)

# Add segments to show where the points are in 3d
segments(obs$x, obs$y, pred$x, pred$y)


That produces the following plot:



screen shot



You might not want to make predictions so far from the observed data. You can put NA values into carb to avoid that. This code does that:



exclude <- exclude.too.far(rep(cyl,steps), 
rep(hp, rep(steps, steps)),
mtcars$cyl,
mtcars$hp, 0.15) # 0.15 chosen by trial and error
carb[exclude] <- NA
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)
segments(obs$x, obs$y, pred$x, pred$y)


That produces this plot:



screen shot



Finally, you might want to use the rgl package to get a dynamic graph instead. After the same manipulations as above, use this code to do the plotting:



library(rgl)
persp3d(cyl, hp, carb, col="yellow", polygon_offset = 1)
surface3d(cyl, hp, carb, front = "lines", back = "lines")
with(mtcars, points3d(cyl, hp, carb, col = "red"))
with(mtcars, segments3d(rep(cyl, each = 2),
rep(hp, each = 2),
as.numeric(rbind(fitted(fit),
carb))))


Here's one possible view:



screen shot



You can use the mouse to rotate this one if you want to see it from a different angle. One other advantage is that points that should be hidden by the surface really are hidden; in persp, they'll plot on top even if they should be behind it.






share|improve this answer























  • Absolutely fantastic answer. You made my day. Thank you so much

    – Angelo
    Mar 15 at 20:35















2














As @李哲源 pointed out in the comments, you shouldn't use plot here, because it's not flexible enough. Here's a version based on the referenced question Rough thin-plate spline fitting (thin-plate spline interpolation) in R with mgcv.



# First, get the fit
library(mgcv)
fit <- gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)

# Now expand it to a grid so that persp will work
steps <- 30
cyl <- with(mtcars, seq(min(cyl), max(cyl), length = steps) )

hp <- with(mtcars, seq(min(hp), max(hp), length = steps) )
newdat <- expand.grid(cyl = cyl, hp = hp)
carb <- matrix(predict(fit, newdat), steps, steps)

# Now plot it
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")

# To add the points, you need the same 3d transformation
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)

# Add segments to show where the points are in 3d
segments(obs$x, obs$y, pred$x, pred$y)


That produces the following plot:



screen shot



You might not want to make predictions so far from the observed data. You can put NA values into carb to avoid that. This code does that:



exclude <- exclude.too.far(rep(cyl,steps), 
rep(hp, rep(steps, steps)),
mtcars$cyl,
mtcars$hp, 0.15) # 0.15 chosen by trial and error
carb[exclude] <- NA
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)
segments(obs$x, obs$y, pred$x, pred$y)


That produces this plot:



screen shot



Finally, you might want to use the rgl package to get a dynamic graph instead. After the same manipulations as above, use this code to do the plotting:



library(rgl)
persp3d(cyl, hp, carb, col="yellow", polygon_offset = 1)
surface3d(cyl, hp, carb, front = "lines", back = "lines")
with(mtcars, points3d(cyl, hp, carb, col = "red"))
with(mtcars, segments3d(rep(cyl, each = 2),
rep(hp, each = 2),
as.numeric(rbind(fitted(fit),
carb))))


Here's one possible view:



screen shot



You can use the mouse to rotate this one if you want to see it from a different angle. One other advantage is that points that should be hidden by the surface really are hidden; in persp, they'll plot on top even if they should be behind it.






share|improve this answer























  • Absolutely fantastic answer. You made my day. Thank you so much

    – Angelo
    Mar 15 at 20:35













2












2








2







As @李哲源 pointed out in the comments, you shouldn't use plot here, because it's not flexible enough. Here's a version based on the referenced question Rough thin-plate spline fitting (thin-plate spline interpolation) in R with mgcv.



# First, get the fit
library(mgcv)
fit <- gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)

# Now expand it to a grid so that persp will work
steps <- 30
cyl <- with(mtcars, seq(min(cyl), max(cyl), length = steps) )

hp <- with(mtcars, seq(min(hp), max(hp), length = steps) )
newdat <- expand.grid(cyl = cyl, hp = hp)
carb <- matrix(predict(fit, newdat), steps, steps)

# Now plot it
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")

# To add the points, you need the same 3d transformation
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)

# Add segments to show where the points are in 3d
segments(obs$x, obs$y, pred$x, pred$y)


That produces the following plot:



screen shot



You might not want to make predictions so far from the observed data. You can put NA values into carb to avoid that. This code does that:



exclude <- exclude.too.far(rep(cyl,steps), 
rep(hp, rep(steps, steps)),
mtcars$cyl,
mtcars$hp, 0.15) # 0.15 chosen by trial and error
carb[exclude] <- NA
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)
segments(obs$x, obs$y, pred$x, pred$y)


That produces this plot:



screen shot



Finally, you might want to use the rgl package to get a dynamic graph instead. After the same manipulations as above, use this code to do the plotting:



library(rgl)
persp3d(cyl, hp, carb, col="yellow", polygon_offset = 1)
surface3d(cyl, hp, carb, front = "lines", back = "lines")
with(mtcars, points3d(cyl, hp, carb, col = "red"))
with(mtcars, segments3d(rep(cyl, each = 2),
rep(hp, each = 2),
as.numeric(rbind(fitted(fit),
carb))))


Here's one possible view:



screen shot



You can use the mouse to rotate this one if you want to see it from a different angle. One other advantage is that points that should be hidden by the surface really are hidden; in persp, they'll plot on top even if they should be behind it.






share|improve this answer













As @李哲源 pointed out in the comments, you shouldn't use plot here, because it's not flexible enough. Here's a version based on the referenced question Rough thin-plate spline fitting (thin-plate spline interpolation) in R with mgcv.



# First, get the fit
library(mgcv)
fit <- gam( carb ~ te(cyl, hp, k=c(3,4)), data = mtcars)

# Now expand it to a grid so that persp will work
steps <- 30
cyl <- with(mtcars, seq(min(cyl), max(cyl), length = steps) )

hp <- with(mtcars, seq(min(hp), max(hp), length = steps) )
newdat <- expand.grid(cyl = cyl, hp = hp)
carb <- matrix(predict(fit, newdat), steps, steps)

# Now plot it
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")

# To add the points, you need the same 3d transformation
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)

# Add segments to show where the points are in 3d
segments(obs$x, obs$y, pred$x, pred$y)


That produces the following plot:



screen shot



You might not want to make predictions so far from the observed data. You can put NA values into carb to avoid that. This code does that:



exclude <- exclude.too.far(rep(cyl,steps), 
rep(hp, rep(steps, steps)),
mtcars$cyl,
mtcars$hp, 0.15) # 0.15 chosen by trial and error
carb[exclude] <- NA
p <- persp(cyl, hp, carb, theta = 45, col = "yellow")
obs <- with(mtcars, trans3d(cyl, hp, carb, p))
pred <- with(mtcars, trans3d(cyl, hp, fitted(fit), p))
points(obs, col = "red", pch = 16)
segments(obs$x, obs$y, pred$x, pred$y)


That produces this plot:



screen shot



Finally, you might want to use the rgl package to get a dynamic graph instead. After the same manipulations as above, use this code to do the plotting:



library(rgl)
persp3d(cyl, hp, carb, col="yellow", polygon_offset = 1)
surface3d(cyl, hp, carb, front = "lines", back = "lines")
with(mtcars, points3d(cyl, hp, carb, col = "red"))
with(mtcars, segments3d(rep(cyl, each = 2),
rep(hp, each = 2),
as.numeric(rbind(fitted(fit),
carb))))


Here's one possible view:



screen shot



You can use the mouse to rotate this one if you want to see it from a different angle. One other advantage is that points that should be hidden by the surface really are hidden; in persp, they'll plot on top even if they should be behind it.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 7 at 18:34









user2554330user2554330

10.1k11241




10.1k11241












  • Absolutely fantastic answer. You made my day. Thank you so much

    – Angelo
    Mar 15 at 20:35

















  • Absolutely fantastic answer. You made my day. Thank you so much

    – Angelo
    Mar 15 at 20:35
















Absolutely fantastic answer. You made my day. Thank you so much

– Angelo
Mar 15 at 20:35





Absolutely fantastic answer. You made my day. Thank you so much

– Angelo
Mar 15 at 20:35



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047365%2fr-plot-gam-3d-surface-to-show-also-actual-response-values%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved