Plot getting cut when using plot3D





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I'm trying to plot a simple histogram using hist3D from plot3D package using the following code:



library(tidyverse)
library(plot3D)
data(iris)
iris=as.tibble(iris)

x=c(1,2)
y=x
z=matrix(rnorm(4,sd=0.5,mean=1),ncol=2,nrow=2)

pmat<-hist3D(x,y,
z,
border="black",
axes=TRUE,
expand=0.4,
theta=40,phi=30,
zmin=-1,
margin=c(10,10),
mar=c(10, 1, 0, 2),
ticktype = "detailed",col="green",box=TRUE)


But the histogram get cut at the bottom:



enter image description here
So, I'm looking for a way to extends the width or the height of the canvas for hist3D... Thank you in advance.










share|improve this question





























    0















    I'm trying to plot a simple histogram using hist3D from plot3D package using the following code:



    library(tidyverse)
    library(plot3D)
    data(iris)
    iris=as.tibble(iris)

    x=c(1,2)
    y=x
    z=matrix(rnorm(4,sd=0.5,mean=1),ncol=2,nrow=2)

    pmat<-hist3D(x,y,
    z,
    border="black",
    axes=TRUE,
    expand=0.4,
    theta=40,phi=30,
    zmin=-1,
    margin=c(10,10),
    mar=c(10, 1, 0, 2),
    ticktype = "detailed",col="green",box=TRUE)


    But the histogram get cut at the bottom:



    enter image description here
    So, I'm looking for a way to extends the width or the height of the canvas for hist3D... Thank you in advance.










    share|improve this question

























      0












      0








      0








      I'm trying to plot a simple histogram using hist3D from plot3D package using the following code:



      library(tidyverse)
      library(plot3D)
      data(iris)
      iris=as.tibble(iris)

      x=c(1,2)
      y=x
      z=matrix(rnorm(4,sd=0.5,mean=1),ncol=2,nrow=2)

      pmat<-hist3D(x,y,
      z,
      border="black",
      axes=TRUE,
      expand=0.4,
      theta=40,phi=30,
      zmin=-1,
      margin=c(10,10),
      mar=c(10, 1, 0, 2),
      ticktype = "detailed",col="green",box=TRUE)


      But the histogram get cut at the bottom:



      enter image description here
      So, I'm looking for a way to extends the width or the height of the canvas for hist3D... Thank you in advance.










      share|improve this question














      I'm trying to plot a simple histogram using hist3D from plot3D package using the following code:



      library(tidyverse)
      library(plot3D)
      data(iris)
      iris=as.tibble(iris)

      x=c(1,2)
      y=x
      z=matrix(rnorm(4,sd=0.5,mean=1),ncol=2,nrow=2)

      pmat<-hist3D(x,y,
      z,
      border="black",
      axes=TRUE,
      expand=0.4,
      theta=40,phi=30,
      zmin=-1,
      margin=c(10,10),
      mar=c(10, 1, 0, 2),
      ticktype = "detailed",col="green",box=TRUE)


      But the histogram get cut at the bottom:



      enter image description here
      So, I'm looking for a way to extends the width or the height of the canvas for hist3D... Thank you in advance.







      r plot rstudio






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 16 '18 at 17:45









      manzerbredesmanzerbredes

      10918




      10918
























          1 Answer
          1






          active

          oldest

          votes


















          1














          You can use par(xpd = NA) before the hist3D call to allow your full device region to be used for plotting. This might not be enough space; if not, set the margins to be really large as well. For example,



          par(xpd = NA, mar = c(10,10,10,10))
          hist3D(x,y,
          z,
          border="black",
          axes=TRUE,
          expand=0.4,
          theta=40,phi=30,
          zmin=-1,
          margin=c(20,20),
          mar=c(10, 1, 0, 2),
          ticktype = "detailed",col="green",box=TRUE)


          produces this for me:



          screenshot



          It's pretty ugly, but that's to be expected for a 3D histogram :-).






          share|improve this answer
























          • Yes ! Exactly what I was looking for thank you. Actually in a first place, I was drawing lines and they had unexpected sizes. Then, I found that they was cutted by the edge of canvas.

            – manzerbredes
            Nov 16 '18 at 18:16












          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%2f53342933%2fplot-getting-cut-when-using-plot3d%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









          1














          You can use par(xpd = NA) before the hist3D call to allow your full device region to be used for plotting. This might not be enough space; if not, set the margins to be really large as well. For example,



          par(xpd = NA, mar = c(10,10,10,10))
          hist3D(x,y,
          z,
          border="black",
          axes=TRUE,
          expand=0.4,
          theta=40,phi=30,
          zmin=-1,
          margin=c(20,20),
          mar=c(10, 1, 0, 2),
          ticktype = "detailed",col="green",box=TRUE)


          produces this for me:



          screenshot



          It's pretty ugly, but that's to be expected for a 3D histogram :-).






          share|improve this answer
























          • Yes ! Exactly what I was looking for thank you. Actually in a first place, I was drawing lines and they had unexpected sizes. Then, I found that they was cutted by the edge of canvas.

            – manzerbredes
            Nov 16 '18 at 18:16
















          1














          You can use par(xpd = NA) before the hist3D call to allow your full device region to be used for plotting. This might not be enough space; if not, set the margins to be really large as well. For example,



          par(xpd = NA, mar = c(10,10,10,10))
          hist3D(x,y,
          z,
          border="black",
          axes=TRUE,
          expand=0.4,
          theta=40,phi=30,
          zmin=-1,
          margin=c(20,20),
          mar=c(10, 1, 0, 2),
          ticktype = "detailed",col="green",box=TRUE)


          produces this for me:



          screenshot



          It's pretty ugly, but that's to be expected for a 3D histogram :-).






          share|improve this answer
























          • Yes ! Exactly what I was looking for thank you. Actually in a first place, I was drawing lines and they had unexpected sizes. Then, I found that they was cutted by the edge of canvas.

            – manzerbredes
            Nov 16 '18 at 18:16














          1












          1








          1







          You can use par(xpd = NA) before the hist3D call to allow your full device region to be used for plotting. This might not be enough space; if not, set the margins to be really large as well. For example,



          par(xpd = NA, mar = c(10,10,10,10))
          hist3D(x,y,
          z,
          border="black",
          axes=TRUE,
          expand=0.4,
          theta=40,phi=30,
          zmin=-1,
          margin=c(20,20),
          mar=c(10, 1, 0, 2),
          ticktype = "detailed",col="green",box=TRUE)


          produces this for me:



          screenshot



          It's pretty ugly, but that's to be expected for a 3D histogram :-).






          share|improve this answer













          You can use par(xpd = NA) before the hist3D call to allow your full device region to be used for plotting. This might not be enough space; if not, set the margins to be really large as well. For example,



          par(xpd = NA, mar = c(10,10,10,10))
          hist3D(x,y,
          z,
          border="black",
          axes=TRUE,
          expand=0.4,
          theta=40,phi=30,
          zmin=-1,
          margin=c(20,20),
          mar=c(10, 1, 0, 2),
          ticktype = "detailed",col="green",box=TRUE)


          produces this for me:



          screenshot



          It's pretty ugly, but that's to be expected for a 3D histogram :-).







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 16 '18 at 18:02









          user2554330user2554330

          10.2k11341




          10.2k11341













          • Yes ! Exactly what I was looking for thank you. Actually in a first place, I was drawing lines and they had unexpected sizes. Then, I found that they was cutted by the edge of canvas.

            – manzerbredes
            Nov 16 '18 at 18:16



















          • Yes ! Exactly what I was looking for thank you. Actually in a first place, I was drawing lines and they had unexpected sizes. Then, I found that they was cutted by the edge of canvas.

            – manzerbredes
            Nov 16 '18 at 18:16

















          Yes ! Exactly what I was looking for thank you. Actually in a first place, I was drawing lines and they had unexpected sizes. Then, I found that they was cutted by the edge of canvas.

          – manzerbredes
          Nov 16 '18 at 18:16





          Yes ! Exactly what I was looking for thank you. Actually in a first place, I was drawing lines and they had unexpected sizes. Then, I found that they was cutted by the edge of canvas.

          – manzerbredes
          Nov 16 '18 at 18:16




















          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%2f53342933%2fplot-getting-cut-when-using-plot3d%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

          The Sandy Post

          Danny Elfman

          Pages that link to "Head v. Amoskeag Manufacturing Co."