Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24a43ee

Browse files
committed
add strip style by default comment
remove stip = false in fig2plotly call
1 parent 0b6ef6f commit 24a43ee

File tree

30 files changed

+241
-179
lines changed

30 files changed

+241
-179
lines changed

hard-coded/chart-types/area/matlab-basic-area/script.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
fig = figure
88
area(y)
99

10-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
10+
%--PLOTLY--%
11+
12+
% Strip MATLAB style by default!
13+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1114
plotly_url = response.url;

hard-coded/chart-types/bar/matlab-basic-bar/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
fig = figure;
88
bar(x,y);
99

10-
% PLOTLY
11-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
10+
%--PLOTLY--%
11+
12+
% Strip MATLAB style by default!
13+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1214
plotly_url = response.url;
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
signin({% if username %}'{{username}}'{% else %}'MATLABAPI'{% endif %}, {% if api_key %}'{{api_key}}'{% else %}'jzt0hr6tzv'{% endif %})
22

3-
%bins
3+
%bins
44
x = 1900:10:2000;
55

6-
%data
6+
%data
77
y1 = [75.99,91.92,105.71,...
88
123.23,131.69,...
99
150.67,179.33,203.12,...
1010
226.55,249.63,281.42];
11-
%data
11+
%data
1212
y2 = [55.2,61.972,65.71,...
1313
76.23,87.669,...
1414
91.7,103.23,124.21,...
1515
130.55,135.63,145.22];
1616

17-
%create MATLAB bar chart
18-
fig = figure;
17+
%create MATLAB bar chart
18+
fig = figure;
1919
bar(x, y1);
2020
hold on
2121
bar(x, y2,'r');
2222

2323
%add legend
24-
legend('group1','group2');
24+
legend('group1','group2');
2525

26-
% PLOTLY
27-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
26+
%--PLOTLY--%
27+
28+
% Strip MATLAB style by default!
29+
response = fig2plotly(fig, 'filename', '>>>filename<<<';
2830
plotly_url = response.url;

hard-coded/chart-types/bar/matlab-stacked-bar/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
ylabel('Cases (in thousands)');
1515
legend('Measles', 'Mumps', 'Chicken pox');
1616

17-
% PLOTLY
18-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
17+
%--PLOTLY--%
18+
19+
% Strip MATLAB style by default!
20+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1921
plotly_url = response.url;
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
11
signin({% if username %}'{{username}}'{% else %}'MATLABAPI'{% endif %}, {% if api_key %}'{{api_key}}'{% else %}'jzt0hr6tzv'{% endif %})
22

3-
%bins
3+
%bins
44
x = 1900:10:2000;
55

6-
%data
6+
%data
77
y1 = [75.99,91.92,105.71,...
88
123.23,131.69,...
99
150.67,179.33,203.12,...
1010
226.55,249.63,281.42];
11-
%data
11+
%data
1212
y2 = [55.2,61.972,65.71,...
1313
76.23,87.669,...
1414
91.7,103.23,124.21,...
1515
130.55,135.63,145.22];
1616

17-
%create MATLAB bar chart
18-
fig = figure('Color','w');
17+
%create MATLAB bar chart
18+
fig = figure('Color','w');
1919
bar(x, [y1' y2'],'grouped');
20-
ax = get(gca);
21-
cat = ax.Children;
20+
ax = get(gca);
21+
cat = ax.Children;
2222

2323
%set the first bar chart style
24-
set(cat(2),'FaceColor',[145 25 206]/255,'BarWidth',2);
24+
set(cat(2),'FaceColor',[145 25 206]/255,'BarWidth',2);
2525

2626
%set the second bar chart style
27-
set(cat(1),'FaceColor',[45 125 206]/255,'BarWidth',2);
27+
set(cat(1),'FaceColor',[45 125 206]/255,'BarWidth',2);
2828

2929
%set the axes style
3030
set(gca,'box','off');
3131

32-
% PLOTLY
33-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
32+
%--PLOTLY--%
33+
34+
% Strip MATLAB style by default!
35+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
3436
plotly_url = response.url;

hard-coded/chart-types/box/matlab-basic-box-plot/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
fig = figure;
99
boxplot([data1,data2])
1010

11-
%--PLOTLY--%
12-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
11+
%--PLOTLY--%
12+
13+
% Strip MATLAB style by default!
14+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1315
plotly_url = response.url;

hard-coded/chart-types/error-bar/matlab-symmetric-error-bars/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
fig = figure
88
errorbar(x,y,e)
99

10-
% PLOTLY
11-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
10+
%--PLOTLY--%
11+
12+
% Strip MATLAB style by default!
13+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1214
plotly_url = response.url;

hard-coded/chart-types/heatmap/matlab-basic-heatmap/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
imagesc(z);
1414
colorbar;
1515

16-
% PLOTLY
17-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
16+
%--PLOTLY--%
17+
18+
% Strip MATLAB style by default!
19+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1820
plotly_url = response.url;

hard-coded/chart-types/histogram/matlab-basic-histogram/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
fig = figure;
88
hist(x)
99

10-
% PLOTLY
11-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
10+
%--PLOTLY--%
11+
12+
% Strip MATLAB style by default!
13+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1214
plotly_url = response.url;
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
signin({% if username %}'{{username}}'{% else %}'MATLABAPI'{% endif %}, {% if api_key %}'{{api_key}}'{% else %}'jzt0hr6tzv'{% endif %})
22

3-
% horizontal histogram
3+
% horizontal histogram
44
sd = 0.1;
55
mu = 1;
66
data = mu + sd*randn(1,5000);
@@ -9,10 +9,12 @@
99
nbins = 50;
1010

1111
% make/plot histogram of data
12-
fig = figure;
12+
fig = figure;
1313
[h1 bins]= hist(data,nbins);
14-
barh(bins,h1);
14+
barh(bins,h1);
1515

16-
% PLOTLY
17-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
16+
%--PLOTLY--%
17+
18+
% Strip MATLAB style by default!
19+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
1820
plotly_url = response.url;

hard-coded/chart-types/histogram/matlab-overlaid-histogram/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
set(xd(i),'XData',dat);
3434
end
3535

36-
% PLOTLY
37-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
36+
%--PLOTLY--%
37+
38+
% Strip MATLAB style by default!
39+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
3840
plotly_url = response.url;
Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
signin({% if username %}'{{username}}'{% else %}'MATLABAPI'{% endif %}, {% if api_key %}'{{api_key}}'{% else %}'jzt0hr6tzv'{% endif %})
22

3-
% stacked histogram
4-
sd1 = 0.1;
5-
mu1 = 0;
6-
data1 = mu1+ sd1.*randn(5000,1);
7-
sd2 = 0.1;
8-
mu2 = 0;
9-
data2 = mu2+ sd2.*randn(5000,1);
3+
% stacked histogram
4+
sd1 = 0.1;
5+
mu1 = 0;
6+
data1 = mu1+ sd1.*randn(5000,1);
7+
sd2 = 0.1;
8+
mu2 = 0;
9+
data2 = mu2+ sd2.*randn(5000,1);
1010

11-
% bin specs.
12-
nbins = 50;
13-
bound = 1;
14-
bins = linspace(-bound,bound,nbins);
11+
% bin specs.
12+
nbins = 50;
13+
bound = 1;
14+
bins = linspace(-bound,bound,nbins);
1515

16-
fig = figure;
16+
fig = figure;
1717

1818
% first histogram
19-
y1 = hist(data1, bins);
19+
y1 = hist(data1, bins);
2020

2121
% second histogram
2222
y2 = hist(data2, bins);
2323

24-
% stacked histograms
24+
% stacked histograms
2525
bar([y1.' y2.'],'stacked')
2626

27-
% relabelx-axis range/ticks
28-
xd = findobj('-property','XData');
27+
% relabelx-axis range/ticks
28+
xd = findobj('-property','XData');
2929

3030
for i=1:2
3131
dat = get(xd(i),'XData');
32-
dat = 2*dat/nbins - bound;
33-
set(xd(i),'XData',dat);
32+
dat = 2*dat/nbins - bound;
33+
set(xd(i),'XData',dat);
3434
end
3535

36-
% PLOTLY
37-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
36+
%--PLOTLY--%
37+
38+
% Strip MATLAB style by default!
39+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
3840
plotly_url = response.url;

hard-coded/chart-types/line_exclusive/matlab-basic-line/script.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
y1 = sin(x);
55
y2 = cos(x);
66

7-
fig = figure;
7+
fig = figure;
88
plot(x,y1,x,y2);
99

1010
%--PLOTLY--%
11-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
12-
plotly_url = response.url;
11+
12+
% Strip MATLAB style by default!
13+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
14+
plotly_url = response.url;
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
signin({% if username %}'{{username}}'{% else %}'MATLABAPI'{% endif %}, {% if api_key %}'{{api_key}}'{% else %}'jzt0hr6tzv'{% endif %})
22

33
% sampling rate
4-
fs = 500;
4+
fs = 500;
55

6-
% duration
7-
dur = 1;
6+
% duration
7+
dur = 1;
88

9-
% time vector
10-
t = 1 + linspace(-dur,dur,fs);
9+
% time vector
10+
t = 1 + linspace(-dur,dur,fs);
1111

1212
% signal
13-
sig = [t(1:length(t)/2) t(1:length(t)/2)];
13+
sig = [t(1:length(t)/2) t(1:length(t)/2)];
1414

1515
% noise
16-
sign = sig + 0.1*randn(1,length(sig));
16+
sign = sig + 0.1*randn(1,length(sig));
1717

1818
% plot signal + noise
19-
fig = figure;
20-
sp = plot(t,sig,'LineWidth',8);
19+
fig = figure;
20+
sp = plot(t,sig,'LineWidth',8);
2121
hold on
22-
sn = plot(t,sign,'ro');
22+
sn = plot(t,sign,'ro');
2323

2424
% title/labels
25-
title('Singal Noise');
26-
xlabel('Time (s.)');
27-
ylabel('Amplitude');
25+
title('Singal Noise');
26+
xlabel('Time (s.)');
27+
ylabel('Amplitude');
2828

29-
%--PLOTLY--%
30-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
31-
plotly_url = response.url;
29+
%--PLOTLY--%
30+
31+
% Strip MATLAB style by default!
32+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
33+
plotly_url = response.url;

hard-coded/chart-types/line_exclusive/matlab-line-markers/script.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
plot(x, y0, 'r+', x, y1, 'go', x, y2, 'b*', x, y3, 'cx', ...
1616
x, y4, 'ms', x, y5, 'yd', x, y6, 'kv');
1717

18-
%--PLOTLY--%
18+
%--PLOTLY--%
1919

20-
% strip = false => preserve MATLAB style!
20+
% strip = false => preserve MATLAB style!
2121

22-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
22+
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
2323
plotly_url = response.url;

hard-coded/chart-types/line_exclusive/matlab-log-log-line/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
xlabel('omega');
2323
ylabel('|G|[omega]');
2424

25-
% PLOTLY
26-
response = fig2plotly(gcf, 'filename', '>>>filename<<<', 'strip', false);
25+
%--PLOTLY--%
26+
27+
% Strip MATLAB style by default!
28+
response = fig2plotly(gcf, 'filename', '>>>filename<<<');
2729
plotly_url = response.url;

hard-coded/chart-types/line_exclusive/matlab-semi-logy/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
xlabel('EbNo (dB)');
2121
ylabel('SER and BER');
2222

23-
% PLOTLY
24-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
23+
%--PLOTLY--%
24+
25+
% Strip MATLAB style by default!
26+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
2527
plotly_url = response.url;

hard-coded/chart-types/log/matlab-log-log-line-2/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
xlabel('omega');
2323
ylabel('|G|[omega]');
2424

25-
% PLOTLY
26-
response = fig2plotly(gcf, 'filename', '>>>filename<<<', 'strip', false);
25+
%--PLOTLY--%
26+
27+
% Strip MATLAB style by default!
28+
response = fig2plotly(gcf, 'filename', '>>>filename<<<');
2729
plotly_url = response.url;

hard-coded/chart-types/log/matlab-semi-logy-2/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
xlabel('EbNo (dB)');
2121
ylabel('SER and BER');
2222

23-
% PLOTLY
24-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
23+
%--PLOTLY--%
24+
25+
% Strip MATLAB style by default!
26+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
2527
plotly_url = response.url;

hard-coded/chart-types/network_graphs/matlab-graph-plot/script.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
gplot(H, V, 'r-');
1616
axis off equal;
1717

18-
% PLOTLY
19-
response = fig2plotly(fig, 'filename', '>>>filename<<<', 'strip', false);
18+
%--PLOTLY--%
19+
20+
% Strip MATLAB style by default!
21+
response = fig2plotly(fig, 'filename', '>>>filename<<<');
2022
plotly_url = response.url;

0 commit comments

Comments
 (0)