Filter löschen
Filter löschen

x-axis value

5 Ansichten (letzte 30 Tage)
Rai
Rai am 4 Mai 2019
Kommentiert: Rik am 7 Mai 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'})

Akzeptierte Antwort

Rik
Rik am 4 Mai 2019
Bearbeitet: Rik am 4 Mai 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 Kommentare
Rai
Rai am 5 Mai 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 am 7 Mai 2019
What exactly is the problem you're having now?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by