Changing a single marker on a line

Hi,

I have a very simple request - I am drawing a line with n points, using a particle marker - something like:

x = np.linspace(1,10,11) ** 2
y = np.linspace(1,10,11)
plot(x,y,‘ro’)

Is there any way to change the 7th dot (7, 49) to be a blue star instead of a red circle?

I was considering using the scatter function to scatter points 1:6 and 8:10 separately with ‘ro’ and then scatter 7 with the right properties… is that the easiest way?
Thanks a lot,

Federico

Pretty much. Although, you could possibly just do the first plot normally and then have the scatter function simply plot the red star over the blue circle (maybe make the star size bigger to fully cover the blue circle?).

Ben Root

···

On Thu, Mar 8, 2012 at 10:18 AM, federico vaggi <vaggi.federico@…287…> wrote:

Hi,

I have a very simple request - I am drawing a line with n points, using a particle marker - something like:

x = np.linspace(1,10,11) ** 2
y = np.linspace(1,10,11)
plot(x,y,‘ro’)

Is there any way to change the 7th dot (7, 49) to be a blue star instead of a red circle?

I was considering using the scatter function to scatter points 1:6 and 8:10 separately with ‘ro’ and then scatter 7 with the right properties… is that the easiest way?
Thanks a lot,

Federico

federico vaggi:

  I am drawing a line with n points, using a particle marker -

something like:

  x = np.linspace(1,10,11) ** 2

  y = np.linspace(1,10,11)

  ZZZ=plot(x,y,'ro')



  Is there any way to change the 7th dot (7, 49) to be a blue star

instead of a red circle?

  I was considering using the scatter function to scatter points 1:6

and 8:10 separately with ‘ro’ and then scatter 7 with the right
properties… is that the easiest way?
I might be silly, but I believe that this IS the easiest way. In the
program above ZZZ (which I put myself) is a list containing just ONE
Line2D object, with a common set of properties, such as
set_markerfacecolor() or set_marker_size(), and if you use them, all
markers change. The data attached to the plot have no information
about markers. So, if a way exists at all, to change just one
marker, it would be quite involved, and a second plot seems easier
than anything else.

But a true specialist might know The Real Magic...

Jerzy Karczmarczuk