0
考慮到this question,我試圖用兩個獨立的plot使用座標軸而不是plotyy來解決問題,該座標不能與'boxplot'和'plot ':繪製兩個不同的圖(y軸),在matlab中共享相同的x
%%% definition of my x=y line axes
y2 = 1:6;
x2 = 1:6;
% Plot the first data set using boxplot, that results in 6 boxes
load carsmall;
boxplot(MPG,Origin)
% Get the axes and configure it
ax1 = gca;
set(ax1,'XColor','r','YColor','r')
%Create the new axes
ax2 = axes('Position',get(ax1,'Position'),...
'XAxisLocation','top',...
'YAxisLocation','right',...
'Color','none',...
'XColor','k','YColor','k');
% Plot the second data set with the new axes
hl2 =plot(x2,y2,'Color','k','parent',ax2);
但仍然沒有得到我的最後陰謀正確的方式。有誰知道爲什麼?
請張貼可執行代碼。 (什麼是box_panda_8?) – thewaywewalk
@thewaywewalk,請看現在更新的問題;) – Amir