In [1]:
from ahh import exp, vis
import datetime

In [2]:
x, y = exp.arr_1d(xy=True)

In [3]:
ax = vis.plot_line(x, y, xlabel='x', ylabel='y')
locs = 'top left, top center, top right, center right, bottom right, center bottom, bottom left, left center, center'.split(', ')
for loc in locs:
    vis.set_axtext(ax, text=loc, loc=loc)
    vis.set_figtext(ax, text=loc, loc=loc)



In [4]:
ax = vis.plot_line(x, y, xlabel='x', ylabel='y')
locs = 'upper left, south east, middle top'.split(', ') # it will try to figure out the loc based on keywords
for loc in locs:
    vis.set_axtext(ax, text=loc, loc=loc)



In [5]:
ax = vis.plot_line(x, y, xlabel='x', ylabel='y')
vis.set_axtext(ax, text='xy', xy=(6, 6)) # instead of passing named location, can also pass in coordinates
vis.set_axtext(ax, text='centered', xy=(2, 4), fha='center') # horizontally align to the center

vis.set_axtext(ax, text='(two, six)', xy=(2, 6), fva='bottom') # vertically align to bottom
vis.set_axtext(ax, text='(two, six)', xy=(2, 6), fva='top', fha='right') # vertically align to top and horizontally to right



In [6]:
dts = exp.arr_dt()
ax = vis.plot_line(dts, y)
vis.set_axtext(ax, text='dt_str', xy=('2016-02-29', 6)) # can a pass a datetime string
vis.set_axtext(ax, text='dt_str_hr_min', xy=('2016-03-06 12:30', 6)) # also with hour and minutes
vis.set_axtext(ax, text='dt', xy=(datetime.datetime(2016, 3, 3), 8)) # and an actual datetime



In [ ]: