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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:31:00+00:00 2026-06-14T06:31:00+00:00

I have a filter of size 150 by 150 When using imagesc to plot

  • 0

I have a filter of size 150 by 150 When using imagesc to plot the filter, the background is green

minValue = -1.5; maxValue = +1.5;

The RGB index of zeros in the image (green color) is is 0.5,1,0.5

I would like to change all the index ‘0’ / background colour in the image to white while leaving the remaining as they are if possible.

size(colormap) : 64 3

I have tried the following but it does not seem to work on my image:
matlab's imagesc background color

Thanks a lot

  • 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-14T06:31:01+00:00Added an answer on June 14, 2026 at 6:31 am

    Here’s my solution. Histogram image intensities, find those that are closest to zero, then set it to white. For example:

     m=peaks(100); % generate data
     imagesc(m);   
    
     colormap_range=64; % default colormap_range is 64, but change it to your needs
     [n,xout] =hist(m(:),colormap_range);   % hist intensities according to the colormap range
     [val ind]=sort(abs(xout)); % sort according to values closest to zero
     j = jet;
     j(ind(1),:) = [ 1 1 1 ]; % also see comment below
     % you can also use instead something like j(ind(1:whatever),:)=ones(whatever,3); 
     colormap(j);
    

    instead of sort you can use min, but I thought that by sorting you can also edit more than just that level with additional lines such as, j(ind(1:3),:)=ones(3); . The attached figure below was done using this…

    enter image description here

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

Sidebar

Related Questions

I have an ISAPI filter that I am using to do URL rewriting for
I want to make a FIR filter using a window function. I have some
I want to make a FIR filter. I have an array of coefficients (buffer[size])
I have some filter and one grid.And grid have some buttons like modify/edit.I am
I have to filter a text file filter.tmp containing two types of lines, this
I have a filter: class MyFilters { def filters = { before = {
I have 3 filter conditions on a web page Filter by dropdown Source Filter
I have a Filter Servlet that filters request from a Servlet. I do not
I have to filter out certain elements from an array in javascript and thought
Given a thrush operator, I have a filter expression as one of the forms.

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.