bug? cant change the format of an array variable column

3 visualizaciones (últimos 30 días)
James Upton
James Upton el 20 de Jul. de 2019
Comentada: Star Strider el 20 de Jul. de 2019
I have imported data from xls into a double array variable called price,I have gone onto the variable window to change the format of the column to short fixed decimal however the format of the column does not change, some values are still scientific looking. I have tried the code format short but this only fixes the command window results, my issue is when I plot the price on a chart it shows the scienfific scale and not the actual numbers, I have tried ytickformat('%.2f') but this does not work for me. What am I doing wrong?

Respuesta aceptada

Star Strider
Star Strider el 20 de Jul. de 2019
You probably want the Exponent property of the Numeric Ruler class (R2015b and later versions).
set(gca, 'Exponent',2)
may work.
Experiment to get the result you want.
  2 comentarios
James Upton
James Upton el 20 de Jul. de 2019
Editada: James Upton el 20 de Jul. de 2019
This answer did not work for me. :( I think this maybe a bug in the latest version of Matlab
format long g
plot(thedate,price)
datetick('x', 'yyyy-mm-dd')
ytickformat('%.2f')
set(gca, 'Exponent',2)
Star Strider
Star Strider el 20 de Jul. de 2019
Try this:
Ax = gca;
Ax.YAxis.Exponent = 2;

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Formatting and Annotation 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