Borrar filtros
Borrar filtros

subplot axis scaling

2 visualizaciones (últimos 30 días)
old_user_rat
old_user_rat el 26 de Abr. de 2012
Dear all,
I am using this code:
%case i
y1=0:0.001:.25;
a1=y1;
y1=0.251:0.001:0.5;
a2=1/2-y1;
y1=0.501:0.001:0.75;
a3=-1/2+y1;
y1=0.751:0.001:1;
a4=1-y1;
y1=0:0.001:1;
a=[a1 a2 a3 a4];
subplot(2,1,1);plot(a)
title('case i')
As part of a multiple plot. Why is MATLAB rescaling my x-axis by multiplying through by 1000!?
Thanks, David

Respuesta aceptada

Honglei Chen
Honglei Chen el 26 de Abr. de 2012
You didn't specify x axis, that's why the x axis becomes the indices. Just do
plot(y1,a)

Más respuestas (1)

Thomas
Thomas el 26 de Abr. de 2012
because
size(a)
ans =
1.00 1001.00
It is not multiplying your xaxis by 1000, it is just plotting 1001 valuea of a for x going 1:1001
use plot(y1,a)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by