Menu

Productivity6 min read

The Efficient Scientist's Guide to Beautiful Figures

By Francesco Villasmunta
The Efficient Scientist's Guide to Beautiful Figures

You are not paid by the hour for figure formatting. Here are five strategies to cut your figure-making time by 80% while actually improving quality.

Strategies

0.Live Code: Template-Based Figure

1.The 80/20 Rule of Figures

2.Build a Personal Style Template

3.Use AI to Skip the Boilerplate

4.Batch Processing Workflow

5.Color Palette Shortcuts

0. Live Code: Template-Based Figure

Define your style once, then every figure you create automatically uses the right fonts, colors, and formatting. This 3-panel figure took 30 seconds to customize.

Live Code Editor
Code EditorPython
Loading editor...
Live Preview

Preparing preview

Running once automatically on first load

Learn by Experimenting

This is a safe playground for learning! Try changing:

  • Colors: Modify color values to see different palettes
  • Numbers: Adjust sizes, positions, or data ranges
  • Labels: Update titles, axis names, or legends

Edit the code, run it, then open the full data visualization tool to continue with your own dataset.

1. The 80/20 Rule of Figures

80% of your figure time goes to formatting, not analysis. The fix is simple: separate style from content. Define your formatting once, then apply to every figure.

2 hours

Manually formatting each figure

Waste
10 min

Writing a reusable style template

Investment
30 sec

Applying template to new data

Payoff

2. Build a Personal Style Template

Try it

Try it now: turn this method into your next figure

Apply the same approach to your own dataset and generate clean, publication-ready code and plots in minutes.

Open in Plotivy Analyze

Newsletter

Get a weekly Python plotting tip

One concise tip each week for cleaner, faster scientific figures. Built for researchers who publish.

No spam. Unsubscribe anytime.

lab_style.py (save once, import everywhere)

# lab_style.py - Import this at the top of every plotting script
import matplotlib
LAB_STYLE = {
    "font.family": "Arial",
    "font.size": 8,
    "axes.spines.top": False,
    "axes.spines.right": False,
    "axes.linewidth": 0.8,
    "figure.dpi": 150,
    "savefig.dpi": 600,
    "savefig.bbox": "tight",
}
PALETTE = ["#0072B2", "#E69F00", "#CC79A7", "#56B4E9", "#009E73"]

def apply():
    matplotlib.rcParams.update(LAB_STYLE)

3. Use AI to Skip the Boilerplate

Instead of writing plotting code from scratch, describe what you want. AI tools generate the code, you edit the result.

Example Prompt

"Create a 2-panel figure: panel A is a grouped bar chart with SEM error bars comparing 3 treatment groups, panel B is a Kaplan-Meier survival curve. Use Arial 8pt, Nature single-column width."

4. Batch Processing Workflow

Process all CSV files in a folder

import glob
import pandas as pd

for csv_file in glob.glob("data/*.csv"):
    df = pd.read_csv(csv_file)
    fig, ax = plt.subplots(figsize=(3.5, 2.8))
    # ... your standard plot code here ...
    name = csv_file.replace("data/", "").replace(".csv", "")
    fig.savefig(f"figures/{name}.tiff", dpi=600)
    plt.close(fig)
    print(f"Generated: figures/{name}.tiff")

Pro Tip

Close figures with plt.close(fig) in loops to prevent memory leaks. Matplotlib keeps all figures in memory until you explicitly close them.

5. Color Palette Shortcuts

Wong Palette

#000 #E69F00 #56B4E9 #009E73 #F0E442 #0072B2 #D55E00 #CC79A7

Colorblind-safe. 8 maximally distinct colors.

Viridis

matplotlib.cm.viridis

Perceptually uniform. Best for sequential data (heatmaps).

Tab10

matplotlib default

Good for up to 10 qualitative categories.

Custom Lab

#0072B2 #E69F00 #CC79A7 #56B4E9

Define 4-5 color-blind safe colors and reuse across all papers.

Chart gallery

Chart Templates to Start From

Skip the blank canvas. Start from a template close to what you need.

Browse all chart types →
Bar chart comparing average scores across 5 groups with error bars
Comparisonmatplotlib, seaborn
From the chart galleryComparing performance across categories

Bar Chart

Compares categorical data using rectangular bars with heights proportional to values.

Sample code / prompt

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats

# Generate performance scores for 5 treatment groups
np.random.seed(42)
groups = ['Control', 'Treatment A', 'Treatment B', 'Treatment C', 'Treatment D']
n_samples = 30
Scatter plot of height vs weight colored by gender with regression line
Statisticalmatplotlib, seaborn
From the chart galleryCorrelation analysis between metrics

Scatterplot

Displays values for two variables as points on a Cartesian coordinate system.

Sample code / prompt

import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import pandas as pd

# Generate sample data
np.random.seed(42)
n_samples = 200
height = np.random.normal(170, 8, n_samples)
weight = height * 0.6 + np.random.normal(0, 8, n_samples) - 50
Multi-line graph showing temperature trends for 3 cities over a year
Time Seriesmatplotlib, seaborn
From the chart galleryStock price tracking over time

Line Graph

Displays data points connected by straight line segments to show trends over time.

Sample code / prompt

import matplotlib.pyplot as plt
import numpy as np

# Generate temperature data for 3 major US cities over 12 months
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
nyc = [30, 32, 40, 52, 65, 75, 82, 81, 74, 63, 50, 38]
miami = [65, 66, 70, 76, 82, 87, 90, 90, 87, 80, 72, 66]
chicago = [25, 27, 35, 48, 62, 72, 80, 79, 71, 60, 45, 32]

# Create figure with enhanced styling
Correlation heatmap with diverging color scale and coefficient annotations
Statisticalseaborn, matplotlib
From the chart galleryCorrelation analysis between variables

Heatmap

Represents data values as colors in a two-dimensional matrix format.

Sample code / prompt

import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np

# Create correlation matrix for financial metrics
metrics = ['Revenue', 'Profit', 'Expenses', 'ROI', 'Customers', 'AOV', 'Marketing', 'Employees']
correlation_data = np.array([
    [1.00, 0.85, -0.45, 0.72, 0.88, 0.65, 0.72, 0.55],
    [0.85, 1.00, -0.78, 0.92, 0.75, 0.58, 0.63, 0.48],
Box and whisker plot comparing gene expression across 4 genotypes with significance brackets
Distributionseaborn, matplotlib
From the chart galleryComparing experimental groups in scientific research

Box and Whisker Plot

Displays data distribution using quartiles, median, and outliers in a standardized format.

Sample code / prompt

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats

# Generate gene expression data for 4 genotypes
np.random.seed(42)
genotypes = ['WT', 'KO1', 'KO2', 'Mutant']
n_per_group = 20
Violin plot comparing score distributions across 3 groups with inner box plots
Distributionseaborn, matplotlib
From the chart galleryComparing treatment effects across groups

Violin Plot

Combines box plots with kernel density to show distribution shape across groups.

Sample code / prompt

import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from scipy.stats import f_oneway

# Generate exam score data for 3 groups
np.random.seed(42)
control = np.random.normal(72, 12, 50)
treatment_a = np.random.normal(78, 10, 50)

The Fastest Way to Beautiful Figures

Upload data, describe the figure, edit the code. Publication-ready in under a minute.

Tags:#productivity#workflow#templates#visualization#time-saving#matplotlib

Found this helpful? Share it with your network.

FV
Francesco Villasmunta

Experimental Physicist & Photonics Researcher

Hands-on experience in silicon photonics, semiconductor fabrication (DRIE/ICP-RIE), optical simulation, and data-driven analysis. Built Plotivy to help researchers focus on discoveries instead of data struggles.

More about the author

Visualize your own data

Apply the techniques from this article to your own datasets. Upload CSV, Excel, or paste data directly.

Start Analyzing - Free