Plotly Ignores Colors
See original GitHub issue- Weights and Biases version: ‘0.8.21’
- Python version: 3.5.3
- Operating System: GCP AI Notebook with Tensorflow 2.0 Environment Jupyter Lab
Description
If I create a bar plot using matplotlib.pyplot and pass in a set of colors to use for each bar, it displays the plot correctly with the corresponding colors. When I log this plot to wandb, the plot displayed in wandb shows the correct bars but all the same color. Alternatively, if I log the plot to wandb as an image, it uploads the plot correctly with the corresponding colors.
What I Did
import numpy as np
import matplotlib.pylplot as plt
import seaborn as sns
lengths, modes = np.unique(counts, return_counts=True)
pal = list(sns.color_palette("hls", len(lengths)))
plt.bar(lengths[1:], modes[1:], color=pal)
plt.xlabel('Visit Lengths')
plt.ylabel('Frequency')
wandb.log({'Visit Length Distribution' : plt})
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Plotly ignores my custom colors in a 3d Scatter plot
If you don't use it, Plotly tries to use the colours specified in the color array as colors to be assigned to categories...
Read more >colors argument to add_trace is ignored #1699 - GitHub
The colors argument is ignored. The same happens when specifying a custom colour palette with colorRampPalette from RColorBrewer : library( ...
Read more >Ggplotly ignoring ggplot geom_point fill colors - Plotly R
fig results in a plot that have different point fill colors depended on the max rain, but fig 2 turns every point fill...
Read more >Colors mode doesn't work with a second added trace - Plotly R
With this method the plot is correctly done but the colors shown are not the ones choosen in “color_a” and “color_b”. they are...
Read more >JavaScript Figure Reference: Single-Page - Plotly
Has an effect only if in `marker.color` is set to a numerical array. ... If `false`, this stop is ignored even within its...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a branch that fixes this, you can use with:
pip install --upgrade git+git://github.com/wandb/client.git@bug/plotly_np#egg=wandb
we’ll get this out in the next release.Hi! I was facing a similar issue, when I created a seaborn scatter plot. When logging as a wandb.Image, it showed the colors, but when I logged the figure directly, the colors were not shown on the legend, only on the actual points in the scatter plot.
Example:
For info:
plotly==5.3.1 matplotlib==3.3.4 seaborn==0.11.2