Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ssplot creates two windows #21

Open
jcanner opened this issue Apr 13, 2017 · 2 comments
Open

ssplot creates two windows #21

jcanner opened this issue Apr 13, 2017 · 2 comments

Comments

@jcanner
Copy link

jcanner commented Apr 13, 2017

I am trying to create an ssplot within Rmd and knit to pdf. It seems to be producing a blank window in addition to my plot and in the knitted pdf the blank plot window appears ruining formatting.

head(noh)
PID NoH1 NoH2 NoH3 NoH4 NoH5 NoH6 NoH7 NoH8 NoH9 NoH10 NoH11 NoH12
1 1001 1 0 1 0 1 0 1 0 0 0 0 0
2 1004 1 0 1 1 0 1 1 0 1 0 1 0
3 1005 0 0 0 0 0 0 0 0 1 0 0 0
4 1007 0 1 1 0 0 1 1 1 1 1 1 0
5 1011 0 0 0 0 0 0 0 0 0 0 0 1
6 1056 0 0 0 0 0 0 0 0 0 0 0 0
noh_seq<-seqdef(noh[,2:13],start=1, labels = c("Heavy","Not Heavy"))
attr(noh_seq, "cpal") <- c("violetred2", "darkgoldenrod2")
ssplot(noh_seq,
sortv = "from.start", sort.channel = 1, type = "I",
ylab = c("Patients"),
xtlab = 1:12, xlab = "Week", title = "All Patients")

@jcanner
Copy link
Author

jcanner commented Apr 18, 2017

Still a weird bug, but I found a work around. If you include fig.keep="last" in the code chunk it will only print the last plot and not the blank window

@jcanner jcanner closed this as completed Apr 18, 2017
@satuhelske
Copy link
Collaborator

Good that you found the workaround for knitr, I was just about to suggest that.

We are aware of this issue, it's a problem caused by mixing base and grid graphics. Unfortunately, so far we haven't been able to fix it so that the figures and their margins would work as they are supposed to in all situations, so this remains an open issue.

@satuhelske satuhelske reopened this Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants