Can I change axes of existing figure from linear to loglog in Matlab without redrawing all the data?

25 visualizaciones (últimos 30 días)
I have a given Matlab figure, but not the original data. Can I change axes of existing figure from linear to loglog in Matlab without redrawing all the data?

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 10 de Jul. de 2014
set(gca,'XScale','log','YScale','log')
  3 comentarios
Erez
Erez el 10 de Jul. de 2014
Editada: Erez el 10 de Jul. de 2014
And if the data was originally log10(~something~). Can I change the axes in a way that I will see 10^(~something~) in both axes? Meaning the original data, althogh I rescieved it as log(A) Vs log (B) (I didn't get the figure in loglog scailing, it's in linear scailing but the data itself is a log...)? Would be very helpful!
Chad Greene
Chad Greene el 10 de Jul. de 2014
Editada: Chad Greene el 10 de Jul. de 2014
You can change what's printed on the axes to anything you want, regardless of the actual numbers being plotted with xtick and xticklabel.
x=[1 1.5 4];
y=[1 2 3];
plot(x,y)
set(gca,'XTick',[1.1 2 3])
set(gca,'XTickLabel',str2mat('1.00','400','2'))
set(gca,'YTick',y)
set(gca,'YTickLabel',str2mat('1.00','2.00','pants'))

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks 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