Skip to content

Commit f778e1a

Browse files
committed
susahnyaaa
1 parent 59b0544 commit f778e1a

File tree

4 files changed

+61
-267
lines changed

4 files changed

+61
-267
lines changed

SaveLegendToImage.m

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
function saveLegendToImage(figHandle, legHandle, ...
2+
fileName, fileType)
3+
4+
%make all contents in figure invisible
5+
allLineHandles = findall(figHandle, 'type', 'line');
6+
7+
for i = 1:length(allLineHandles)
8+
9+
allLineHandles(i).XData = NaN; %ignore warnings
10+
11+
end
12+
13+
%make axes invisible
14+
axis off
15+
16+
%move legend to lower left corner of figure window
17+
legHandle.Units = 'pixels';
18+
boxLineWidth = legHandle.LineWidth;
19+
%save isn't accurate and would swallow part of the box without factors
20+
legHandle.Position = [6 * boxLineWidth, 6 * boxLineWidth, ...
21+
legHandle.Position(3), legHandle.Position(4)];
22+
legLocPixels = legHandle.Position;
23+
24+
%make figure window fit legend
25+
figHandle.Units = 'pixels';
26+
% figHandle.InnerPosition = [1, 1, legLocPixels(3) + 12 * boxLineWidth, ...
27+
% legLocPixels(4) + 12 * boxLineWidth];
28+
29+
%save legend
30+
% saveas(figHandle, [fileName, '.', fileType], fileType);
31+
32+
end

jmeterplot.m~

Lines changed: 0 additions & 124 deletions
This file was deleted.

pmfjmeter.m

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,52 @@
2626

2727
hold on
2828

29-
% set(gca, 'YScale', 'log')
30-
stem(x,y);
31-
stem(x,y1);
32-
stem(x,y2);
29+
set(gca, 'YScale', 'log')
30+
31+
p(1) = stem(x,y,'r');
32+
p(2) = stem(x,y1,'Color',[0 0.7 0]);
33+
p(3) = stem(x,y2,'b');
34+
35+
% legend(gca,'MQTT Connect','MQTT Disconnect','MQTT Publish')
36+
3337

3438

3539

3640
box on;
3741
set(gcf,'Units','Inches');
3842
ax = gca;
3943
ax.YAxis.Exponent = 0;
44+
ax.XAxis.Exponent = 0;
4045
ax.GridLineStyle = ':';
4146
ax.GridAlpha = 0.3;
4247
ax.LineWidth = 0.9;
4348
set(gca,'FontSize',16)
4449

4550

46-
title({'Response Times Distribution','Instance Type (m5.xlarge/m5a.xlarge)'},'FontSize',14);
51+
52+
title({'','Response Times Distribution','Instance Type (m5.xlarge/m5a.xlarge)'},'FontSize',14);
4753
xlabel(ylabels,'FontSize',15);
48-
ylabel('Number of responses','FontSize',15);
49-
% ylabel('\boldmath \bf{$\log _{10} (Number\, of\, responses)$}','FontSize',15,'interpreter','latex','FontWeight', 'bold');
54+
% ylabel('Number of responses','FontSize',15);
55+
ylabel('\boldmath \bf{$\log _{10} (Number\, of\, responses)$}','FontSize',15,'interpreter','latex','FontWeight', 'bold');
5056
ax.XAxis.Exponent = 0;
5157
pos = get(gcf,'Position');
5258
set(findall(gcf,'-property','FontName'),'FontName','Times New Roman');
5359
set(gcf,'PaperPositionMode','Auto','PaperUnits','Inches','PaperSize',[pos(3), pos(4)]);
60+
61+
breakxaxis([40000 280000]);
62+
%https://stackoverflow.com/questions/18117664/how-can-i-show-only-the-legend-in-matlab
63+
p2(1) = stem(nan,nan,'r','DisplayName','MQTT Connect');
64+
p2(2) = stem(nan,nan,'DisplayName','MQTT Disconnect','Color',[0 0.7 0]);
65+
p2(3) = stem(nan,nan,'b','DisplayName','MQTT Publish');
66+
lgdh=legend(p2);
67+
lgdh.Location = 'northWest';
68+
SaveLegendToImage(gca, lgdh, 'testImage', 'tif');
69+
set(findall(gca, 'type', 'text'), 'visible', 'off')
70+
71+
legend show;
5472
print(gcf,'-dpdf',strcat('/Users/mymac/Documents/SCRIPTSHEET/SKRIPSI/hasilgrafik/',strcat(dataID,stringCSV)),'-r0');
5573
savefig(strcat('/Users/mymac/Documents/SCRIPTSHEET/SKRIPSI/hasilgrafik/',strcat(dataID,stringCSV)));
56-
hold off
74+
hold off
75+
76+
77+

redismongoSUM.m~

Lines changed: 0 additions & 135 deletions
This file was deleted.

0 commit comments

Comments
 (0)