help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vertical bar shaded in graph


From: Juan Pablo Carbajal
Subject: Re: Vertical bar shaded in graph
Date: Wed, 18 Jan 2017 15:46:17 +0100

On Wed, Jan 18, 2017 at 1:56 PM, Luciano Magrini
<address@hidden> wrote:
> Dears,
>
> I need to plot a vertical bar on my chart to highlight a specific region.
> How to do this using the "patch" command.
>
> Specifically,
>
> The vertical bar should start at x = 121 and end at x = 198 and I want this
> bar to occupy the entire range of the y-axis.
>
> Can you help me?
>
> I thank you!
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave
>
What about like this?

N = 100;
yd = rand (N,1);
xd = linspace (110,210, N).';
plot(xd,yd,'o');
axis tight

v = axis ();
patch ([121,198,198,121],v([3 3 4 4]),'g');

Do not forget to read the help of functions using
help <function_name>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]