Error in loglog plot

2 vues (au cours des 30 derniers jours)
Balakrishnan
Balakrishnan le 1 Fév 2022
Commenté : quintan le 22 Sep 2024
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

Réponse acceptée

Star Strider
Star Strider le 1 Fév 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 commentaire
quintan
quintan le 22 Sep 2024
I have this same issue, did you find a workaround?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Log Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by