RosettaCodeData/Task/Polynomial-regression/Phix/polynomial-regression-2.phix
2017-09-25 22:28:19 +02:00

22 lines
531 B
Text

include pGUI.e
constant x = {0,1,2,3,4,5,6,7,8,9,10}
constant y = {1,6,17,34,57,86,121,162,209,262,321}
IupOpen()
Ihandle plot = IupPlot("GRID=YES, MARGINLEFT=50, MARGINBOTTOM=40")
-- (just add ", AXS_YSCALE=LOG10" for a nice log scale)
IupPlotBegin(plot, 0)
for i=1 to length(x) do
IupPlotAdd(plot, x[i], y[i])
end for
{} = IupPlotEnd(plot)
Ihandle dlg = IupDialog(plot)
IupSetAttributes(dlg, "RASTERSIZE=%dx%d", {640, 480})
IupSetAttribute(dlg, "TITLE", "simple plot")
IupShow(dlg)
IupMainLoop()
IupClose()