grantmcdermott / grantmcdermott/tinyplot

how to save plot with `file` para with a `tpar` multiplot

Open
#426 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
427
Forks
25
Avg merge
22h 54m
Merged PRs (30d)
28

Description

# plot layout
tpar(mfrow=c(2,1))

tinyplot(X_new, mean_coverage_rate, 
         xlab="local test point", ylab="coverage rate",
         ylim=c(0, 1.0),
         col="forestgreen",
         draw=abline(h=1-alpha, col="orangered", lwd=1.2),
         main="Local coverage with kernel estimation", sub="estimator")


tinyplot(X_new, beta_hat*X_new, 
         xlab="local test point", ylab="prediction interval",
         col="forestgreen", 
         sub="Coverage in one trial",
         draw={
           segments(x0=X_new, y0=beta_hat*X_new-half_interval[, 1],
                    x1=X_new, y1=beta_hat*X_new+half_interval[, 1],
                    lwd=2, col="forestgreen")
           points(X_new, X_new+rnorm(40, sd=0.1), pch=17, col="gold1")
         },
        file="/Users/desktop/a.jpg"
         )

hi, I'm wondering how to save plot with file para with such a tpar layout above, it seems that tinyplot always save a png for the 2nd plot seperately...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the supplied R script using tpar(mfrow=c(2,1)), two tinyplot calls, and the file argument. Start at tinyplot's file-handling entry point and determine how it interacts with the tpar layout. Done means the two-panel plot is saved as one requested image, or the supported limitation is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.