简体   繁体   中英

Each marker with a different color

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() (ie 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]

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM