Effacer les filtres
Effacer les filtres

CVS yy-axis plot

5 vues (au cours des 30 derniers jours)
Rai
Rai le 2 Mai 2019
Commenté : Rai le 3 Mai 2019
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')

Réponse acceptée

Star Strider
Star Strider le 2 Mai 2019
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 commentaires
Star Strider
Star Strider le 3 Mai 2019
My pleasure.
Rai
Rai le 3 Mai 2019
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

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by