-
Notifications
You must be signed in to change notification settings - Fork 748
[Q] How to compare multiple lines on the same plot? #3035
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You just call |
@vanpelt Thanks for your reply, I have tried the code following: 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"
)}) The picture I get after choosing Edit Panel is following: The picture I want to get is like Difference between with these pictures are
|
Hey @Ynjxsjmh you likely don't want to use our custom plot functionality but instead just log the raw data, i.e.
Then you can edit any chart in your workspace to show both y1 and y2 plotted against "x": |
@vanpelt Thanks you for letting me know I should manually select y on Data tab to compare multiple lines on the same plot. I start to know that the Line Plot - Documentation is talking about how to use the web interface to customize the plot rather than with code. My confusion is that is it possible to customize the plot with code like
However in It would be inconvenient if I want to compare y1, y2 etc. through Experiment1, Experiment2 etc. It's possible to log Matplotlib and Plotly Plots | Log Plots - Documentation directly but it lacks some wandb features like Smoothing(Exponential Moving Average, Gaussian, Running Average) and loses the original import wandb
import numpy as np
import matplotlib.pyplot as plt
wandb.init(project="test", entity="xxx")
figure, ax = plt.subplots()
y1 = np.random.randint(100, size=100)
ax.plot(range(100), y1, label='y1', color='blue')
ax.fill_between(range(100), y1-10, y1+10, alpha=.5)
ax.plot(range(100), np.random.randint(100, size=100), label='y2', color='red')
ax.set_title("Experiment")
ax.legend()
plt.tight_layout()
wandb.log({'chart': plt}) |
@Ynjxsjmh yep, when logging matplot lib objects you lose the ability to compare and we're just rendering with Plotly so you can only do what Plotly allows. The only other alternative if you want full control over how a chart looks is our custom plots which you were using initially. You can modify the vega spec and make it do anything that vega can do but it's a steep learning curve and can be pretty complicated. You can learn more about custom charts here. |
Thank you for your generosity! |
Hi, I'm in need of the same feature (multi line plots) and the proposed solutions aren't really working in my case - Uploading line_series or matplotlib plots can't be done incrementally per epoch which is how other metrics are done (am I correct here?) and is very time consuming at the end of the training session. It also removes many helpful features from the plot, such as changing the x axis and smoothing. The other option requires manual intervention which just isn't realistic for many training sessions (I'm running a large sweep) Are there any plans to add this feature? |
@vanpelt Came here to mention that it is indeed a need functionality and it is a pain to have to either collect the plot data and access it only after the session is done, or have configure the plot manually each time. Is there any plan to revisit this? Same with 1 level of nested planes like |
@ArturPrzybysz agree! Demand is still there. Especially the simplest case, where you want to compare training with validation loss on the same plot. This is still not possible without manually configure the plot each time. |
Bump. This is basic functionality in tensorboard via the "custom_scalars" feature and it's frustrating that there is nothing comparable in wandb. |
Any updates on this feature? |
I also would love this feature! |
Bump! It seems that being able to configure the panel programmatically similar to how one can currently edit a report programmatically would be the easiest way to do this.. |
Any updates on this feature? |
I would like to see this feature as well. I have several groups of line plots to show on the separate graphs. doing them all on the UI is too much work. |
In the document of Line Plot - Documentation, it says
But how to do these? There is not even one line of code to show this matter.
The text was updated successfully, but these errors were encountered: