Plot multiple graphs in one plot using Tensorboard
ML System Design practice on Codemia
Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.
Introduction
TensorBoard can show multiple curves together, but the exact behavior depends on how you log the data. Sometimes you want multiple runs overlaid for the same metric, and sometimes you want different scalar metrics grouped into one chart. Those are related but different use cases.
Same Tag Across Different Runs
The simplest way to compare multiple curves in one TensorBoard scalar chart is to log the same tag name in different run directories.
When you launch TensorBoard on logs, both runs appear on the same scalar card for loss, letting you compare them directly.
That is the easiest answer when the curves represent the same metric from different experiments.
Multiple Metrics From One Run
If you log different scalar tags such as train_loss and val_loss, TensorBoard will normally show separate scalar cards.
This is useful, but it is not yet "one plot." For that, you usually want the Custom Scalars plugin.
Use Custom Scalars to Group Curves in One Chart
TensorBoard supports custom scalar layouts so related metrics can be displayed together in one multiline chart.
Now TensorBoard can render both series in a single multiline chart in the Custom Scalars dashboard.
Naming Conventions Help Even Without Custom Layouts
Even when you do not use the Custom Scalars plugin, consistent naming makes TensorBoard easier to navigate.
Examples:
- '
loss/train' - '
loss/val' - '
accuracy/train' - '
accuracy/val'
This keeps related metrics grouped logically in the UI and makes it easier to filter or compare runs.
Choose the Right Comparison Mode
A useful rule is:
- Same metric across experiments: use the same tag in different run directories.
- Different but related metrics in one experiment: use separate scalar tags and optionally group them with Custom Scalars.
This distinction prevents a lot of confusion when people try to force every charting problem into one TensorBoard feature.
Common Pitfalls
- Logging different experiments into the same run directory and mixing the data accidentally.
- Expecting different scalar tags to appear on one chart automatically without a custom layout.
- Using inconsistent tag names, which makes TensorBoard harder to read than it needs to be.
- Comparing runs with different preprocessing or training conditions as if the curves were directly equivalent.
- Forgetting that the Scalars and Custom Scalars dashboards solve slightly different visualization problems.
Summary
- TensorBoard overlays curves automatically when different runs log the same scalar tag.
- Different metrics from the same run normally appear as separate scalar cards.
- Use the Custom Scalars plugin when you want multiple scalar series in one multiline chart.
- Keep run directories and tag names organized so the comparisons stay interpretable.
- Decide first whether you are comparing multiple runs or multiple metrics, because the logging strategy differs.
Related reading
- Plotting learning curve in keras gives KeyError 'val_acc
- Poetry fails to install tensorflow
- Poor results with tensorflow DNNClassifier and cross_val_score
- Possible to virtualize NVIDIA GeForce GTX 1070 Graphics Card for Distributed Tensorflow?
- Plot PCA loadings and loading in biplot in sklearn like R's autoplot
- Plot scikit-learn sklearn SVM decision boundary / surface
- Plot yerr/xerr as shaded region rather than error bars
- Plotting a pie chart out of a dictionary

DSA Fundamentals
Master algorithmic patterns and data structures through hands-on LeetCode-style problems - from arrays and hashing to dynamic programming and advanced graphs.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
ML System Design practice on Codemia
Design recommenders, ranking systems and training pipelines the way ML interviews actually ask for them, with worked solutions.