How to draw the image of the first-order function (e.g. y = 2x [0

How to draw the image of the first-order function (e.g. y = 2x [0

x=0,y=2
x=3,y=6
An image is a line segment (not including two endpoints) connecting (0,2) and (3,6)