Color from a number
flag
6 messages - Collapse all
/groups/adfetch?hl=en&adid=9P2mnhIAAACmvycH2jMozSLzgPDf9W6ZHOOf3QyR6bPzxOY7iJ1W1A
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
1.  ivankappa  
View profile  
 More options Feb 22 2008, 5:22 am
Newsgroups: comp.soft-sys.matlab
From: ivankappa <ivanka...@gmail.com>
Date: Fri, 22 Feb 2008 02:22:57 -0800 (PST)
Local: Fri, Feb 22 2008 5:22 am
Subject: Color from a number
Hi
I've looked for a function which gives me a color proporcional to
number, but I've not found. I mean, I could use the number but only to
set a color (eg in rgb [num 0.5 0.5]) but I would like to have a whole
set of color in function of the single number. Any idea?

TIA


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  Yumnam Kirani Singh  
View profile  
 More options Feb 22 2008, 7:21 am
Newsgroups: comp.soft-sys.matlab
From: Yumnam Kirani Singh <kirani.si...@gmail.com>
Date: Fri, 22 Feb 2008 07:21:03 EST
Local: Fri, Feb 22 2008 7:21 am
Subject: Re: Color from a number
It depends on which type of image your are using. For an rgb image, you have to set the color in that way only. If your image is an indexed image, then you can set the color by a single number which corresponds to the index of the colormap table.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
3.  ImageAnalyst  
View profile  
 More options Feb 22 2008, 8:14 am
Newsgroups: comp.soft-sys.matlab
From: ImageAnalyst <imageanal...@mailinator.com>
Date: Fri, 22 Feb 2008 05:14:58 -0800 (PST)
Local: Fri, Feb 22 2008 8:14 am
Subject: Re: Color from a number
On Feb 22, 5:22 am, ivankappa <ivanka...@gmail.com> wrote:

> Hi
> I've looked for a function which gives me a color proporcional to
> number, but I've not found. I mean, I could use the number but only to
> set a color (eg in rgb [num 0.5 0.5]) but I would like to have a whole
> set of color in function of the single number. Any idea?

> TIA

How about just using one of the pre-defined colormaps that MATLAB
supplies, such as Jet?  Plug in an index and you'll get an RGB color
from it.

Really, you need to supply more info.  How do we know what color you
want?  There are an infinite number of colors that could be generated
from an infinite number of functions. How can I know what function
you'd be happy with?
- ImageAnalyst


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
4.  ivankappa  
View profile  
 More options Feb 22 2008, 10:14 am
Newsgroups: comp.soft-sys.matlab
From: ivankappa <ivanka...@gmail.com>
Date: Fri, 22 Feb 2008 07:14:23 -0800 (PST)
Local: Fri, Feb 22 2008 10:14 am
Subject: Re: Color from a number
On 22 Feb, 14:14, ImageAnalyst <imageanal...@mailinator.com> wrote:

Fundamentally, I would like to assign a color to a line proporcionally
to its length. The relation is not direct proportion because I've to
face lines with very different length. But, for example, I would like
that the max line is dark red, the 50% line is orange, the 25% is dark
yellow, and so on using all colours like an altimetric map, but they
could be others, as soon as I can put them in an explaining colorbar.

tnx


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
5.  ImageAnalyst  
View profile  
(1 user)  More options Feb 22 2008, 10:46 pm
Newsgroups: comp.soft-sys.matlab
From: ImageAnalyst <imageanal...@mailinator.com>
Date: Fri, 22 Feb 2008 19:46:12 -0800 (PST)
Local: Fri, Feb 22 2008 10:46 pm
Subject: Re: Color from a number
On Feb 22, 10:14 am, ivankappa <ivanka...@gmail.com> wrote:

=========================================
Ivan:
This is pretty easy.  You should have been able to figure it out.  It
goes something like this:
myColorMap = hot; % Use the "hot" color map for example.
myLineLength = 0.5; % or whatever percentage you want.
myLineColor = myColorMap (int16(myLineLength *64),:); % Extracts a
single RGB color.
% Then plot your line with myLineColor.
If you don't like the hot color map, use autumn or whatever you like
by making up a custom one.
Regards,
ImageAnalyst

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
6.  ivankappa  
View profile  
 More options Feb 23 2008, 6:35 am
Newsgroups: comp.soft-sys.matlab
From: ivankappa <ivanka...@gmail.com>
Date: Sat, 23 Feb 2008 03:35:55 -0800 (PST)
Local: Sat, Feb 23 2008 6:35 am
Subject: Re: Color from a number
On 23 Feb, 04:46, ImageAnalyst <imageanal...@mailinator.com> wrote:

Thanks man you solved it! I didn't undertand the use of colormap, but
that is what I need!
Regards

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google