tfontsizeorg1 = ax1.FontSize;
f1_scale3 = 28 * leafcount * 4 / 3;
f1_scale4 = 28 * leafcount * 2 / 3;
f1_scale4 = f2_scale3 / 2;
legcol = fix((leafcount - 1) / 15) + 1;
f1.Position(3) = f1_scale3;
f1.Position(4) = f1_scale4;
tfontsize1 = tfontscale1 * tfontsizeorg1 / 560 * f1_scale3;
ZXAxis1 = max(tfontsize1 * 9 / 11 /2, 9);
Zlegend1 = ZXAxis1 * 9 / 10;
r = random(pd,[valid_rows,1]);
Zleaf = randi([1, leafcount], valid_rows, 1);
Xl = [r ones(sum(valid_rows), 1)];
orgplot = gscatter(Xl(:,1),Xl(:,2),Zleaf);
OrgCol = vertcat(orgplot.Color);
[OrgCsize, ~, iOrgdx] = unique(OrgCol, 'rows');
legend('Location','eastoutside')
title(usedata_name,'FontSize',tfontsize1);
ax1.XAxis.FontSize = ZXAxis1;
ax1.Legend.FontSize = Zlegend1;