Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
(1) color order in plot' (2) colormap with 2 axes in gui

Subject: (1) color order in plot' (2) colormap with 2 axes in gui

From: Jeremy

Date: 14 May, 2010 20:25:21

Message: 1 of 4

Hello! Two questions for everyone to consider...

(1) I'm working on a gui with an image being shown next to a plot. The user selects regions of an image using roipolyold, and with each new region, a line is added to the plot next door. I've got the color of each additional line on the plot changing with no problems, but I'm trying to match these colors with a label that is drawn on top of the image. Seems trivial, right? I've pulled the ColorOrder matrix, and have a variable which keeps track of the number of regions selected. When I draw the label, I tell it to use: 'Color',colororder(numplots,:). Not working...each of the labels shows up blue! Any thoughts?

(2) I have an option to switch the view to 3d under certain circumstances. The 3d plot looks best with a jet colormap. However, when I set this colormap for axes2, the colormap for axes1 (the image) is also changed, and I can't figure out why. Any thoughts?

Thanks!
Jeremy

Subject: (1) color order in plot' (2) colormap with 2 axes in gui

From: Jeremy

Date: 4 Jun, 2010 16:30:38

Message: 2 of 4

Please help!

I've gotten #1 of my original post figured out, but #2 is still driving me insane!

Can anyone help me?

Thanks!

Subject: (1) color order in plot' (2) colormap with 2 axes in gui

From: Walter Roberson

Date: 4 Jun, 2010 16:40:02

Message: 3 of 4

Jeremy wrote:

> (2) I have an option to switch the view to 3d under certain
> circumstances. The 3d plot looks best with a jet colormap. However, when
> I set this colormap for axes2, the colormap for axes1 (the image) is
> also changed, and I can't figure out why. Any thoughts?

colormaps are per-figure, not per-axes

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colormap.html

Algorithm

Each figure has its own colormap property. colormap is a function that
sets and gets this property.

Subject: (1) color order in plot' (2) colormap with 2 axes in gui

From: Jeremy

Date: 4 Jun, 2010 16:53:23

Message: 4 of 4

Thanks for the info Walter. After a quick search with your info in mind, I came across this link...just in case anyone else has a desire to do utilize multiple colormaps within a single figure.

http://www.mathworks.com/support/tech-notes/1200/1215.shtml

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us