How do I make the ticks go from 0 to 100?

Carl Wenrich wrote:

Thanks, Jeff. The hlines work fine. But the ylim doesn't change anything. I still get a plot that goes from 20 to 90 instead of 0 to 100. Here's my code. Please take a quick look and tell me where I have to put the ylim statement.

fig = figure(figsize=(6,2))
title('Dow Jones Industrials (^DJI) Relative Strength Index (RSI)', fontsize=8)

months = MonthLocator(range(1,13,2), bymonthday=1)
monthsFmt = DateFormatter("%b '%y")

bx = fig.add_subplot(111)
bx.grid(True)
bx.plot_date(dates, rsis, '-')

bx.xaxis.set_major_locator(months)
bx.xaxis.set_major_formatter(monthsFmt)

axhline(30,color='g')
axhline(70,color='r')

fig.savefig('dow_30_rsi')

Carl: I can't run this, since the 'dates' and 'rsis' objects are not defined, but I'd try putting the ylim last, after the axhlines.

-Jeff

···

*/Jeff Whitaker <jswhit@...146...>/* wrote:

    carlwenrich wrote:
    > I have a dataset where the values range from 20 to 90, but I
    want the y
    > coordinates to go from 0 to 100.
    >
    import pylab

    pylab.ylim(0,100)
    > Also, how can I draw a highlight (colored line) across the chart
    at 30, and
    > another at 70?
    >

    pylab.axhline(30,color='r')
    pylab.axhline(70.color='r')

    HTH,

    -Jeff

    -- Jeffrey S. Whitaker Phone : (303)497-6313
    Meteorologist FAX : (303)497-6449
    NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@...259...
    325 Broadway Office : Skaggs Research Cntr 1D-124
    Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328