Menu

Tables in Python & LaTeX

Publication-Ready Data Tables in Python & LaTeX

Turn raw data into professional summary tables in seconds. Plotivy computes the statistics, styles the table, and exports clean LaTeX booktabs, runnable Python, Markdown, HTML, and CSV - so your tables look as good as your figures.

Stop Hand-Formatting Tables

Manually copying numbers into Word, re-rounding them, and re-aligning columns is slow and error-prone - and the result rarely matches the journal's style. A code-generated table is reproducible, instantly re-runnable when your data changes, and renders identically every time.

Reproducible

Re-run the same code on new data and the table updates automatically.

Journal-ready

Booktabs LaTeX and 300 DPI matplotlib output meet publisher standards.

Consistent

Rounding, alignment, and styling are applied uniformly to every cell.

Live Code Lab: Summary Statistics Table

This Python code computes group means, standard deviations, ranges, and 95% confidence intervals, then renders a styled table figure with a shaded header, alternating rows, and bold labels. Edit anything and see the result instantly.

Customization tips

  • Add statistics: append a column to headers and compute it in the loop (e.g. median, SEM, IQR).
  • Recolor the header: change HEADER_BG to match your brand or journal palette.
  • Tighter rounding: swap :.2f for :.3g for significant-figure formatting.

The Same Table in LaTeX (booktabs)

Writing your manuscript in LaTeX? Plotivy exports the exact same table as clean booktabs code - the style used by Nature, Science, and most journals. Copy, paste, compile.

LaTeX
% Add \usepackage{booktabs} to your preamble
\begin{table}[htbp]
  \centering
  \caption{Group summary statistics.}
  \label{tab:summary}
  \begin{tabular}{lrrrrr}
    \toprule
    \textbf{Group} & \textbf{N} & \textbf{Mean} & \textbf{SD} & \textbf{Min} & \textbf{Max} \\
    \midrule
    Control     & 40 & 50.12 & 8.04 & 33.20 & 67.40 \\
    Treatment A & 40 & 58.33 & 9.87 & 39.10 & 80.05 \\
    Treatment B & 40 & 71.02 & 7.13 & 55.40 & 86.20 \\
    \bottomrule
  \end{tabular}
\end{table}

Why booktabs wins

  • Three horizontal rules only - no busy vertical lines.
  • Built-in \caption and \label for cross-referencing.
  • Right-aligned numeric columns for clean decimal stacking.
  • A ruled-grid fallback is available when a package-free table is required.

Group Comparison Tables (“Table 1”)

The most common table in empirical papers: variables as rows, groups as columns, cells as Mean ± SD (or Median [IQR]), and a p-value column. Continuous and categorical variables mix freely - categoricals render as n (%) with a chi-squared or Fisher's exact test. Plotivy picks the right test automatically - t-test or ANOVA when the data look normal, Mann-Whitney or Kruskal-Wallis when they do not - and notes which test it used.

VariablePlacebo (n=25)Low dose (n=25)High dose (n=25)p-value
Systolic BP (mmHg)119.9 ± 11.0116.1 ± 8.1100.6 ± 8.0<0.001
Diastolic BP (mmHg)80.2 ± 6.178.4 ± 5.772.1 ± 5.9<0.001
Age (years)54.3 ± 9.855.1 ± 10.253.7 ± 9.10.871
Sex: Female, n (%)13 (52.0%)14 (56.0%)15 (60.0%)0.842

Values are mean ± SD or n (%); p-values from one-way ANOVA and chi-squared tests. Export the same table as booktabs LaTeX, matplotlib, Word, Markdown, HTML, or CSV.

Which Export Format Should You Use?

FormatBest forOutput
LaTeX (booktabs)Manuscripts & thesesJournal-standard typeset table
Python (matplotlib)Slides, posters, figures300 DPI table image (chart.png)
Word (RTF)Word documents & reportsEditable table that opens in Word
MarkdownGitHub, docs, notebooksPlain-text pipe table
HTMLWeb pages & reportsStyled, self-contained table
CSVExcel, re-analysisRaw comma-separated values

Tip: export LaTeX for the manuscript and the matplotlib version for your slides - both come from the same source data, so they always agree.

Bonus: Color-Graded Tables

Shade each cell by its value to turn a dense matrix into an at-a-glance visual - perfect for correlation matrices, scorecards, and conditional formatting. Edit the data and the colors update live.

Why Researchers Build Tables with Plotivy

Statistics computed for you

Pick columns and statistics - mean, SD, SEM, CV%, quartiles, IQR, range, skewness, and kurtosis - and Plotivy builds the table, with optional grouping for per-condition summaries.

Six export formats

LaTeX booktabs, runnable Python, Word (RTF), Markdown, HTML, and CSV - copy or download any of them in a single click.

Publication styling

Shaded headers, alternating rows, bold index columns, and 300 DPI output that drops straight into a paper or slide.

No setup required

Everything runs in the browser. No LaTeX install, no matplotlib config - just upload data and export.

Frequently Asked Questions

How do I create a publication-ready table in Python?

Upload your data to Plotivy, open the Summary Statistics Table tool, choose the columns and statistics you need, then export. Plotivy generates runnable matplotlib code that renders a styled table figure at 300 DPI - with a shaded header, alternating row colors, and a bold index column - ready to drop into a paper or slide deck.

Can I export tables to LaTeX?

Yes. Every summary table can be copied as LaTeX in the journal-standard booktabs style (toprule, midrule, bottomrule) or as a classic ruled grid. The output includes a caption and label so you can reference it with \ref{} immediately. You only need \usepackage{booktabs} in your preamble.

What is the booktabs style and why use it?

Booktabs is the de-facto standard for professional LaTeX tables. It uses three horizontal rules (top, middle, bottom) and avoids vertical lines, producing the clean, uncluttered look you see in Nature, Science, and most peer-reviewed journals. Plotivy uses booktabs by default.

Which export formats are supported?

Plotivy exports summary tables as LaTeX (booktabs or grid), runnable Python (matplotlib), Word (RTF), Markdown, HTML, and CSV. Copy any format to the clipboard in one click, or download the Word and CSV files directly.

Can I export tables to Microsoft Word?

Yes. Download the table as an RTF file and open it in Microsoft Word (or LibreOffice/Pages) - it imports as a real, editable table with a bold header row, not a flat image. This works without installing anything and keeps your formatting intact.

Can Plotivy make a Table 1 with p-values?

Yes. Turn on comparison mode and pick a grouping column to get the classic 'Table 1' layout: variables as rows, groups as columns with their sample sizes, cells as Mean ± SD or Median [IQR], and a p-value column. Plotivy chooses the test automatically - Welch's t-test or one-way ANOVA when the groups look normal, Mann-Whitney U or Kruskal-Wallis otherwise - or you can force a parametric or non-parametric test. The test used is recorded in the table caption.

Can I make color-graded or conditionally formatted tables?

Yes. Using the matplotlib export you can shade each cell by its value - ideal for correlation matrices, heatmap tables, and scorecards. The live editor on this page includes a ready-to-edit color-graded table example.

Do I need to know Python or LaTeX to use it?

No. You can generate and export tables entirely through the point-and-click interface. The Python and LaTeX code is provided so you can reproduce, version-control, or fine-tune the output if you want to - but it is optional.

Chart gallery

Pair Your Tables with Figures

The same data, visualized

Browse all chart types →
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
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
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)

Make Your Next Table in 30 Seconds

Upload your data and export a publication-ready table in Python, LaTeX, or four other formats - no formatting by hand.