These two commands work in my script:
ax.errorbar(rv_times, rv_rvs, rv_sigma, color = 'maroon', marker = 'o', fmt='o', zorder = -1, ms=5)
ax.scatter(df['rv_times'], df['rv_rvs'], color = df['rv_telescopes'].map(colors), marker = 'o', s=10, zorder = 1)
I would like to combine them, so I tried:
ax.errorbar(df['rv_times'], df['rv_rvs'], df['rv_sigma'], color = df['rv_telescopes'].map(colors), marker = 'o', ms=10, zorder = 1)
But it gave an error:
ValueError: RGBA sequence should have length 3 or 4
Why, please? What does this error mean? The desired result is a graph with markers that have a different colour base of strings in rv_telescopes. I do not care about colour of errorbars, but I need to have markers with errorbars in the legend, so I cannot combine two plots - scatter and errorbars.
Edit after advice
This is was color is equal to:
print(df['rv_telescopes'].map(colors))
0 tab:blue
1 tab:blue
2 tab:blue
3 tab:blue
4 tab:blue
5 tab:blue
6 tab:blue
7 tab:blue
8 tab:blue
9 tab:blue
10 tab:blue
11 tab:blue
12 tab:blue
13 tab:blue
14 tab:blue
15 tab:blue
16 tab:blue
17 tab:blue
18 tab:blue
19 tab:blue
20 tab:blue
21 tab:orange
22 tab:orange
23 tab:orange
24 tab:orange
...
849 tab:red
850 tab:red
851 tab:red
852 tab:red
853 tab:red
854 tab:red
855 tab:red
856 tab:red
857 tab:red
858 tab:red
859 tab:red
860 tab:red
861 tab:red
862 tab:red
863 tab:red
864 tab:red
So, the first column of numbers is wrong?