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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:42:37+00:00 2026-06-06T19:42:37+00:00

I have a terrain map which i would like to represent some data in.

  • 0

I have a terrain map which i would like to represent some data in. See the below picture:

enter image description here

The area on the right circled by white is a separate surf function to the remainder of the plot. What I would like to be able to do is change the colour scheme. The outside should be grey scale and the inside should be a single colour based on a value that I have separate to the plot. Currently I have tried the colormap(gray) function then changing but that changes the entire plot.

I am open to suggestions about differant plotting styles ie. plot3 instead of surf. So the data i have to make these two surfs are two lists of x, y, z points.

If possible I would also like to display a colour bar that represents the colour of the circled area (which will be set by me based on the outside value).

Does anyone know of a good way to do this?

Thanks.

EDIT:

What i would like to do is this:

enter image description here

The Image should not have the dark blue at the top of the mound. The image will be continually update with more of the ‘blue’ spots, the colour should change based on an external value and ideally it will merge colours with the previous spots if they overlap.

  • 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-06T19:42:40+00:00Added an answer on June 6, 2026 at 7:42 pm

    Have you seen this from MATLAB Tech Support?

    http://www.mathworks.com/support/solutions/en/data/1-GNRWEH/index.html

    You can edit the colorbar properties.

    g = colorbar;
    get(g)
    

    For example,

    % Define a colormap that uses the cool colormap and 
    % the gray colormap and assign it as the Figure's colormap.
    colormap([cool(64);gray(64)])
    
    
    % Generate some surface data.
    [X,Y,Z] = peaks(30);
    
    
    % Produce the two surface plots.
    h(1) = surf(X,Y,Z);
    hold on
    h(2) = pcolor(X,Y,Z);
    hold off
    
    
    % Move the pcolor to Z = -10.
    % The 0*Z is in the statement below to insure that the size
    % of the ZData does not change.
    set(h(2),'ZData',-10 + 0*Z)
    set(h(2),'FaceColor','interp','EdgeColor','interp')
    view(3)
    
    
    % Scale the CData (Color Data) of each plot so that the 
    % plots have contiguous, nonoverlapping values. The range 
    % of each CData should be equal. Here the CDatas are mapped 
    % to integer values so that they are easier to manage; 
    % however, this is not necessary.
    
    
    % Initially, both CDatas are equal to Z.
    m = 64; % 64-elements is each colormap
    
    
    cmin = min(Z(:));
    cmax = max(Z(:));
    % CData for surface
    C1 = min(m,round((m-1)*(Z-cmin)/(cmax-cmin))+1); 
    % CData for pcolor
    C2 = 64+C1;
    
    
    % Update the CDatas for each object.
    set(h(1),'CData',C1);
    set(h(2),'CData',C2);
    
    
    % Change the CLim property of axes so that it spans the 
    % CDatas of both objects.
    caxis([min(C1(:)) max(C2(:))])
    
    % I added these two lines
    g = colorbar
    set(g,'YLim',[1 60])
    

    The last two lines are mine. The rest is from the MATLAB Tech Support link. And it will give you a colorbar with just one colormap. If you wanted the gray half of the colormap, then you would do set(g,'YLim',[64 128]).

    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 a terrain data which contains elevations as shown below And each file
I have a program which draws some terrain and simulates water flowing over it
I have acquired Digital Elevation Maps(Height Map of Earth) of some area. My aim
I have code like this that sets the map type to Terrain View: map
I have a controller (address /Home/Test see below) which definately responds to get request
In simple game, where map (terrain) is divided in grid cell I have soldier
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
I have a map with multiple markers, which I populate via an array. Each
I have a set of different map types (styles). As you can see in
I have some problems making a google map that loads XML file that have

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.