1

How do I set colors manually when using groupby and plotting the results? Say for example I got different types of devices which have an output depending on the voltage setting. So maybe I want to plot the output agains the voltage setting for each device, so I would get a curve/scatterpoints for each device.

The code might look like this:

...
df.set_index("Voltage", inplace = True)
group = df.groupby("Device")["Output"]
group.plot(style = ".", legend=True)

What is the easiest way to set the colors for my groups in my plot manually? So the colors for each device in my example. I found some responses elsewhere but I could not make them work. It seems to be a missing feature?

Jailbone
  • 167
  • 1
  • 9
  • [How to give a pandas/matplotlib bar graph custom colors](https://stackoverflow.com/questions/11927715/how-to-give-a-pandas-matplotlib-bar-graph-custom-colors) I find this answer to be very helpful – r-beginners Nov 03 '20 at 01:23

0 Answers0