Graphs

Graphs menu. ChakataStat draws charts straight into the Output log, next to your tables. There are seven quick chart dialogs plus a free-form Chart Builder, and several analyses can attach their own plots.

Once a chart is in the log you can restyle it in place — see Editing a chart.

The quick charts

Histogram

Graphs → Histogram… (Ctrl+Shift+H). Pick one scale variable to see the shape of its distribution — the spread, skew and any outliers. An optional normal curve overlay helps judge normality by eye.

Example. A histogram of BMI shows whether the sample is centred around a healthy range or skewed.

The bins control changes the display only — no data changes. To turn a scale variable into real analysis groups, use a Recode instead.

Bin labels chooses how the bars are labelled on the x axis: Edges (a plain tick at each bin boundary, the default), Range (each bar's interval, e.g. 11 – 20 — the same wording as Bin Variable's groups for the same cutpoints, so the two never disagree), Bar start (the value each bar starts at), or Custom (start + width) — set the leftmost bar's label range minimum and a fixed range width, and the rest of the bars' labels are computed from those two numbers, shown as clean, non-overlapping brackets (10 – 19, 20 – 29, 30 – 39, …) when both are whole numbers. This is a relabelling only: it doesn't change how the bars themselves are computed, so use it to lay your own numbering (e.g. age brackets) over bars whose actual computed edges are inconvenient floating-point values.

Every bar gets its own label under Custom (unlike the other modes, which thin to roughly 8 labels to avoid crowding a wide bin count) — the point of a hand-chosen numbering is a complete set of brackets. Label every is a dropdown that overrides either default — Auto, Every bar, or every 2nd/3rd/4th/5th/10th bar — if a high bin count still gets crowded.

Scatterplot

Graphs → Scatterplot… (Ctrl+Shift+T). Pick an X and a Y scale variable to see how two variables relate — the visual companion to a correlation.

Example. BMI (X) against SystolicBP (Y) — does blood pressure rise with BMI?

LOESS smoother

Tick LOESS smoother to draw a trend curve over the points — a local-linear fit that follows the data wherever it goes, instead of forcing a straight line through it. It answers the question a correlation coefficient cannot: is this relationship even linear? A straight smoother says a linear summary (Pearson's r, a linear regression) is telling the whole story; a bend, plateau or U-shape says it is not, before you commit to a model that assumes it is.

Span controls how much of the data each part of the curve looks at, as a fraction between 0 (exclusive) and 1: the default 0.75 gives the standard gently-smoothed trend, smaller spans follow local wiggles more closely (and eventually chase noise), larger spans iron them out. If you are unsure, leave the default — it is the convention most statistical software shares.

Reading the curve:

  • The curve is drawn in its own accent color over the points — recoloring the points in the chart editor never recolors the curve that explains them.
  • The smoother needs at least 6 complete pairs (and two distinct X values). With fewer, the scatterplot still draws and its note says why the curve is absent.
  • The curve describes the plotted points; it is an exploratory reading aid, not a fitted model with coefficients or intervals. When the shape it shows is genuinely non-linear, that is the cue to model the curvature (a transformation, or a non-linear term in regression).

Example. Age (X) against reaction time (Y): the smoother dips through the 20s–40s and climbs after 60 — a U-shape a single correlation coefficient would average away to "no association".

Boxplot

Graphs → Boxplot… (Ctrl+Shift+B). Summarise a scale variable's median, quartiles and outliers, optionally split by a categorical variable to compare groups side by side.

Example. SystolicBP boxed by SmokingStatus.

Line Chart

Graphs → Line Chart… (Ctrl+Shift+L). Plot one or more scale variables against an X variable (or case order, when none is given), optionally split by a categorical variable to compare one line per group. Turn on point markers to see the individual data points along each line.

Example. SystolicBP against Age, split by SmokingStatus — does the age trend differ across smoking groups?

Bar Chart

Graphs → Bar Chart…. Pick a category variable to chart the count of cases per level, or switch Bars show to the mean, sum or median of a scale variable per level. An optional Cluster by category groups bars side by side (one color per cluster level, with a legend), or — with Stacked bars ticked — stacks those segments into one bar per level (part-to-whole). Value labels drive the category axis, so a 1/2 coded variable labelled Male/Female charts by its labels.

With Stacked bars on, Show chooses what the stack means. Absolute values stacks the numbers themselves, so a taller bar is a bigger total. 100% (composition) normalises every bar to fill the axis, so the totals are deliberately thrown away and only the mix is compared — the right choice when the categories are very different sizes and you want to ask "what proportion", not "how many". A clinic with 10 patients and one with 400 then sit side by side on equal terms.

100% stacking needs every value to be zero or more, because a share of a total means nothing once the parts cancel. If the chart contains a negative it stacks absolute values instead and says so in its note.

Bar spacing sets how much of each category's width is left empty — drag it left for fatter bars that touch, right for thin ones. Leave it alone and the chart keeps its standard proportions; the setting is only recorded in the command once you move it.

Example. The mean SystolicBP by SmokingStatus, clustered by Sex.

Error Bar

Graphs → Error Bar…. The mean of a scale variable per level of a category, each mean with an error bar: a confidence interval of the mean (default 95%), or ± standard error / ± standard deviation with a multiplier of your choice. A second Cluster by category turns it into the classic interaction/profile plot — one connected point-run per level — the picture to check alongside a two-way ANOVA.

Example. Mean SystolicBP by SmokingStatus with 95% CIs; cluster by Sex to see whether the smoking effect differs between the sexes.

Q-Q Plot

Graphs → Q-Q Plot…. The standard visual normality check: a scale variable's sorted values against the quantiles of a theoretical distribution (normal by default, or Student t / chi-square at a chosen df), with a reference line fitted through the quartiles. Points hugging the line mean the distribution fits; systematic bowing means skew, S-shapes mean heavy or light tails. The formal companion tests live under Tests of Normality.

Example. A Q-Q plot of BMI before deciding between a t test and a Mann-Whitney.

Styling a chart

The Line Chart dialog's collapsed Style section controls presentation without touching the data: Legend placement (Auto/Right/Bottom/Hidden), a Line width stepper, and, when there is no split (so the series are known up front), a color swatch per series. These are options on the journaled command, so they show up in the .cks syntax too and reproduce exactly on re-run:

line_chart y=[SystolicBP], x=Age, legend=bottom, colors=["#1f77b4"], line_width=2.5

Example. colors=["#1f77b4"] keeps the first series' color fixed across re-runs even if the palette itself ever changes.

You do not have to decide any of this up front, and you do not have to re-open the dialog to change your mind: edit the finished chart directly from its card in the Output log. Because the editor writes the same journaled options back into the same command, a chart styled after the fact is exactly as reproducible as one styled in the dialog.

The Chart Builder

Graphs → Chart Builder… (Ctrl+Shift+G) is the general dialog: choose the chart type and assign variables to its roles. Use it when you want more control than the three quick dialogs give.

The Builder also offers the charts with no quick dialog of their own:

Violin Plot

A scale variable's distribution drawn as a mirrored density silhouette, optionally one violin per level of a category — with a quartile bar and a median dot inside each. Use it where a boxplot is not enough: a boxplot reduces a distribution to five numbers, so a two-humped (bimodal) group and an ordinary one can produce identical boxes — the violin's outline shows the humps.

Two things worth knowing about how it is drawn:

  • The smooth outline is a kernel density estimate (Gaussian kernel, Silverman's bandwidth — computed on the weighted case count when Weight Cases is on), validated against the reference implementation like every other statistic.
  • Violin widths share one scale: the most concentrated group is the widest violin, and a group twice as concentrated is twice as wide. Some tools stretch every violin to the same width; ChakataStat deliberately does not, because that hides exactly the concentration differences the chart is for.

A group with fewer than two distinct values has no density to draw; it keeps its quartile mark and the chart's note names it.

Example. ReactionTime by Condition — do the conditions differ in shape, not just in centre?

Scatterplot Matrix

Every pair of the numeric variables you tick, drawn as one grid of small scatterplots — the standard first look at a dataset with several measurements, because it answers "which of these move together?" for all of them at once instead of one pair at a time.

Reading it: the diagonal names the variable, so the panel in row A and column B plots A up the side against B along the bottom. Each pair appears twice, once either way up; that is deliberate, since a relationship can be easier to see in one orientation than the other.

Three things worth knowing:

  • Every panel is square and shares its scales down its column and across its row. That is what lets you compare panels against each other — a stretched panel would flatten its cloud and make the same relationship look weaker than the one beside it.
  • Cases are dropped listwise: a case missing on any chosen variable leaves every panel, not just the ones involving that variable. The whole matrix is therefore drawn on one set of cases and its panels stay comparable; the chart's note says how many were dropped.
  • The variable count is capped at 8 by default, because the panel count grows with the square — twelve variables is 144 panels, none of them big enough to read. If the cap bites, the note tells you which variables were kept and how to raise it (Maximum variables; set it to 0 to remove the limit entirely).

Example. Age, BMI, SystolicBP and Cholesterol together — before fitting anything, which pairs are related and which are not?

ECDF

The empirical cumulative distribution: for each value on the x axis, the proportion of cases at or below it, drawn as a step that climbs from 0 to 1.

Use it instead of a histogram when the answer might depend on the bin width. A histogram's shape changes with its bin count — the same data can look bimodal or smooth depending on a choice you made, not on the data. An ECDF has no such choice to make: it plots every observation exactly where it falls. It is also the easiest way to read a percentile straight off a chart (find the proportion on the left axis, read across), and to compare two groups, since two curves that separate are two distributions that differ, and the biggest vertical gap between them is exactly the Kolmogorov-Smirnov statistic.

The curve is a step, not a sloping line: the distribution genuinely does not change between one observed value and the next, and a sloped line would claim it does. Where several cases share a value the curve steps once, by their combined weight.

Example. Salary grouped by Department — do the departments differ across the whole range, or only at the top?

Dot Plot (Cleveland)

One dot per category, placed at its value — a count, or the mean, sum or median of a scale variable.

Use it instead of a bar chart whenever your values do not start at zero. A bar says something with its length, so it is only honest when it grows from zero; if the axis starts at 60, a bar twice as long does not mean twice as much. A dot says something with its position, which stays true wherever the axis starts. That makes the dot plot the right choice for the very common case of comparing values in a narrow range — test scores between 70 and 85, prices between £40 and £55 — where a zero-based bar chart wastes the whole plot and a truncated one misleads.

Two conventions:

  • Categories are sorted by value, descending, by default. Sorting is half of what makes a dot plot readable — without a baseline to run along, the eye needs the order to do the work. Switch to Category order if the levels have a natural sequence (months, dose levels) that matters more.
  • The faint line behind each dot runs the full width of the plot. It is a guide from the label across to the dot, not a bar — it deliberately does not stop at the value, because a line from the axis to the dot would be a bar from a non-zero baseline, the exact thing this chart exists to avoid.

Long category names are welcome here: they sit along the left edge with room to breathe, where a bar chart would have to turn them on their side.

Example. Mean SatisfactionScore by Region, where every region scores between 6.8 and 7.9.

Bubble Chart

A scatterplot whose marks carry a third numeric variable as their size — useful when two variables relate and a third explains some of the scatter (population behind a country's figures, sample size behind a site's result).

Area, never radius. The bubble's area is proportional to the value: a value twice as large is drawn with twice the ink, not twice the width. This is the single most common mistake in bubble charts — mapping the value to the radius makes a doubled value look four times bigger — and it is worth knowing that ChakataStat does not make it, if you are comparing against a chart drawn elsewhere.

Bubbles are drawn largest first with a translucent fill and a solid outline, so a small bubble is never hidden under a big one. Cases with a zero or negative size have no area to draw and are dropped; the note says how many, rather than letting them vanish silently.

Use it sparingly: area is read far less accurately than position, so a bubble chart answers "roughly how big" and not "exactly how much". If the third variable is the point of the chart, put it on an axis instead.

Example. LifeExpectancy against GDPPerCapita, bubbles sized by Population.

Charts attached to analyses

Some analyses can draw a chart built directly from their own result — look for a Plot… checkbox in the dialog. These include:

  • the Kaplan-Meier survival curve (and cumulative-hazard curve), with an optional Show point markers checkbox at each step;
  • the correlation heatmap from Correlate (tick Plot heatmap): the coefficient matrix drawn as coloured cells, so the structure of a large matrix — a block of variables that move together, a lone unrelated one, a sign flip — is visible before you read a single number. The scale is diverging: one hue for negative, one for positive, and a neutral middle, so no relationship looks like nothing rather than like a middling one. It is pinned at −1…+1 rather than stretched to the strongest correlation present, so a weak matrix looks weak and two matrices can be compared;
  • the ACF/PACF correlogram from Autocorrelation;
  • the ARIMA forecast plot (observed, forecast and prediction band);
  • the canonical discriminant scatter (optionally with a territorial map);
  • the scree plot from Factor Analysis (eigenvalues per component, with the Kaiser criterion line at 1 — on by default);
  • the forest plot and funnel plot from Meta-Analysis (per-study effects with the pooled diamond; effect against precision with the pseudo-CI funnel — both on by default);
  • the balance plot from Propensity Score (tick Plot balance, on by default): each covariate's standardized mean difference before and after matching/weighting as paired points, with zero — perfect balance — always in view;
  • the Bland-Altman plot from Method Comparison (tick Plot mean vs difference, on by default): each subject's between-method difference against the pair mean, with a solid line at the bias and dashed lines at both limits of agreement, each labelled with its value;
  • the item and test information curves from Item Response Theory (tick Plot information curves, on by default): each item's Fisher information over the latent trait — one curve per item, legend and palette as on any line chart — and the whole test's information profile;
  • the interaction plot from moderated mediation (tick Interaction plot, on by default): the moderated path's fitted simple-slope lines, one per probe level of the moderator, every other predictor held at its mean — lines fanning apart are the moderation;
  • the dendrogram from Hierarchical Cluster (the merge tree from the agglomeration schedule — on by default; a very wide tree is rendered as its last merges, with collapsed clusters sized in parentheses and a note saying so).

See the relevant analysis pages for each.

These plots are part of the recorded command. Whether you asked for the survival curve, the hazard curve or the markers is journaled along with the analysis, so re-running the recorded command reproduces the chart, not just the tables. The survival curves and the canonical discriminant scatter also accept the same presentation arguments the Line Chart does — legend, colors, and (for the curves) line_width — so a styled plot survives a re-run unchanged, and both can be edited from the Output log like any other chart. See Reproducibility.

The plots that come attached to a statistical procedure — a regression's diagnostic panels, the scree plot, the dendrogram — are the exception: they carry no presentation arguments and have no Edit button.

Colors

A chart with one series is drawn in your theme's accent color, so it follows the appearance you picked in Settings.

A chart with several series uses a fixed palette instead, and this is worth knowing about: the first group always gets the first color, the second group the second, and so on, whatever the chart is. Add a group, remove one, or filter your cases, and the groups that were already there keep the colors they had — so you can carry an identity from one chart to the next. The palette is chosen for readability rather than decoration: adjacent colors stay distinguishable with red-green color blindness, and they stay distinguishable in a black-and-white print, which matters if the chart is going into a paper. Light and dark themes use their own version of it.

Past eight groups colors have to repeat, and the chart says so in its note line. When you see that, colour has stopped identifying a group on its own — group the categories, or split the chart, rather than trusting the legend.

Choosing a palette

Settings → Chart colours offers a short list of palettes:

Palette When to choose it
Standard The default. Eight hues stepped to carry an even visual weight across a chart, so no one series shouts louder than the rest.
Colour-blind safe (Okabe–Ito) Okabe & Ito's published scheme, the de-facto standard in scientific publishing. Its colours separate considerably further under red-green colour blindness than the standard palette's — at the cost of a less even look, since it varies lightness as well as hue (that variation is part of how it works). Choose it if you know a reader is colour-blind, or if the chart is going into a publication that asks for an accessible palette.

The list is deliberately short and closed — there is no free colour picker. Every palette offered here is checked, in both light and dark mode, for separation under simulated protanopia and deuteranopia, for separation under ordinary vision, and for no two slots collapsing into the same colour; a palette that fails is not offered. A hand-picked set of eight colours will almost always fail one of those checks without its author noticing, which is the defect a fixed palette exists to prevent.

Changing the palette recolours every chart in the Output log immediately, and the choice is remembered between sessions.

To override the palette for one chart, pick its colours in the chart editor, or set them explicitly on that chart's command (the colors argument) — see Reproducibility. Either way it is the same escape hatch, recorded the same way: a one-off (matching a house style in a report, say) without changing what every other chart looks like.

Working with chart output

  • Charts appear as cards in the Output View, interleaved with tables in the order you ran them.
  • The output chart width is a setting — see Settings.
  • Charts are included when you export the output log to HTML/Markdown/LaTeX (rendered as their geometry) — see Reproducibility.

Exporting one chart

Right-click a chart and choose Export image… — or Copy image, which puts a picture straight on the clipboard to paste into a document. The export asks for a format first, because that decides the file's extension, and remembers what you chose, so a paper's worth of figures is one decision rather than one per chart.

Format What it is Reach for it when
PNG A picture: a fixed grid of pixels, at a resolution you choose The figure is going into a slide, an email or a page that wants an image. Enlarging it beyond the resolution you exported at softens it.
SVG Vector: the figure stored as shapes and text You want to keep editing it — an SVG opens in any drawing program with every line and every label still separate and still editable. Also the format most journals prefer.
PDF Vector, as a one-page document You are attaching the figure to a submission, or want a file that opens the same way everywhere without a drawing program.

The two vector formats have no resolution, which is the point of them: the figure is geometry rather than pixels, so it stays sharp printed at any size, at a column width or across a page. The resolution control greys out when you pick one.

Labels stay text in both vector formats. An axis title, a tick label and a legend entry are exported as the words themselves, not as drawings of them — so they can be selected, searched, copied out and restyled by a typesetter. That is usually what an author guideline means when it asks for "editable" or "vector" figures.

Choosing a resolution for a PNG

The resolution is offered in dots per inch, and the dialog shows what each choice works out to for the chart in front of you — both the pixel dimensions and the printed size, which does not change with the resolution. Resolution buys detail, not size.

288 dpi is the default, and is exactly what ChakataStat rasterised at before the choice existed, so leaving it alone reproduces what you have always had. 300 dpi is offered beside it because that is the number journals print in their author guidelines. If you are exporting for a journal, though, SVG or PDF answers the question outright — a vector figure has no resolution to fall short of.

One limit worth knowing

A PDF is written with the fonts every PDF reader already has, which cover the Latin alphabet, ordinary punctuation and little else. If a chart's labels use characters outside that — Greek, Cyrillic, CJK — the export dialog names them and says so before you export. Choose SVG, which has no such limit, and the labels come through exactly as they appear on screen.

Everything the chart editor changes — axis titles and ranges, reference lines, marker shapes, the gridline toggle, colours — is part of the chart, so it is part of every export.