create 3 subplots from 9 plots using a matrix loop

7 ビュー (過去 30 日間)
Jonas Grossmann
Jonas Grossmann 2019 年 11 月 21 日
回答済み: Siriniharika Katukam 2019 年 12 月 2 日
Hi, I have a function that takes a matrix as an input and creates plots, it looks like this:
function p = pub_fig_test(R,Lable,legend,path_latex, savename)
axislines = [199/255,221/255,242/255];
color_code = [0,84/255,159/255;
227/255,0,102/255;
255/255,237/255,0;
0,97/255,101/255;
87/255,171/255,39/255;
246/255,168/255,0;
204/255,7/255,30/255;
122/255,111/255,172/255]; %RGB Farbcodes
A = plot(R);
for j=1:size(legend,2)
set(A(j),'Color',color_code(j,:));
end
export_fig([path_latex savename], '-pdf');
this creates 9 Plots. I would like to join every 3 plots this function creates into a subplot. Any Ideas? Thanks :)

回答 (1 件)

Siriniharika Katukam
Siriniharika Katukam 2019 年 12 月 2 日
Hi,
Use subplot to plot each of the 9 plots you get in a 3X3 matrix form.
Using subplot(33i) where (i=1 to 9) and plot each of the 9 plots you obtained.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by