open the table
if not withx
numeric column for x
if not withy
use other numeric columns for y
write commands for the title of the plot and labels of the x axis
for each y column
if one y axis
write commands for y axis labels
else
write commands for the legend
for each row
write x[i], y[i]
end
end