plot_motifs | R Documentation |
The 'plot_motifs' function visualizes the results generated by the 'generateCurves' function. It provides comprehensive plots of functional curves with embedded motifs, allowing users to inspect the placement and characteristics of each motif within the curves. This visualization is crucial for validating the correctness of motif embedding and for gaining insights into the distribution and variability of motifs across different curves.
The function supports saving the generated plots to a specified directory, facilitating the creation of reports or the sharing of visual results. By plotting motifs in distinct colors or styles, 'plot_motifs' ensures that overlapping motifs and their respective curves remain distinguishable, enhancing the clarity and interpretability of the visualizations.
This plotting utility is an essential tool within the 'funMoDisco' package, aiding users in the exploratory analysis of simulated functional data and the assessment of motif detection algorithms.
plot_motifs(object, curves, name, path)
object |
An S4 object of class 'motifSimulation' that has been previously constructed using the 'motifSimulationBuilder' function. This object contains all necessary parameters and configurations used during curve and motif generation (mandatory). |
curves |
The output list from the 'generateCurves' function, containing the generated functional curves with embedded motifs. This parameter provides the data to be visualized (mandatory). |
name |
Name of the output file. |
path |
A character string specifying the directory path where the generated plots will be saved. The function will save the plots in this directory, allowing for organized storage and easy access to visual results (mandatory). |
The function does not return any value but generates and saves plots of the functional curves with embedded motifs in the specified directory. Each plot visually represents the motifs within the curves, aiding in the qualitative assessment of motif embedding.
# Example: Plotting motifs in generated curves
# Assume 'builder' has been created and 'curves' have been generated using generateCurves
builder <- funMoDisco::motifSimulationBuilder(N = 20, len = 300, mot_details)
curves <- funMoDisco::generateCurves(builder, noise_type = 'pointwise', noise_str = noise_str)
# Specify the directory to save plots
plots_name <- "plots_1"
# Generate and save the plots
funMoDisco::plot_motifs(builder, curves, plots_name)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.