Editing a chart

Every chart in the Output log has an Edit chart… button in its card header. It opens the chart editor: a live preview with the presentation controls that chart actually supports — legend placement, series colours, line width, bar stacking and spacing, and the title.

The editor changes how a chart looks. It never changes what it measures: no control in it can alter a variable, a filter, a bin count or a statistic. To change the analysis, re-run the command.

The one thing worth understanding

An edit is a command, not a decoration.

When you press Apply, ChakataStat does not store your colours somewhere beside the chart. It rewrites the chart's own line in the command journal to include what you chose, and swaps the restyled chart into the same slot in the Output log:

bar_chart category=Region, cluster=Treatment

becomes, after you stack the bars, move the legend and pick two colours:

bar_chart category=Region, cluster=Treatment, stacked=true, legend=bottom, colors=["#1f77b4", "#d62728"]

(One command per line, however long — see Reproducibility.)

That is the whole design. Re-run the script tomorrow, hand it to a colleague, or replay it on next year's data, and the chart comes back styled exactly as you left it — because the styling is part of the analysis you recorded, not a layer on top of it. Nothing you can do in the editor is unreproducible.

It also means the editor and the console are two views of one thing: anything the editor can set, you can type; anything you type, the editor picks up when you open it.

What you can edit

The editor asks the chart's own command what arguments it takes and offers exactly those controls — so it never shows you a control that would do nothing. A bar chart has no Line width; a histogram has one colour rather than a series list; a violin plot has no Legend, because it labels its groups on the axis instead.

Control What it does Charts that offer it
Title Renames the chart. Clear the field to get the analysis's own title back. Every chart tool except Kaplan-Meier (see below)
Legend Auto (top-right, inside the plot), Right, Bottom, or hidden The charts that draw a legend
Series colours One swatch per series, overriding the palette Every chart; single-colour charts show one swatch
Line width Stroke width of the plotted lines Line chart, ECDF, survival curves
Stacked / Stacking Clustered bars stacked part-to-whole, as values or normalised to 100% Bar chart
Bar gap How much of each category's slot is left empty Bar chart

Two deliberate gaps, both for the same reason — an option that cannot be stated honestly is not offered:

  • Kaplan-Meier plots take no title. One kaplan_meier command can draw two different charts (the survival curve and the cumulative hazard), and a single title argument cannot name both. Their other controls all work.
  • Charts embedded in an analysis's output — a regression's diagnostic panels, a scree plot, a dendrogram — have no Edit button. They are byproducts of an analysis command rather than charts you asked for, and styling them would mean putting presentation arguments on statistical procedures.

Direct manipulation

Two things on the preview respond to the mouse:

  • Drag the legend. It snaps to the nearest of its allowed positions when you drop it. There is no free placement by design: the legend's position is a named setting in the command, and a legend pinned to a pixel would not survive a window resize honestly. Use Legend → Hidden to remove it.
  • Click a legend row to select that series; its row lights up in the colour list, so you can recolour the series you pointed at rather than counting rows.

Charts without a legend — the violin plot, the single-colour charts — are edited entirely from the panel, which always works.

Split File: one edit, the whole set

Under Split File, one command produces one chart per group. They share a command, so they share a style: editing any one of them restyles all of them, and the editor says so before you apply. Per-group styling is not something the command can express, so it is not something the editor pretends to do.

Titles are the exception that proves the rule. Rename a split chart "Blood pressure" and each group keeps its own qualifier — Blood pressure [region = North], Blood pressure [region = South] — because otherwise a renamed set would be several identical-looking charts with nothing to tell them apart.

When the journal gains a line instead

Applying an edit normally replaces the chart's existing line. Two cases append a new line instead, and the chart's note says so when it happens:

  • A chart the AI assistant made. The assistant runs tools directly and does not record them, so there is no line to amend — styling one of its charts is what finally gives it a command in the journal. That is the journal doing its job, not an error.
  • A line you edited away. If you have since rewritten or deleted the command the chart came from, ChakataStat will not guess which line you meant. It appends the styled command and tells you, so the script still reproduces what you are looking at.

Either way the journal keeps its meaning: the script that reproduces the current output, styled as seen.

What the editor does not do

By design, and recorded rather than merely missing: no axis-range or tick overrides, no annotations or free-standing text, no free-pixel legend placement, no per-group styling of a split set, and no editing of data or of what is plotted. The editor edits what the recorded command can express — exactly that, so that everything it can do survives a re-run.

See also

  • Graphs — the chart dialogs and what each chart is for.
  • Reproducibility — the command journal the editor writes into, and the presentation arguments you can type directly.
  • Settings — the palette every chart starts from.