Error in loglog plot
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Star Strider
2022-2-1
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.
.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Log Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!