How to Make a Parallel Coordinates Plot in StatFas, SPSS, R, Python and MATLAB
This tutorial draws the same parallel coordinates plot, with an ANOVA for each variable, in five tools. The example table has one row per patient, a group column (Placebo, Low dose, High dose) and six clinical variables.
What you will make
A publication-ready parallel coordinates plot with the compulsory checks and statistics that go with it, produced in five ways. The StatFas generator needs no coding and no account to run; the code versions are for readers who want a scripted workflow. For the theory behind the plot and how to read it, see the full guide.
Example data
| Column | Contents |
|---|---|
group | Placebo, Low dose or High dose |
sbp, dbp, heart_rate | Blood pressure and pulse |
cholesterol, glucose, bmi | Laboratory and body measures |
Save your table as parallel.csv with a header row. The StatFas generator has a Load Example Data button with simulated data, so you can follow along without your own file. The example data are invented for illustration and are not real findings.
Method 1: StatFas (free, no coding)
- Open the Parallel Coordinates Plot Generator and click Load Example Data, or paste/upload your own file.
- Choose the variables and the group column, set Axis scaling (standardized is a good default) and Axis order (by η² puts the most different variables together).
- Run the analysis. Read the ANOVA table (F, df, p, Holm-adjusted p, η²), the group means table and the figure interpretation.
- Change colors, line widths, fonts and sizes in the figure style panel.
- Log in (free) to download the figure (PNG or SVG), tables (CSV) and a Word report with APA7 interpretations.
Method 2: SPSS
SPSS has no parallel coordinates chart, so the figure has to be drawn elsewhere. You can run the per-variable ANOVAs in SPSS with Analyze > Compare Means > One-Way ANOVA and a Bonferroni or Tukey post hoc test, then draw the plot in R, Python or StatFas. Syntax for the tests:
ONEWAY sbp dbp heart_rate cholesterol glucose bmi BY group
/STATISTICS DESCRIPTIVES HOMOGENEITY
/POSTHOC=TUKEY ALPHA(0.05).SPSS does not apply a family-wise correction across the six variables. Adjust the p-values yourself (for example Holm) or use StatFas, which reports them.
Method 3: R
library(GGally); library(ggplot2)
df <- read.csv("parallel.csv"); df$group <- factor(df$group)
ggparcoord(df, columns = 2:7, groupColumn = 1, scale = "std", alphaLines = 0.35) +
theme_classic() + labs(x = NULL, y = "z-score")
ggsave("parallel.png", width = 7, height = 4.5, dpi = 300)
res <- do.call(rbind, lapply(names(df)[-1], function(v) {
a <- summary(aov(df[[v]] ~ df$group))[[1]]
data.frame(variable = v, F = a$`F value`[1], df1 = a$Df[1], df2 = a$Df[2],
p = a$`Pr(>F)`[1], eta2 = a$`Sum Sq`[1] / sum(a$`Sum Sq`))
}))
res$p_holm <- p.adjust(res$p, method = "holm")
resPackages: install.packages(c("GGally","ggplot2")). scale = "std" gives z-scores; use "uniminmax" for min–max scaling.
Method 4: Python
import pandas as pd, matplotlib.pyplot as plt
from pandas.plotting import parallel_coordinates
from scipy import stats
df = pd.read_csv("parallel.csv") # group + 6 numeric variables
vars_ = [c for c in df.columns if c != "group"]
z = df.copy(); z[vars_] = (df[vars_] - df[vars_].mean()) / df[vars_].std() # z-score axes
ax = parallel_coordinates(z, "group", colormap="Set1", alpha=0.35)
ax.set_ylabel("z-score"); plt.xticks(rotation=30); plt.tight_layout(); plt.savefig("parallel.png", dpi=300)
# One-way ANOVA per variable, Holm-adjusted, with eta squared
rows = []
for v in vars_:
groups = [d[v].values for _, d in df.groupby("group")]
F, p = stats.f_oneway(*groups)
k, N = len(groups), len(df); eta2 = F * (k - 1) / (F * (k - 1) + N - k)
rows.append((v, F, k - 1, N - k, p, eta2))
res = pd.DataFrame(rows, columns=["variable", "F", "df1", "df2", "p", "eta2"])
order = res["p"].argsort().values; m = len(res); adj = [0] * m; run = 0
for rank, i in enumerate(order):
run = max(run, min(1, (m - rank) * res["p"].iloc[i])); adj[i] = run # Holm step-down
res["p_holm"] = adj
print(res.round(4))Requires pandas, scipy and matplotlib. The loop applies the Holm step-down adjustment by hand; statsmodels.stats.multitest.multipletests(p, method="holm") does the same.
Method 5: MATLAB, OriginPro, Excel and others
MATLAB
T = readtable("parallel.csv"); X = zscore(T{:, 2:end});
parallelcoords(X, "Group", T.group, "Labels", T.Properties.VariableNames(2:end));
[p, tbl] = anova1(T.cholesterol, T.group);OriginPro / Excel
OriginPro has a parallel coordinates plot among its specialized plot types (menu names vary by version). Excel has no native parallel coordinates chart; a line chart with one series per case on pre-scaled columns gives a rough equivalent.
Which method should you choose?
| Tool | Cost and skill | Plot | Statistical checks | Report-ready output |
|---|---|---|---|---|
| StatFas | Free, in the browser | Yes (group means, ordering) | ANOVA, Holm, η² | Yes, to Word |
| SPSS | Licence needed | No | ANOVA yes; no multi-variable correction | Tables only |
| R | Free, coding | Yes (GGally) | Manual loop | Manual |
| Python | Free, coding | Yes (pandas) | Manual loop | Manual |
Choose StatFas for speed and APA7-ready output, SPSS if your department already licenses it and you only need the statistics, and R or Python when the analysis must be scripted and reproduced in a pipeline.
How to report the result in APA7
Report the scaling in the figure note and give one line per variable that differs: F(df₁, df₂), the adjusted p and η². Name the correction (Holm or Benjamini–Hochberg). StatFas writes this paragraph and the ANOVA table for you.
See the guide for an example paragraph.
Troubleshooting
- Lines hide each other. Reduce line opacity, show only group means, or plot a random subset.
- Group means look different but ANOVA is not significant. Check the sample size and spread; a visual difference in means can be within sampling noise. Report the test, not the picture.
- All axes look flat. You used raw scales with one dominant variable. Switch to z-score scaling.
- ANOVA warns about unequal variances. Check homogeneity of variance; consider Welch’s ANOVA.
Frequently asked questions
Can SPSS make a parallel coordinates plot?
Not as a built-in chart. Use R, Python, MATLAB, OriginPro or StatFas for the figure.
Do I need coding skills?
No. The StatFas generator works from a pasted or uploaded table.
Related tools, guides and tutorials
- Guide: Parallel Coordinates Plot Explained: How to Make, Read and Report It
- One-way ANOVA calculator
- One-way ANOVA tutorial
- One-way ANOVA explained
- MANOVA explained
- Tukey’s HSD explained
- Descriptive statistics calculator
- Levene’s test explained
- Normality tests explained
- PCA Biplot Generator
- 3D Scatter Plot Generator
- Ternary Plot Generator
- All tutorials
- All blog posts
References
- American Psychological Association. (2020). Publication manual of the American Psychological Association (7th ed.).
- Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: A practical and powerful approach to multiple testing. Journal of the Royal Statistical Society B, 57(1), 289–300.
- Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6(2), 65–70.
- Inselberg, A. (1985). The plane with parallel coordinates. The Visual Computer, 1(2), 69–91.
- Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.