# There is not history when logging wandb.plot.bar?

**URL:** https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203
**Category:** W&B Help
**Tags:** wandb
**Created:** [September 30, 2022, 5:19am UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203 "2022-09-30T05:19:45Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![wztdream](https://avatars.discourse-cdn.com/v4/letter/w/96bed5/32.png) [@wztdream](https://community.wandb.ai/u/wztdream)
#### Post date: [September 30, 2022, 5:19am UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203/1 "2022-09-30T05:19:45Z")

</div>

Hi,  
I want to use wandb.plot.bar to log a bar chart, with below code

```auto
    table_data = some_function_to_get_data()
    table = wandb.Table(["label", "value"], table_data)
    wandb.log(
        {"a_bar_chart": wandb.plot.bar(table, "label", "value")}, step=global_step,
    )

```

There are two problems:

1. there is no bar plot shown in browser, I need to create the a chart and custom it to bar, this is a little weird in the sense that I already told wandb to log a bar, but it does not do it by default
2. there is no history of the bar chart, only the current bar chart, as we are **logging** the bar chart, I suppose I can see the history of bar chart, that’s how we call it a log right? So we should able to see the history of both table and bar chart during training.

Maybe I did something wrong?  
BTW, I know I can achieve what I want by using matplotlib and log the figure, but I prefer using wandb.pot, as this allows to free of worrying about create and delete the figure object.

---

<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: [September 30, 2022, 7:05pm UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203/2 "2022-09-30T19:05:22Z")

</div>

Hi @wztdream,

Are you calling these lines of code in a loop? `log` for `Table`s are not designed to be called repeatedly right now, but we plan to change this in the future.

I would definitely need some more context into what exactly you are looking to do to help you out best, and a link to your workspace would be great too.

Thanks,  
Ramit

---

<div class="post-metadata">

### Author: ![wztdream](https://avatars.discourse-cdn.com/v4/letter/w/96bed5/32.png) [@wztdream](https://community.wandb.ai/u/wztdream)
#### Post date: [October 1, 2022, 11:15am UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203/3 "2022-10-01T11:15:42Z")

</div>

thank you for your reply, yes I call these code repeatedly, every training step in my case, and I want to see how the bar chart change over training. So I suppose currently this is not supported, and have to wait until this feature is available 🙂

---

<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: [October 3, 2022, 5:20pm UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203/4 "2022-10-03T17:20:12Z")

</div>

Got it, what you would like to do instead in this case for now is log all your data under one table, log it when you are done with your table and then use the `wandb.plot.bar` function.

An alternative (and admittedly not very efficient) hack would be to instantiate a new table object in each loop, copy data from your old table to your new table and then append more data to your new table. This has the potential for having a quadratic memory cost, so I would recommend against it, but if you really need real time logging on tables and have the RAM to support it, this might be an option to consider.

Thanks,  
Ramit

---

<div class="post-metadata">

### Author: ![wztdream](https://avatars.discourse-cdn.com/v4/letter/w/96bed5/32.png) [@wztdream](https://community.wandb.ai/u/wztdream)
#### Post date: [October 4, 2022, 1:24am UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203/5 "2022-10-04T01:24:03Z")

</div>

let me make it clear, I did not mean log all data in **one** table. I suppose it should be similar with logging an `pyplot.plot` figure. In that case there is one plot figure for each step, and there is a nice control bar to review the history figure. It will be nice there is similar control bar for ` wandb.plot.bar` and even for `wandb.Table`

![image](https://us1.discourse-cdn.com/flex020/uploads/wandb/original/2X/a/aeabd9c7b49dc0ed077c098cbafd99628756d8bb.png)

---

<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: [October 18, 2022, 6:30pm UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203/6 "2022-10-18T18:30:14Z")

</div>

Hi @wztdream,

Apologies for the delay, just wanted to provide an update here - I looked into this and we do not support the step slider on `wandb.plot.bar` as we do on images, since they work on different underlying mechanisms. That does sound like a great feature request though, and I am creating a feature request to enable this.

For now, I would suggest using `wandb.Image` to get a step slider based bar graph.

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: [December 17, 2022, 6:30pm UTC](https://community.wandb.ai/t/there-is-not-history-when-logging-wandb-plot-bar/3203/7 "2022-12-17T18:30:33Z")

</div>

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