[SciPy-User] a notable horizontal reference line

Samuel John scipy@samueljohn...
Mon Sep 12 02:58:29 CDT 2011


Hi Kejia,

I assume you are using matplotlib (because scipy itself has no plotting).
There are also other plotting alternatives like chacco.

You could just add a horizontal line with axhline:
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axhline

Or you could add another plot:
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot

> from pylab import *
> plot( [1,2,4,8,16], label="my speed" )
> plot( [ [0,1], [4,1] ] , '-',  label="baseline at 1") # just the first and last point connected by a line '-'
> show()


have fun,
 Samuel


PS: I don't know, if the googlegroups adress is still in use. I think scipy-user@scipy.org is right.


On 10.09.2011, at 20:09, Kejia柯嘉 wrote:

> Hi all,
> 
> I am making some speedup diagram, so it is better to highlight the base---the horizontal line, y = 1. How can I do that? Thanks.
> 
> --------------
> Kejia
> 
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user



More information about the SciPy-User mailing list