필터 지우기
필터 지우기

CVS yy-axis plot

조회 수: 5 (최근 30일)
Rai
Rai 2019년 5월 2일
댓글: Rai 2019년 5월 3일
Hello,
I have attached the simulation result and csv file but I want to plot these graphs in matlab after plotting the graps in matlab my Y-axis is missing. This is my code I need help please where i went wrong.
plotData = importdata('nmosesd.csv')
plotData.colheaders(1)
plotData.data(1)
figure(1)
clf
hold on
grid minor
hLine(1)=plot(plotData.data(:,1),plotData.data(:,2),'*-r','LineWidth',2)
hLine(2)=plot(plotData.data(:,3),plotData.data(:,4),'p-b','LineWidth',2)
hLine(3)=plot(plotData.data(:,5),plotData.data(:,6),'o-k','LineWidth',2)
hLine(4)=plot(plotData.data(:,7),plotData.data(:,8),'^-g','LineWidth',2)
title('Output Voltage at 10K\Omega')
set(gca,'FontSize',11);
xlabel('Time','FontSize',11,'FontWeight','bold')
ylabel('Voltage','FontSize',11,'FontWeight','bold')
legend([hLine(1) hLine(2) hLine(3) hLine(4)],'Input Power for Low Vth transistor','Current','Input Power for High Vth transistor', 'Input Power for Standard Vth transistor')

채택된 답변

Star Strider
Star Strider 2019년 5월 2일
Try this:
plotData = importdata('nmosesd.csv')
plotData.colheaders(1)
plotData.data(1)
figure(1)
clf
hold on
grid minor
hLine(1)=plot(plotData.data(:,1),plotData.data(:,2),'*-r','LineWidth',2)
hLine(2)=plot(plotData.data(:,3),plotData.data(:,4),'p-b','LineWidth',2)
hLine(3)=plot(plotData.data(:,5),plotData.data(:,6),'o-k','LineWidth',2)
hLine(4)=plot(plotData.data(:,7),plotData.data(:,8),'^-g','LineWidth',2)
hold off
yyaxis right % Add Right Y-Axis
yt = get(gca, 'YTick'); % Get Default Y-Yick Values
newyt = linspace(min(yt), max(yt), 12); % Create New Right Y-Tick Values
newytl = linspace(-100, 1000, numel(newyt)); % Create New Right Y-Tick Labels
set(gca, 'YTick',newyt, 'YTickLabel',newytl); % Set New Right Y-Tick Labels
title('Output Voltage at 10K\Omega')
set(gca,'FontSize',11);
xlabel('Time','FontSize',11,'FontWeight','bold')
ylabel('Voltage','FontSize',11,'FontWeight','bold')
I do not have your data to work with. This works on my test plot.
  댓글 수: 13
Star Strider
Star Strider 2019년 5월 3일
My pleasure.
Rai
Rai 2019년 5월 3일
I try to use 'bold' command to make my all three axis to be more visible but no success for me. Is it possible to it them bold? or not. I need help regarding bold command in the code where I have to do it

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by