I usually do something like:

x = np.ones_like(y)*3
plt.plot(x, y,'+',markersize=8,mec='k')

David G. Parker

From:        Benjamin Root <ben.root@ou.edu>
To:        Ulrich vor dem Esche <ulrich.esche@googlemail.com>
Cc:        matplotlib-users@lists.sourceforge.net
Date:        06/06/2012 12:15 PM
Subject:        Re: [Matplotlib-users] scatter plot with constant x

On Tue, Jun 5, 2012 at 11:53 AM, Ulrich vor dem Esche <ulrich.esche@googlemail.com> wrote:
Hey! :o)
This should be simple, but i cant manage: I need to plot many dots with the same x, like


The array for x values is silly, especially since the number of y values may be rather large. Is there a way to enter a constant there?

Cheers to you all!

No, but you can do this:

plt.plot([3] * 4, [60, 80, 120, 180], ...)

Does that help?
Ben Root
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
Matplotlib-users mailing list