superimpose a line of slope (-5/3) on a log-log graph

5 visualizaciones (últimos 30 días)
Mindy
Mindy el 20 de Abr. de 2022
Comentada: Davide Masiello el 20 de Abr. de 2022
Hello everybody,
Do you know how to draw a straight line with a certain slope on a log-log graph please?
Here what I want to do:
Thank you in advance,

Respuestas (1)

Davide Masiello
Davide Masiello el 20 de Abr. de 2022
Editada: Davide Masiello el 20 de Abr. de 2022
See example below
clear,clc
x = [1e1,1e4];
slope = -3/5;
offset = 1;
y = slope*x+offset;
loglog(x,y,'--r')
  2 comentarios
Mindy
Mindy el 20 de Abr. de 2022
Thank you very much for your answers. So I try to modify my code like this:
x = [1e1,1e4];
slope = -3/5;
offset = 10;
y = slope*x+offset;
figure
loglog(freq,PSD,x,y)
But the slope doesn't appear... Do you know why?
Davide Masiello
Davide Masiello el 20 de Abr. de 2022
Could you please share all of your code?

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by