Skip to content

Fix heatmap issues used in ssim baselines matlab code examples data distribution plots heatmap #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix issue #194
  • Loading branch information
galvisgilberto committed Aug 19, 2021
commit 909c00df9fdf3dc22c87b5fc092b6bfbe68c6841
12 changes: 11 additions & 1 deletion plotly/plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
obj.PlotOptions.TreatAs = '_';
obj.PlotOptions.Image3D = false;
obj.PlotOptions.ContourProjection = false;
obj.PlotOptions.AxisEqual = false;

% offline options
obj.PlotOptions.Offline = true;
Expand Down Expand Up @@ -205,6 +206,9 @@
if(strcmpi(varargin{a},'TreatAs'))
obj.PlotOptions.TreatAs = varargin{a+1};
end
if(strcmpi(varargin{a},'AxisEqual'))
obj.PlotOptions.AxisEqual = varargin{a+1};
end
end
end

Expand Down Expand Up @@ -670,8 +674,14 @@ function validate(obj)

% update annotations
for n = 1:obj.State.Figure.NumTexts
try
plotclass = obj.State.Plot(n).Class;
catch
plotclass = ' ';
end

try
if ~strcmpi(obj.State.Plot(dataIndex).Class, 'heatmap')
if ~strcmpi(plotclass, 'heatmap')
updateAnnotation(obj,n);
else
obj.PlotOptions.CleanFeedTitle = false;
Expand Down
13 changes: 11 additions & 2 deletions plotly/plotlyfig_aux/core/updateAxis.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,22 @@

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

if obj.PlotOptions.AxisEqual
wh = min(axis_data.Position(3:4));
w = wh;
h = wh;
else
w = axis_data.Position(3);
h = axis_data.Position(4);
end

%-xaxis domain-%
xaxis.domain = min([axis_data.Position(1) axis_data.Position(1)+axis_data.Position(3)],1);
xaxis.domain = min([axis_data.Position(1) axis_data.Position(1) + w],1);

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

%-yaxis domain-%
yaxis.domain = min([axis_data.Position(2) axis_data.Position(2)+axis_data.Position(4)],1);
yaxis.domain = min([axis_data.Position(2) axis_data.Position(2) + h],1);

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

Expand Down
13 changes: 11 additions & 2 deletions plotly/plotlyfig_aux/core/updateFigure.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,22 @@

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

if obj.PlotOptions.AxisEqual
wh = min(figure_data.Position(3:4));
w = wh;
h = wh;
else
w = figure_data.Position(3);
h = figure_data.Position(4);
end

%-figure width-%
obj.layout.width = figure_data.Position(3)*obj.PlotlyDefaults.FigureIncreaseFactor;
obj.layout.width = w * obj.PlotlyDefaults.FigureIncreaseFactor;

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

%-figure height-%
obj.layout.height = figure_data.Position(4)*obj.PlotlyDefaults.FigureIncreaseFactor;
obj.layout.height = h * obj.PlotlyDefaults.FigureIncreaseFactor;

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

Expand Down