Borrar filtros
Borrar filtros

How do you change the x scale of a plot to logs?

181 visualizaciones (últimos 30 días)
LM
LM el 26 de Oct. de 2017
Respondida: Jos (10584) el 26 de Oct. de 2017
I am trying to make my plots x scale in logs i did it manually but don't know the code.

Respuesta aceptada

Birdman
Birdman el 26 de Oct. de 2017
Editada: Birdman el 26 de Oct. de 2017

Más respuestas (1)

Jos (10584)
Jos (10584) el 26 de Oct. de 2017
That is easy :)
% draw a graph
x = 10.^[0:0.5:9] ;
y = 2 *log10(x) + 3 ;
plot(x,y,'bo-');
pause
% set the x-axis scale to log
set(gca,'Xscale','log') % yeah, that is indeed easy!

Categorías

Más información sobre Log Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by