フィルターのクリア

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