[sample_bin, quit] = drawFunc_line(window, resp_input_vec, draw_args, trial_bin, sample_bin)


DRAWFUNC_LINE is a stock draw_func example for easyScale. It generates a line plot showing the recent response input history that appears to scrolls off to the left once its right extent has been reached. Multi-dimensional inputs are accomodated as multiple lines on the plot.


The current draw_func takes the standard form required by easyScale, and like drawFunc_bar, is designed to be flexible through use of draw_args. The parameters supplied to this function via easyScale are as follows: window: token for the window where the bar plot should be drawn. resp_input_vec: timeseries object with recent history of responses (with arbitrary dimensionality of [n m], where n is any number of samples and m is any number of dimensions. The samples n(1) to n(end) will be drawn left to right on the line plot. draw_args: parameters set by the calling experiment used to control the behaviour of this draw_func. 1: bar_lims: a two-element numeric array to set the bounds of all bars [lower_limit upper_limit]. 2: x_axis_name: a string to label the x-axis. 3: y_axis_name: a string to label the y-axis. 4: line_labels: a cell array of strings of length m to label each line. 5: line_cols: a cell array with m strings or three-element numeric arrays, each describing a color recognized by matlab to be applied to the line in the corresponding position. 6: origin: a two-element numeric array describing the [x y] screen coordinates where the x and y axes should begin. 7: plot_size: a two-element numeric array [x_height y_height] to determine the size of the plot. 8: axis_col: a string or three-element array describing the axis color. 9: text_margin: a scalar describing the margin to be left between the axes and text labels. 10: thresh: a numeric array of values. Any values supplied here will be drawn as a dashed horizontal line on the plot. trial_bin: ignored sample_bin: ignored DRAWFUNC_LINE also returns sample_bin and quit as output, because they are required by easyScale; however, these are not used in the function. sample_bin is simply returned as it was provided in the input_args, and quit is a boolean that is always false.

Example Usage

For example usage of DRAWFUNC_LINE, please see demoEasyScale_history.