# Plot array, over time

**URL:** <https://community.wandb.ai/t/plot-array-over-time/2690>\
**Category:** W&B Help\
**Created:** [July 1, 2022, 8:44pm UTC](https://community.wandb.ai/t/plot-array-over-time/2690 "2022-07-01T20:44:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstein06](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@cstein06](https://community.wandb.ai/u/cstein06)\
**Post date:** [July 1, 2022, 8:44pm UTC](https://community.wandb.ai/t/plot-array-over-time/2690/1 "2022-07-01T20:44:42Z")

</div>

Hi all,

I have a simple 1D array (e.g. norm of each layer), that I want to plot over time (e.g. plot “norm against array index”, each time step). Should I create a line plot? How can I overlay line plots as they are updated?

Thanks! Carlos

---

<div class="post-metadata">

**Author:** ![ramit\_goolry](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@ramit\_goolry](https://community.wandb.ai/u/ramit_goolry)\
**Post date:** [July 6, 2022, 11:28pm UTC](https://community.wandb.ai/t/plot-array-over-time/2690/2 "2022-07-06T23:28:54Z")

</div>

Hi Carlos,

Yes absolutely! A line plot can work to display the norm of a layer. You can also log the weights of a layer individually as a histogram to get a more granular sense of your layers. This is done as

```auto
wandb.log({
    'layer' : wandb.Histogram(<array-like>)
})

```

---

<div class="post-metadata">

**Author:** ![cstein06](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@cstein06](https://community.wandb.ai/u/cstein06)\
**Post date:** [July 7, 2022, 4:33pm UTC](https://community.wandb.ai/t/plot-array-over-time/2690/3 "2022-07-07T16:33:29Z")

</div>

Ok, thanks for replying! But if I want to have a chart that overlays line plots for each epoch, generated e.g. like this:

data = [[x, y] for (x, y) in zip(range(len(norms)), norms)]  
table = wandb.Table(data = norms, columns = [“index”, “norm”])  
norms\_line = wandb.plot.line(table, “index”, “norm”, title=“Norms by layer”)  
wandb.log({“epoch”: epoch, “norms”: norms\_line})

It creates a chart with the line plot, but I couldn’t figure out how to modify the chart to overlay the lines for all epochs.

A related question, media charts created for each step seem to generate a scroll bar below automatically, to navigate the step/epoch. Can I add the same to this line plot, to navigate how it changed during each epoch?

Thanks again for taking the time.

---

<div class="post-metadata">

**Author:** ![ramit\_goolry](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@ramit\_goolry](https://community.wandb.ai/u/ramit_goolry)\
**Post date:** [July 12, 2022, 7:27pm UTC](https://community.wandb.ai/t/plot-array-over-time/2690/4 "2022-07-12T19:27:12Z")

</div>

Hey @cstein!

The easiest way to do this would be to use `wandb.log` to log your metrics and them overlaying them through the UI. As an example, let’s assume we have 2 metrics - `Test/Loss` and `Test/Accuracy` which have been logged through `wandb.log`. They can be overlayed as:

![output](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/1X/1caa01b281ddb26aa2a65d75465bf177d3b23237.gif)

Please let me know if you face any issues!

Thanks,  
Ramit

---

<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:** [September 10, 2022, 7:28pm UTC](https://community.wandb.ai/t/plot-array-over-time/2690/5 "2022-09-10T19:28:04Z")

</div>

Closed on September 10, 2022, 7:28pm UTC

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