Creates an X-ray plot showing where terms appear across documents. Each row represents a term, and marks indicate occurrences.
Usage
plot_lexical_dispersion(
dispersion_data,
scale = "relative",
title = "Lexical Dispersion",
colors = NULL,
height = 400,
width = NULL,
marker_size = 8
)Arguments
- dispersion_data
Data frame from calculate_lexical_dispersion()
- scale
Character, "relative" or "absolute" (must match calculation)
- title
Plot title (default: "Lexical Dispersion")
- colors
Named vector of colors for each term, or NULL for auto
- height
Plot height in pixels (default: 400)
- width
Plot width in pixels (default: NULL for auto)
- marker_size
Size of position markers (default: 8)
See also
Other visualization:
apply_standard_plotly_layout(),
create_empty_plot_message(),
create_message_table(),
create_standard_ggplot_theme(),
get_dt_options(),
get_plotly_hover_config(),
get_sentiment_color(),
get_sentiment_colors(),
plot_cluster_terms(),
plot_cross_category_heatmap(),
plot_entity_frequencies(),
plot_log_odds_ratio(),
plot_mwe_frequency(),
plot_ngram_frequency(),
plot_pos_frequencies(),
plot_semantic_viz(),
plot_similarity_heatmap(),
plot_term_trends_continuous(),
plot_weighted_log_odds(),
plot_word_frequency()
Examples
if (FALSE) { # \dontrun{
dispersion <- calculate_lexical_dispersion(tokens, c("education", "technology"))
plot_lexical_dispersion(dispersion)
} # }
