Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
problem regarding limits of y and x-axis
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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.
[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 comentarios
Bob Thompson
el 10 de Mayo de 2019
'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?
Respuestas (1)
Bob Thompson
el 13 de Mayo de 2019
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
0 comentarios
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!