Skip to main content

How to Change the X-Axis of a Metric Chart in the MLflow UI

· 11 min read
Jagdish Kumawat
Founder @ Dewiride

When a run logs a metric at several steps, the MLflow UI draws it as a line against Step. That's one of four choices: the same chart can run along the clock, along the seconds since the run's first value, or along another metric. This guide tries all four on one chart, then changes every chart at once, with screenshots from MLflow 3.18.0.

Prerequisites​

The screenshots use four runs from Part 2 of the MLflow series. Each one grows, in stages, a random forest that predicts house prices, and after every stage logs three scores on held-back data, val_mae, val_rmse and val_r2, with the number of trees as the step:

RunColorTreesTree depth
curve-100-treesBlue10 to 100, 10 at a timeNo limit
curve-300-treesOrange20 to 300, 20 at a timeNo limit
curve-depth-8Green10 to 100, 10 at a time8
curve-depth-8-sampledRedThe same as curve-depth-88

The last run repeats curve-depth-8 with the same settings, so its scores are identical, and on a Step chart its red line hides under the green one.

Step 1: Open the Chart's Settings​

Each chart has a ⋮ menu at its top right. Open the one on val_rmse and click Configure:

The menu of the val_rmse chart in the MLflow 3.18.0 chart view, open over the chart above it, with Configure, Delete, Export as CSV, Download as SVG, Download as PNG, Move to top, Move up, and the greyed-out Move down and Move to bottom.

Step 2: Read the X-Axis Choices​

The Edit chart dialog opens, with the settings on the left and a preview on the right. Under X-axis, Type has five choices:

The Edit chart dialog for val_rmse with X-axis Type set to Use workspace settings, the other choices Step, Time (wall), Time (relative) and Metric, and a preview plotting val_rmse against Step: a red line near 0.59 and blue and orange lines falling from 0.55 to 0.525, cut off at about step 225.

ChoiceWhat the chart runs along
Use workspace settingsThe chart view's own setting, which is Step until you change it in Step 6
StepThe step each value was logged with: here, the number of trees
Time (wall)"Absolute date and time": the moment each value was logged
Time (relative)"Amount of time that has passed since the first metric value was logged", in seconds
MetricAnother metric, which you pick from a list

The quotes are the tooltips of the ? icons. The red line is on top in this preview, so the green one is underneath.

The preview is wider than its box: in MLflow 3.18.0 the chart is drawn 700 pixels wide in a box 516 pixels wide, so the curves that go on to 300 trees stop at about 225. Scroll the preview sideways to see the rest. The saved chart shows all of it.

Step 3: See What Time (Wall) Does​

Select Time (wall). The preview puts every value at the clock time it was logged:

The Edit chart dialog with Time (wall) selected and a preview whose X-axis runs from 10:48 to 10:56 on Nov 18, 2026: the blue run is an almost vertical line at 10:48, and the orange and green runs are almost vertical lines just before 10:50.

Each run logged all its values within about three seconds, so each one shrinks to an almost vertical line at the minute it ran. The red run started at 10:58, off the right edge of the preview. Wall time answers "when did this happen?", such as which runs ran before a change you made; to compare curves, the next choice works better.

Step 4: Plot Against the Time Since the First Value​

Select Time (relative). Every run now starts at 0, and its curve lasts as long as the run took:

The Edit chart dialog with Time (relative) selected and a preview plotting val_rmse against Relative Time: the red and green lines near 0.59 end before 1 second, the blue line ends just after 1 second, and the orange line runs past 2 seconds.

Click Save changes. The chart on the page switches, while its neighbors stay on Step:

The second row of the chart view after saving: val_mae and val_r2 still plotted against Step, and val_rmse plotted against Relative Time from 0 to about 3 seconds, with the red line now showing past the end of the green one.

The 300-tree run took about 3 seconds from its first score to its last, the 100-tree run about 1.1. And the red run shows at last: the same scores at the same steps as the green run, but 0.83 seconds from first to last instead of 0.68. A Step chart can't show that difference; a time chart can.

Step 5: Plot One Metric Against Another​

Open Configure again and select Metric. Its list holds every metric of the runs, the system/ metrics too. Choose val_mae:

The Edit chart dialog with Metric selected and val_mae chosen in the list under it, and a preview plotting val_rmse against val_mae from 0.34 to 0.39: the blue and orange runs form short diagonal lines rising to the right.

Each point now pairs two values logged at the same step: val_mae across and val_rmse up. The blue run's first point, for example, is its 10-tree score, 0.359 across and 0.549 up. Click Save changes:

The second row of the chart view with val_rmse now plotted against val_mae: the blue and orange runs form a diagonal line near 0.34 to 0.36 across and 0.52 to 0.55 up, and the green depth-8 runs a short steep line top right near 0.41 across and 0.59 up.

The two errors fall together as trees are added, so each run draws a short diagonal line, and the depth-8 runs sit apart at the top right, worse on both. In the preview they were past its right edge, near 0.41.

To put the chart back, open Configure, select Use workspace settings and click Save changes.

Step 6: Change Every Chart at Once​

The gear icon to the right of Search metric charts opens the settings of the whole chart view, the "workspace": an X-axis for every chart set to Use workspace settings, and Line smoothing:

The chart view's settings menu under the gear icon, with X-axis choices Step (ticked), Time (wall), Time (relative) and Metric with an arrow to a list of metrics, and a Line smoothing slider set to 0.

Choose Time (relative). All three line charts switch together:

The second row of the chart view after choosing Time (relative) in the gear menu: val_mae, val_r2 and val_rmse all plotted against Relative Time from 0 to about 3 seconds.

The bar charts of mae, r2 and rmse don't change: those metrics were logged once per run, so their charts have no X-axis to set. Choose Step in the same menu to go back.

A chart set to anything other than Use workspace settings keeps its own X-axis. With val_rmse set to Step in its Edit chart dialog, choosing Time (relative) here switched val_mae and val_r2 and left val_rmse on Step. That keeps one chart as it is while you change the rest.

Where the UI Keeps These Settings​

MLflow 3.18.0 saves them in your browser's local storage, in one entry per experiment, so they're still there after a reload. The tracking server keeps none of them: its database has no record of them. Changing the X-axis changes only how the charts are drawn, never the logged values.

Common Mistakes​

MistakeWhat happensDo this instead
Judging how long training took from a Step chartStep shows how far training got, not how long it tookSwitch to Time (relative)
Comparing runs made at different times on Time (wall)Each run shrinks to a sliver at its own time of dayUse Time (relative): every run starts at 0
Reading the preview as the whole chartIts right end is cut offScroll the preview sideways, or save and read the chart
Changing the gear's X-axis for a chart with its own settingThat chart keeps its own X-axisSet it to Use workspace settings first

Troubleshooting​

SymptomLikely causeFix
The preview's curves stop partwayThe preview is drawn wider than its boxScroll it sideways; the saved chart shows all of it
One chart ignores the gear's X-axisIt's set to its own X-axisConfigure → Use workspace settings
Your chart settings are missing in another browserThey're saved in the browser where you made themSet them again there
Two runs share one line on a Step chartThey logged the same values at the same stepsSwitch to a time X-axis, where their timing differs

FAQ​

Can I set the X-axis from Python?​

No, it's a setting of the UI. In code, MlflowClient().get_metric_history() returns each value's step and timestamp, so you can plot either one: How to Get the History of a Metric in MLflow.

Can I smooth a noisy curve?​

Yes: Line smoothing sits in the Edit chart dialog for one chart and in the gear menu for every chart.

Why do the System metrics charts run along time?​

System metrics are samples MLflow takes every few seconds while a run works, so the UI charts them against time rather than step: How to Turn On System Metrics Logging in MLflow.

Conclusion​

Configure in a chart's ⋮ menu changed that chart's X-axis: Step for progress, Time (wall) for the moment each value was logged, Time (relative) for the seconds since the first value, and Metric to plot one metric against another at the same steps. The gear changed every chart that uses the workspace settings at once. MLflow 3.18.0 keeps those choices in the browser, and the preview in Edit chart scrolls sideways when the chart is wider than its box.

Additional Resources​