; docformat = 'rst ;+ ; Simple line plot in object graphics. ; ; :Params: ; x : in, required, type=fltarr(n) ; x-values of line plot ; y : in, required, type=fltarr(n) ; y-values of line plot ; ; :Keywords: ; _extra : in, optional, type=keywords ; keywords to IDLgrPlot::init, IDLgrWindow::init, IDLgrAxis::init ;- pro mg_ogplot_example, x, y, _extra=e compile_opt strictarr view = obj_new('IDLgrView') model = obj_new('IDLgrModel') view->add, model plot = obj_new('IDLgrPlot', x, y, _extra=e) model->add, plot plot->getProperty, xrange=xr, yrange=yr xc = mg_linear_function(xr, [-0.75, 0.90]) yc = mg_linear_function(yr, [-0.75, 0.90]) plot->setProperty, xcoord_conv=xc, ycoord_conv=yc xaxis = obj_new('IDLgrAxis', direction=0, range=xr, /exact, _extra=e) model->add, xaxis yaxis = obj_new('IDLgrAxis', direction=1, range=yr, /exact, _extra=e) model->add, yaxis xaxis->setProperty, xcoord_conv=xc, ycoord_conv=yc yaxis->setProperty, xcoord_conv=xc, ycoord_conv=yc window = obj_new('IDLgrWindow', graphics_tree=view, _extra=e) window->draw end ; main-level example program openr, lun, filepath('damp_sn.dat', subdir=['examples', 'data']), /get_lun dsin = bytarr(512) readu, lun, dsin free_lun, lun mg_ogplot_example, findgen(512), dsin end