Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8963571
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:23:17+00:00 2026-06-15T16:23:17+00:00

I have a matlab plot that looks like this: Where the Y values for

  • 0

I have a matlab plot that looks like this:

enter image description here

Where the Y values for each of the subplots are stored in single dimensional arrays. What i would like to do is to find an area where the top graph is above a certain height say 0.5. I would also like to highlight the same area in the other graphs as well.

Here is an example of what I am talking about:

enter image description here

The best i have been able to find so far is the function area which will fill an area on the matlab grid. However, if someone could tell me how to make it transparent and also how to fill multiple areas without having to do lots of area commands that would be great.

Otherwise I can identify a group of areas in a struct and use a for loop to plot them. Here is some psuedo code of the way i would do it:

countstruct = 1;
for i = 1:length(yValue)
    if (yValue(i) > 1)
        outside = [outside, i]
    else
         areas(countstruct).outside = outside;
         countstruct = countstruct + 1;
         clear outside;

     end
 end

Then to plot the areas i would do this:

for i = 1:length(areas)
    area(areas(i).outside, ones(length(area), 1)*14, "SomeThingToMakeItTransperant')
end

and i would do this for each of the subplots. Obviously this is quite convoluted so it would be better to have a one liner. Can anyone think of one?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:23:19+00:00Added an answer on June 15, 2026 at 4:23 pm

    I figured it out, The psuedo code i provided gets the correct regions. You can then do this:

    for i = 1:length(areas)
        harea = area(areas(i).outside, ones(length(areas(i).outside), 1)*14, 'LineStyle', 'none')
        set(harea, 'FaceColor', 'r')
        alpha(0.25)
        hold on
    end
    

    alpha sets the transparency in most area plots. This in combination with the code in the question results in this:

    This is pretty cool to plot in matlab.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have multiple vectors of varying lengths that I would like to plot next
I have a function y=f(x), and I would like to plot in Matlab a
I have a Matlab program that is running longer than I'd like it to.
Matlab is displaying a black border around a plot and I would like to
I would like to plot connected points in MATLAB. My connected points come from
I would like to plot the greasy test signal in Matlab, and then plot
On matlab, I have an adjacency matrix and using a function, I would like
I have param as a matrix like below; I would like to plot param.num_av_BS
I have a matlab gui that shall contain 4 plots. The first plot shall
I have some data that I want to plot in MATLAB. The data consists

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.