Syntax of semilogx, semilogy, loglog
Mostra commenti meno recenti
Hi,
I just realized that the following syntaxes are not valid
semilogx(X1,Y1,LineSpec,'PropertyName',PropertyValue)
semilogy(X1,Y1,LineSpec,'PropertyName',PropertyValue)
loglog(X1,Y1,LineSpec,'PropertyName',PropertyValue)
whereas
plot(X1,Y1,LineSpec,'PropertyName',PropertyValue)
is valid. Shouldn't this be fixed for consistency?
Risposta accettata
Più risposte (2)
UJJWAL
il 26 Set 2011
Things are working ok... There is no inconsistency or I was not able to understand you.. Please check the following code and rephrase the question so that I would understand better :-
clc
clear all
t= 0:0.001:2;
plot(t,exp(t),'--.r','LineWidth',2);
figure(2);
semilogx(t,exp(t),'*k','LineWidth',2);
figure(3);
semilogy(t,exp(t),'-.b','LineWidth',2);
figure(4);
loglog(t,exp(t),'--y','LineWidth',2);
Khaleel UR Rehman Khan
il 23 Giu 2020
0 voti
If suppose we have to make the linewidth=3,
loglog(x,y,'linewidth',3) is wrong
the right syntax is
loglog(x,y,"Linewidth",3)
1 Commento
Steven Lord
il 23 Giu 2020
loglog accepts the name of a name-value pair argument as a char vector or as a string perfectly fine when I tried it in release R2020a. Can you clarify why you believe the syntax with the name specified as a char vector is wrong? If you're seeing an error can you show all of the error message (all the text displayed in red?)
x = 1:10;
y = x.^2;
figure
loglog(x, y, 'linewidth', 3)
figure
loglog(x, y, "linewidth", 3)
Categorie
Scopri di più su Log Plots in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!