Error in loglog plot
3 views (last 30 days)
Show older comments
I used the following code to fill the circles with suitable color in loglogplot. I am trying to plot multiple data st on a single loglog plot. But I got error marked in italic
loglog(x1,y1,'-bo','MarkerFaceColor',[0 0.4470 0.7410],'MarkerEdgeColor',[0 0.4470 0.7410],x2,y2,'-ro','MarkerFaceColor',[0.8500 0.3250 0.0980],'MarkerEdgeColor',[0.8500 0.3250 0.0980]);
Error during execution
Error using loglog
Invalid data argument.
Please advise on plotting solid circles on loglog plot
0 Comments
Accepted Answer
Star Strider
on 1 Feb 2022
I have no idea what the original problem was, however breaking it out into two different plot statements (that I originally did to see if that would help isolate the error) solved it.
x1 = 1:10;
y1 = rand(1,10);
x2 = 11:20;
y2 = rand(1,10);
figure
loglog(x1,y1,'-bo','MarkerFaceColor',[0 0.4470 0.7410],'MarkerEdgeColor',[0 0.4470 0.7410])
hold on
loglog(x2,y2,'-ro','MarkerFaceColor',[0.8500 0.3250 0.0980],'MarkerEdgeColor',[0.8500 0.3250 0.0980])
hold off
grid
The second loglog call can also simply be plot, with the same arguments.
.
1 Comment
More Answers (0)
See Also
Categories
Find more on Log Plots 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!