Skip to content

Commit 923455d

Browse files
Some bug fixes
1 parent 87bc388 commit 923455d

File tree

3 files changed

+15
-218
lines changed

3 files changed

+15
-218
lines changed

plotly/convertFigure.asv

-159
This file was deleted.

plotly/fig2plotly.asv

-54
This file was deleted.

plotly/fig2plotly_aux/extractTitle.m

+15-5
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,23 @@
2727

2828
%POSITION
2929
xd_range = xa.domain(2) - xa.domain(1);
30-
yd_range = ya.domain(2) - ya.domain(1);
3130
xr_range = xa.range(2) - xa.range(1);
31+
if strcmp('linear', xa.type)
32+
data.x = xa.domain(1)+ (d.Extent(1) - xa.range(1))*xd_range / xr_range;
33+
data.x = xa.domain(1)+ 0.5*xd_range;
34+
end
35+
if strcmp('log', xa.type)
36+
data.x = xa.domain(1)+ 0.5*xd_range;
37+
end
38+
yd_range = ya.domain(2) - ya.domain(1);
3239
yr_range = ya.range(2) - ya.range(1);
33-
34-
%use center of bounding box as reference
35-
data.x = xa.domain(1)+ (d.Extent(1)+d.Extent(3)/2 - xa.range(1))*xd_range / xr_range;
36-
data.y = ya.domain(1)+ (d.Extent(2)+d.Extent(4)/2 - ya.range(1))*yd_range / yr_range;
40+
if strcmp('linear', ya.type)
41+
data.y = ya.domain(1)+ (d.Extent(2) - ya.range(1))*yd_range / yr_range;
42+
data.y = ya.domain(2)+ 0.04;
43+
end
44+
if strcmp('log', ya.type)
45+
data.y = ya.domain(2)+ 0.04;
46+
end
3747

3848
data.align = d.HorizontalAlignment;
3949
data.xanchor = 'center';

0 commit comments

Comments
 (0)