From: <DP...@ch...> - 2012-06-22 13:08:15
|
I usually do something like: y=np.array([60,80,120,180]) x = np.ones_like(y)*3 plt.plot(x, y,'+',markersize=8,mec='k') David G. Parker From: Benjamin Root <ben...@ou...> To: Ulrich vor dem Esche <ulr...@go...> Cc: mat...@li... 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 < ulr...@go...> wrote: Hey! :o) This should be simple, but i cant manage: I need to plot many dots with the same x, like plt.plot([3,3,3,3],[60,80,120,180],'+',markersize=8,mec='k') 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! Ulli 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 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/_______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |