how to create legend from neighboring column in 3d plot
Show older comments
Hi, I have a question, I'm wondering how I'd be able to create a legend based on a neighboring column
right now I have this code

And the pulled table doesn't necessarily extract the element names (i assume because it's not integer?)
but I'm wondering how I can make my scatter legend based on my column 1 in the excel sheet?

7 Comments
Image Analyst
on 28 Apr 2023
How many legend labels would you want, and what do you want them to say? Do you want one legend label string for every unique marker color?
Andrew
on 28 Apr 2023
Image Analyst
on 28 Apr 2023
OK, you want as many legend strings as points that are currently selected in your Excel instance. Some questions remain:
- So are you using ActiveX to figure out which cells in Excel are the currently selected cells? If not, how do you know which ones (cells, indexes) are selected?
- Where exactly does the legend label string come from (unanswered question from before)? Is it some column in the workbook and you want to use the strings in the same rows as the rows you selected?
I'm going to be busy traveling this weekend and might not be able to answer if you don't answer quickly.
Andrew
on 28 Apr 2023
Image Analyst
on 28 Apr 2023
OK, but his code does not determine how many cells you selected. Remember you said "depend on the index that I selected".
Andrew
on 28 Apr 2023
dpb
on 28 Apr 2023
"...but his code does not determine how many cells you selected..."
Au contraire, good buddy! <VBG> I did get that far before the phone rang...it's in
C=jet(nnz(ix));
although not at that point a separate variable...not sure if going to need that or not, yet, but is good possibility.
Will return to the field of battle; may need to look more at the structure of the spreadsheet; I didn't look at it specifically, to know what details may look like...
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
