3D surface with a 2D projection using R











up vote
3
down vote

favorite
2












I need to plot a 3D surface with 2D projections like the one below using R.



3D plot



It features a 3D density plot, something easy to do in R using plotly, for example. The 2D surfaces on the other hand I've had no luck so far in my search for how to draw them. The best I've found is this example, but it uses Python instead of R.



I have also found that package RSM (Response Surface Methods) may have the tools to draw this graph, but I've studied the package documentation and looked for online examples and so far I have not been able to find anything close to this graph in quality.



Base R function persp looks like it could offer some answer too, but I've had no success using it to draw the 2D projections so far. Package plot3D may also offer clues to the solution.



Thanks in advance for any help on this.










share|improve this question




















  • 3




    This question is interesting, but you should make it reproducible by adding some data and code.
    – alistaire
    Nov 7 at 1:43






  • 2




    Perhaps overkill, but some aspects of this display should be possible using github.com/tylermorganwall/rayshader
    – Jon Spring
    Nov 7 at 4:19










  • @alistaire I do not have any data nor code since I do not know what package would be able to draw such a graph. The specific surface and 2D projections are also not important.
    – thomasvconti
    Nov 7 at 12:27










  • Making a reprex is not an option for an SO question; it's a requirement without which this question is likely to get closed. Open-ended questions get a more favorable response over at RStudio Community.
    – alistaire
    Nov 7 at 13:44










  • The rgl package might of a possible solution for the 3D plot, but you may need to manually create the 2D projections. Good luck.
    – Dave2e
    Nov 7 at 20:01















up vote
3
down vote

favorite
2












I need to plot a 3D surface with 2D projections like the one below using R.



3D plot



It features a 3D density plot, something easy to do in R using plotly, for example. The 2D surfaces on the other hand I've had no luck so far in my search for how to draw them. The best I've found is this example, but it uses Python instead of R.



I have also found that package RSM (Response Surface Methods) may have the tools to draw this graph, but I've studied the package documentation and looked for online examples and so far I have not been able to find anything close to this graph in quality.



Base R function persp looks like it could offer some answer too, but I've had no success using it to draw the 2D projections so far. Package plot3D may also offer clues to the solution.



Thanks in advance for any help on this.










share|improve this question




















  • 3




    This question is interesting, but you should make it reproducible by adding some data and code.
    – alistaire
    Nov 7 at 1:43






  • 2




    Perhaps overkill, but some aspects of this display should be possible using github.com/tylermorganwall/rayshader
    – Jon Spring
    Nov 7 at 4:19










  • @alistaire I do not have any data nor code since I do not know what package would be able to draw such a graph. The specific surface and 2D projections are also not important.
    – thomasvconti
    Nov 7 at 12:27










  • Making a reprex is not an option for an SO question; it's a requirement without which this question is likely to get closed. Open-ended questions get a more favorable response over at RStudio Community.
    – alistaire
    Nov 7 at 13:44










  • The rgl package might of a possible solution for the 3D plot, but you may need to manually create the 2D projections. Good luck.
    – Dave2e
    Nov 7 at 20:01













up vote
3
down vote

favorite
2









up vote
3
down vote

favorite
2






2





I need to plot a 3D surface with 2D projections like the one below using R.



3D plot



It features a 3D density plot, something easy to do in R using plotly, for example. The 2D surfaces on the other hand I've had no luck so far in my search for how to draw them. The best I've found is this example, but it uses Python instead of R.



I have also found that package RSM (Response Surface Methods) may have the tools to draw this graph, but I've studied the package documentation and looked for online examples and so far I have not been able to find anything close to this graph in quality.



Base R function persp looks like it could offer some answer too, but I've had no success using it to draw the 2D projections so far. Package plot3D may also offer clues to the solution.



Thanks in advance for any help on this.










share|improve this question















I need to plot a 3D surface with 2D projections like the one below using R.



3D plot



It features a 3D density plot, something easy to do in R using plotly, for example. The 2D surfaces on the other hand I've had no luck so far in my search for how to draw them. The best I've found is this example, but it uses Python instead of R.



I have also found that package RSM (Response Surface Methods) may have the tools to draw this graph, but I've studied the package documentation and looked for online examples and so far I have not been able to find anything close to this graph in quality.



Base R function persp looks like it could offer some answer too, but I've had no success using it to draw the 2D projections so far. Package plot3D may also offer clues to the solution.



Thanks in advance for any help on this.







r ggplot2 r-plotly density-plot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 7 at 12:31

























asked Nov 7 at 1:17









thomasvconti

265




265








  • 3




    This question is interesting, but you should make it reproducible by adding some data and code.
    – alistaire
    Nov 7 at 1:43






  • 2




    Perhaps overkill, but some aspects of this display should be possible using github.com/tylermorganwall/rayshader
    – Jon Spring
    Nov 7 at 4:19










  • @alistaire I do not have any data nor code since I do not know what package would be able to draw such a graph. The specific surface and 2D projections are also not important.
    – thomasvconti
    Nov 7 at 12:27










  • Making a reprex is not an option for an SO question; it's a requirement without which this question is likely to get closed. Open-ended questions get a more favorable response over at RStudio Community.
    – alistaire
    Nov 7 at 13:44










  • The rgl package might of a possible solution for the 3D plot, but you may need to manually create the 2D projections. Good luck.
    – Dave2e
    Nov 7 at 20:01














  • 3




    This question is interesting, but you should make it reproducible by adding some data and code.
    – alistaire
    Nov 7 at 1:43






  • 2




    Perhaps overkill, but some aspects of this display should be possible using github.com/tylermorganwall/rayshader
    – Jon Spring
    Nov 7 at 4:19










  • @alistaire I do not have any data nor code since I do not know what package would be able to draw such a graph. The specific surface and 2D projections are also not important.
    – thomasvconti
    Nov 7 at 12:27










  • Making a reprex is not an option for an SO question; it's a requirement without which this question is likely to get closed. Open-ended questions get a more favorable response over at RStudio Community.
    – alistaire
    Nov 7 at 13:44










  • The rgl package might of a possible solution for the 3D plot, but you may need to manually create the 2D projections. Good luck.
    – Dave2e
    Nov 7 at 20:01








3




3




This question is interesting, but you should make it reproducible by adding some data and code.
– alistaire
Nov 7 at 1:43




This question is interesting, but you should make it reproducible by adding some data and code.
– alistaire
Nov 7 at 1:43




2




2




Perhaps overkill, but some aspects of this display should be possible using github.com/tylermorganwall/rayshader
– Jon Spring
Nov 7 at 4:19




Perhaps overkill, but some aspects of this display should be possible using github.com/tylermorganwall/rayshader
– Jon Spring
Nov 7 at 4:19












@alistaire I do not have any data nor code since I do not know what package would be able to draw such a graph. The specific surface and 2D projections are also not important.
– thomasvconti
Nov 7 at 12:27




@alistaire I do not have any data nor code since I do not know what package would be able to draw such a graph. The specific surface and 2D projections are also not important.
– thomasvconti
Nov 7 at 12:27












Making a reprex is not an option for an SO question; it's a requirement without which this question is likely to get closed. Open-ended questions get a more favorable response over at RStudio Community.
– alistaire
Nov 7 at 13:44




Making a reprex is not an option for an SO question; it's a requirement without which this question is likely to get closed. Open-ended questions get a more favorable response over at RStudio Community.
– alistaire
Nov 7 at 13:44












The rgl package might of a possible solution for the 3D plot, but you may need to manually create the 2D projections. Good luck.
– Dave2e
Nov 7 at 20:01




The rgl package might of a possible solution for the 3D plot, but you may need to manually create the 2D projections. Good luck.
– Dave2e
Nov 7 at 20:01

















active

oldest

votes











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',
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%2f53182432%2f3d-surface-with-a-2d-projection-using-r%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53182432%2f3d-surface-with-a-2d-projection-using-r%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







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini