Skip to content

Commit

Permalink
fix issue #422
Browse files Browse the repository at this point in the history
  • Loading branch information
galvisgilberto committed Nov 1, 2021
1 parent a3fd27a commit f999448
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
7 changes: 5 additions & 2 deletions plotly/plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@
obj.PlotOptions.AspectRatio = [];
obj.PlotOptions.CameraEye = [];
obj.PlotOptions.is_headmap_axis = false;
obj.PlotOptions.Quality = -1;
obj.PlotOptions.Zmin = [];
obj.PlotOptions.FrameDuration = 1; % in ms.
obj.PlotOptions.FrameTransitionDuration = 0; % in ms.
obj.PlotOptions.geoRenderType = 'geo';
obj.PlotOptions.DomainFactor = [1 1 1 1];

% offline options
obj.PlotOptions.Offline = true;
Expand Down Expand Up @@ -274,6 +273,10 @@
if(strcmpi(varargin{a},'geoRenderType'))
obj.PlotOptions.geoRenderType = varargin{a+1};
end
if(strcmpi(varargin{a},'DomainFactor'))
len = length(varargin{a+1});
obj.PlotOptions.DomainFactor(1:len) = varargin{a+1};
end
end
end

Expand Down
22 changes: 7 additions & 15 deletions plotly/plotlyfig_aux/core/updateAxis.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,29 +89,21 @@

%-------------------------------------------------------------------------%

%-getting and setting postion data-%
xo = axisData.Position(1);
yo = axisData.Position(2);
w = axisData.Position(3);
h = axisData.Position(4);

if obj.PlotOptions.AxisEqual
wh = min(axisData.Position(3:4));
w = wh;
h = wh;
end
%-get position data-%
axisPos = axisData.Position .* obj.PlotOptions.DomainFactor;
if obj.PlotOptions.AxisEqual, axisPos(3:4) = min(axisPos(3:4)); end

%-------------------------------------------------------------------------%

%-xaxis domain-%
xaxis.domain = min([xo xo + w],1);
scene.domain.x = min([xo xo + w],1);
xaxis.domain = min([axisPos(1) sum(axisPos([1,3]))], 1);
scene.domain.x = xaxis.domain;

%-------------------------------------------------------------------------%

%-yaxis domain-%
yaxis.domain = min([yo yo + h],1);
scene.domain.y = min([yo yo + h],1);
yaxis.domain = min([axisPos(2) sum(axisPos([2,4]))], 1);
scene.domain.y = yaxis.domain;

%-------------------------------------------------------------------------%

Expand Down

0 comments on commit f999448

Please sign in to comment.