How to make a specific bar to be hatched with a specific color
I have the array y1 which consists of 5 sets, and each set consists of 6 elements. For example, the first set is 0.25 1.14 2.20 0.21 1.09 2.16. I need to make the last three elements in each set to be cross hatched with a specific color I choose.. how can I make it. my code is below
x=[1,2,3,4,5];
y1=[0.25 1.14 2.20 0.21 1.09 2.16 ; 0.48 2.26 4.40 0.42 2.20 4.34; 0.72 3.38 6.58 0.74 3.27 5.86 ;1.01 4.56 8.82 0.99 4.34 7.65;1.33 5.76 11.04 1.33 5.50 9.61 ]
figure
h1 = bar(y1);
set(h1, {‘DisplayName’}, {‘textbf{Proposed framework without AES}’,’textbf{Proposed framework with AES-128}’,’textbf{Proposed framework with AES-256}’,’textbf{Delay-energy-aware without AES}’,’textbf{Delay-energy-aware with AES-128}’,’textbf{Delay-energy-aware with AES-256}’}’)
set(gca,’TickLabelInterpreter’,’latex’, ‘LineWidth’, 1,’FontSize’,12, ‘YMinorTick’,’on’);
legend(‘Location’,’northwest’,’Interpreter’,’latex’, ‘FontWeight’,’bold’,’FontSize’,9.5,…
‘FontName’,’Palatino Linotype’,…
‘Location’,’best’);
xlabel(‘$textbf{Number of tasks}$’,’FontWeight’,’bold’,’FontSize’,12,…
‘FontName’,’Palatino Linotype’,’Interpreter’,’latex’);
ylabel(‘$textbf{Total delay [S]}$’,’FontWeight’,’bold’,’FontSize’,12,…
‘FontName’,’Palatino Linotype’,’Interpreter’,’latex’);I have the array y1 which consists of 5 sets, and each set consists of 6 elements. For example, the first set is 0.25 1.14 2.20 0.21 1.09 2.16. I need to make the last three elements in each set to be cross hatched with a specific color I choose.. how can I make it. my code is below
x=[1,2,3,4,5];
y1=[0.25 1.14 2.20 0.21 1.09 2.16 ; 0.48 2.26 4.40 0.42 2.20 4.34; 0.72 3.38 6.58 0.74 3.27 5.86 ;1.01 4.56 8.82 0.99 4.34 7.65;1.33 5.76 11.04 1.33 5.50 9.61 ]
figure
h1 = bar(y1);
set(h1, {‘DisplayName’}, {‘textbf{Proposed framework without AES}’,’textbf{Proposed framework with AES-128}’,’textbf{Proposed framework with AES-256}’,’textbf{Delay-energy-aware without AES}’,’textbf{Delay-energy-aware with AES-128}’,’textbf{Delay-energy-aware with AES-256}’}’)
set(gca,’TickLabelInterpreter’,’latex’, ‘LineWidth’, 1,’FontSize’,12, ‘YMinorTick’,’on’);
legend(‘Location’,’northwest’,’Interpreter’,’latex’, ‘FontWeight’,’bold’,’FontSize’,9.5,…
‘FontName’,’Palatino Linotype’,…
‘Location’,’best’);
xlabel(‘$textbf{Number of tasks}$’,’FontWeight’,’bold’,’FontSize’,12,…
‘FontName’,’Palatino Linotype’,’Interpreter’,’latex’);
ylabel(‘$textbf{Total delay [S]}$’,’FontWeight’,’bold’,’FontSize’,12,…
‘FontName’,’Palatino Linotype’,’Interpreter’,’latex’); I have the array y1 which consists of 5 sets, and each set consists of 6 elements. For example, the first set is 0.25 1.14 2.20 0.21 1.09 2.16. I need to make the last three elements in each set to be cross hatched with a specific color I choose.. how can I make it. my code is below
x=[1,2,3,4,5];
y1=[0.25 1.14 2.20 0.21 1.09 2.16 ; 0.48 2.26 4.40 0.42 2.20 4.34; 0.72 3.38 6.58 0.74 3.27 5.86 ;1.01 4.56 8.82 0.99 4.34 7.65;1.33 5.76 11.04 1.33 5.50 9.61 ]
figure
h1 = bar(y1);
set(h1, {‘DisplayName’}, {‘textbf{Proposed framework without AES}’,’textbf{Proposed framework with AES-128}’,’textbf{Proposed framework with AES-256}’,’textbf{Delay-energy-aware without AES}’,’textbf{Delay-energy-aware with AES-128}’,’textbf{Delay-energy-aware with AES-256}’}’)
set(gca,’TickLabelInterpreter’,’latex’, ‘LineWidth’, 1,’FontSize’,12, ‘YMinorTick’,’on’);
legend(‘Location’,’northwest’,’Interpreter’,’latex’, ‘FontWeight’,’bold’,’FontSize’,9.5,…
‘FontName’,’Palatino Linotype’,…
‘Location’,’best’);
xlabel(‘$textbf{Number of tasks}$’,’FontWeight’,’bold’,’FontSize’,12,…
‘FontName’,’Palatino Linotype’,’Interpreter’,’latex’);
ylabel(‘$textbf{Total delay [S]}$’,’FontWeight’,’bold’,’FontSize’,12,…
‘FontName’,’Palatino Linotype’,’Interpreter’,’latex’); hatched bars, matlab bars, matlab MATLAB Answers — New Questions