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

采纳的回答

Star Strider
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.
.
  1 个评论
quintan
quintan 2024-9-22
I have this same issue, did you find a workaround?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Log Plots 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by