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 7912305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:34:06+00:00 2026-06-03T13:34:06+00:00

Two questions really, but I feel they overlap, so I’ll ask them in one

  • 0

Two questions really, but I feel they overlap, so I’ll ask them in one place (if that’s OK).

I’ve created a pcolor in matlab using:

p = pcolor(Lon', Lat', data);

But now I want to add some information. I have a matrix mask which has the same dimensions as data, but is populated by 1s and 0s. Where it contains a 1, I would like to retain the pixel in the pcolor, and when it contains a 0, remove it (not just turn the value to zero, which is not represented by a white pixel in my colormap).

Secondly, I have a second matrix, called ‘stipple’, which again contains 0s and 1s. I now want to overlay any location represented by a 1 with a stipple effect.

The purpose of this is to create an image something like this:
http://www.ipcc.ch/publications_and_data/ar4/wg1/en/figure-spm-7.html
where the average is painted on, but areas where there is too much disagreement are whited out, and areas where there is much agreement are ‘stippled’.

Thanks in advance!

  • 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-03T13:34:07+00:00Added an answer on June 3, 2026 at 1:34 pm

    The approach I would take is to use your mask for transparency. This is slightly more complicated for pcolor because it doesn’t let you set properties directly when creating the plot, but you can grab the handle to it and do it that way.

    To overlay stippling, you can just hold on so the pcolor plot doesn’t disappear, and use ‘plot’ to plot points where you want them.

    Lon = (-179:1:180)'; %# comment for formatting'
    Lat = -90:1:90;
    data = randn(length(Lon),length(Lat)); #% generate random data
    mask = randi(2,size(data))-1; #% generate a random mask (zeros and ones)
    point_matrix = randi(4,size(data)-1)==4; #% random (logical) matrix
    [r c]=find(point_matrix==1); %# get the coordinates of the ones
    figure;
    hold on;
    #% save a handle to the surface object created by pcolor
    h=pcolor(repmat(Lon ,1,length(Lat)),repmat(Lat,length(Lon),1),data);
    #% set properties of that surface: use mask as alphadata for transparency
    #% and set 'facealpha' property to 'flat', and turn off edges (optional)
    set(h,'alphadata',mask,'facealpha','flat','edgecolor','none');
    #% overlay black dots on the center of the randomly chosen tiles
    plot(r-179.5,c-89.5,'.k')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are some related questions here and here , but they didn't really give
This is really two questions: Why isn't the membership operator (__contains__) ever being called?
Two questions, really: Is there a standard/convention regarding the placement on configuration files? For
This consists of two questions: Is MySQL's timestamp field really faster than datetime field
two questions: how do i compile a .java file that isn't on my username
I know there are already some questions about this, but not that specific. I
I know that the question has been asked before , but it's been two
this is really two questions, I'll start with the easiest. I get an access
I've got two questions really. The first is more a description of events: software
Two questions here really; why is this happening? And what can be done about

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.