Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #56901
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: Markers on a matplotlib plot |
| Date | 2013-10-16 23:31 +0100 |
| References | <05dfa5c6-0516-403a-8970-f944084ac4ed@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1121.1381962686.18130.python-list@python.org> (permalink) |
On 16/10/2013 22:34, Brandon La Porte wrote:
> I have the following code to make a plot of 4 different supply curves (economics).
>
>
> from matplotlib import pyplot as plt
>
> price = range(0,51)
> q1 = [x/2.0 for x in price]
> q2 = [x/4.0 for x in price]
> q3 = [x/5.0 for x in price]
> q4 = [x/10.0 for x in price]
>
> markers_on = [20, 40]
>
> plt.plot(q1,price,'b',q2,price,'g',q3,price,'r', q4, price, 'y' )
> plt.title('Supply Curve')
> plt.xlabel('Quantity Supplied (Thousands per month')
> plt.ylabel('Price ($)')
> #plt.legend(('Kd = %d'%kd, 'Kd = %d'%kd2, 'Kd = %d'% kd3, 'Step'), loc=4)
> plt.legend(('p = 2Qs', 'p = 4Qs', 'p = 5Qs', 'p = 10Qs'), loc=4)
>
> plt.grid()
> plt.show()
>
> I would like to place markers on the 4 curves when the price is equal to $20 label it A, and when the price is equal to $40 and label it B. Does anyone know how I can accomplish this.
>
If this matplotlib.pyplot.text described here
http://matplotlib.org/api/pyplot_api.html isn't any good I suggest you
ask on the dedicated matplotlib users mailing list see
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Roses are red,
Violets are blue,
Most poems rhyme,
But this one doesn't.
Mark Lawrence
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Markers on a matplotlib plot Brandon La Porte <laporte.brandon@gmail.com> - 2013-10-16 14:34 -0700
Re: Markers on a matplotlib plot Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-16 23:31 +0100
Re: Markers on a matplotlib plot Brandon La Porte <laporte.brandon@gmail.com> - 2013-10-16 18:31 -0700
Re: Markers on a matplotlib plot Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-10-17 08:06 +0100
Re: Markers on a matplotlib plot Piet van Oostrum <piet@vanoostrum.org> - 2013-10-17 14:35 -0400
csiph-web