Scientific Schematics

Automate and integrate Scientific Schematics for precise technical diagram creation

Scientific Schematics is a community skill for creating technical diagrams for scientific publications, covering molecular structures, circuit diagrams, experimental setups, pathway maps, and data flow visualizations for research communication.

What Is This?

Overview

Scientific Schematics provides tools for generating publication-quality technical diagrams programmatically. It covers molecular structures that render chemical compounds and protein structures as vector graphics, circuit diagrams that draw electronic and biological circuit representations with standard symbols, experimental setups that illustrate laboratory workflows and instrument configurations, pathway maps that visualize biological and chemical reaction networks with directed connections, and data flow visualizations that diagram computational pipelines and analysis workflows. The skill helps researchers create clear technical illustrations.

Who Should Use This

This skill serves researchers preparing figures for journal submissions, students creating diagrams for thesis presentations, and science communicators illustrating technical concepts for broader audiences.

Why Use It?

Problems It Solves

Creating scientific diagrams manually in drawing tools is time-consuming and produces inconsistent styles. Reproducing diagrams when data or experimental designs change requires redrawing from scratch. Standard drawing tools lack domain-specific symbols for molecules, circuits, and biological pathways. Publication requirements demand vector formats and specific resolution standards that screenshot-based approaches cannot meet.

Core Highlights

Diagram generator creates publication-quality technical figures programmatically. Symbol library provides domain-specific shapes for scientific contexts. Layout engine arranges components with automatic spacing and alignment. Export system produces vector formats meeting journal requirements.

How to Use It?

Basic Usage

import matplotlib.pyplot\
  as plt
import matplotlib.patches\
  as patches

def experiment_diagram(
  steps: list[dict],
  output: str
):
  fig, ax = plt.subplots(
    figsize=(10, 3))
  ax.set_xlim(0, 10)
  ax.set_ylim(0, 2)
  ax.axis('off')

  n = len(steps)
  width = 8 / n
  for i, step in\
    enumerate(steps):
    x = 1 + i * width
    rect = patches\
      .FancyBboxPatch(
        (x, 0.5),
        width * 0.8, 1,
        boxstyle=
          'round,pad=0.1',
        facecolor=step\
          .get('color',
            '#e3f2fd'),
        edgecolor='#333')
    ax.add_patch(rect)
    ax.text(
      x + width * 0.4,
      1.0,
      step['label'],
      ha='center',
      va='center',
      fontsize=9)
    if i < n - 1:
      ax.annotate(
        '', xy=(
          x + width * 0.85,
          1),
        xytext=(
          x + width, 1),
        arrowprops=dict(
          arrowstyle='->'))

  fig.savefig(
    output, dpi=300,
    bbox_inches='tight')
  plt.close(fig)

experiment_diagram([
  {'label': 'Sample',
   'color': '#e8f5e9'},
  {'label': 'Extract',
   'color': '#e3f2fd'},
  {'label': 'Sequence',
   'color': '#fff3e0'},
  {'label': 'Analyze',
   'color': '#fce4ec'}],
  'workflow.png')

Real-World Examples

import matplotlib.pyplot\
  as plt
import networkx as nx

class PathwayDiagram:
  def __init__(self):
    self.G = nx.DiGraph()
    self.styles = {}

  def add_node(
    self,
    name: str,
    node_type: str =
      'protein'
  ):
    self.G.add_node(name)
    self.styles[name] = (
      node_type)

  def add_edge(
    self,
    src: str,
    tgt: str,
    label: str = ''
  ):
    self.G.add_edge(
      src, tgt,
      label=label)

  def render(
    self,
    output: str
  ):
    colors = {
      'protein': '#bbdefb',
      'gene': '#c8e6c9',
      'metabolite':
        '#ffe0b2'}
    node_colors = [
      colors.get(
        self.styles[n],
        '#eee')
      for n in self.G]

    fig, ax = plt.subplots(
      figsize=(8, 6))
    pos = nx.spring_layout(
      self.G, seed=42)
    nx.draw(self.G,
      pos, ax=ax,
      node_color=
        node_colors,
      with_labels=True,
      node_size=2000,
      font_size=8,
      arrows=True)
    fig.savefig(
      output, dpi=300)
    plt.close(fig)

pw = PathwayDiagram()
pw.add_node('EGFR',
  'protein')
pw.add_node('RAS',
  'protein')
pw.add_node('MAPK',
  'protein')
pw.add_edge(
  'EGFR', 'RAS')
pw.add_edge(
  'RAS', 'MAPK')
pw.render('pathway.png')

Advanced Tips

Use vector output formats like SVG or PDF for publication figures to maintain quality at any scale. Define a consistent color palette across all figures in a paper. Automate diagram generation from data files to ensure figures update when underlying data changes.

When to Use It?

Use Cases

Create an experimental workflow diagram showing sequential processing steps. Generate a signaling pathway map with directed connections between proteins. Build a data analysis pipeline diagram for a methods section.

Related Topics

Scientific figures, technical diagrams, data visualization, matplotlib, publication graphics, and research communication.

Important Notes

Requirements

Python visualization libraries such as matplotlib and networkx for diagram rendering. Domain knowledge for correct symbol usage and labeling conventions. Journal figure specifications for resolution, format, and size requirements.

Usage Recommendations

Do: export figures in vector formats for journal submissions to maintain resolution independence. Use consistent styling across all figures in a manuscript. Label all components clearly with standard scientific nomenclature.

Don't: use raster screenshots when vector diagrams would provide better quality. Apply decorative effects that obscure scientific content for visual appeal. Create overly complex diagrams that require extensive legends to interpret.

Limitations

Programmatic diagram generation requires coding that may be slower than manual drawing for simple one-off figures. Automatic layout algorithms may not produce optimal arrangements for complex diagrams. Some specialized scientific symbols may need custom implementation beyond standard libraries.