Skip to content

Commit 4924560

Browse files
error bars in!
1 parent 893bd42 commit 4924560

File tree

6 files changed

+28
-10
lines changed

6 files changed

+28
-10
lines changed

Diff for: plotly/convertFigure.m

+2-8
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
end
7373

7474
end
75+
7576
if strcmp('patch',m_data.Type)
7677
%area plot
7778
data{data_counter} = extractDataScatter(m_data, xid, yid, m_axis.CLim, f.Colormap);
@@ -106,14 +107,7 @@
106107

107108
end
108109

109-
if strcmp('text',m_data.Type)
110-
annot_tmp = extractDataAnnotation(m_data, xid, yid);
111-
if numel(annot_tmp)>0
112-
annotations{annot_counter} = annot_tmp;
113-
annot_counter = annot_counter+1;
114-
end
115-
116-
end
110+
117111

118112

119113
end

Diff for: plotly/fig2plotly_aux/extractDataGeneral.m

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
if numel(d.DisplayName)>0
1818
data.name = parseText(d.DisplayName);
19+
else
20+
data.showlegend = false;
1921
end
2022

2123

Diff for: plotly/fig2plotly_aux/extractDataScatter.m

+18-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
%define mode
5353
if marker_bool && line_bool
54-
data.mode = 'lines+markers';
54+
data.mode = 'lines+markers';
5555
else
5656
if marker_bool
5757
data.mode = 'markers';
@@ -61,6 +61,23 @@
6161
end
6262
end
6363

64+
% ERROR BARS
65+
if isfield(d, 'LData')
66+
data.error_y.type = 'data';
67+
data.error_y.array = d.LData;
68+
data.error_y.visible = true;
69+
if isfield(d, 'Color') && size(d.Color,2)==3
70+
data.error_y.color = parseColor(d.Color);
71+
else
72+
data.error_y.color = 'rgb(100, 100, 100)';
73+
end
74+
if isfield(data, 'marker') ...
75+
&& isfield(data.marker, 'line') ...
76+
&& isfield(data.marker.line, 'width')
77+
data.error_y.thickness = data.marker.line.width;
78+
end
79+
end
80+
6481

6582

6683
end

Diff for: plotly/fig2plotly_aux/extractLegend.m

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
if strcmp(a.Visible, 'on')
1212

13+
legend.traceorder = 'reversed';
14+
1315
%POSITION
1416
x_ref = a.Position(1)+a.Position(3)/2;
1517
y_ref = a.Position(2)+a.Position(4)/2;

Diff for: plotly/fig2plotly_aux/parseMarker.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
%SIZE
3131
if isfield(d, 'MarkerSize')
32-
marker_str.size = d.MarkerSize;
32+
marker_str.size = 1.3*d.MarkerSize;
3333
end
3434
if isfield(d, 'SizeData')
3535
if numel(d.SizeData)==1

Diff for: plotly/fig2plotly_aux/parseText.m

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
text_str = input_text;
1616
else
1717
text_str=[];
18+
if cases(1)>1
19+
text_str = [text_str input_text(1:cases(1)-1)];
20+
end
1821
for i=1:numel(cases)-1
1922
text_str = [text_str '\' input_text(cases(i):cases(i+1)-1)];
2023
end

0 commit comments

Comments
 (0)