is there a way to automatically label columns with stackedplot with a common name?
    5 次查看(过去 30 天)
  
       显示 更早的评论
    
hi, i have found how to  use stackedplot, but so far i haven't found a way to make the stackedplot()  to automatically make labels using the same name without having to input the name manually for each plot

i basically want to know if there is a way to make stackedplot() to instead of say column #, to say channel #  without having to write "channel 1", "channel 2", "channel 3", etc
0 个评论
采纳的回答
  KSSV
      
      
 2024-11-3
        You rename the labels of the table to the desired and use stackedplot. 
A = rand(10,4) ;
T = array2table(A) ;
stackedplot(T)
% Rename the labels 
T.Properties.VariableNames = {'a', 'b', 'c', 'd'} ;
stackedplot(T)
2 个评论
  Stephen23
      
      
 2024-11-3
				N = 4;
T = array2table(rand(10,N), 'VariableNames',"channel#"+(1:N));
stackedplot(T)
更多回答(0 个)
另请参阅
类别
				在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!





