3

In a similar vein to: Matplotlib scatterplot; colour as a function of a third variable, can one specify the color of each marker separately in a regular `ax.plot() (i.e. without using a scatterplot).

If I try:

cmap  = sns.color_palette("Greys",5)
color = np.array(cmap)[[0,4],:]

ax.plot(X, Y, color=color, markersize=12, marker='o', linewidth=0)

I get:

ValueError: to_rgba: Invalid rgba arg "[[ 0.91252596  0.91252596  0.91252596]
Community
  • 1
  • 1
Josh
  • 11,979
  • 17
  • 60
  • 96
  • Maybe you could plot the lines first using `plot` and then add the markers afterwards with `scatter`? – J. P. Petersen Jan 05 '17 at 09:14
  • 1
    AFAIK, that is not possible. What is the reason you do not want to use `scatter()`? The example you provide would work just fine using that instead of `plot()` – Diziet Asahi Jan 05 '17 at 11:55
  • Thanks @DizietAsahi I am hoping to use my own type of marker. Can we do that with `scatter` ? – Josh Jan 05 '17 at 14:30

1 Answers1

4

Its not possible to plot different markets with plot(). That is the whole point of scatter - you get more options. To make custom markers see this question.

Community
  • 1
  • 1
Ted Petrou
  • 59,042
  • 19
  • 131
  • 136