% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mr_scatter_class.R
\name{showplot}
\alias{showplot}
\title{Display MR Plots on Screen}
\usage{
showplot(object, outcome = NULL, exposure = NULL)
}
\arguments{
\item{object}{An \code{MRScatterPlots}, \code{GWASForestPlots}, or
\code{MRForestPlots} object.}

\item{outcome}{Optional character string; if supplied, only plots whose
outcome matches this value are displayed.}

\item{exposure}{Optional character string; if supplied, only plots whose
exposure matches this value are displayed.}
}
\value{
Invisibly returns \code{object}.
}
\description{
Renders plots stored in an \code{MRScatterPlots}, \code{GWASForestPlots},
or \code{MRForestPlots} object to the active graphics device. You can
display all plots or filter to a specific outcome, exposure, or
outcome-exposure pair.
}
\details{
Filtering logic:
\itemize{
  \item \strong{Both \code{outcome} and \code{exposure} supplied} — displays
    the single plot for that exact pair.
  \item \strong{\code{outcome} only} — displays all exposures for that
    outcome.
  \item \strong{\code{exposure} only} — displays all outcomes for that
    exposure.
  \item \strong{Neither supplied} — displays every plot in the object.
}
}
\examples{
\donttest{
data("fi_49item")
input1   <- harmonize_mr_data(df = fi_49item)$input_df
outcome1 <- run_mr_analysis(MR_input_data = input1)

# Scatter plots
scatter <- plot_mr_scatter(MR_input_data = input1, summary_df = outcome1)
showplot(scatter)
showplot(scatter, outcome = "fi_49item")
showplot(scatter, outcome = "fi_49item", exposure = "Zn")

# GWAS forest plots
gwas_plots <- GWAS_forest(MR_input_data = input1, report_form = "Beta")
showplot(gwas_plots)
showplot(gwas_plots, exposure = "Zn")

# MR forest plots
mr_plots <- MR_forest(summary_df = outcome1, effect = "Beta")
showplot(mr_plots)
showplot(mr_plots, outcome = "fi_49item", exposure = "Zn")
}
}
