# How to plot multiline in one plot with smoothing features?

**URL:** <https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512>\
**Category:** W&B Help\
**Tags:** wandb, beginner-friendly\
**Created:** [December 12, 2021, 2:15am UTC](https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512 "2021-12-12T02:15:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hoo-leo](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hoo-leo](https://community.wandb.ai/u/hoo-leo)\
**Post date:** [December 12, 2021, 2:15am UTC](https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512/1 "2021-12-12T02:15:05Z")

</div>

I’m trying to plot the figure as in [W&B Smoothing Features], but it didn’t provide any code:

[![](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/9b0793db422eac619667bd11a7c56351d9d69149.png) ](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/9b0793db422eac619667bd11a7c56351d9d69149.png)

Tutorials I could find by searching `wandb multiline in one plot` is [Custom Multi-Line Plots] which introduces `wandb.plot.line_series()`. So I tried the code following

```python
import wandb
import numpy as np

wandb.init(project="test", entity="xxxx")

wandb.log({"my_custom_id":
           wandb.plot.line_series(
               xs=range(100),
               ys=[range(100), np.random.randint(100, size=100)],
               keys=["y1", "y2"],
               title="Multiline",
               xname="steps"
           )})

```

It gives me the following pic after choosing `Edit panel`

[![](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/4e32b0d8ec1fb96df36dd2a7609f129875cb9e8e.png) ](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/4e32b0d8ec1fb96df36dd2a7609f129875cb9e8e.png)

Unlike the first picture:

1. It **doesn’t** have `Data`, `Group` etc tabs.
2. There are **two types** of legend `name` and `lineKey` rather than one type.

My question is how to plot exactly the same as the first picture with same function supported in wandb web?

---

<div class="post-metadata">

**Author:** ![aidanjd](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/aidanjd/32/258_2.png) [@aidanjd](https://community.wandb.ai/u/aidanjd)\
**Post date:** [December 13, 2021, 9:52pm UTC](https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512/2 "2021-12-13T21:52:48Z")

</div>

@hoo-leo could you link me to your chart so I can take a look for you?

---

<div class="post-metadata">

**Author:** ![hoo-leo](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hoo-leo](https://community.wandb.ai/u/hoo-leo)\
**Post date:** [December 14, 2021, 12:46am UTC](https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512/3 "2021-12-14T00:46:13Z")

</div>

The link is [Example](https://wandb.ai/hoo-leo/example/runs/2q2qigsk?workspace=user-hoo-leo), the corresponding code is in my question.

---

<div class="post-metadata">

**Author:** ![hoo-leo](https://avatars.discourse-cdn.com/v4/letter/h/5f8ce5/32.png) [@hoo-leo](https://community.wandb.ai/u/hoo-leo)\
**Post date:** [December 15, 2021, 12:32am UTC](https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512/4 "2021-12-15T00:32:50Z")

</div>

First I need to log the data I want

```python
import random
import wandb

wandb.init(project="test", entity="xxxx")
for i in range(100):
    wandb.log({"y1": random.random(), "y2": random.random(), "x": i})

```

Then, I need to mannually choosing y1 and y2 on Y Axis.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/1794a161b9d71b6745d9a5c7f4beff76003a4d5c.jpeg)

---

<div class="post-metadata">

**Author:** ![aidanjd](https://sea2.discourse-cdn.com/flex020/user_avatar/community.wandb.ai/aidanjd/32/258_2.png) [@aidanjd](https://community.wandb.ai/u/aidanjd)\
**Post date:** [December 20, 2021, 9:26am UTC](https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512/5 "2021-12-20T09:26:01Z")

</div>

Hi @hoo-leo glad you figured this out!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/366b649231631dbab896843020da0056074ac79d.png) [@system](https://community.wandb.ai/u/system)\
**Post date:** [February 18, 2022, 9:26am UTC](https://community.wandb.ai/t/how-to-plot-multiline-in-one-plot-with-smoothing-features/1512/6 "2022-02-18T09:26:49Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
