Borrar filtros
Borrar filtros

Fitting datapoint to a x-axis on a figure

1 visualización (últimos 30 días)
Lily
Lily el 2 de Mzo. de 2014
Editada: the cyclist el 2 de Mzo. de 2014
I'm trying to fit the x-axis on my figure so that there will be an nearly equal spacing between data points. Especially minimize the spacing between 100ms, 200ms, 400ms and 1000ms. Could you help me?
T = [0.05 0.1 0.2 0.5 1.2 2 6 12 21 50 100 200 400 1000]; %[ms]
I = [70 50 35 25 19 18 15 15 15 15 15 15 15 38]; %[mA]
figure (1)
plot(T,I,'m');
hold on
grid on
xlabel('Time [ms]');
ylabel('Current [mA]');
hold off

Respuesta aceptada

the cyclist
the cyclist el 2 de Mzo. de 2014
Editada: the cyclist el 2 de Mzo. de 2014
Maybe you want to plot on a log axis? Try the semilogx() command:
T = [0.05 0.1 0.2 0.5 1.2 2 6 12 21 50 100 200 400 1000]; %[ms]
I = [70 50 35 25 19 18 15 15 15 15 15 15 15 38]; %[mA]
figure (1)
semilogx(T,I,'.-m');
hold on
grid on
xlabel('Time [ms]');
ylabel('Current [mA]');
hold off
I also added markers at the data points, to make them stand out more.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by