필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

problem regarding limits of y and x-axis

조회 수: 1 (최근 30일)
Rai
Rai 2019년 5월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello,
I am having problems regarding the limits of x and yy axis in csv file. I have share the code, csv file and required graph which plot in the matlab please help where is
problem in the code why the graph is not look like this.
fast.PNG
[plotData,S] = xlsread('nosfast.csv');
figure
[Ax,H1,H2] = plotyy(plotData(:,3),plotData(:,4), plotData(:,1),plotData(:,2));
hold on
grid minor
plot(plotData(:,5),plotData(:,6))
hold off
H1.LineStyle = '-';
H2.LineStyle = '-';
hold off
ylabel(Ax(1), 'Voltage(V)')
ylabel(Ax(2), 'Current(nA)');
% title('ESD event under negative HBM')
legend('Idd, M0', 'V1', 'V2') % Create Legend
ytr = get(Ax(2), 'YTick'); % Get Default Right Y-Yick Values
newytr = linspace(min(ytr), max(ytr), 11); % Create New Right Y-Tick Values
newytrl = linspace(0, 1000, numel(newytr)); % Create New Right Y-Tick Labels
set(Ax(2), 'YTick',newytr, 'YTickLabel',newytrl); % Set New Right Y-Tick Labels
ytl = get(Ax(1), 'YTick'); % Get Default Left Y-Yick Values
newytl = linspace(min(ytl), max(ytl), 12); % Create New Left Y-Tick Values
newytll = round(newytl,1); % Create New Left Y-Tick Labels
set(Ax(1), 'YTick',newytl, 'YTickLabel',newytll); % Set New Left Y-Tick Labels
xt = get(gca, 'XTick');
set(gca, 'XTick',xt, 'XTickLabel',xt*1E+6)
xlabel('Time(us)')
  댓글 수: 2
Bob Thompson
Bob Thompson 2019년 5월 10일
'problem in the code why the graph is not look like this'
What exactly do you mean by this? Is the data wrong, is it just a matter of presentation, or is there something else I'm missing?
Rai
Rai 2019년 5월 10일
Thank you for answer
My cvs data is correct but after matlab plotting axis are not correct. This graph is different with the above desired graph. May be my code is not correct please help me. I hope you understand.fasttt.png

답변 (1개)

Bob Thompson
Bob Thompson 2019년 5월 13일
It seems like all you need to do is change the axis range.
This can be done manually in the figure window. Open the 'Edit' menu and select 'Axes Properties...'
Alternatively, you can set the range with code using something like the following:
figure(1)
plot(x,y)
axis([0 1 0 1]) % Sets x and y-axes to range from 0 to 1

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by