Fill a specific area of the plot with Diagonal Lines, or Vertical Lines

19 views (last 30 days)
My objective is to produce within a range, diagonal lines or horizontal lines instead of just filling the all space with a colour, as you can see in the image I have attached.
x = 1:100;
f = sin(x);
x1 = [20 35 35 20]
y1 = [0.4 0.4 0.7 0.7]
Tiago Dias
Tiago Dias on 27 Apr 2018
oh ok, i was trying somrthing like hatchill.Color = 'red' but wasnt going anywhere xD thanks mate

Sign in to comment.

Answers (0)


Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by