Let's plot a well-known function with different styles. For this purpose, we will choose the function y=sin x and we will plot it with different style options in different intervals.
export(plot, Function2d):
G := x -> sin(x): // Here is our function
F1 := Function2d(
G(x), x=-2*PI..-PI,
Style = [Points],
Grid = [20],
PointStyle = Squares
):
F2 := Function2d(
G(x), x=-PI..0,
Style = [Lines],
LineWidth=10
):
F3 := Function2d(
G(x), x=0..PI,
Style = [LinesPoints],
Grid = [20],
PointStyle = FilledCircles,
PointWidth = 60
):
F4 := Function2d(
G(x), x=PI..2*PI,
Style = [Impulses],
Grid = [20]
):
plot(F1, F2, F3, F4)