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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:38:33+00:00 2026-06-18T03:38:33+00:00

What I want: Different coloured points on a plot and to have the points

  • 0

What I want:

Different coloured points on a plot and to have the points in a legend with their respective colours.

I tried this:

I have created a struct which contains x, y values of points. With these points I hope to plot points on an image so I can see where they are. However, as I’m using a struct I can’t get the plot to make the points in different colours. With the for loop I tried to coax matlab in creating multiple plots, and hopefully different lines, which I could then assign to different colours of my choosing.

Code:

img = imread('retinotopische map V1M Base clean.bmp');            

hold on;                     
image([0.825 4.61],[-2.85 ,-8.25],img);

for A =  1:B
    plot( [c(A).Lateral],[c(A).Bregma],'o','MarkerSize',10);    
    plot( [c(A).Lateral],[c(A).Bregma],'.','MarkerSize',10);    
end
  • 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-18T03:38:34+00:00Added an answer on June 18, 2026 at 3:38 am

    You can change the colour using the ‘Color’ option:

       img = imread('retinotopische map V1M Base clean.bmp');            
    
        hold on;                     
        image([0.825 4.61],[-2.85 ,-8.25],img);
    
        for A =  1:B
           plot( [c(A).Lateral],[c(A).Bregma],'o','MarkerSize',10, 'Color', [A/B, 0, 1 - A/B]);     
        end
    

    ‘Color’ lets you specify an RGB triple like [1 0 0] for red for example. You can use this to plot whatever colors you want. My example will plot them in like a gradient but you could also have totally different colours using say rand(1, 3) to get the triple? Or else make a colour matrix where you specify the exact order of colours you want like:

    MyColours = [1 1 0;
                 0 0 1;
                 1 0 0;
                 0.5 0.2 0.9]; %etc...
    

    and then in your for loop:

    plot( [c(A).Lateral],[c(A).Bregma],'o','MarkerSize',10, 'Color', MyColours(A, :));     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script in the head of my index.html. I want different scripts
I have an action inside my controller class and I want two different routes
I want to have different layouts like [left|content|right] and [left|content] or [content|right] when using
I want to have different color to each side of a border in WPF
I have a dense set of points in the plane. I want them colored
I have a calendar control with various days as various colours. I want a
I have a message system where I want different message handlers to be called
I have many square images with different sizes, and I want to first resize
i have a bar in my footer called #elementbar. i want this elementbar to
Possible Duplicate: Automatically plot different colored lines in MATLAB I have the following data

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.