working on the programmatic interface. how to construct a plot?