Borrar filtros
Borrar filtros

x-axis value

5 visualizaciones (últimos 30 días)
Rai
Rai el 4 de Mayo de 2019
Comentada: Rik el 7 de Mayo de 2019
Hello,
I need help regarding x-axis values. I need that x-axis start at 1 ns and end at 20 ns. This is my code where i have to make changes plesase tell me.
plotData = importdata('nosnoise.csv')
plotData.colheaders(1)
plotData.data(1)
figure(1)
clf
hold on
grid minor
plot(plotData.data(:,1),plotData.data(:,2),'x-m')
plot(plotData.data(:,3),plotData.data(:,4),'x-m')
title('ESD event for the CDM')
x = linspace(0,20);
% set(gca,'FontSize',18);
xlabel('Time (ns)')
ylabel('Voltage (V)')
legend({'Immunity to power supply noise'})

Respuesta aceptada

Rik
Rik el 4 de Mayo de 2019
Editada: Rik el 4 de Mayo de 2019
You x-axis exponent has me believe that you already have the correct range and that your goal is to show nanoseconds instead of seconds on your x-axis (note the 10^-8 at the end of your axis).
You can do this two ways: either change the data, or change the axis ticks. The first is easier, but I chose to do the second.
plotData = importdata('nosnoise.csv')
plotData.colheaders(1)
plotData.data(1)
figure(1)
clf
hold on
grid minor
plot(plotData.data(:,1),plotData.data(:,2),'x-m')
plot(plotData.data(:,3),plotData.data(:,4),'x-m')
title('ESD event for the CDM')
x=linspace(0,20,5);
set(gca,'XTick',x*10^-9)
set(gca,'XTickLabels',cellfun(@num2str,num2cell(x),'UniformOutput',0))
xlabel('Time (ns)')
ylabel('Voltage (V)')
legend({'Immunity to power supply noise'})
  4 comentarios
Rai
Rai el 5 de Mayo de 2019
thank you for your help but I need more help regarding y axis how can i change there axis according to my limits. Pleae help me
Rik
Rik el 7 de Mayo de 2019
What exactly is the problem you're having now?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots 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