Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

18 Unique Research Visualization Techniques for Scientific Papers

Tech 1

Colored Label Bar Plots

Bar charts are a staple for clear, straightforward data presentation in academic manuscripts, but crafting polished variants requires intentional data manipulation and theming. The dual-axis tiered label style below leverages dummy entries (zeros and empty fields) to enforce grouping, paired with ggplot2’s internal data retrieval to sync y-axis label colors to bar hues.

# Load and preprocess KEGG annotation data
kegg_df <- read.delim("ko_enrichment_results.txt", header = TRUE)
# Reverse factor levels for top-to-bottom plotting matching input order
kegg_df$Category_L1 <- factor(kegg_df$Category_L1,
                               levels = rev(unique(kegg_df$Category_L1)),
                               ordered = TRUE)
kegg_df$Category_L2 <- factor(kegg_df$Category_L2,
                               levels = rev(unique(kegg_df$Category_L2)),
                               ordered = TRUE)
# Initialize ggplot
library(ggplot2)
base_bar <- ggplot(kegg_df, aes(x = Gene_Count,
                                 y = Category_L2,
                                 fill = Category_L1, na.rm = FALSE)) +
  geom_col(na.rm = FALSE) +
  geom_text(aes(label = Annotation_Label), size = 2.8,
            hjust = 0, nudge_x = 0.15) +
  scale_x_continuous(limits = c(0, 28),
                     expand = expansion(mult = c(0, 0.12))) +
  labs(x = "Count of Annotated Genes", y = NULL,
       title = "KEGG Pathway Enrichment Overview")
# Extract and adjust color palette
plot_data <- ggplot_build(base_bar)
color_set <- rev(plot_data$data[[1]]$fill)
# Set L1 category separator labels to dark gray
zero_positions <- which(rev(kegg_df$Gene_Count) == 0)
color_set[zero_positions] <- "gray20"
# Define custom publication-ready theme
custom_theme <- theme(
  plot.title = element_text(size = rel(1.1), hjust = 0.5, face = "bold"),
  axis.title = element_text(size = rel(1.05)),
  axis.text.y = element_text(size = rel(0.9),
                              color = color_set, face = "bold"),
  legend.position = "none",
  plot.margin = unit(c(0.2, 0.2, 0.2, 0.2), "inches")
)
# Render final plot
base_bar + custom_theme

Diverging PCA Scatter Plots

Principal Component Analysis (PCA) scatter plots can be enhanced with centroid connecting segments and truncated axes to emphasize clustering. This implementation uses ggh4x for axis manipulation.

# Import PCA coordinates and metadata
pca_coords <- read.csv("pca_coordinates_metadata.csv")
library(ggplot2)
library(ggh4x)
# Create plot with segments and filled points
pca_plot <- ggplot(pca_coords, aes(x = PC1, y = PC2, fill = Sample_Group)) +
  stat_centroid(aes(xend = PC1, yend = PC2, color = Sample_Group),
                geom = "segment", crop_other = FALSE,
                alpha = 0.35, linewidth = 1.1, show.legend = FALSE) +
  geom_point(size = 3.2, alpha = 0.72,
             color = "white", shape = 21, show.legend = TRUE) +
  scale_color_manual(values = c("#FF7F7F", "#9966CC")) +
  scale_fill_manual(values = c("#FF7F7F", "#9966CC")) +
  scale_x_continuous(expand = expansion(add = c(0.8, 0.8)),
                     limits = c(-11, 6)) +
  scale_y_continuous(expand = expansion(add = c(0.6, 0.6)),
                     limits = c(-8, 6)) +
  guides(x = "axis_truncated", y = "axis_truncated")

Polar Bar (Nightingale Rose) Plots

Polar bar charts excel at visualizing periodic data such as seasonal trends. This version uses stacked filtering and custom color ramps.

# Load monthly measurement data
monthly_data <- read.csv("monthly_environmental_data.csv")
# Convert numeric months to abbreviations
monthly_data$Month <- month.abb[monthly_data$Month]
library(dplyr)
library(ggplot2)
# Prepare tibble with fixed factor order
monthly_tbl <- as_tibble(monthly_data)
monthly_tbl$Month <- factor(monthly_tbl$Month,
                             levels = unique(monthly_tbl$Month), ordered = TRUE)
monthly_tbl$Quarter <- as.character(monthly_tbl$Quarter)
# Filter daytime measurements
daytime_tbl <- filter(monthly_tbl, Measurement_Type == "Daytime")
# Create custom color ramps
initial_rainbow <- rainbow(12)
cool_ramp <- colorRampPalette(initial_rainbow[1:4])(12)
warm_ramp <- colorRampPalette(c("#99CC00", "#FFFF66", "#FF9933", "#FF6347"))(12)
# Plot polar bar chart
rose_plot <- ggplot(daytime_tbl, aes(x = Month, y = Value, fill = Month)) +
  geom_col(width = 1.15, color = NA, alpha = 1) +
  geom_text(aes(label = Value), nudge_y = -2.2,
            color = "white", size = 3.1) +
  ylim(-1.5, 18) +
  scale_fill_manual(values = cool_ramp) +
  coord_polar(start = 0) +
  theme_void()

Enrichment Circos Plots

OmicShare’s advanced GO and KEGG enrichment tools generate ready-to-use Circos plots alongside traditional bar charts and networks, requiring only a target gene list for common model and non-model organisms.

Correlation Network Heatmaps

Network-integrated heatmaps visualize both intra-omic correlations (heatmap core) and inter-omic associations (network segments), ideal for multi-omics studies linking environmental factors, metabolites, traits, and microbial/genomic features.

Flow-optimized Sankey Diagrams

Sankey diagrams are perfect for tracking data transitions between categorical groups, such as taxonomic assignments across hierarchical levels or experimental group correlations.

Multi-Comparison Differential Scatter Plots

Unlike single-comparison volcano plots, multi-group differential scatter plots display log2(fold change) values across all pairwise comparisons on a single axis, enabling rapid cross-group comparison of differentially expressed genes/proteins.

Custom Labeled Heatmaps

Heatmaps use color gradients to reveal expression patterns across samples. Advanced tools support group annotation bars and intelligent, non-overlapping text labels for even large gene sets.

Interactive Venn Diagrams

Interactive Venn diagrams support 2–6 group comparisons, allowing extraction of subset elements and dynamic filtering using either pre-processed element lists or raw abundance data.

Circular Network Graphs

Circular network layouts cleanly display node interactions, especially for modular datasets. This implementation uses ggraph and tidygraph for reproducible, publication-ready results.

# Load network analysis libraries
library(ggraph)
library(tidygraph)
library(igraph)
library(ggplot2)
# Import edge and node metadata
edge_list <- read.csv("network_edge_list.csv")
node_metadata <- read.csv("network_node_attributes.csv")
# Construct tidygraph object
network_obj <- tbl_graph(nodes = node_metadata, edges = edge_list, directed = FALSE)
# Calculate node degree
V(network_obj)$degree <- degree(network_obj)
# Define custom color palette
class_colors <- c("#FF8C00", "#00BFFF", "#FF69B4")
# Plot circular network with curved edges
circ_network <- ggraph(network_obj, layout = "linear", circular = TRUE) +
  geom_edge_arc(color = "gray40", linewidth = 1.05, alpha = 0.32) +
  geom_node_point(aes(color = Node_Class), size = 6.2, alpha = 0.82) +
  scale_color_manual(values = class_colors) +
  geom_node_text(aes(x = 1.07 * x, y = 1.07 * y,
                     angle = -((-node_angle(x, y) + 90) %% 180) + 90,
                     label = Node_Name),
                 hjust = "outward", repel = FALSE, size = 2.6) +
  coord_fixed(clip = "off") +
  theme_graph()

Significance-Marked Correlation Heatmaps

Correlation heatmaps can be annotated with asterisks to indicate statistically significant pairwise associations, improving interpretability.

Sign-Marked Correlation Heatmaps

Alternative to significance markers, correlation heatmaps can use plus/minus symbols to highlight positive/negative correlations, or filter too display only strong associations.

Circular Clustered Heatmaps

Circular heatmaps paired with circular dendrograms provide a compact, aesthetically pleasing way to display clustered gene expression data across multiple groups.

Network Venn Diagrams

Network-style Venn diagrams visualize shared and unique elements between groups with node size proportional to element count, offering a fresh alternative for small-to-medium group sets.

Enhanced Volcano Plots

Volcano plots show differential expression significance vs. magnitude. Enhanced versions adjust point size for target genes and add non-overlapping labels for key features using ggplot2.

Customizable t-SNE/UMAP Scatter Plots

Seurat’s default t-SNE/UMAP plots offer limited customization; extracting cell embeddings and metadata allows full control over point styling, colors, and annotations using ggplot2.

Dual-Axis Validation Plots

Dual-axis charts compare RNA-seq (right axis, line plot) and qPCR (left axis, bar plot) validation data directly, aligning results for the same genes/samples.

Vertical Symmetric Combination Plots

Vertical symmetric plots display two correlated, dimensionally distinct datasets—such as evaporation (top panel) and precipitation (bottom panel)—in a single, space-efficient layout.

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.