How to create a plot with strings?
Show older comments
I need create a plot like this:(similar)

Data:
category= { } with 90x1 could be Beef & Pork, Chicken & Fish or Salads
fat and calories is a 90x1 too
I try to do:
figure(1)
xlabel('Fat')
ylabel('Calories')
if category=="Beef & Pork"
plot(fat, calories, 'd')
end
if category=="Chicken & Fish"
plot(fat, calories, 'o')
end
if category=="Salads"
plot(fat, calories, 'x')
end
But only read the first element.
Accepted Answer
More Answers (0)
Categories
Find more on Annotations 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!