How to display only bottom and left axis, not top and right axis?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
jfrazie9
am 23 Mai 2018
Beantwortet: Dinant Kistemaker
am 11 Jan. 2023
I am trying to plot this without the top and right axis, so the top and right side will not be confined by a border on the plot area. I have followed the other suggested question but it is not working for my case. I tried adding a section of the code from another example after the whole addition did not change. I am using Matlab 2017a.
subplot2 = subplot(1,2,2,'Parent',figure1,'YMinorTick','on',...
set(gca,'Visible','off'),
axes('Position',get(gca,'Position'),...
'XAxisLocation','bottom',...
'YAxisLocation','left',...
'XMinorTick','on',...
'XScale','log',...
'FontSize',16,...
'FontName','Arial'));
All I am trying to do is get the figure to plot without those two axis confining the plot area, so the second through fourth line were adding to a code that produced the figure I am after.
Thank in advance.
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 23 Mai 2018
There are syntax errors in your code. But besides that why are you creating an axis, turning its visibility off and making a new axis at the same position. Try the following code
subplot2 = subplot(1,2,2,'Parent',gcf,'YMinorTick','on',...
'XAxisLocation','bottom',...
'YAxisLocation','left',...
'XMinorTick','on',...
'XScale','log',...
'FontSize',16,...
'FontName','Arial');
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!