A graph with swift in a macOS window

Hi

i would like to be able to create graphs with swift in a macOS window.

something like this:

just the two axes, a segment, a black point and a red point.

could somebody write me a little swift program that make this example, so that i can change it to create other graphs ?

thanks a lot

sergio