Skip to content
Advertisement

Pandas chart using plotly.graph_objects DO NOT ALLOW FOR ‘c’ or ‘color’ ATTRIBUTE

I am adding line charts to an OHLV plotly, but I do not manage to color them.

JavaScript

The above code fail when I use ‘color’ as a ‘figg.add_scatter’ attribute : Error given is:

JavaScript

WHEN I do not specidy the color of the the scatter lines, the program works fine.

Bellow is a data sample:

JavaScript

I would like to pick the colors of the lines ’ema_160′ and ’ema_50′ in the bellow example: enter image description here

Thank you

I use: * Pycharm * Windows 10 * Python 3.7.9 And I tried the bellow urls without success:

Series plot pandas color

pandas: Using color in a scatter plot

Advertisement

Answer

The color specification in graph_objects is done in the form of a dictionary with various settings. If you don’t need it, just use a single color.

JavaScript

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement