
Scientific Schematics
- 44 installs
- 557 repo stars
- Updated April 4, 2026
- jimmc414/kosmos
Create publication-quality scientific diagrams, flowcharts, and schematics in Python (graphviz, matplotlib, schemdraw, networkx), exporting SVG/EPS.
About
Generates publication-quality scientific diagrams and flowcharts using Python plotting libraries. A developer uses it for neural-network architecture diagrams, system diagrams, and flowcharts with quality verification.
- Uses graphviz, matplotlib, schemdraw, and networkx
- Outputs SVG/EPS with automated quality checks
Scientific Schematics by the numbers
- 44 all-time installs (skills.sh)
- Ranked #843 of 1,879 Documentation skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/jimmc414/kosmos --skill scientific-schematicsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 44 |
|---|---|
| repo stars | ★ 557 |
| Last updated | April 4, 2026 |
| Repository | jimmc414/kosmos ↗ |
What it does
Create publication-quality scientific diagrams, flowcharts, and schematics in Python (graphviz, matplotlib, schemdraw, networkx), exporting SVG/EPS.
Files
Scientific Schematics and Diagrams
Overview
Scientific schematics and diagrams transform complex concepts into clear visual representations for publication. Generate neural network architectures, flowcharts, circuit diagrams, biological pathways, and system diagrams using best-in-class Python libraries. All diagrams are created as SVG/EPS files, stored in the figures/ subfolder, and referenced in papers/posters - never embedded directly in LaTeX.
Zero-Shot Diagram Generation Workflow
Standard workflow for ALL diagrams:
1. Analyze requirements - Identify diagram type and components 2. Choose optimal library - Select best tool for the specific diagram type 3. Generate vector graphic - Create SVG/EPS with proper spacing and layout 4. Store in figures/ - Save to figures/ subfolder with descriptive name 5. Run quality checks - Verify no overlaps, good contrast, proper resolution 6. Reference in document - Use \includegraphics{figures/diagram_name.pdf} in LaTeX
Key principle: Generate standalone vector graphics first, then integrate into documents.
When to Use This Skill
This skill should be used when:
- Creating neural network architecture diagrams (Transformers, CNNs, RNNs, etc.)
- Illustrating system architectures and data flow diagrams
- Drawing methodology flowcharts for study design (CONSORT, PRISMA)
- Visualizing algorithm workflows and processing pipelines
- Creating circuit diagrams and electrical schematics
- Depicting biological pathways and molecular interactions
- Generating network topologies and hierarchical structures
- Illustrating conceptual frameworks and theoretical models
- Designing block diagrams for technical papers
Best Libraries by Diagram Type
Choose the optimal library for your specific diagram type:
Neural Network Architectures (Transformers, CNNs, etc.)
Best library: graphviz via Python's pygraphviz or pydot
- Excellent automatic layout algorithms
- Clean, professional appearance
- Perfect for layer stacks and connections
- Handles complex cross-connections well
Alternative: Custom matplotlib with careful positioning
- More control over exact placement
- Better for highly customized designs
- Requires more manual positioning
Flowcharts and Process Diagrams
Best library: graphviz with dot or flowchart layout
- Automatic optimal positioning
- Standard flowchart shapes
- Clean arrow routing
- Minimal overlap issues
Alternative: diagrams library (for cloud/system architecture style)
Circuit Diagrams
Best library: schemdraw
- Purpose-built for electrical circuits
- Extensive component library
- Automatic wire routing
- Professional engineering standard output
Biological Pathways
Best library: networkx with custom rendering
- Graph-based pathway representation
- Algorithm-driven layout
- Flexible node/edge styling
Block Diagrams and System Architecture
Best library: graphviz or diagrams
- Clean hierarchical layouts
- Automatic spacing
- Professional appearance
Zero-Shot Examples for Common Diagram Types
Example 1: Transformer Architecture (Neural Network)
Creating a Transformer encoder-decoder diagram like in "Attention Is All You Need":
import graphviz
from pathlib import Path
def create_transformer_diagram(output_dir='figures'):
"""
Create a Transformer architecture diagram.
Zero-shot generation with automatic layout.
"""
Path(output_dir).mkdir(exist_ok=True)
# Create directed graph with TB (top-to-bottom) layout
dot = graphviz.Digraph(
'transformer',
format='pdf',
graph_attr={
'rankdir': 'BT', # Bottom to top (like the original paper)
'splines': 'ortho', # Orthogonal edges
'nodesep': '0.5',
'ranksep': '0.8',
'bgcolor': 'white',
'dpi': '300'
},
node_attr={
'shape': 'box',
'style': 'rounded,filled',
'fillcolor': 'lightgray',
'fontname': 'Arial',
'fontsize': '11',
'width': '2.5',
'height': '0.5'
},
edge_attr={
'color': 'black',
'penwidth': '1.5'
}
)
# ENCODER STACK (left side)
with dot.subgraph(name='cluster_encoder') as enc:
enc.attr(label='Encoder', fontsize='14', fontname='Arial-Bold')
enc.attr(style='rounded', color='blue', penwidth='2')
# Encoder layers (bottom to top)
enc.node('enc_input_emb', 'Input Embedding', fillcolor='#E8F4F8')
enc.node('enc_pos', 'Positional Encoding', fillcolor='#E8F4F8')
enc.node('enc_mha', 'Multi-Head\nAttention', fillcolor='#B3D9E6')
enc.node('enc_an1', 'Add & Norm', fillcolor='#CCE5FF')
enc.node('enc_ff', 'Feed Forward', fillcolor='#B3D9E6')
enc.node('enc_an2', 'Add & Norm', fillcolor='#CCE5FF')
# Encoder flow
enc.edge('enc_input_emb', 'enc_pos')
enc.edge('enc_pos', 'enc_mha')
enc.edge('enc_mha', 'enc_an1')
enc.edge('enc_an1', 'enc_ff')
enc.edge('enc_ff', 'enc_an2')
# DECODER STACK (right side)
with dot.subgraph(name='cluster_decoder') as dec:
dec.attr(label='Decoder', fontsize='14', fontname='Arial-Bold')
dec.attr(style='rounded', color='red', penwidth='2')
# Decoder layers (bottom to top)
dec.node('dec_output_emb', 'Output Embedding', fillcolor='#FFE8E8')
dec.node('dec_pos', 'Positional Encoding', fillcolor='#FFE8E8')
dec.node('dec_mmha', 'Masked Self-\nAttention', fillcolor='#FFB3B3')
dec.node('dec_an1', 'Add & Norm', fillcolor='#FFCCCC')
dec.node('dec_cross', 'Cross-Attention', fillcolor='#FFB3B3')
dec.node('dec_an2', 'Add & Norm', fillcolor='#FFCCCC')
dec.node('dec_ff', 'Feed Forward', fillcolor='#FFB3B3')
dec.node('dec_an3', 'Add & Norm', fillcolor='#FFCCCC')
dec.node('dec_linear', 'Linear & Softmax', fillcolor='#FF9999')
dec.node('dec_output', 'Output\nProbabilities', fillcolor='#FFE8E8')
# Decoder flow
dec.edge('dec_output_emb', 'dec_pos')
dec.edge('dec_pos', 'dec_mmha')
dec.edge('dec_mmha', 'dec_an1')
dec.edge('dec_an1', 'dec_cross')
dec.edge('dec_cross', 'dec_an2')
dec.edge('dec_an2', 'dec_ff')
dec.edge('dec_ff', 'dec_an3')
dec.edge('dec_an3', 'dec_linear')
dec.edge('dec_linear', 'dec_output')
# Cross-attention connection (encoder to decoder)
dot.edge('enc_an2', 'dec_cross',
style='dashed',
color='purple',
label=' context ',
fontsize='9')
# Input and output labels
dot.node('input_seq', 'Input Sequence',
shape='ellipse', fillcolor='lightgreen')
dot.node('target_seq', 'Target Sequence',
shape='ellipse', fillcolor='lightgreen')
dot.edge('input_seq', 'enc_input_emb')
dot.edge('target_seq', 'dec_output_emb')
# Render to files
output_path = f'{output_dir}/transformer_architecture'
dot.render(output_path, cleanup=True)
# Also save as SVG and EPS
dot.format = 'svg'
dot.render(output_path, cleanup=True)
dot.format = 'eps'
dot.render(output_path, cleanup=True)
print(f"✓ Transformer diagram created:")
print(f" - {output_path}.pdf")
print(f" - {output_path}.svg")
print(f" - {output_path}.eps")
return f"{output_path}.pdf"
# Usage
if __name__ == '__main__':
diagram_path = create_transformer_diagram('figures')
# Run quality checks
from quality_checker import run_quality_checks
run_quality_checks(diagram_path.replace('.pdf', '.png'))LaTeX integration:
\begin{figure}[htbp]
\centering
\includegraphics[width=0.9\textwidth]{figures/transformer_architecture.pdf}
\caption{Transformer encoder-decoder architecture showing multi-head attention,
feed-forward layers, and cross-attention mechanism.}
\label{fig:transformer}
\end{figure}Example 2: Simple Flowchart (CONSORT-style)
import graphviz
from pathlib import Path
def create_consort_flowchart(output_dir='figures'):
"""Create a CONSORT participant flow diagram."""
Path(output_dir).mkdir(exist_ok=True)
dot = graphviz.Digraph(
'consort',
format='pdf',
graph_attr={
'rankdir': 'TB',
'splines': 'ortho',
'nodesep': '0.6',
'ranksep': '0.8',
'bgcolor': 'white'
},
node_attr={
'shape': 'box',
'style': 'rounded,filled',
'fillcolor': '#E8F4F8',
'fontname': 'Arial',
'fontsize': '10',
'width': '3',
'height': '0.6'
}
)
# Enrollment
dot.node('assessed', 'Assessed for eligibility\n(n=500)')
dot.node('excluded', 'Excluded (n=150)\n• Age < 18: n=80\n• Declined: n=50\n• Other: n=20')
dot.node('randomized', 'Randomized\n(n=350)')
# Allocation
dot.node('treatment', 'Allocated to treatment\n(n=175)', fillcolor='#C8E6C9')
dot.node('control', 'Allocated to control\n(n=175)', fillcolor='#FFECB3')
# Follow-up
dot.node('treat_lost', 'Lost to follow-up (n=15)', fillcolor='#FFCDD2')
dot.node('ctrl_lost', 'Lost to follow-up (n=10)', fillcolor='#FFCDD2')
# Analysis
dot.node('treat_analyzed', 'Analyzed (n=160)', fillcolor='#C8E6C9')
dot.node('ctrl_analyzed', 'Analyzed (n=165)', fillcolor='#FFECB3')
# Connect nodes
dot.edge('assessed', 'excluded')
dot.edge('assessed', 'randomized')
dot.edge('randomized', 'treatment')
dot.edge('randomized', 'control')
dot.edge('treatment', 'treat_lost')
dot.edge('treatment', 'treat_analyzed')
dot.edge('control', 'ctrl_lost')
dot.edge('control', 'ctrl_analyzed')
# Render
output_path = f'{output_dir}/consort_flowchart'
dot.render(output_path, cleanup=True)
print(f"✓ CONSORT flowchart created: {output_path}.pdf")
return f"{output_path}.pdf"Example 3: CNN Architecture
def create_cnn_architecture(output_dir='figures'):
"""Create a CNN architecture diagram."""
dot = graphviz.Digraph(
'cnn',
format='pdf',
graph_attr={'rankdir': 'LR', 'bgcolor': 'white'}
)
# Define layers
layers = [
('input', 'Input\n32×32×3', '#FFE8E8'),
('conv1', 'Conv 3×3\n32 filters', '#B3D9E6'),
('pool1', 'MaxPool\n2×2', '#FFE5B3'),
('conv2', 'Conv 3×3\n64 filters', '#B3D9E6'),
('pool2', 'MaxPool\n2×2', '#FFE5B3'),
('flatten', 'Flatten', '#D4E8D4'),
('fc1', 'FC 128', '#C8B3E6'),
('fc2', 'FC 10', '#C8B3E6'),
('softmax', 'Softmax', '#FFC8C8')
]
# Create nodes
for node_id, label, color in layers:
dot.node(node_id, label,
shape='box', style='rounded,filled',
fillcolor=color, fontname='Arial')
# Connect layers
for i in range(len(layers) - 1):
dot.edge(layers[i][0], layers[i+1][0])
output_path = f'{output_dir}/cnn_architecture'
dot.render(output_path, cleanup=True)
print(f"✓ CNN diagram created: {output_path}.pdf")
return f"{output_path}.pdf"Core Capabilities
1. Diagram Types Supported
Neural Network Architectures
- Transformer encoder-decoder models
- Convolutional Neural Networks (CNNs)
- Recurrent networks (LSTM, GRU)
- Attention mechanisms and variants
- Custom deep learning architectures
Methodology Flowcharts
- CONSORT participant flow diagrams
- PRISMA systematic review flows
- Data processing pipelines
- Algorithm workflows
- Subject enrollment flows
Circuit Diagrams
- Analog and digital electronic circuits
- Signal processing block diagrams
- Control system diagrams
Biological Diagrams
- Signaling pathways
- Metabolic pathway diagrams
- Gene regulatory networks
- Protein interaction networks
System Architecture Diagrams
- Software architecture and components
- Data flow diagrams
- Network topology diagrams
- Hierarchical organization charts
Required Libraries and Installation
Primary Library: Graphviz (Recommended for 90% of diagrams)
Graphviz is the best tool for most scientific diagrams due to automatic layout, clean rendering, and zero-overlap guarantee.
Installation:
# Install Graphviz binary (required)
# macOS
brew install graphviz
# Ubuntu/Debian
sudo apt-get install graphviz
# Install Python bindings
pip install graphvizWhy Graphviz is optimal:
- ✓ Automatic optimal layout (no manual positioning needed)
- ✓ Zero overlaps guaranteed by layout algorithms
- ✓ Professional appearance out of the box
- ✓ Supports complex hierarchies and cross-connections
- ✓ Native SVG, PDF, EPS output
- ✓ Minimal code for maximum quality
Specialized Libraries
Schemdraw - Circuit diagrams only
pip install schemdrawNetworkX - Complex network analysis + visualization
pip install networkx matplotlibMatplotlib - Custom manual diagrams (when you need exact control)
pip install matplotlibQuick Start Guide for Zero-Shot Diagram Creation
Follow this systematic approach for any diagram type:
Step 1: Identify Diagram Structure
Ask yourself:
- Is it a hierarchy? → Use
rankdir='TB'or'BT'(top-to-bottom or bottom-to-top) - Is it a sequence? → Use
rankdir='LR'(left-to-right) - Does it have parallel branches? → Use subgraphs/clusters
- Does it have cross-connections? → Graphviz handles this automatically
Step 2: Set Up Base Template
Start with this template and customize:
import graphviz
from pathlib import Path
def create_diagram(output_dir='figures', diagram_name='my_diagram'):
"""Universal diagram creation template."""
Path(output_dir).mkdir(exist_ok=True, parents=True)
dot = graphviz.Digraph(
name=diagram_name,
format='pdf',
graph_attr={
'rankdir': 'TB', # TB, BT, LR, or RL
'splines': 'ortho', # ortho (straight) or curved
'nodesep': '0.6', # horizontal spacing
'ranksep': '0.8', # vertical spacing
'bgcolor': 'white',
'dpi': '300'
},
node_attr={
'shape': 'box', # box, ellipse, diamond, etc.
'style': 'rounded,filled',
'fillcolor': 'lightgray',
'fontname': 'Arial',
'fontsize': '11',
'margin': '0.2',
'width': '2', # minimum width
'height': '0.5' # minimum height
},
edge_attr={
'color': 'black',
'penwidth': '1.5',
'arrowsize': '0.8'
}
)
# Add your nodes and edges here
dot.node('node1', 'Label 1')
dot.node('node2', 'Label 2')
dot.edge('node1', 'node2')
# Render to multiple formats
output_path = f'{output_dir}/{diagram_name}'
dot.render(output_path, cleanup=True) # PDF
dot.format = 'svg'
dot.render(output_path, cleanup=True) # SVG
dot.format = 'eps'
dot.render(output_path, cleanup=True) # EPS
print(f"✓ Diagram saved: {output_path}.{{pdf,svg,eps}}")
return f"{output_path}.pdf"Step 3: Add Nodes with Clear Labels
Best practices:
- Use descriptive node IDs:
'encoder_layer1'not'n1' - Use
\nfor multi-line labels - Use fill colors to group related components
- Keep labels concise (3-5 words max per line)
# Good node definitions
dot.node('input_layer', 'Input Layer\n(512 dims)', fillcolor='#E8F4F8')
dot.node('attention', 'Multi-Head\nAttention', fillcolor='#B3D9E6')
dot.node('output', 'Output', fillcolor='#C8E6C9')Step 4: Connect Nodes with Edges
Edge types:
# Standard arrow
dot.edge('node1', 'node2')
# Dashed line (for information flow)
dot.edge('encoder', 'decoder', style='dashed')
# Bidirectional
dot.edge('node1', 'node2', dir='both')
# With label
dot.edge('layer1', 'layer2', label=' ReLU ')
# Different color
dot.edge('input', 'output', color='red', penwidth='2')Step 5: Use Subgraphs for Grouping
For parallel structures (like Encoder/Decoder):
# Encoder cluster
with dot.subgraph(name='cluster_encoder') as enc:
enc.attr(label='Encoder', style='rounded', color='blue')
enc.node('enc1', 'Encoder Layer 1')
enc.node('enc2', 'Encoder Layer 2')
enc.edge('enc1', 'enc2')
# Decoder cluster
with dot.subgraph(name='cluster_decoder') as dec:
dec.attr(label='Decoder', style='rounded', color='red')
dec.node('dec1', 'Decoder Layer 1')
dec.node('dec2', 'Decoder Layer 2')
dec.edge('dec1', 'dec2')
# Cross-connection between clusters
dot.edge('enc2', 'dec1', style='dashed', color='purple')Step 6: Render and Verify
# Always render to PDF (for LaTeX) and SVG (for web/slides)
output_path = f'{output_dir}/{diagram_name}'
# PDF for papers
dot.format = 'pdf'
dot.render(output_path, cleanup=True)
# SVG for posters/slides
dot.format = 'svg'
dot.render(output_path, cleanup=True)
# EPS for some journals
dot.format = 'eps'
dot.render(output_path, cleanup=True)Common Graphviz Attributes Quick Reference
Graph Attributes (overall layout)
graph_attr={
'rankdir': 'TB', # Direction: TB, BT, LR, RL
'splines': 'ortho', # Edge style: ortho, curved, line, polyline
'nodesep': '0.5', # Space between nodes (inches)
'ranksep': '0.8', # Space between ranks (inches)
'bgcolor': 'white', # Background color
'dpi': '300', # Resolution for raster output
'compound': 'true', # Allow edges between clusters
'concentrate': 'true' # Merge multiple edges
}Node Attributes (boxes/shapes)
node_attr={
'shape': 'box', # box, ellipse, circle, diamond, plaintext
'style': 'rounded,filled', # rounded, filled, dashed, bold
'fillcolor': '#E8F4F8', # Fill color (hex or name)
'color': 'black', # Border color
'penwidth': '1.5', # Border width
'fontname': 'Arial', # Font family
'fontsize': '11', # Font size (points)
'fontcolor': 'black', # Text color
'width': '2', # Minimum width (inches)
'height': '0.5', # Minimum height (inches)
'margin': '0.2' # Internal padding
}Edge Attributes (arrows/connections)
edge_attr={
'color': 'black', # Line color
'penwidth': '1.5', # Line width
'style': 'solid', # solid, dashed, dotted, bold
'arrowsize': '1.0', # Arrow head size
'dir': 'forward', # forward, back, both, none
'arrowhead': 'normal' # normal, vee, diamond, dot, none
}Colorblind-Safe Palettes
Use these color sets to ensure accessibility:
Okabe-Ito Palette (8 colors)
OKABE_ITO = {
'orange': '#E69F00',
'sky_blue': '#56B4E9',
'green': '#009E73',
'yellow': '#F0E442',
'blue': '#0072B2',
'vermillion': '#D55E00',
'purple': '#CC79A7',
'black': '#000000'
}Light Backgrounds (for filled nodes)
LIGHT_FILLS = {
'blue': '#E8F4F8',
'green': '#E8F5E9',
'orange': '#FFF3E0',
'purple': '#F3E5F5',
'red': '#FFEBEE',
'yellow': '#FFFDE7',
'gray': '#F5F5F5'
}4. Publication Standards
All diagrams follow scientific publication best practices:
Vector Format Output
- PDF for LaTeX integration (preferred)
- SVG for web and presentations
- EPS for legacy publishing systems
- High-resolution PNG as fallback (300+ DPI)
Colorblind-Friendly Design
- Okabe-Ito palette for categorical elements
- Perceptually uniform colormaps for continuous data
- Redundant encoding (shapes + colors)
- Grayscale compatibility verification
Typography Standards
- Sans-serif fonts (Arial, Helvetica) for consistency
- Minimum 7-8 pt text at final print size
- Clear, readable labels with units
- Consistent notation throughout
Accessibility
- High contrast between elements
- Adequate line weights (0.5-1 pt minimum)
- Clear visual hierarchy
- Descriptive captions and alt text
For comprehensive publication guidelines, see references/best_practices.md.
Quick Start Examples
Example 1: Simple Flowchart in TikZ
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric, arrows.meta}
% Load colorblind-safe colors
\input{tikz_styles.tex}
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}[
node distance=2cm,
process/.style={rectangle, rounded corners, draw=black, thick,
fill=okabe-blue!20, minimum width=3cm, minimum height=1cm},
decision/.style={diamond, draw=black, thick, fill=okabe-orange!20,
minimum width=2cm, aspect=2},
arrow/.style={-Stealth, thick}
]
% Nodes
\node (start) [process] {Screen Participants\\(n=500)};
\node (exclude) [process, below of=start] {Exclude (n=150)\\Age $<$ 18 years};
\node (randomize) [process, below of=exclude] {Randomize (n=350)};
\node (treatment) [process, below left=1.5cm and 2cm of randomize]
{Treatment Group\\(n=175)};
\node (control) [process, below right=1.5cm and 2cm of randomize]
{Control Group\\(n=175)};
\node (analyze) [process, below=3cm of randomize] {Analyze Data};
% Arrows
\draw [arrow] (start) -- (exclude);
\draw [arrow] (exclude) -- (randomize);
\draw [arrow] (randomize) -| (treatment);
\draw [arrow] (randomize) -| (control);
\draw [arrow] (treatment) |- (analyze);
\draw [arrow] (control) |- (analyze);
\end{tikzpicture}
\caption{Study participant flow diagram following CONSORT guidelines.}
\label{fig:consort}
\end{figure}
\end{document}Example 2: Circuit Diagram with Schemdraw
import schemdraw
import schemdraw.elements as elm
# Create drawing with colorblind-safe colors
d = schemdraw.Drawing()
# Voltage source
d += elm.SourceV().label('$V_s$')
# Resistors in series
d += elm.Resistor().right().label('$R_1$\n1kΩ')
d += elm.Resistor().label('$R_2$\n2kΩ')
# Capacitor
d += elm.Capacitor().down().label('$C_1$\n10µF')
# Close the circuit
d += elm.Line().left().tox(d.elements[0].start)
# Add ground
d += elm.Ground()
# Save as vector graphics
d.save('circuit_diagram.svg')
d.save('circuit_diagram.pdf')Example 3: Biological Pathway with Python
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib.patches import FancyBboxPatch, FancyArrowPatch
# Okabe-Ito colorblind-safe palette
colors = {
'protein': '#56B4E9', # Blue
'gene': '#009E73', # Green
'process': '#F0E442', # Yellow
'inhibition': '#D55E00' # Orange
}
fig, ax = plt.subplots(figsize=(8, 6))
# Define proteins as rounded rectangles
proteins = [
('Receptor', 1, 5),
('Kinase A', 3, 5),
('Kinase B', 5, 5),
('TF', 7, 5),
('Gene', 7, 3)
]
for name, x, y in proteins:
color = colors['gene'] if name == 'Gene' else colors['protein']
box = FancyBboxPatch((x-0.4, y-0.3), 0.8, 0.6,
boxstyle="round,pad=0.1",
facecolor=color, edgecolor='black', linewidth=2)
ax.add_patch(box)
ax.text(x, y, name, ha='center', va='center', fontsize=10, fontweight='bold')
# Add activation arrows
arrows = [
(1.5, 5, 2.5, 5, 'black'), # Receptor -> Kinase A
(3.5, 5, 4.5, 5, 'black'), # Kinase A -> Kinase B
(5.5, 5, 6.5, 5, 'black'), # Kinase B -> TF
(7, 4.7, 7, 3.6, 'black') # TF -> Gene
]
for x1, y1, x2, y2, color in arrows:
arrow = FancyArrowPatch((x1, y1), (x2, y2),
arrowstyle='->', mutation_scale=20,
linewidth=2, color=color)
ax.add_patch(arrow)
# Configure axes
ax.set_xlim(0, 8.5)
ax.set_ylim(2, 6)
ax.set_aspect('equal')
ax.axis('off')
plt.tight_layout()
plt.savefig('signaling_pathway.pdf', bbox_inches='tight', dpi=300)
plt.savefig('signaling_pathway.png', bbox_inches='tight', dpi=300)Production Workflow (From Concept to Publication)
Follow this systematic workflow for all diagrams:
Phase 1: Analysis (2 minutes)
1. Identify diagram type - What are you visualizing?
- Neural network architecture? → Use graphviz
- Flowchart (CONSORT, PRISMA)? → Use graphviz
- Circuit diagram? → Use schemdraw
- Complex network? → Use networkx + graphviz
2. Determine layout direction
- Vertical flow (top-to-bottom)? →
rankdir='TB' - Bottom-up (like Transformer)? →
rankdir='BT' - Left-to-right sequence? →
rankdir='LR' - Right-to-left? →
rankdir='RL'
3. Identify groupings
- Parallel structures (encoder/decoder)? → Use clusters/subgraphs
- Sequential only? → Simple node chain
- Cross-connections? → Graphviz handles automatically
Phase 2: Implementation (10-15 minutes)
Standard procedure for 95% of diagrams:
import graphviz
from pathlib import Path
# 1. Set up output directory
output_dir = 'figures'
Path(output_dir).mkdir(exist_ok=True, parents=True)
# 2. Create diagram with base template
dot = graphviz.Digraph(
'my_diagram',
format='pdf',
graph_attr={
'rankdir': 'TB', # Adjust based on Phase 1
'splines': 'ortho', # Clean orthogonal edges
'nodesep': '0.6', # Good default spacing
'ranksep': '0.8',
'bgcolor': 'white',
'dpi': '300'
},
node_attr={
'shape': 'box',
'style': 'rounded,filled',
'fillcolor': 'lightgray',
'fontname': 'Arial',
'fontsize': '11'
},
edge_attr={'color': 'black', 'penwidth': '1.5'}
)
# 3. Add nodes (with descriptive IDs and clear labels)
dot.node('input', 'Input Layer', fillcolor='#E8F4F8')
dot.node('hidden', 'Hidden Layer', fillcolor='#B3D9E6')
dot.node('output', 'Output Layer', fillcolor='#C8E6C9')
# 4. Add edges
dot.edge('input', 'hidden')
dot.edge('hidden', 'output')
# 5. Render to figures/ folder
output_path = f'{output_dir}/my_diagram'
dot.render(output_path, cleanup=True) # Creates PDF
dot.format = 'svg'
dot.render(output_path, cleanup=True) # Creates SVG
dot.format = 'eps'
dot.render(output_path, cleanup=True) # Creates EPS
print(f"✓ Saved to: {output_path}.{{pdf,svg,eps}}")Phase 3: Quality Verification (5 minutes)
Automatic checks:
# Convert PDF to PNG for quality checking
from pdf2image import convert_from_path
pages = convert_from_path(f'{output_path}.pdf', dpi=300)
pages[0].save(f'{output_path}.png')
# Run quality checks
from quality_checker import run_quality_checks
report = run_quality_checks(f'{output_path}.png')
if report['overall_status'] != 'PASS':
print("⚠️ Issues detected - review quality_reports/")
# Adjust spacing: increase nodesep or ranksep
# Adjust colors: check accessibility report
else:
print("✓ Quality checks passed!")Manual verification: 1. Open PDF in viewer - check for overlaps 2. Verify text is readable (zoom to 100%) 3. Check alignment and spacing looks professional 4. Ensure colors are distinguishable
Phase 4: LaTeX Integration (2 minutes)
In your LaTeX document:
% In preamble
\usepackage{graphicx}
% In document
\begin{figure}[htbp]
\centering
\includegraphics[width=0.8\textwidth]{figures/my_diagram.pdf}
\caption{Clear, descriptive caption explaining all components and abbreviations.
Define any non-standard notation used in the diagram.}
\label{fig:my_diagram}
\end{figure}
% Reference in text
As shown in Figure~\ref{fig:my_diagram}, the architecture consists of...For posters (beamer):
\begin{frame}{Architecture}
\begin{center}
\includegraphics[width=0.9\textwidth]{figures/my_diagram.pdf}
\end{center}
\end{frame}Phase 5: Version Control (1 minute)
Always commit: 1. Python source code (create_my_diagram.py) 2. Generated outputs (figures/my_diagram.{pdf,svg,eps}) 3. Quality reports (my_diagram_quality_reports/)
git add create_my_diagram.py
git add figures/my_diagram.*
git add my_diagram_quality_reports/
git commit -m "Add architecture diagram with quality verification"Troubleshooting Common Issues
Graphviz-Specific Problems
Problem: Nodes overlap or are too close
# Solution: Increase spacing
graph_attr={
'nodesep': '1.0', # Increase from default 0.6
'ranksep': '1.2' # Increase from default 0.8
}Problem: Edges cross in confusing ways
# Solution 1: Use orthogonal splines
graph_attr={'splines': 'ortho'}
# Solution 2: Adjust rank direction
graph_attr={'rankdir': 'LR'} # Try different directionsProblem: Labels are cut off or too small
# Solution: Adjust node size and font
node_attr={
'fontsize': '12', # Increase from 11
'margin': '0.3', # More internal padding
'width': '2.5', # Wider boxes
'height': '0.6' # Taller boxes
}Problem: Clusters/subgraphs not appearing
# Solution: Cluster names MUST start with 'cluster_'
with dot.subgraph(name='cluster_encoder') as enc: # ✓ Correct
enc.attr(label='Encoder')
with dot.subgraph(name='encoder') as enc: # ✗ Won't show as cluster
enc.attr(label='Encoder')Problem: Cross-cluster edges not working
# Solution: Enable compound edges
dot.attr(compound='true')
# Then use lhead/ltail for cluster connections
dot.edge('node1', 'node2', lhead='cluster_decoder')Problem: Graphviz not found error
# Solution: Install graphviz binary (not just Python package)
# macOS
brew install graphviz
# Ubuntu
sudo apt-get install graphviz
# Then install Python bindings
pip install graphvizVisual Quality Issues
Problem: Colors not colorblind-safe
# Solution: Use Okabe-Ito palette
COLORS = {
'blue': '#56B4E9',
'green': '#009E73',
'orange': '#E69F00',
'purple': '#CC79A7'
}
dot.node('n1', 'Node', fillcolor=COLORS['blue'])Problem: Text too small when printed
# Solution: Increase font size and DPI
node_attr={'fontsize': '12'} # Minimum 11-12 for print
graph_attr={'dpi': '300'} # Publication qualityProblem: PDF too large
# Solution 1: Use simpler edge routing
graph_attr={'splines': 'line'} # Simpler than 'ortho'
# Solution 2: Reduce DPI for drafts
graph_attr={'dpi': '150'} # For drafts onlyWorkflow Issues
Problem: Need to regenerate diagram after changes
# Solution: Make diagram generation a function
def create_diagram(params):
# ... diagram code ...
return output_path
# Easy to regenerate with different parameters
create_diagram({'nodesep': '0.8', 'ranksep': '1.0'})Problem: Diagram doesn't match paper figures style
# Solution: Create a reusable style configuration
PAPER_STYLE = {
'graph_attr': {
'rankdir': 'TB',
'bgcolor': 'white',
'dpi': '300'
},
'node_attr': {
'fontname': 'Arial',
'fontsize': '11',
'style': 'rounded,filled',
'fillcolor': '#E8F4F8'
},
'edge_attr': {
'color': 'black',
'penwidth': '1.5'
}
}
# Use for all diagrams
dot = graphviz.Digraph(**PAPER_STYLE)Visual Verification and Quality Control
All diagrams undergo automated visual quality checks to prevent overlaps, ensure readability, and verify accessibility. This multi-stage verification process uses computer vision techniques to detect common issues.
Stage 1: Overlap Detection
Automatically detect overlapping elements that reduce clarity:
import numpy as np
from PIL import Image
import json
from pathlib import Path
def detect_overlaps(image_path, threshold=0.95):
"""
Detect potential overlapping regions in a diagram.
Args:
image_path: Path to the rendered diagram (PNG/PDF)
threshold: Similarity threshold for detecting overlaps (0-1)
Returns:
dict: Overlap report with locations and severity
"""
# Load image
img = Image.open(image_path).convert('RGB')
img_array = np.array(img)
# Detect dense regions (potential overlaps)
gray = np.mean(img_array, axis=2)
# Edge detection to find boundaries
from scipy.ndimage import sobel
edges_x = sobel(gray, axis=0)
edges_y = sobel(gray, axis=1)
edge_magnitude = np.hypot(edges_x, edges_y)
# Find regions with high edge density (overlaps)
from scipy.ndimage import label, find_objects
binary_edges = edge_magnitude > np.percentile(edge_magnitude, 85)
labeled_regions, num_features = label(binary_edges)
overlaps = []
slices = find_objects(labeled_regions)
for i, slice_obj in enumerate(slices):
if slice_obj is not None:
region = edge_magnitude[slice_obj]
density = np.mean(region)
# High density suggests potential overlap
if density > threshold * np.max(edge_magnitude):
y_center = (slice_obj[0].start + slice_obj[0].stop) // 2
x_center = (slice_obj[1].start + slice_obj[1].stop) // 2
overlaps.append({
'region_id': i + 1,
'position': (x_center, y_center),
'density': float(density),
'severity': 'high' if density > 0.98 * np.max(edge_magnitude) else 'medium'
})
report = {
'image': str(image_path),
'overlaps_detected': len(overlaps),
'overlap_regions': overlaps,
'status': 'PASS' if len(overlaps) == 0 else 'WARNING'
}
return report
def save_overlap_report(report, output_path='overlap_report.json'):
"""Save overlap detection report to JSON."""
with open(output_path, 'w') as f:
json.dump(report, indent=2, fp=f)
print(f"Overlap Report: {report['status']}")
print(f" - Overlaps detected: {report['overlaps_detected']}")
if report['overlap_regions']:
print(" - Regions requiring review:")
for region in report['overlap_regions']:
print(f" * Region {region['region_id']}: "
f"Position {region['position']}, Severity: {region['severity']}")Stage 2: Contrast and Accessibility Verification
Ensure diagrams meet accessibility standards for colorblind readers:
def verify_accessibility(image_path):
"""
Verify diagram meets accessibility standards.
Checks:
- Sufficient contrast ratios
- Grayscale readability
- Text size adequacy
"""
from PIL import ImageFilter, ImageStat
img = Image.open(image_path).convert('RGB')
# Test 1: Grayscale conversion
grayscale = img.convert('L')
gray_stat = ImageStat.Stat(grayscale)
# Calculate contrast (std dev of grayscale)
contrast = gray_stat.stddev[0]
min_contrast = 30 # Minimum standard deviation for good contrast
# Test 2: Color distribution
rgb_array = np.array(img)
unique_colors = len(np.unique(rgb_array.reshape(-1, 3), axis=0))
# Test 3: Simulate common color blindness (deuteranopia)
def simulate_colorblind(img_array):
# Simplified deuteranopia simulation
colorblind = img_array.copy().astype(float)
colorblind[:, :, 0] = 0.625 * img_array[:, :, 0] + 0.375 * img_array[:, :, 1]
colorblind[:, :, 1] = 0.7 * img_array[:, :, 1] + 0.3 * img_array[:, :, 0]
return colorblind.astype(np.uint8)
colorblind_img = simulate_colorblind(np.array(img))
cb_image = Image.fromarray(colorblind_img)
cb_gray = cb_image.convert('L')
cb_stat = ImageStat.Stat(cb_gray)
cb_contrast = cb_stat.stddev[0]
report = {
'image': str(image_path),
'checks': {
'grayscale_contrast': {
'value': contrast,
'threshold': min_contrast,
'status': 'PASS' if contrast >= min_contrast else 'FAIL'
},
'colorblind_contrast': {
'value': cb_contrast,
'threshold': min_contrast * 0.8,
'status': 'PASS' if cb_contrast >= min_contrast * 0.8 else 'FAIL'
},
'color_diversity': {
'unique_colors': unique_colors,
'status': 'INFO'
}
},
'overall_status': 'PASS' if (contrast >= min_contrast and
cb_contrast >= min_contrast * 0.8) else 'FAIL'
}
return report
def save_accessibility_report(report, output_path='accessibility_report.json'):
"""Save accessibility report to JSON."""
with open(output_path, 'w') as f:
json.dump(report, indent=2, fp=f)
print(f"Accessibility Report: {report['overall_status']}")
for check_name, check_data in report['checks'].items():
print(f" - {check_name}: {check_data['status']}")
if 'value' in check_data and 'threshold' in check_data:
print(f" Value: {check_data['value']:.2f}, Threshold: {check_data['threshold']:.2f}")Stage 3: Text Size and Resolution Validation
Verify text is readable at publication size:
def validate_resolution(image_path, target_dpi=300, min_text_size_pt=7):
"""
Validate image resolution and estimated text size.
Args:
image_path: Path to diagram image
target_dpi: Target DPI for publication (default 300)
min_text_size_pt: Minimum acceptable text size in points
"""
from PIL import Image
import pytesseract
img = Image.open(image_path)
# Check DPI
dpi = img.info.get('dpi', (72, 72))
actual_dpi = dpi[0] if isinstance(dpi, tuple) else dpi
# Estimate text size (simplified - assumes text detection)
# For production, use OCR or PDF text extraction
width, height = img.size
dpi_ratio = actual_dpi / 72 # Convert to screen pixels
# Calculate physical size in inches
width_inches = width / actual_dpi if actual_dpi > 0 else width / 72
height_inches = height / actual_dpi if actual_dpi > 0 else height / 72
report = {
'image': str(image_path),
'resolution': {
'dpi': actual_dpi,
'target_dpi': target_dpi,
'status': 'PASS' if actual_dpi >= target_dpi else 'WARNING'
},
'dimensions': {
'pixels': {'width': width, 'height': height},
'inches': {'width': round(width_inches, 2),
'height': round(height_inches, 2)}
},
'recommendations': []
}
if actual_dpi < target_dpi:
report['recommendations'].append(
f"Increase resolution to {target_dpi} DPI for publication quality"
)
if width_inches > 7:
report['recommendations'].append(
"Image width exceeds typical single-column width (7 inches)"
)
return reportStage 4: Comprehensive Quality Check Pipeline
Run all verification stages in sequence:
def run_quality_checks(image_path, output_dir='quality_reports'):
"""
Run comprehensive quality checks on diagram.
Args:
image_path: Path to diagram to verify
output_dir: Directory to save reports
Returns:
dict: Comprehensive quality report
"""
import os
from datetime import datetime
Path(output_dir).mkdir(exist_ok=True)
print(f"Running quality checks on: {image_path}")
print("=" * 60)
# Stage 1: Overlap Detection
print("\n[Stage 1/4] Detecting overlaps...")
overlap_report = detect_overlaps(image_path)
save_overlap_report(
overlap_report,
f"{output_dir}/overlap_report.json"
)
# Stage 2: Accessibility
print("\n[Stage 2/4] Verifying accessibility...")
accessibility_report = verify_accessibility(image_path)
save_accessibility_report(
accessibility_report,
f"{output_dir}/accessibility_report.json"
)
# Stage 3: Resolution
print("\n[Stage 3/4] Validating resolution...")
resolution_report = validate_resolution(image_path)
with open(f"{output_dir}/resolution_report.json", 'w') as f:
json.dump(resolution_report, f, indent=2)
# Stage 4: Generate visual report
print("\n[Stage 4/4] Generating visual report...")
create_visual_report(
image_path,
overlap_report,
accessibility_report,
f"{output_dir}/visual_report.png"
)
# Comprehensive summary
all_pass = (
overlap_report['status'] != 'FAIL' and
accessibility_report['overall_status'] != 'FAIL' and
resolution_report['resolution']['status'] != 'FAIL'
)
summary = {
'timestamp': datetime.now().isoformat(),
'image': str(image_path),
'overall_status': 'PASS' if all_pass else 'NEEDS REVIEW',
'stage_results': {
'overlap_detection': overlap_report['status'],
'accessibility': accessibility_report['overall_status'],
'resolution': resolution_report['resolution']['status']
},
'reports_saved_to': output_dir
}
with open(f"{output_dir}/summary.json", 'w') as f:
json.dump(summary, f, indent=2)
print("\n" + "=" * 60)
print(f"OVERALL STATUS: {summary['overall_status']}")
print(f"Reports saved to: {output_dir}/")
print("=" * 60)
return summary
def create_visual_report(image_path, overlap_report, accessibility_report, output_path):
"""Create visual report with annotations."""
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
fig, axes = plt.subplots(1, 3, figsize=(15, 5))
# Load original image
img = Image.open(image_path)
# Panel 1: Original with overlap markers
axes[0].imshow(img)
axes[0].set_title('Overlap Detection', fontsize=12, fontweight='bold')
if overlap_report['overlap_regions']:
for region in overlap_report['overlap_regions']:
x, y = region['position']
color = 'red' if region['severity'] == 'high' else 'orange'
circle = Circle((x, y), 20, color=color, fill=False, linewidth=2)
axes[0].add_patch(circle)
axes[0].axis('off')
axes[0].text(0.02, 0.98, f"Status: {overlap_report['status']}",
transform=axes[0].transAxes, fontsize=10,
verticalalignment='top', bbox=dict(boxstyle='round',
facecolor='wheat', alpha=0.5))
# Panel 2: Grayscale version
gray_img = img.convert('L')
axes[1].imshow(gray_img, cmap='gray')
axes[1].set_title('Grayscale Preview', fontsize=12, fontweight='bold')
axes[1].axis('off')
gray_status = accessibility_report['checks']['grayscale_contrast']['status']
axes[1].text(0.02, 0.98, f"Status: {gray_status}",
transform=axes[1].transAxes, fontsize=10,
verticalalignment='top', bbox=dict(boxstyle='round',
facecolor='wheat', alpha=0.5))
# Panel 3: Colorblind simulation
img_array = np.array(img)
colorblind = img_array.copy().astype(float)
colorblind[:, :, 0] = 0.625 * img_array[:, :, 0] + 0.375 * img_array[:, :, 1]
colorblind[:, :, 1] = 0.7 * img_array[:, :, 1] + 0.3 * img_array[:, :, 0]
axes[2].imshow(colorblind.astype(np.uint8))
axes[2].set_title('Colorblind Simulation', fontsize=12, fontweight='bold')
axes[2].axis('off')
cb_status = accessibility_report['checks']['colorblind_contrast']['status']
axes[2].text(0.02, 0.98, f"Status: {cb_status}",
transform=axes[2].transAxes, fontsize=10,
verticalalignment='top', bbox=dict(boxstyle='round',
facecolor='wheat', alpha=0.5))
plt.tight_layout()
plt.savefig(output_path, dpi=150, bbox_inches='tight')
print(f"Visual report saved: {output_path}")
plt.close()Usage Example: Complete Workflow with Verification
Here's how to create a diagram with full quality verification:
import matplotlib.pyplot as plt
from matplotlib.patches import FancyBboxPatch, FancyArrowPatch
# Step 1: Create diagram
def create_flowchart_with_verification(output_base='flowchart'):
"""Create flowchart with automated quality checks."""
# Okabe-Ito colorblind-safe palette
colors = {
'process': '#56B4E9', # Blue
'decision': '#E69F00', # Orange
'data': '#009E73', # Green
'terminal': '#CC79A7' # Purple
}
fig, ax = plt.subplots(figsize=(8, 10))
# Define flowchart elements with careful spacing
elements = [
('Start', 4, 9, 'terminal'),
('Input Data', 4, 7.5, 'data'),
('Process A', 4, 6, 'process'),
('Decision?', 4, 4.5, 'decision'),
('Process B1', 2, 3, 'process'),
('Process B2', 6, 3, 'process'),
('Output', 4, 1.5, 'data'),
('End', 4, 0, 'terminal')
]
# Draw boxes with adequate spacing
box_positions = {}
for label, x, y, element_type in elements:
color = colors[element_type]
width, height = (1.2, 0.6) if element_type != 'decision' else (1.5, 1.0)
box = FancyBboxPatch(
(x - width/2, y - height/2), width, height,
boxstyle="round,pad=0.1" if element_type != 'decision' else "round,pad=0.05",
facecolor=color, edgecolor='black', linewidth=2
)
ax.add_patch(box)
ax.text(x, y, label, ha='center', va='center',
fontsize=10, fontweight='bold')
box_positions[label] = (x, y)
# Draw arrows with proper spacing
arrows = [
('Start', 'Input Data'),
('Input Data', 'Process A'),
('Process A', 'Decision?'),
('Decision?', 'Process B1'),
('Decision?', 'Process B2'),
('Process B1', 'Output'),
('Process B2', 'Output'),
('Output', 'End')
]
for start, end in arrows:
x1, y1 = box_positions[start]
x2, y2 = box_positions[end]
# Calculate arrow start/end points to avoid overlap
if x1 == x2: # Vertical arrow
y1_adj = y1 - 0.3 if y2 < y1 else y1 + 0.3
y2_adj = y2 + 0.3 if y2 < y1 else y2 - 0.3
arrow = FancyArrowPatch(
(x1, y1_adj), (x2, y2_adj),
arrowstyle='->', mutation_scale=20, linewidth=2, color='black'
)
else: # Diagonal arrow
arrow = FancyArrowPatch(
(x1, y1 - 0.5), (x2, y2 + 0.3),
arrowstyle='->', mutation_scale=20, linewidth=2, color='black'
)
ax.add_patch(arrow)
ax.set_xlim(0, 8)
ax.set_ylim(-0.5, 9.5)
ax.set_aspect('equal')
ax.axis('off')
plt.tight_layout()
# Save in multiple formats
plt.savefig(f'{output_base}.pdf', bbox_inches='tight', dpi=300)
plt.savefig(f'{output_base}.png', bbox_inches='tight', dpi=300)
plt.savefig(f'{output_base}.svg', bbox_inches='tight')
print(f"Diagram saved: {output_base}.pdf/.png/.svg")
plt.close()
# Step 2: Run quality checks
print("\nRunning quality verification...")
quality_report = run_quality_checks(
f'{output_base}.png',
output_dir=f'{output_base}_quality_reports'
)
# Step 3: Review and iterate if needed
if quality_report['overall_status'] != 'PASS':
print("\n⚠️ Diagram needs review. Check quality reports for details.")
return False
else:
print("\n✓ Diagram passed all quality checks!")
return True
# Run complete workflow
if __name__ == '__main__':
success = create_flowchart_with_verification('my_flowchart')Iterative Refinement Loop
For complex diagrams, use an iterative refinement process:
def iterative_diagram_refinement(create_function, max_iterations=3):
"""
Iteratively refine diagram until it passes quality checks.
Args:
create_function: Function that creates and saves diagram
max_iterations: Maximum refinement attempts
"""
for iteration in range(1, max_iterations + 1):
print(f"\n{'='*60}")
print(f"ITERATION {iteration}/{max_iterations}")
print(f"{'='*60}")
# Create diagram
diagram_path = create_function(iteration)
# Run checks
quality_report = run_quality_checks(
diagram_path,
output_dir=f'iteration_{iteration}_reports'
)
if quality_report['overall_status'] == 'PASS':
print(f"\n✓ Diagram approved after {iteration} iteration(s)")
return True
else:
print(f"\n⚠️ Issues found. Adjusting parameters for next iteration...")
# Here you would adjust spacing, colors, etc. based on reports
print(f"\n❌ Maximum iterations reached. Manual review required.")
return FalseCommon Use Cases
Use Case 1: CONSORT Participant Flow Diagram
Clinical trials require standardized participant flow diagrams. Use the flowchart template:
% Load template
\input{assets/flowchart_template.tex}
% Customize with your numbers
\begin{tikzpicture}[consort]
\node (assessed) [flowbox] {Assessed for eligibility (n=500)};
\node (excluded) [flowbox, below=of assessed] {Excluded (n=150)};
\node (reasons) [infobox, right=of excluded] {
\begin{tabular}{l}
Age $<$ 18: n=80 \\
Declined: n=50 \\
Other: n=20
\end{tabular}
};
% ... continue diagram
\end{tikzpicture}See assets/flowchart_template.tex for complete template.
Use Case 2: Electronics Circuit Schematic
For electronics papers, use Schemdraw or CircuitikZ:
# Python with Schemdraw - see scripts/circuit_generator.py
from scripts.circuit_generator import create_circuit
circuit = create_circuit(
components=['voltage_source', 'resistor', 'capacitor', 'ground'],
values=['5V', '1kΩ', '10µF', None],
layout='series'
)
circuit.save('my_circuit.pdf')Or use CircuitikZ in LaTeX - see assets/circuit_template.tex.
Use Case 3: Biological Signaling Pathway
Visualize molecular interactions and signaling cascades:
# Python script - see scripts/pathway_diagram.py
from scripts.pathway_diagram import PathwayGenerator
pathway = PathwayGenerator()
pathway.add_protein('EGFR', position=(1, 5))
pathway.add_protein('RAS', position=(3, 5))
pathway.add_protein('RAF', position=(5, 5))
pathway.add_activation('EGFR', 'RAS')
pathway.add_activation('RAS', 'RAF')
pathway.save('mapk_pathway.pdf')Or create in TikZ - see assets/pathway_template.tex.
Use Case 4: System Architecture Diagram
Illustrate software/hardware components and relationships:
% Use block diagram template
\input{assets/block_diagram_template.tex}
\begin{tikzpicture}[architecture]
\node (sensor) [component] {Sensor};
\node (adc) [component, right=of sensor] {ADC};
\node (micro) [component, right=of adc] {Microcontroller};
\node (wifi) [component, above right=of micro] {WiFi Module};
\node (display) [component, below right=of micro] {Display};
\draw [dataflow] (sensor) -- node[above] {Analog} (adc);
\draw [dataflow] (adc) -- node[above] {Digital} (micro);
\draw [dataflow] (micro) -- (wifi);
\draw [dataflow] (micro) -- (display);
\end{tikzpicture}See assets/block_diagram_template.tex for complete template.
Helper Scripts
The scripts/ directory contains Python utilities for automated diagram generation and quality verification:
generate_flowchart.py
Convert text descriptions into TikZ flowcharts with automatic quality checks:
from scripts.generate_flowchart import text_to_flowchart, create_with_verification
description = """
1. Screen participants (n=500)
2. Exclude if age < 18 (n=150)
3. Randomize remaining (n=350)
4. Treatment group (n=175)
5. Control group (n=175)
6. Follow up at 3 months
7. Analyze data
"""
# Generate TikZ code
tikz_code = text_to_flowchart(description)
with open('methodology_flow.tex', 'w') as f:
f.write(tikz_code)
# Or create with automatic verification
success = create_with_verification(
description,
output='methodology_flow',
verify=True
)circuit_generator.py
Generate circuit diagrams using Schemdraw with quality verification:
from scripts.circuit_generator import CircuitBuilder
builder = CircuitBuilder()
builder.add_voltage_source('Vs', '5V')
builder.add_resistor('R1', '1kΩ')
builder.add_capacitor('C1', '10µF')
builder.add_ground()
# Save with automatic quality checks
builder.save('circuit.pdf', verify=True)
# Access quality report
print(builder.quality_report)pathway_diagram.py
Create biological pathway diagrams with overlap detection:
from scripts.pathway_diagram import PathwayGenerator
gen = PathwayGenerator(
colorblind_safe=True,
auto_spacing=True # Automatically adjust spacing to prevent overlaps
)
gen.add_node('Receptor', type='protein', position=(1, 5))
gen.add_node('Kinase', type='protein', position=(3, 5))
gen.add_edge('Receptor', 'Kinase', interaction='activation')
# Save with quality verification
quality_report = gen.save('pathway.pdf', verify=True)
# Iteratively refine if needed
if quality_report['status'] != 'PASS':
gen.auto_adjust_spacing()
gen.save('pathway.pdf', verify=True)compile_tikz.py
Standalone TikZ compilation utility with quality checks:
# Compile TikZ to PDF with verification
python scripts/compile_tikz.py flowchart.tex -o flowchart.pdf --verify
# Generate PNG with quality report
python scripts/compile_tikz.py flowchart.tex -o flowchart.pdf --png --dpi 300 --verify
# Preview with quality overlay
python scripts/compile_tikz.py flowchart.tex --preview --show-qualityquality_checker.py
Standalone quality verification tool for any diagram:
# Check single diagram
python scripts/quality_checker.py diagram.png
# Check with detailed report
python scripts/quality_checker.py diagram.png --detailed --output-dir reports/
# Batch check multiple diagrams
python scripts/quality_checker.py figures/*.png --batch
# Export visual comparison report
python scripts/quality_checker.py diagram.png --visual-report# Python API
from scripts.quality_checker import DiagramQualityChecker
checker = DiagramQualityChecker()
# Run all checks
report = checker.check_diagram('diagram.png')
# Access specific checks
overlap_report = checker.check_overlaps('diagram.png')
accessibility_report = checker.check_accessibility('diagram.png')
resolution_report = checker.check_resolution('diagram.png')
# Generate visual report
checker.create_visual_report('diagram.png', output='quality_report.png')
# Batch processing
results = checker.batch_check(['fig1.png', 'fig2.png', 'fig3.png'])
checker.save_batch_report(results, 'batch_quality_report.json')Templates and Assets
Pre-built templates in assets/ directory provide starting points:
- `flowchart_template.tex` - Methodology flowcharts (CONSORT style)
- `circuit_template.tex` - Electrical circuit diagrams
- `pathway_template.tex` - Biological pathway diagrams
- `block_diagram_template.tex` - System architecture diagrams
- `tikz_styles.tex` - Reusable style definitions (ALWAYS load this)
All templates use colorblind-safe Okabe-Ito palette and publication-ready styling.
Best Practices Summary
Design Principles
1. Clarity over complexity - Simplify, remove unnecessary elements 2. Consistent styling - Use templates and style files 3. Colorblind accessibility - Use Okabe-Ito palette, redundant encoding 4. Appropriate typography - Sans-serif fonts, minimum 7-8 pt 5. Vector format - Always use PDF/SVG for publication
Technical Requirements
1. Resolution - Vector preferred, or 300+ DPI for raster 2. File format - PDF for LaTeX, SVG for web, PNG as fallback 3. Color space - RGB for digital, CMYK for print (convert if needed) 4. Line weights - Minimum 0.5 pt, typical 1-2 pt 5. Text size - 7-8 pt minimum at final size
Integration Guidelines
1. Include in LaTeX - Use \input{} for TikZ, \includegraphics{} for external 2. Caption thoroughly - Describe all elements and abbreviations 3. Reference in text - Explain diagram in narrative flow 4. Maintain consistency - Same style across all figures in paper 5. Version control - Keep source files (.tex, .py) in repository
Troubleshooting Common Issues
TikZ Compilation Errors
Problem: ! Package tikz Error: I do not know the key '/tikz/...
- Solution: Missing library - add
\usetikzlibrary{...}to preamble
Problem: Overlapping text or elements
- Solution: Run quality checker to identify overlaps:
python scripts/quality_checker.py diagram.png - Solution: Increase
node distance, adjust positioning manually based on overlap report - Solution: Use
auto_spacing=Truein pathway generator for automatic adjustment
Problem: Arrows not connecting properly
- Solution: Use anchor points:
(node.east),(node.north), etc. - Solution: Check overlap report for arrow/node intersections
Python Generation Issues
Problem: Schemdraw elements not aligning
- Solution: Use
.at()method for precise positioning - Solution: Enable
auto_spacingto prevent overlaps
Problem: Matplotlib text rendering issues
- Solution: Set
plt.rcParams['text.usetex'] = Truefor LaTeX rendering - Solution: Ensure LaTeX installation is available
Problem: Export quality poor
- Solution: Increase DPI:
plt.savefig(..., dpi=300, bbox_inches='tight') - Solution: Run resolution checker:
quality_checker.check_resolution(image_path, target_dpi=300)
Problem: Elements overlap after generation
- Solution: Run
detect_overlaps()function to identify problem regions - Solution: Use iterative refinement:
iterative_diagram_refinement(create_function) - Solution: Increase spacing between elements by 20-30%
Quality Check Issues
Problem: False positive overlap detection
- Solution: Adjust threshold:
detect_overlaps(image_path, threshold=0.98) - Solution: Manually review flagged regions in visual report
Problem: Quality checker fails on PDF files
- Solution: Convert PDF to PNG first:
from pdf2image import convert_from_path - Solution: Use PNG output format for quality checks
Problem: Colorblind simulation shows poor contrast
- Solution: Switch to Okabe-Ito palette explicitly in code
- Solution: Add redundant encoding (shapes, patterns, line styles)
- Solution: Increase color saturation and lightness differences
Problem: High-severity overlaps detected
- Solution: Review overlap_report.json for exact positions
- Solution: Increase spacing in those specific regions
- Solution: Re-run with adjusted parameters and verify again
Problem: Visual report generation fails
- Solution: Check Pillow and matplotlib installations
- Solution: Ensure image file is readable:
Image.open(path).verify() - Solution: Check sufficient disk space for report generation
Accessibility Problems
Problem: Colors indistinguishable in grayscale
- Solution: Run accessibility checker:
verify_accessibility(image_path) - Solution: Add patterns, shapes, or line styles for redundancy
- Solution: Increase contrast between adjacent elements
Problem: Text too small when printed
- Solution: Run resolution validator:
validate_resolution(image_path) - Solution: Design at final size, use minimum 7-8 pt fonts
- Solution: Check physical dimensions in resolution report
Problem: Accessibility checks consistently fail
- Solution: Review accessibility_report.json for specific failures
- Solution: Increase color contrast by at least 20%
- Solution: Test with actual grayscale conversion before finalizing
Resources and References
Detailed References
Load these files for comprehensive information on specific topics:
- `references/tikz_guide.md` - Complete TikZ syntax, positioning, styles, and techniques
- `references/diagram_types.md` - Catalog of scientific diagram types with examples
- `references/best_practices.md` - Publication standards and accessibility guidelines
- `references/python_libraries.md` - Guide to Schemdraw, NetworkX, and Matplotlib for diagrams
External Resources
TikZ and LaTeX
- TikZ & PGF Manual: https://pgf-tikz.github.io/pgf/pgfmanual.pdf
- TeXample.net: http://www.texample.net/tikz/ (examples gallery)
- CircuitikZ Manual: https://ctan.org/pkg/circuitikz
Python Libraries
- Schemdraw Documentation: https://schemdraw.readthedocs.io/
- NetworkX Documentation: https://networkx.org/documentation/
- Matplotlib Documentation: https://matplotlib.org/
Publication Standards
- Nature Figure Guidelines: https://www.nature.com/nature/for-authors/final-submission
- Science Figure Guidelines: https://www.science.org/content/page/instructions-preparing-initial-manuscript
- CONSORT Diagram: http://www.consort-statement.org/consort-statement/flow-diagram
Integration with Other Skills
This skill works synergistically with:
- Scientific Writing - Diagrams follow figure best practices
- Scientific Visualization - Shares color palettes and styling
- LaTeX Posters - Reuse TikZ styles for poster diagrams
- Research Grants - Methodology diagrams for proposals
- Peer Review - Evaluate diagram clarity and accessibility
Quick Reference Checklist
Before submitting diagrams, verify:
Visual Quality
- [ ] Vector format (PDF/SVG) or 300+ DPI raster
- [ ] No overlapping elements (verified by quality checker)
- [ ] Adequate spacing between all components
- [ ] Clean, professional alignment
- [ ] All arrows connect properly to intended targets
Accessibility
- [ ] Colorblind-safe palette (Okabe-Ito) used
- [ ] Works in grayscale (tested with accessibility checker)
- [ ] Sufficient contrast between elements (verified)
- [ ] Redundant encoding where appropriate (shapes + colors)
- [ ] Colorblind simulation passes all checks
Typography and Readability
- [ ] Text minimum 7-8 pt at final size
- [ ] All elements labeled clearly and completely
- [ ] Consistent font family and sizing
- [ ] No text overlaps or cutoffs
- [ ] Units included where applicable
Publication Standards
- [ ] Consistent styling with other figures in manuscript
- [ ] Comprehensive caption written with all abbreviations defined
- [ ] Referenced appropriately in manuscript text
- [ ] Meets journal-specific dimension requirements
- [ ] Exported in required format for journal (PDF/EPS/TIFF)
Quality Verification (Required)
- [ ] Ran
run_quality_checks()and achieved PASS status - [ ] Reviewed overlap detection report (zero high-severity overlaps)
- [ ] Passed accessibility verification (grayscale and colorblind)
- [ ] Resolution validated at target DPI (300+ for print)
- [ ] Visual quality report generated and reviewed
- [ ] All quality reports saved with figure files
Documentation and Version Control
- [ ] Source files (.tex, .py) saved for future revision
- [ ] Quality reports archived in
quality_reports/directory - [ ] Configuration parameters documented (colors, spacing, sizes)
- [ ] Git commit includes source, output, and quality reports
- [ ] README or comments explain how to regenerate figure
Final Integration Check
- [ ] Figure displays correctly in compiled manuscript
- [ ] Cross-references work (
\ref{}points to correct figure) - [ ] Figure number matches text citations
- [ ] Caption appears on correct page relative to figure
- [ ] No compilation warnings or errors related to figure
Use this skill to create clear, accessible, publication-quality diagrams that effectively communicate complex scientific concepts. The integrated quality verification workflow ensures all diagrams meet professional standards before publication.
% Block Diagram Template
% For system architecture, data flow, and component diagrams
%
% Usage:
% 1. Copy and customize this template
% 2. Modify blocks and connections
% 3. Compile with: pdflatex block_diagram_template.tex
% 4. Include in paper with: \includegraphics{block_diagram.pdf}
\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz}
% Load shared styles
\input{tikz_styles.tex}
\begin{document}
% === Example 1: Data Acquisition System ===
\begin{tikzpicture}[blockdiagram]
% Components
\node[component] (sensor) {Sensor};
\node[component, right=of sensor] (adc) {ADC};
\node[component, right=of adc] (micro) {Micro-\\controller};
\node[component, above right=1cm and 1.5cm of micro] (wireless) {Wireless\\Module};
\node[component, below right=1cm and 1.5cm of micro] (display) {Display};
\node[component, right=3cm of micro] (server) {Server};
% Connections with data flow
\draw[dataflow] (sensor) -- node[above, font=\footnotesize] {analog} (adc);
\draw[dataflow] (adc) -- node[above, font=\footnotesize] {digital} (micro);
\draw[dataflow] (micro) -- node[above right, font=\footnotesize] {WiFi} (wireless);
\draw[dataflow] (micro) -- node[below right, font=\footnotesize] {SPI} (display);
\draw[dataflow] (wireless) -- node[above, font=\footnotesize] {TCP/IP} (server);
% Optional: control signals
\draw[control, <->] (server) to[bend left=20] node[above, font=\footnotesize] {control} (micro);
\end{tikzpicture}
\vspace{1cm}
% === Example 2: Software Architecture (Three-Tier) ===
\begin{tikzpicture}[blockdiagram]
% Presentation Layer
\node[subsystem] (web) {Web UI};
\node[subsystem, right=of web] (mobile) {Mobile App};
% Business Logic Layer
\node[subsystem, below=2cm of web, xshift=1.5cm] (api) {API Server};
\node[component, left=of api] (auth) {Auth\\Service};
\node[component, right=of api] (worker) {Worker\\Queue};
% Data Layer
\node[component, below=2cm of auth] (db) {Database};
\node[component, below=2cm of api] (cache) {Cache};
\node[component, below=2cm of worker] (storage) {File\\Storage};
% Connections
\draw[dataflow, <->] (web) -- (api);
\draw[dataflow, <->] (mobile) -- (api);
\draw[dataflow, <->] (api) -- (auth);
\draw[dataflow, <->] (api) -- (worker);
\draw[dataflow, <->] (auth) -- (db);
\draw[dataflow, <->] (api) -- (db);
\draw[dataflow, <->] (api) -- (cache);
\draw[dataflow, <->] (worker) -- (storage);
% Layer labels
\node[annotation, left=2.5cm of web] {Presentation\\Layer};
\node[annotation, left=2.5cm of api] {Business\\Logic};
\node[annotation, left=2.5cm of db] {Data\\Layer};
\end{tikzpicture}
\vspace{1cm}
% === Example 3: Experimental Setup ===
\begin{tikzpicture}[blockdiagram, node distance=2.5cm]
% Equipment chain
\node[component] (source) {Light\\Source};
\node[component, right=of source] (filter) {Filter};
\node[component, right=of filter] (sample) {Sample\\Chamber};
\node[component, right=of sample] (detector) {Detector};
\node[component, right=of detector] (amp) {Amplifier};
\node[component, above right=0.5cm and 1cm of amp] (daq) {Data\\Acquisition};
\node[component, below=1.5cm of sample] (temp) {Temperature\\Controller};
% Signal flow
\draw[dataflow] (source) -- node[above, font=\footnotesize] {light} (filter);
\draw[dataflow] (filter) -- (sample);
\draw[dataflow] (sample) -- (detector);
\draw[dataflow] (detector) -- node[above, font=\footnotesize] {signal} (amp);
\draw[dataflow] (amp) -- (daq);
% Control
\draw[control, <->] (temp) -- (sample);
\draw[control] (daq.south) |- (temp.east);
% Computer
\node[subsystem, right=of daq] (computer) {Computer};
\draw[dataflow, <->] (daq) -- (computer);
\end{tikzpicture}
\end{document}
% === Customization Guide ===
%
% BLOCK TYPES (from tikz_styles.tex):
% component - Standard component (blue, medium size)
% subsystem - Larger system block (green, larger, bold)
% interface - Connection point (orange circle)
%
% ARROW TYPES:
% dataflow - Data flow arrow (solid, blue)
% control - Control signal (dashed, red)
% arrow - Generic arrow (black)
%
% ARROW DIRECTIONS:
% --> : Left to right
% <-> : Bidirectional
% |- : Vertical then horizontal
% -| : Horizontal then vertical
%
% POSITIONING:
% right=of node - To the right
% below=of node - Below
% above=of node - Above
% right=2cm of node - Specific distance
% above right=1cm and 2cm of node - Diagonal
%
% LABELS ON ARROWS:
% \draw[dataflow] (a) -- node[above] {label} (b);
% \draw[dataflow] (a) -- node[below, font=\footnotesize] {label} (b);
% \draw[dataflow] (a) -- node[pos=0.3, above] {label} (b);
%
% CURVED CONNECTIONS:
% \draw[dataflow] (a) to[bend left=30] (b);
% \draw[dataflow] (a) to[bend right=30] (b);
% \draw[dataflow, out=45, in=135] (a) to (b);
%
% GROUPING COMPONENTS:
% Use fit library to draw box around multiple components:
%
% \node[background, fit=(comp1) (comp2) (comp3)] {};
% \node[above, font=\small] at (group.north) {Subsystem Name};
%
% Or manually draw a box:
%
% \draw[thick, okabe-green, rounded corners]
% (x1, y1) rectangle (x2, y2);
% \node at (x, y) {Group Label};
%
% LAYER/HIERARCHY VISUALIZATION:
% Add horizontal lines and labels to show layers:
%
% % Draw separators
% \draw[thick, gray, dashed] (-2, 0) -- (8, 0);
% \draw[thick, gray, dashed] (-2, -3) -- (8, -3);
%
% % Add layer labels
% \node[annotation, left] at (-2, 1) {Layer 1};
% \node[annotation, left] at (-2, -1.5) {Layer 2};
%
% SIGNAL TYPES:
% Annotate data/signal types on connections:
% - Digital/Analog
% - Protocol (SPI, I2C, UART, Ethernet, etc.)
% - Data rate (Mbps, Hz)
% - Voltage levels
%
% TYPICAL USAGE IN PAPER:
%
% \begin{figure}[h]
% \centering
% \includegraphics[width=0.9\textwidth]{block_diagram.pdf}
% \caption{System architecture showing data flow from sensor through
% signal processing to display and wireless transmission.
% Solid arrows indicate data flow, dashed arrows show control signals.}
% \label{fig:architecture}
% \end{figure}
%
% MULTI-PANEL DIAGRAMS:
% Combine overview and detail views:
% - Panel A: High-level system overview
% - Panel B: Detailed view of one subsystem
%
% Add panel labels:
% \node[font=\large\bfseries] at (-3, 5) {A};
% \node[font=\large\bfseries] at (-3, -2) {B};
%
% RESOURCES:
% - UML diagrams: https://www.uml-diagrams.org/
% - System architecture patterns
% - IEEE recommended practice for architectural description
% Circuit Diagram Template using CircuitikZ
% For electrical schematics, instrumentation diagrams, and signal processing
%
% Usage:
% 1. Copy and customize this template
% 2. Compile with: pdflatex circuit_template.tex
% 3. Include in paper with: \includegraphics{circuit.pdf}
\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz}
\usepackage{circuitikz}
% Load shared colors (optional, for consistent styling)
\input{tikz_styles.tex}
\begin{document}
% === Example 1: RC Filter Circuit ===
\begin{circuitikz}[american, scale=1.2, transform shape]
% Input
\draw (0,0) node[left] {$V_{in}$}
to[short, o-] (0.5,0)
to[R, l=$R_1$, v^>=$V_R$] (3,0)
to[short, -o] (3.5,0) node[right] {$V_{out}$};
% Capacitor to ground
\draw (3,0) to[C, l=$C_1$, *-] (3,-2)
node[ground] {};
% Component values annotation (optional)
\node[below, font=\small] at (1.5,-2.5) {$R_1 = 1\,\mathrm{k}\Omega$, $C_1 = 10\,\mu\mathrm{F}$};
\end{circuitikz}
\vspace{1cm}
% === Example 2: Voltage Divider ===
\begin{circuitikz}[american, scale=1.2, transform shape]
% Voltage source
\draw (0,0) to[V, v=$V_s$, invert] (0,3);
% Resistors
\draw (0,3) to[short] (2,3)
to[R, l=$R_1$] (2,1.5)
to[short, -o] (3,1.5) node[right] {$V_{out}$}
(2,1.5) to[R, l=$R_2$] (2,0)
to[short] (0,0);
% Ground
\draw (0,0) node[ground] {};
\end{circuitikz}
\vspace{1cm}
% === Example 3: Amplifier Circuit ===
\begin{circuitikz}[american, scale=1.0, transform shape]
% Input
\draw (0,0) node[left] {$V_{in}$}
to[C, l=$C_{in}$, o-] (1.5,0);
% Biasing resistor
\draw (1.5,0) to[R, l=$R_b$, *-] (1.5,2)
to[short] (0,2) node[left] {$+V_{cc}$};
% Transistor
\node[npn] (npn) at (3,0) {};
\draw (1.5,0) to[short] (npn.base);
% Collector resistor
\draw (npn.collector) to[R, l=$R_c$] (3,2.5)
to[short] (3,3) node[above] {$+V_{cc}$};
% Emitter to ground
\draw (npn.emitter) to[short] (3,-1.5) node[ground] {};
% Output
\draw (npn.collector) to[C, l=$C_{out}$, *-o] (5,0.75) node[right] {$V_{out}$};
\end{circuitikz}
\end{document}
% === CircuitikZ Component Reference ===
%
% PASSIVE COMPONENTS:
% to[R, l=$R_1$] - Resistor with label
% to[C, l=$C_1$] - Capacitor
% to[L, l=$L_1$] - Inductor
% to[D, l=$D_1$] - Diode
% to[vR] - Variable resistor
% to[vC] - Variable capacitor
%
% SOURCES:
% to[V, v=$V_s$] - Voltage source
% to[I, i=$I_s$] - Current source
% to[sV] - Sinusoidal voltage source
% to[battery] - Battery
%
% SEMICONDUCTORS:
% node[npn] (name) {} - NPN transistor
% node[pnp] (name) {} - PNP transistor
% node[nmos] (name) {} - N-channel MOSFET
% node[pmos] (name) {} - P-channel MOSFET
% node[op amp] (name) {} - Operational amplifier
%
% CONNECTIONS:
% to[short] - Wire/short circuit
% to[short, o-] - Wire starting with open circle
% to[short, -o] - Wire ending with open circle
% to[short, *-] - Wire starting with filled dot
% to[short, -*] - Wire ending with filled dot
%
% OTHER:
% node[ground] {} - Ground symbol
% node[vcc] {} - VCC symbol
% to[meter, l=$V$] - Voltmeter
% to[ammeter] - Ammeter
%
% VOLTAGE/CURRENT ANNOTATIONS:
% v=$V_x$ - Voltage drop label
% v^>=$V_x$ - Voltage with arrow pointing up
% v_<=$V_x$ - Voltage with arrow pointing down
% i=$I_x$ - Current label
%
% CUSTOMIZATION:
%
% 1. Change style to european:
% \begin{circuitikz}[european]
%
% 2. Scale the circuit:
% \begin{circuitikz}[scale=1.5, transform shape]
%
% 3. Change colors (using okabe-ito palette):
% to[R, l=$R_1$, color=okabe-blue]
%
% 4. Rotate components:
% to[R, l=$R_1$, rotate=90]
%
% 5. Add node at specific coordinate:
% \draw (2,3) node[npn] {};
%
% TYPICAL USAGE IN PAPER:
%
% \begin{figure}[h]
% \centering
% \includegraphics[width=0.6\columnwidth]{circuit.pdf}
% \caption{Schematic diagram of the measurement circuit.
% $R_1 = 1\,\mathrm{k}\Omega$, $C_1 = 10\,\mu\mathrm{F}$.}
% \label{fig:circuit}
% \end{figure}
%
% RESOURCES:
% - CircuitikZ manual: https://ctan.org/pkg/circuitikz
% - Component library: See CircuitikZ documentation Section 4
% CONSORT-Style Flowchart Template
% For methodology sections, participant flow diagrams, and study design
%
% Usage:
% 1. Copy this template
% 2. Modify node contents and participant numbers
% 3. Add/remove nodes as needed
% 4. Compile with: pdflatex flowchart_template.tex
% 5. Include in paper with: \input{flowchart.tex} or \includegraphics{flowchart.pdf}
\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz}
% Load shared styles
\input{tikz_styles.tex}
\begin{document}
\begin{tikzpicture}[consort]
% === Nodes ===
% Modify these to match your study
% Initial assessment
\node[flowbox] (assessed) {
Assessed for eligibility\\
(n=500)
};
% Exclusions
\node[flowbox, below=of assessed] (excluded) {
Excluded (n=150)
};
% Exclusion criteria (side annotation)
\node[infobox, right=of excluded] (reasons) {
\textbf{Exclusion criteria:}\\
Age $<$ 18 years: n=80\\
Declined participation: n=50\\
Other reasons: n=20
};
% Randomization
\node[flowbox, below=of excluded] (randomized) {
Randomized\\
(n=350)
};
% Treatment groups
\node[groupbox, below left=2cm and 1.5cm of randomized] (treatment) {
\textbf{Treatment Group}\\
Allocated to intervention\\
(n=175)
};
\node[groupbox, below right=2cm and 1.5cm of randomized] (control) {
\textbf{Control Group}\\
Allocated to control\\
(n=175)
};
% Follow-up (treatment)
\node[flowbox, below=of treatment] (followup-t) {
Completed follow-up\\
(n=168)
};
\node[infobox, right=of followup-t] (lost-t) {
Lost to follow-up: n=7\\
(withdrew: n=5, other: n=2)
};
% Follow-up (control)
\node[flowbox, below=of control] (followup-c) {
Completed follow-up\\
(n=170)
};
\node[infobox, left=of followup-c] (lost-c) {
Lost to follow-up: n=5\\
(withdrew: n=3, other: n=2)
};
% Analysis
\node[flowbox, below=2.5cm of randomized] (analyzed) {
Analyzed\\
(n=338)
};
% === Connections ===
% Arrows showing flow
% Main flow
\draw[arrow] (assessed) -- (excluded);
\draw[arrow] (excluded) -- (randomized);
% Randomization to groups
\draw[arrow] (randomized) -| (treatment);
\draw[arrow] (randomized) -| (control);
% Follow-up
\draw[arrow] (treatment) -- (followup-t);
\draw[arrow] (control) -- (followup-c);
% To analysis
\draw[arrow] (followup-t) |- (analyzed);
\draw[arrow] (followup-c) |- (analyzed);
% === Optional Elements ===
% Add panel label if part of multi-panel figure
% \node[font=\large\bfseries, above left=0.2cm of assessed] {A};
% Add study phase labels
% \node[annotation, left=2cm of assessed] {Enrollment};
% \node[annotation, left=2cm of randomized] {Allocation};
% \node[annotation, left=2cm of followup-t] {Follow-up};
% \node[annotation, left=2cm of analyzed] {Analysis};
\end{tikzpicture}
\end{document}
% === Customization Notes ===
%
% 1. Change participant numbers (n=X) to match your study
%
% 2. Add more exclusion criteria in the infobox:
% \node[infobox, right=of excluded] (reasons) {
% \textbf{Exclusion criteria:}\\
% Criterion 1: n=XX\\
% Criterion 2: n=YY\\
% Criterion 3: n=ZZ
% };
%
% 3. Add more treatment arms (for 3+ group studies):
% \node[groupbox, below=2cm of randomized] (group3) {
% \textbf{Group 3}\\
% Description\\
% (n=XX)
% };
% \draw[arrow] (randomized) -- (group3);
%
% 4. Add intervention details:
% \node[infobox, right=of treatment] (intervention) {
% Received intervention: n=XXX\\
% Did not receive: n=YY\\
% \quad Reason 1: n=Z
% };
%
% 5. Modify colors by changing node styles in tikz_styles.tex
%
% 6. To use in your paper:
% \begin{figure}[h]
% \centering
% \includegraphics[width=0.9\textwidth]{flowchart.pdf}
% \caption{Study participant flow diagram following CONSORT guidelines.
% Boxes show participant numbers (n) at each stage.}
% \label{fig:consort}
% \end{figure}
% Biological Pathway Template
% For signaling cascades, metabolic pathways, and molecular interactions
%
% Usage:
% 1. Copy and customize this template
% 2. Modify node positions and labels
% 3. Compile with: pdflatex pathway_template.tex
% 4. Include in paper with: \includegraphics{pathway.pdf}
\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz}
% Load shared styles
\input{tikz_styles.tex}
\begin{document}
\begin{tikzpicture}[pathway]
% === Example: MAPK Signaling Pathway ===
% Nodes (proteins, genes, etc.)
\node[protein] (ligand) at (0, 6) {Growth\\Factor};
\node[protein] (receptor) at (2, 6) {Receptor};
\node[protein] (ras) at (4, 6) {RAS};
\node[protein] (raf) at (6, 6) {RAF};
\node[protein] (mek) at (8, 6) {MEK};
\node[protein] (erk) at (10, 6) {ERK};
% Transcription factor (different style)
\node[protein, fill=okabe-purple!20] (tf) at (10, 4) {TF};
% Gene (italics, green)
\node[gene] (target) at (10, 2) {\textit{Target\\Gene}};
% === Interactions ===
% Activation arrows (main cascade)
\draw[activation-arrow] (ligand) -- (receptor);
\draw[activation-arrow] (receptor) -- node[above, font=\footnotesize] {activates} (ras);
\draw[activation-arrow] (ras) -- (raf);
\draw[activation-arrow] (raf) -- (mek);
\draw[activation-arrow] (mek) -- (erk);
\draw[activation-arrow] (erk) -- (tf);
\draw[activation-arrow] (tf) -- node[right, font=\footnotesize] {transcription} (target);
% === Optional: Add inhibitor ===
% Uncomment to show an inhibitor
% \node[protein, fill=okabe-vermillion!20] (inhibitor) at (5, 8) {Inhibitor};
% \draw[inhibit-arrow] (inhibitor) -- (raf);
% === Optional: Add feedback loop ===
% Uncomment to show negative feedback
% \draw[inhibit-arrow, bend right=45] (erk) to node[left, font=\footnotesize] {feedback} (ras);
% === Optional: Add complex formation ===
% Uncomment to show protein complex
% \node[complex] (complex) at (7, 4) {RAF-MEK\\Complex};
% \draw[arrow, dashed] (raf) -- (complex);
% \draw[arrow, dashed] (mek) -- (complex);
% === Optional: Add subcellular compartments ===
% Uncomment to show membrane, cytoplasm, nucleus
% % Membrane
% \draw[thick, okabe-dblue] (-0.5, 5) -- (11, 5) node[right, font=\small] {Plasma Membrane};
%
% % Nuclear membrane
% \draw[thick, okabe-green] (9.5, 3) rectangle (10.5, 1.5);
% \node[font=\small, okabe-green] at (10, 1.2) {Nucleus};
\end{tikzpicture}
\vspace{1cm}
% === Example 2: Simple Linear Pathway ===
\begin{tikzpicture}[pathway, node distance=2.5cm]
% Linear pathway with enzyme catalysis
\node[metabolite] (s1) {Substrate\\A};
\node[metabolite, right=of s1] (s2) {Product\\B};
\node[metabolite, right=of s2] (s3) {Product\\C};
% Enzymes (above)
\node[enzyme, above=1cm of s1] (e1) {Enzyme 1};
\node[enzyme, above=1cm of s2] (e2) {Enzyme 2};
% Catalysis arrows
\draw[arrow, dashed] (e1) -- (s1);
\draw[activation-arrow] (s1) -- node[above, font=\footnotesize] {catalyzed} (s2);
\draw[arrow, dashed] (e2) -- (s2);
\draw[activation-arrow] (s2) -- (s3);
\end{tikzpicture}
\end{document}
% === Customization Guide ===
%
% NODE TYPES (from tikz_styles.tex):
% protein - Rounded rectangle, blue
% gene - Rectangle, green, italic text
% metabolite - Circle, yellow
% enzyme - Ellipse, dark blue
% complex - Rounded rectangle, orange, thick border
%
% ARROW TYPES:
% activation-arrow - Solid arrow, activation
% inhibit-arrow - Blunt end, inhibition (red)
% arrow, dashed - Dashed arrow, indirect effect
%
% POSITIONING:
% \node[protein] (name) at (x, y) {Label};
% or
% \node[protein, right=2cm of other] (name) {Label};
% or
% \node[protein, below=of other] (name) {Label};
%
% COLORS (Okabe-Ito colorblind-safe):
% okabe-blue, okabe-orange, okabe-green, okabe-yellow
% okabe-dblue, okabe-vermillion, okabe-purple
%
% SUBCELLULAR COMPARTMENTS:
% Draw rectangles or regions to show membrane, cytoplasm, nucleus:
%
% % Nucleus boundary
% \node[rectangle, draw=okabe-green, thick, minimum width=3cm,
% minimum height=2cm] at (10, 3) {};
% \node[font=\small] at (10, 1) {Nucleus};
%
% % Membrane
% \draw[very thick, okabe-dblue] (0, 5) -- (12, 5);
% \node[right, font=\small] at (12, 5) {Membrane};
%
% PATHWAY CONVENTIONS:
% - Proteins: Regular font
% - Genes: Italic font (\textit{gene} or use gene style)
% - Phosphorylation: Add "P" in circle or use annotation
% \node[circle, draw, fill=white, inner sep=1pt, font=\tiny] at (x,y) {P};
% - Ubiquitination: "Ub" annotation
% - Degradation: Dashed arrow to a "trash" symbol or text
%
% TYPICAL USAGE IN PAPER:
%
% \begin{figure}[h]
% \centering
% \includegraphics[width=0.8\textwidth]{pathway.pdf}
% \caption{MAPK signaling pathway. Growth factor binding activates
% receptor, triggering cascade through RAS, RAF, MEK, ERK to
% transcription factor (TF) and target gene expression.
% Arrows indicate activation.}
% \label{fig:pathway}
% \end{figure}
%
% RESOURCES:
% - Systems Biology Graphical Notation (SBGN): https://sbgn.github.io/
% - Pathway Commons: https://www.pathwaycommons.org/
% - KEGG Pathways: https://www.genome.jp/kegg/pathway.html
% TikZ Styles for Scientific Diagrams
% Colorblind-safe Okabe-Ito palette and reusable node/arrow styles
%
% Usage:
% \input{tikz_styles.tex}
% \begin{tikzpicture}[consort] % Use predefined style set
% \node[flowbox] {My node};
% \end{tikzpicture}
% Load required libraries
\usetikzlibrary{shapes.geometric, arrows.meta, positioning, calc, fit, backgrounds}
% === Okabe-Ito Colorblind-Safe Palette ===
% These colors are distinguishable by all types of color blindness
\definecolor{okabe-orange}{RGB}{230, 159, 0} % #E69F00
\definecolor{okabe-blue}{RGB}{86, 180, 233} % #56B4E9
\definecolor{okabe-green}{RGB}{0, 158, 115} % #009E73
\definecolor{okabe-yellow}{RGB}{240, 228, 66} % #F0E442
\definecolor{okabe-dblue}{RGB}{0, 114, 178} % #0072B2
\definecolor{okabe-vermillion}{RGB}{213, 94, 0} % #D55E00
\definecolor{okabe-purple}{RGB}{204, 121, 167} % #CC79A7
\definecolor{okabe-black}{RGB}{0, 0, 0} % #000000
% Semantic color aliases
\colorlet{primary-color}{okabe-blue}
\colorlet{secondary-color}{okabe-orange}
\colorlet{accent-color}{okabe-green}
\colorlet{warning-color}{okabe-vermillion}
% === Arrow Styles ===
\tikzset{
% Standard arrow
arrow/.style={
-Stealth,
thick,
line width=1.2pt
},
% Thicker arrow
thick-arrow/.style={
-Stealth,
very thick,
line width=2pt
},
% Double arrow
double-arrow/.style={
Stealth-Stealth,
thick,
line width=1.2pt
},
% Dashed arrow
dashed-arrow/.style={
-Stealth,
thick,
dashed,
dash pattern=on 3pt off 2pt
},
% Inhibition arrow (blunt end)
inhibit-arrow/.style={
-|,
thick,
line width=1.5pt,
color=okabe-vermillion
},
% Activation arrow (for biological pathways)
activation-arrow/.style={
-Stealth,
thick,
line width=1.5pt,
color=okabe-dblue
},
}
% === Node Shapes for Flowcharts ===
\tikzset{
% Process box (rounded rectangle)
process/.style={
rectangle,
rounded corners=3pt,
draw=black,
thick,
fill=okabe-blue!20,
minimum width=3.5cm,
minimum height=1cm,
align=center,
font=\small,
text width=3cm
},
% Decision diamond
decision/.style={
diamond,
draw=black,
thick,
fill=okabe-orange!20,
minimum width=2.5cm,
minimum height=1.5cm,
aspect=2,
align=center,
font=\small,
text width=2cm
},
% Start/End terminal
terminal/.style={
rectangle,
rounded corners=10pt,
draw=black,
thick,
fill=okabe-green!20,
minimum width=3.5cm,
minimum height=1cm,
align=center,
font=\small,
text width=3cm
},
% Data/Input/Output
data/.style={
trapezium,
trapezium left angle=70,
trapezium right angle=110,
draw=black,
thick,
fill=okabe-yellow!20,
minimum width=3cm,
minimum height=1cm,
align=center,
font=\small,
text width=2.5cm
},
% Subprocess (double border)
subprocess/.style={
rectangle,
rounded corners=3pt,
draw=black,
thick,
double,
double distance=1pt,
fill=okabe-blue!20,
minimum width=3.5cm,
minimum height=1cm,
align=center,
font=\small,
text width=3cm
},
}
% === CONSORT-Style Flowchart Nodes ===
\tikzset{
% CONSORT flow box
flowbox/.style={
rectangle,
rounded corners=2pt,
draw=black,
thick,
fill=white,
minimum width=4cm,
minimum height=1.2cm,
align=center,
font=\small,
text width=3.5cm
},
% CONSORT info box (for exclusion criteria, etc.)
infobox/.style={
rectangle,
draw=black,
thin,
fill=okabe-yellow!15,
minimum width=3cm,
minimum height=0.8cm,
align=left,
font=\footnotesize,
text width=2.8cm
},
% CONSORT group allocation box
groupbox/.style={
rectangle,
rounded corners=2pt,
draw=black,
thick,
fill=okabe-blue!15,
minimum width=3.5cm,
minimum height=1cm,
align=center,
font=\small,
text width=3cm
},
}
% === Block Diagram Components ===
\tikzset{
% Component block
component/.style={
rectangle,
draw=black,
thick,
fill=okabe-blue!20,
minimum width=2.5cm,
minimum height=1.2cm,
align=center,
font=\small
},
% Subsystem (larger, different color)
subsystem/.style={
rectangle,
draw=black,
very thick,
fill=okabe-green!20,
minimum width=3.5cm,
minimum height=1.5cm,
align=center,
font=\small\bfseries
},
% Interface point
interface/.style={
circle,
draw=black,
thick,
fill=okabe-orange!30,
minimum size=0.8cm,
font=\small
},
% Data flow arrow
dataflow/.style={
-Stealth,
thick,
color=okabe-dblue
},
% Control signal arrow
control/.style={
-Stealth,
thick,
dashed,
color=okabe-vermillion
},
}
% === Biological Pathway Nodes ===
\tikzset{
% Protein
protein/.style={
rectangle,
rounded corners=5pt,
draw=black,
thick,
fill=okabe-blue!20,
minimum width=2cm,
minimum height=0.8cm,
align=center,
font=\small
},
% Gene
gene/.style={
rectangle,
draw=black,
thick,
fill=okabe-green!20,
minimum width=2cm,
minimum height=0.8cm,
align=center,
font=\small\itshape % Italics for genes
},
% Metabolite
metabolite/.style={
circle,
draw=black,
thick,
fill=okabe-yellow!20,
minimum size=1.5cm,
align=center,
font=\small
},
% Enzyme/Catalyst
enzyme/.style={
ellipse,
draw=black,
thick,
fill=okabe-dblue!20,
minimum width=2cm,
minimum height=1cm,
align=center,
font=\small
},
% Complex
complex/.style={
rectangle,
rounded corners=8pt,
draw=black,
very thick,
fill=okabe-orange!20,
minimum width=2.5cm,
minimum height=1cm,
align=center,
font=\small
},
}
% === Utility Styles ===
\tikzset{
% Connection dot (for junctions)
junction/.style={
circle,
fill=black,
inner sep=0pt,
minimum size=3pt
},
% Label node (transparent)
label/.style={
rectangle,
draw=none,
fill=none,
font=\small,
align=center
},
% Annotation (smaller text)
annotation/.style={
rectangle,
draw=none,
fill=none,
font=\footnotesize,
align=center,
text=gray
},
% Highlight box (for emphasis)
highlight/.style={
rectangle,
rounded corners=5pt,
draw=okabe-vermillion,
very thick,
fill=okabe-vermillion!10,
minimum width=2cm,
minimum height=1cm,
align=center
},
% Background box
background/.style={
rectangle,
rounded corners=5pt,
draw=gray,
thin,
fill=gray!10,
inner sep=10pt
},
}
% === Predefined Style Sets ===
% CONSORT flowchart style set
\tikzset{
consort/.style={
node distance=1.5cm and 2cm,
every node/.style={font=\small},
>=Stealth
}
}
% Block diagram style set
\tikzset{
blockdiagram/.style={
node distance=2cm and 3cm,
every node/.style={font=\small},
>=Stealth
}
}
% Biological pathway style set
\tikzset{
pathway/.style={
node distance=2cm and 2.5cm,
every node/.style={font=\small},
>=Stealth
}
}
% Simple flowchart style set
\tikzset{
simple/.style={
node distance=1.5cm,
every node/.style={font=\small},
>=Stealth
}
}
% === Helper Commands ===
% Panel label (A, B, C) for multi-panel figures
\newcommand{\panellabel}[2][]{
\node[font=\large\bfseries, #1] at (#2) {\textbf{#2}};
}
% Connection with label
\newcommand{\connlabel}[3][above]{
\draw[arrow] (#2) -- node[#1, font=\footnotesize] {#3} (#2);
}
% === Notes ===
%
% To use these styles in your diagram:
%
% 1. Include this file in your preamble or tikzpicture:
% \input{tikz_styles.tex}
%
% 2. Apply a style set to your tikzpicture:
% \begin{tikzpicture}[consort]
% ...
% \end{tikzpicture}
%
% 3. Use the predefined node styles:
% \node[flowbox] (n1) {My node};
% \node[process, below=of n1] (n2) {Process step};
% \draw[arrow] (n1) -- (n2);
%
% 4. Use the colorblind-safe colors:
% fill=okabe-blue!20, draw=okabe-dblue
%
% All colors and styles follow accessibility best practices for
% scientific publication.
Best Practices for Scientific Diagrams
Overview
This guide provides publication standards, accessibility guidelines, and best practices for creating high-quality scientific diagrams that meet journal requirements and communicate effectively to all readers.
Publication Standards
1. File Format Requirements
Vector Formats (Preferred)
- PDF: Universal acceptance, preserves quality, works with LaTeX
- Use for: Line drawings, flowcharts, block diagrams, circuit diagrams
- Advantages: Scalable, small file size, embeds fonts
- Standard for LaTeX workflows
- EPS (Encapsulated PostScript): Legacy format, still accepted
- Use for: Older publishing systems
- Compatible with most journals
- Can be converted from PDF
- SVG (Scalable Vector Graphics): Web-friendly, increasingly accepted
- Use for: Online publications, interactive figures
- Can be edited in vector graphics software
- Not all journals accept SVG
Raster Formats (When Necessary)
- TIFF: Professional standard for raster graphics
- Use for: Microscopy images, photographs combined with diagrams
- Minimum 300 DPI at final print size
- Lossless compression (LZW)
- PNG: Web-friendly, lossless compression
- Use for: Online supplementary materials, presentations
- Minimum 300 DPI for print
- Supports transparency
Never Use
- JPEG: Lossy compression creates artifacts in diagrams
- GIF: Limited colors, inappropriate for scientific figures
- BMP: Uncompressed, unnecessarily large files
2. Resolution Requirements
Vector Graphics
- Infinite resolution (scalable)
- Recommended: Always use vector when possible
Raster Graphics (when vector not possible)
- Publication quality: 300-600 DPI
- Line art: 600-1200 DPI
- Web/screen: 150 DPI acceptable
- Never: Below 300 DPI for print
Calculating DPI
DPI = pixels / (inches at final size)
Example:
Image size: 2400 × 1800 pixels
Final print size: 8 × 6 inches
DPI = 2400 / 8 = 300 ✓ (acceptable)3. Size and Dimensions
Journal-Specific Column Widths
- Nature: Single column 89 mm (3.5 in), Double 183 mm (7.2 in)
- Science: Single column 55 mm (2.17 in), Double 120 mm (4.72 in)
- Cell: Single column 85 mm (3.35 in), Double 178 mm (7 in)
- PLOS: Single column 83 mm (3.27 in), Double 173 mm (6.83 in)
- IEEE: Single column 3.5 in, Double 7.16 in
Best Practices
- Design at final print size (avoid scaling)
- Use journal templates when available
- Allow margins for cropping
- Test appearance at final size before submission
4. Typography Standards
Font Selection
- Recommended: Arial, Helvetica, Calibri (sans-serif)
- Acceptable: Times New Roman (serif) for mathematics-heavy
- Avoid: Decorative fonts, script fonts, system fonts that may not embed
Font Sizes (at final print size)
- Minimum: 6-7 pt (journal dependent)
- Axis labels: 8-9 pt
- Figure labels: 10-12 pt
- Panel labels (A, B, C): 10-14 pt, bold
- Main text: Should match manuscript body text
Text Clarity
- Use sentence case: "Time (seconds)" not "TIME (SECONDS)"
- Include units in parentheses: "Temperature (°C)"
- Spell out abbreviations in figure caption
- Avoid rotated text when possible (exception: y-axis labels)
5. Line Weights and Strokes
Recommended Line Widths
- Diagram outlines: 0.5-1.0 pt
- Connection lines/arrows: 1.0-2.0 pt
- Emphasis elements: 2.0-3.0 pt
- Minimum visible: 0.25 pt at final size
Consistency
- Use same line weight for similar elements
- Vary line weight to show hierarchy
- Avoid hairline rules (too thin to print reliably)
Accessibility and Colorblindness
1. Colorblind-Safe Palettes
Okabe-Ito Palette (Recommended) Most distinguishable by all types of colorblindness:
% RGB values
Orange: #E69F00 (230, 159, 0)
Sky Blue: #56B4E9 ( 86, 180, 233)
Green: #009E73 ( 0, 158, 115)
Yellow: #F0E442 (240, 228, 66)
Blue: #0072B2 ( 0, 114, 178)
Vermillion: #D55E00 (213, 94, 0)
Purple: #CC79A7 (204, 121, 167)
Black: #000000 ( 0, 0, 0)Alternative: ColorBrewer Palettes
- Qualitative: Set2, Paired, Dark2
- Sequential: Blues, Greens, Oranges (avoid Reds/Greens together)
- Diverging: RdBu (Red-Blue), PuOr (Purple-Orange)
Colors to Avoid Together
- Red-Green combinations (8% of males cannot distinguish)
- Blue-Purple combinations
- Yellow-Light green combinations
2. Redundant Encoding
Don't rely on color alone. Use multiple visual channels:
Shape + Color
Circle + Blue = Condition A
Square + Orange = Condition B
Triangle + Green = Condition CLine Style + Color
Solid + Blue = Treatment 1
Dashed + Orange = Treatment 2
Dotted + Green = ControlPattern Fill + Color
Solid fill + Blue = Group A
Diagonal stripes + Orange = Group B
Cross-hatch + Green = Group C3. Grayscale Compatibility
Test Requirement: All diagrams must be interpretable in grayscale
Strategies
- Use different shades (light, medium, dark)
- Add patterns or textures to filled areas
- Vary line styles (solid, dashed, dotted)
- Use labels directly on elements
- Include text annotations
Grayscale Test
# Convert to grayscale to test
convert diagram.pdf -colorspace gray diagram_gray.pdf4. Contrast Requirements
Minimum Contrast Ratios (WCAG Guidelines)
- Normal text: 4.5:1
- Large text (≥18pt): 3:1
- Graphical elements: 3:1
High Contrast Practices
- Dark text on light background (or vice versa)
- Avoid low-contrast color pairs (yellow on white, light gray on white)
- Use black or dark gray for critical text
- White text on dark backgrounds needs larger font size
5. Alternative Text and Descriptions
Figure Captions Must Include
- Description of diagram type
- All abbreviations spelled out
- Explanation of symbols and colors
- Sample sizes (n) where relevant
- Statistical annotations explained
- Reference to detailed methods if applicable
Example Caption "Participant flow diagram following CONSORT guidelines. Rectangles represent study stages, with participant numbers (n) shown. Exclusion criteria are listed beside each screening stage. Final analysis included n=350 participants across two groups."
Design Principles
1. Simplicity and Clarity
Occam's Razor for Diagrams
- Remove every element that doesn't add information
- Simplify complex relationships
- Break complex diagrams into multiple panels
- Use consistent layouts across related figures
Visual Hierarchy
- Most important elements: Largest, darkest, central
- Supporting elements: Smaller, lighter, peripheral
- Annotations: Minimal, clear labels only
2. Consistency
Within a Figure
- Same shape/color represents same concept
- Consistent arrow styles for same relationships
- Uniform spacing and alignment
- Matching font sizes for similar elements
Across Figures in a Paper
- Reuse color schemes
- Maintain consistent node styles
- Use same notation system
- Apply same layout principles
3. Professional Appearance
Alignment
- Use grids for node placement
- Align nodes horizontally or vertically
- Evenly space elements
- Center labels within shapes
White Space
- Don't overcrowd diagrams
- Leave breathing room around elements
- Use white space to group related items
- Margins around entire diagram
Polish
- No jagged lines or misaligned elements
- Smooth curves and precise angles
- Clean connection points
- No overlapping text
Common Pitfalls and Solutions
Pitfall 1: Overcomplicated Diagrams
Problem: Too much information in one diagram Solution:
- Split into multiple panels (A, B, C)
- Create overview + detailed diagrams
- Move details to supplementary figures
- Use hierarchical presentation
Pitfall 2: Inconsistent Styling
Problem: Different styles for same elements across figures Solution:
- Create and use style templates
- Define reusable TikZ styles
- Use the same color palette throughout
- Document your style choices
Pitfall 3: Poor Label Placement
Problem: Labels overlap elements or are hard to read Solution:
- Place labels outside shapes when possible
- Use leader lines for distant labels
- Rotate text only when necessary
- Ensure adequate contrast with background
Pitfall 4: Tiny Text
Problem: Text too small to read at final print size Solution:
- Design at final size from the start
- Test print at final size
- Minimum 7-8 pt font
- Simplify labels if space is limited
Pitfall 5: Ambiguous Arrows
Problem: Unclear what arrows represent or where they point Solution:
- Use different arrow styles for different meanings
- Add labels to arrows
- Include legend for arrow types
- Use anchor points for precise connections
Pitfall 6: Color Overuse
Problem: Too many colors, confusing or inaccessible Solution:
- Limit to 3-5 colors maximum
- Use color purposefully (categories, emphasis)
- Stick to colorblind-safe palette
- Provide redundant encoding
Quality Control Checklist
Before Submission
Technical Requirements
- [ ] Correct file format (PDF/EPS preferred for diagrams)
- [ ] Sufficient resolution (vector or 300+ DPI)
- [ ] Appropriate size (matches journal column width)
- [ ] Fonts embedded in PDF
- [ ] No compression artifacts
Accessibility
- [ ] Colorblind-safe palette used
- [ ] Works in grayscale (tested)
- [ ] Text minimum 7-8 pt at final size
- [ ] High contrast between elements
- [ ] Redundant encoding (not color alone)
Design Quality
- [ ] Elements aligned properly
- [ ] Consistent spacing and layout
- [ ] No overlapping text or elements
- [ ] Clear visual hierarchy
- [ ] Professional appearance
Content
- [ ] All elements labeled
- [ ] Abbreviations defined
- [ ] Units included where relevant
- [ ] Legend provided if needed
- [ ] Caption comprehensive
Consistency
- [ ] Matches other figures in style
- [ ] Same notation as text
- [ ] Consistent with journal guidelines
- [ ] Cross-references work
Journal-Specific Guidelines
Nature
Figure Requirements
- Size: 89 mm (single) or 183 mm (double column)
- Format: PDF, EPS, or high-res TIFF
- Fonts: Sans-serif preferred
- File size: <10 MB per file
- Resolution: 300 DPI minimum for raster
Style Notes
- Panel labels: lowercase bold (a, b, c)
- Simple, clean design
- Minimal colors
- Clear captions
Science
Figure Requirements
- Size: 55 mm (single) or 120 mm (double column)
- Format: PDF, EPS, TIFF, or JPEG (high quality)
- Resolution: 300 DPI for photos, 600 DPI for line art
- File size: <10 MB
- Fonts: 6-7 pt minimum
Style Notes
- Panel labels: capital bold (A, B, C)
- High contrast
- Readable at small size
Cell
Figure Requirements
- Size: 85 mm (single) or 178 mm (double column)
- Format: PDF preferred, TIFF, EPS acceptable
- Resolution: 300 DPI minimum
- Fonts: 8-10 pt for labels
- Line weight: 0.5 pt minimum
Style Notes
- Clean, professional
- Color or grayscale
- Panel labels capital (A, B, C)
IEEE
Figure Requirements
- Size: 3.5 in (single) or 7.16 in (double column)
- Format: PDF, EPS (vector preferred)
- Resolution: 600 DPI for line art, 300 DPI for halftone
- Fonts: 8-10 pt minimum
- Color: Grayscale in print, color in digital
Style Notes
- Follow IEEE Graphics Manual
- Standard symbols for circuits
- Technical precision
- Clear axis labels
Software-Specific Export Settings
LaTeX/TikZ to PDF
# Compile with pdflatex
pdflatex diagram.tex
# Or use standalone class for cropped PDF
\documentclass[tikz, border=2mm]{standalone}Python (Matplotlib) Export
import matplotlib.pyplot as plt
# Set publication quality
plt.rcParams['font.family'] = 'sans-serif'
plt.rcParams['font.sans-serif'] = ['Arial']
plt.rcParams['font.size'] = 8
plt.rcParams['pdf.fonttype'] = 42 # TrueType fonts in PDF
# Save with proper DPI and cropping
fig.savefig('diagram.pdf', dpi=300, bbox_inches='tight',
pad_inches=0.1, transparent=False)
fig.savefig('diagram.png', dpi=300, bbox_inches='tight')Schemdraw Export
import schemdraw
d = schemdraw.Drawing()
# ... build circuit ...
# Export
d.save('circuit.svg') # Vector
d.save('circuit.pdf') # Vector
d.save('circuit.png', dpi=300) # RasterInkscape Command Line
# PDF to high-res PNG
inkscape diagram.pdf --export-png=diagram.png --export-dpi=300
# SVG to PDF
inkscape diagram.svg --export-pdf=diagram.pdfVersion Control Best Practices
Keep Source Files
- Save original .tex, .py, or .svg files
- Use descriptive filenames with versions
- Document color palette and style choices
- Include README with regeneration instructions
Directory Structure
figures/
├── source/ # Editable source files
│ ├── diagram1.tex
│ ├── circuit.py
│ └── pathway.svg
├── generated/ # Auto-generated outputs
│ ├── diagram1.pdf
│ ├── circuit.pdf
│ └── pathway.pdf
└── final/ # Final submission versions
├── figure1.pdf
└── figure2.pdfGit Tracking
- Track source files (.tex, .py)
- Consider .gitignore for generated PDFs (large files)
- Use releases/tags for submission versions
- Document generation process in README
Testing and Validation
Pre-Submission Tests
Visual Tests 1. Print test: Print at final size, check readability 2. Grayscale test: Convert to grayscale, verify interpretability 3. Zoom test: View at 400% and 25% to check scalability 4. Screen test: View on different devices (phone, tablet, desktop)
Technical Tests 1. Font embedding: Check PDF properties 2. Resolution check: Verify DPI meets requirements 3. File size: Ensure under journal limits 4. Format compliance: Verify accepted format
Accessibility Tests 1. Colorblind simulation: Use tools like Color Oracle 2. Contrast checker: WCAG contrast ratio tools 3. Screen reader: Test alt text (for web figures)
Tools for Testing
Colorblind Simulation
- Color Oracle (free, cross-platform)
- Coblis (Color Blindness Simulator)
- Photoshop/GIMP colorblind preview modes
PDF Inspection
# Check PDF properties
pdfinfo diagram.pdf
# Check fonts
pdffonts diagram.pdf
# Check image resolution
identify -verbose diagram.pdfContrast Checking
- WebAIM Contrast Checker: https://webaim.org/resources/contrastchecker/
- Colorable: https://colorable.jxnblk.com/
Summary: Golden Rules
1. Vector first: Always use vector formats when possible 2. Design at final size: Avoid scaling after creation 3. Colorblind-safe palette: Use Okabe-Ito or similar 4. Test in grayscale: Diagrams must work without color 5. Minimum 7-8 pt text: At final print size 6. Consistent styling: Across all figures in paper 7. Keep it simple: Remove unnecessary elements 8. High contrast: Ensure readability 9. Align elements: Professional appearance matters 10. Comprehensive caption: Explain everything
Further Resources
- Nature Figure Preparation: https://www.nature.com/nature/for-authors/final-submission
- Science Figure Guidelines: https://www.science.org/content/page/instructions-preparing-initial-manuscript
- WCAG Accessibility Standards: https://www.w3.org/WAI/WCAG21/quickref/
- Color Universal Design (CUD): https://jfly.uni-koeln.de/color/
- ColorBrewer: https://colorbrewer2.org/
Following these best practices ensures your diagrams meet publication standards and effectively communicate to all readers, regardless of colorblindness or viewing conditions.
Scientific Diagram Types: Catalog and Examples
Overview
This guide catalogs common scientific diagram types used in research publications, with guidance on when to use each type, design considerations, and example implementations.
1. Methodology Flowcharts
Purpose
Visualize study design, participant flow, data processing pipelines, and experimental workflows.
When to Use
- Clinical trial participant flow (CONSORT diagrams)
- Systematic review selection process (PRISMA flowcharts)
- Data processing and analysis pipelines
- Experimental procedure workflows
- Algorithm or computational workflows
Key Elements
- Start/End nodes: Rounded rectangles (terminals)
- Process boxes: Rectangles for actions/steps
- Decision diamonds: For conditional branches
- Data boxes: Parallelograms for data inputs/outputs
- Arrows: Show sequence and flow direction
- Annotations: Numbers (n=X) for participant counts, exclusion criteria
Design Guidelines
- Flow top-to-bottom or left-to-right consistently
- Align nodes for professional appearance
- Include sample sizes at each step
- Use color sparingly (colorblind-safe palette)
- Keep text concise within nodes
- Add legends for symbols if needed
Example Use Cases
CONSORT Participant Flow
Assessed for eligibility (n=500)
↓
Excluded (n=150)
- Age < 18: n=80
- Declined: n=50
- Other: n=20
↓
Randomized (n=350)
↓
/ \
Treatment Control
(n=175) (n=175)Data Processing Pipeline
Raw Data → Quality Control → Normalization →
Statistical Analysis → Visualization → ReportSystematic Review Selection
Records identified → Duplicates removed →
Title/Abstract screening → Full-text review →
Studies included in meta-analysis2. Circuit Diagrams
Purpose
Illustrate electrical circuits, signal processing systems, and electronic schematics.
When to Use
- Electronics and electrical engineering papers
- Sensor system designs
- Signal processing workflows
- Measurement apparatus descriptions
- Control system diagrams
- Communication protocol implementations
Key Elements
- Voltage/current sources: Standard symbols
- Resistors, capacitors, inductors: Standard component symbols
- Integrated circuits: Rectangular blocks with pins
- Connections: Solid lines (wires), dots at junctions
- Ground symbols: Standard ground notation
- Labels: Component values, node voltages
Design Guidelines
- Follow IEEE/IEC standard symbols
- Wire connections: dots at junctions, no dots for crossovers
- Label all components with values and units
- Use consistent wire thickness
- Indicate signal direction with arrows when helpful
- Group functional blocks with dashed boxes
Example Use Cases
Simple RC Circuit
Voltage Source --- Resistor (R1) --- Capacitor (C1) --- Ground
|
Output nodeAmplifier Circuit
Input → Coupling Capacitor → Transistor → Load Resistor → Output
↑
Bias NetworkSignal Processing Block Diagram
Sensor → Amplifier → Filter → ADC → Microcontroller → DAC → Actuator3. Biological Diagrams
Purpose
Visualize cellular processes, molecular interactions, signaling pathways, and biological systems.
When to Use
- Signaling cascade illustrations
- Metabolic pathways
- Gene regulatory networks
- Protein-protein interactions
- Cellular processes and organelle functions
- Experimental procedures (cloning, assays)
Key Elements
- Proteins/genes: Rounded rectangles or ovals
- Small molecules: Circles or hexagons
- Activation arrows: Standard arrows (→)
- Inhibition: Blunt-ended lines (⊣)
- Transcription: Bent arrows
- Translocation: Dashed arrows across membranes
- Complex formation: Connecting lines
Design Guidelines
- Use standard Systems Biology Graphical Notation (SBGN) when possible
- Italicize gene names, regular font for proteins
- Show subcellular location (cytoplasm, nucleus, membrane)
- Use color to distinguish entity types (proteins, metabolites, genes)
- Include legends for arrow types
- Indicate time progression if relevant
Example Use Cases
MAPK Signaling Pathway
Growth Factor → Receptor → RAS → RAF → MEK → ERK →
Transcription Factor → Gene ExpressionMetabolic Pathway
Glucose → Glucose-6-P → Fructose-6-P → Fructose-1,6-BP →
(enzymes labeled at each arrow)Gene Regulation Network
┌─────────┐
│ Gene A │
└────┬────┘
↓ activates
┌─────────┐
│ Gene B │ ⊣ inhibits
└────┬────┘ ↓
↓ ┌─────────┐
┌─────────┐│ Gene C │
│ Protein │└─────────┘
└─────────┘Cell Signaling with Compartments
Membrane: [Receptor] → [G-protein]
↓
Cytoplasm: [2nd Messenger] → [Kinase Cascade]
↓
Nucleus: [Transcription Factor] → [Gene]4. Block Diagrams / System Architecture
Purpose
Show system components and their relationships, data flow, or hierarchical organization.
When to Use
- Software architecture
- Hardware system design
- Data flow diagrams
- Control systems
- Network architecture
- Experimental apparatus setup
- Conceptual frameworks
Key Elements
- Components: Rectangles with labels
- Subsystems: Grouped components in larger boxes
- Connections: Arrows showing data/signal/control flow
- Interfaces: Labeled connection points
- External entities: Distinct styling for external components
- Annotations: Data types, protocols, frequencies
Design Guidelines
- Organize hierarchically (high-level to low-level)
- Align blocks in rows or columns
- Use consistent block sizes for similar components
- Label all connections with data types or protocols
- Use colors to distinguish component types
- Include legends for line types (data, control, power)
Example Use Cases
Data Acquisition System
┌────────┐ ┌─────┐ ┌──────────────┐ ┌──────────┐
│ Sensor │ → │ ADC │ → │ Microcontrol.│ → │ Database │
└────────┘ └─────┘ └──────────────┘ └──────────┘
↓
┌─────────┐
│ Display │
└─────────┘Software Architecture (Three-Tier)
Presentation Layer: [Web UI] [Mobile App]
↓
Business Logic Layer: [API Server] [Auth Service]
↓
Data Layer: [Database] [Cache] [File Storage]Experimental Setup
[Light Source] → [Sample Chamber] → [Detector] → [Amplifier] →
[Data Acquisition] → [Computer]
↑ ↓
[Temperature Controller] ←───────────────── [Control Software]5. Process Flow Diagrams
Purpose
Illustrate sequential processes, decision logic, and workflows.
When to Use
- Manufacturing processes
- Quality control procedures
- Algorithm logic flow
- Decision trees
- Standard operating procedures (SOPs)
- Troubleshooting guides
Key Elements
- Start/End: Ovals or rounded rectangles
- Process: Rectangles
- Decision: Diamonds with yes/no branches
- Input/Output: Parallelograms
- Subprocess: Rectangle with double borders
- Arrows: Show flow direction
- Connectors: Circles for off-page or looping connections
Design Guidelines
- Single entry and exit points
- Clear decision branch labels (Yes/No, True/False)
- Avoid crossing lines when possible
- Use connectors for complex flows
- Number steps if sequence is critical
- Keep decision questions simple and binary
Example Use Cases
Quality Control Decision Tree
Start → Measure Parameter → [Within Spec?]
Yes ↓ No ↓
Accept Adjust Settings → Retest
↓ ↓
End ← [Pass?] → RejectAlgorithm Flowchart
Initialize Variables → Read Input → [Data Valid?]
No ↓ Yes ↓
Error Message Process Data
↓ ↓
End ←──── Output Results6. Network Diagrams
Purpose
Visualize relationships, connections, and network topology.
When to Use
- Computer networks
- Social networks
- Protein interaction networks
- Collaboration networks
- Communication pathways
- Graph-based data structures
Key Elements
- Nodes: Circles, rectangles, or custom shapes
- Edges: Lines connecting nodes
- Directed edges: Arrows showing direction
- Weighted edges: Line thickness or labels showing weights
- Node attributes: Color, size, or labels
- Clusters: Grouped nodes with boundaries
Design Guidelines
- Use layout algorithms for complex networks (force-directed, hierarchical)
- Size nodes by importance/degree if relevant
- Color-code node types or communities
- Show edge weights if important
- Minimize edge crossings
- Include network statistics if relevant (N nodes, M edges)
Example Use Cases
Communication Network
[Server]
/ | \
/ | \
[PC1] [PC2] [PC3]
\ | /
\ | /
[Router] ← [Internet]Protein Interaction Network
Nodes = proteins (colored by function)
Edges = experimentally verified interactions
Node size = expression levelCollaboration Network
Nodes = researchers
Edges = co-authorship
Node color = institution
Edge thickness = number of collaborations7. Timeline Diagrams
Purpose
Show events, phases, or changes over time.
When to Use
- Study design timelines
- Treatment schedules
- Historical progressions
- Project milestones
- Developmental stages
- Longitudinal study visits
Key Elements
- Time axis: Horizontal or vertical line
- Events: Markers, dots, or boxes at time points
- Durations: Bars or shaded regions
- Labels: Time points and event descriptions
- Phases: Color-coded segments
- Annotations: Additional information for events
Design Guidelines
- Use consistent time scale
- Clearly label all time points
- Use color to distinguish phases or types
- Include scale bar or time units
- Align events vertically for clarity
- Show overlapping events with vertical offset
Example Use Cases
Clinical Trial Timeline
Week: 0 4 8 12 16 20 24
|----|----|----|----|----|----|
Events: ● ● ● ● ● ●
Baseline Randomize Follow-ups End
|=========|=========|
Screening Treatment Follow-upExperimental Protocol
Day 0: Baseline measurements
↓
Days 1-7: Treatment A
↓
Day 8: Washout period
↓
Days 9-15: Treatment B
↓
Day 16: Final measurementsProject Gantt Chart Style
Task 1 |████████|
Task 2 |██████████|
Task 3 |████████|
0 2 4 6 8 10 (months)8. Hierarchical / Tree Diagrams
Purpose
Show hierarchical relationships, classifications, or organizational structure.
When to Use
- Organizational charts
- Taxonomic classifications
- Decision trees
- File system structures
- Phylogenetic trees
- Category hierarchies
Key Elements
- Root node: Top-level element
- Parent nodes: Intermediate levels
- Child nodes: Terminal elements
- Branches: Connections showing relationships
- Levels: Horizontal tiers of hierarchy
- Labels: Node names and attributes
Design Guidelines
- Organize top-to-bottom or left-to-right
- Align nodes at same hierarchical level
- Use consistent spacing between levels
- Size nodes by importance if relevant
- Keep branch angles consistent
- Label branch points if needed (e.g., evolutionary distances)
Example Use Cases
Organizational Structure
[Director]
/ \
/ \
[Manager A] [Manager B]
/ \ / \
[Staff] [Staff] [Staff] [Staff]Taxonomic Classification
Kingdom
↓
Phylum → [Multiple branches]
↓
Class
↓
Order
↓
Family → [Species groups]Decision Tree (Classification)
[Feature 1 > threshold?]
Yes / \ No
[Class A] [Feature 2 > threshold?]
Yes / \ No
[Class B] [Class C]9. Venn Diagrams / Set Relationships
Purpose
Show overlaps, intersections, and relationships between sets.
When to Use
- Shared features or categories
- Overlap analysis (gene lists, patient cohorts)
- Logical relationships
- Comparison of groups
- Inclusion/exclusion criteria
Key Elements
- Circles/ovals: Representing sets
- Overlaps: Intersecting regions
- Labels: Set names and sizes
- Numbers: Element counts in each region
- Color: Distinguish sets (use transparency for overlaps)
Design Guidelines
- Use 2-3 circles maximum for clarity
- Label all regions with counts
- Use colorblind-safe palette with transparency
- Ensure circles overlap proportionally if area matters
- Include total counts for each set
- Consider alternatives for >3 sets (UpSet plots)
Example Use Cases
Gene Expression Overlap
[Treatment A] [Treatment B]
200 150
\ 80 /
\───────/
Differentially expressed genesPatient Eligibility
[Age 18-65] ∩ [No contraindications] ∩ [Willing to participate]
= Eligible participants10. Heatmaps / Matrix Diagrams
Purpose
Visualize matrix data, correlations, or relationships between two categorical variables.
When to Use
- Correlation matrices
- Gene expression across samples
- Confusion matrices (classification)
- Pairwise comparisons
- Presence/absence data
- Intensity measurements across conditions
Key Elements
- Grid cells: Representing matrix values
- Color scale: Mapping values to colors
- Row/column labels: Categories or variables
- Color bar: Legend for color scale
- Annotations: Values within cells if readable
Design Guidelines
- Use perceptually uniform colormap (viridis, plasma)
- Include color bar with scale
- Order rows/columns meaningfully (hierarchical clustering)
- Annotate cells if space permits
- Use diverging colormap for centered data (correlations)
- Keep cell aspect ratio square
Example Use Cases
Correlation Matrix
Var1 Var2 Var3
Var1 [ 1.0 0.7 0.3 ]
Var2 [ 0.7 1.0 0.5 ]
Var3 [ 0.3 0.5 1.0 ]
Color scale: -1 (blue) to +1 (red)Gene Expression Heatmap
Rows = genes
Columns = samples/conditions
Color = expression level (low to high)
Hierarchical clustering on both axesDiagram Selection Guide
| Goal | Diagram Type | Best For |
|---|---|---|
| Show sequence | Flowchart, Timeline | Processes, events over time |
| Show components | Block diagram | System architecture |
| Show relationships | Network, Tree | Connections, hierarchies |
| Show overlap | Venn diagram | Set intersections |
| Show pathway | Biological diagram | Signaling, metabolism |
| Show circuit | Circuit diagram | Electronics, signals |
| Show data matrix | Heatmap | Correlations, patterns |
| Show decisions | Decision tree, Flowchart | Logic, classification |
| Show organization | Tree, Org chart | Hierarchies, structure |
Combining Diagram Types
Often, complex figures combine multiple diagram types:
Example: Experimental Design + Timeline
[Flowchart showing participant groups]
+
[Timeline showing intervention schedule]
+
[Measurement points indicated]Example: System Architecture + Data Flow
[Block diagram of components]
+
[Arrows showing data flow with annotations]
+
[Network diagram of connections]Common Mistakes to Avoid
1. Too much information: Simplify, create multiple figures if needed 2. Inconsistent styling: Use templates and style files 3. Poor alignment: Use grids and alignment tools 4. Unclear flow: Ensure arrows and sequence are obvious 5. Missing labels: Label all components, axes, and connections 6. Color overuse: Stick to colorblind-safe palette, use sparingly 7. Tiny text: Ensure readability at final print size 8. Crossing lines: Minimize or use bridges/gaps to indicate 9. No legend: Include legends for symbols, colors, line types 10. Inconsistent scale: Maintain proportions and spacing
Accessibility Checklist
- [ ] Colorblind-safe palette (Okabe-Ito)
- [ ] Works in grayscale
- [ ] Text minimum 7-8 pt at final size
- [ ] High contrast between elements
- [ ] Redundant encoding (not just color)
- [ ] Clear, descriptive labels
- [ ] Comprehensive figure caption
- [ ] Logical reading order
Further Reading
- CONSORT Flow Diagram: http://www.consort-statement.org/consort-statement/flow-diagram
- PRISMA Flow Diagram: http://prisma-statement.org/
- Systems Biology Graphical Notation (SBGN): https://sbgn.github.io/
- IEEE Standard Graphic Symbols for Electrical and Electronics Diagrams: IEEE Std 315
- Graph Visualization: Graphviz documentation
Use this catalog to select the appropriate diagram type for your scientific communication needs, then refer to the TikZ guide and templates for implementation.