필터 지우기
필터 지우기

x-axis value

조회 수: 5 (최근 30일)
Rai
Rai 2019년 5월 4일
댓글: Rik 2019년 5월 7일
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'})

채택된 답변

Rik
Rik 2019년 5월 4일
편집: Rik 2019년 5월 4일
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
Rai
Rai 2019년 5월 5일
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 2019년 5월 7일
What exactly is the problem you're having now?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by