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;
}
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:

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
add a comment |
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:

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
add a comment |
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:

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
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:

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
r plot rstudio
asked Nov 16 '18 at 17:45
manzerbredesmanzerbredes
10918
10918
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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:

It's pretty ugly, but that's to be expected for a 3D histogram :-).
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:

It's pretty ugly, but that's to be expected for a 3D histogram :-).
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
add a comment |
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:

It's pretty ugly, but that's to be expected for a 3D histogram :-).
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
add a comment |
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:

It's pretty ugly, but that's to be expected for a 3D histogram :-).
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:

It's pretty ugly, but that's to be expected for a 3D histogram :-).
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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