@@ -579,6 +579,14 @@ function validate(obj)
579
579
obj.State.Figure.NumLegends = 0 ;
580
580
obj.State.Figure.NumColorbars = 0 ;
581
581
obj.State.Figure.NumTexts = 0 ;
582
+
583
+ % check if there is tiledlayout
584
+ try
585
+ tiledLayoutStruct = get(obj .State .Figure .Handle .Children );
586
+ isTiledLayout = strcmp(tiledLayoutStruct .Type , ' tiledlayout' );
587
+ catch
588
+ isTiledLayout = false ;
589
+ end
582
590
583
591
% find axes of figure
584
592
ax = findobj(obj .State .Figure .Handle ,' Type' ,' axes' ,' -and' ,{' Tag' ,' ' ,' -or' ,' Tag' ,' PlotMatrixBigAx' ,' -or' ,' Tag' ,' PlotMatrixScatterAx' , ' -or' ,' Tag' ,' PlotMatrixHistAx' });
@@ -616,6 +624,7 @@ function validate(obj)
616
624
ax = temp_ax ;
617
625
% ---------- checking the overlaping of the graphs ----------%
618
626
627
+ % update number of axes
619
628
obj.State.Figure.NumAxes = length(ax );
620
629
621
630
% update number of annotations (one title per axis)
@@ -712,7 +721,7 @@ function validate(obj)
712
721
obj.State.Figure.NumTexts = obj .State .Figure .NumTexts + length(texts );
713
722
714
723
end
715
-
724
+
716
725
% find legends of figure
717
726
if isHG2
718
727
legs = findobj(obj .State .Figure .Handle ,' Type' ,' Legend' );
@@ -778,24 +787,13 @@ function validate(obj)
778
787
end
779
788
end
780
789
catch
781
- % TODO to the future
782
- % disp('catch at line 647 in plotlyfig.m file')
790
+ % TODO
783
791
end
784
792
end
785
793
786
794
% update plots
787
795
for n = 1 : obj .State .Figure .NumPlots
788
796
updateData(obj ,n );
789
-
790
- try
791
- if update_opac(length(ax )-n )
792
- % obj.data{1, n}.opacity = 0.9;
793
- end
794
- catch
795
- % TODO to the future
796
- % disp('catch at line 664 in plotlyfig.m file')
797
- end
798
-
799
797
end
800
798
801
799
% update annotations
@@ -804,20 +802,28 @@ function validate(obj)
804
802
if obj .PlotOptions .is_headmap_axis
805
803
updateHeatmapAnnotation(obj ,n );
806
804
obj.PlotOptions.CleanFeedTitle = false ;
805
+
807
806
elseif obj .PlotlyDefaults .isGeoaxis
808
- % TODO
807
+ % TODO
808
+
809
809
else
810
810
if ~obj .PlotlyDefaults .isTernary
811
811
updateAnnotation(obj ,n );
812
+
812
813
if obj .State .Figure .NumAxes == 1
813
814
obj.PlotOptions.CleanFeedTitle = false ;
814
815
end
815
816
end
816
817
end
817
818
catch
818
- % TODO to the future
819
+ % TODO
819
820
end
820
821
end
822
+
823
+ % update tiled layout annotations
824
+ if isTiledLayout
825
+ updateTiledLayoutAnnotation(obj , tiledLayoutStruct );
826
+ end
821
827
822
828
% update legends
823
829
if obj .State .Figure .NumLegends < 2
@@ -826,6 +832,7 @@ function validate(obj)
826
832
updateLegend(obj ,n );
827
833
end
828
834
end
835
+
829
836
else
830
837
updateLegendMultipleAxes(obj ,1 );
831
838
end
@@ -834,6 +841,7 @@ function validate(obj)
834
841
for n = 1 : obj .State .Figure .NumColorbars
835
842
if ~obj .PlotlyDefaults .isTernary
836
843
updateColorbar(obj ,n );
844
+
837
845
else
838
846
updateTernaryColorbar(obj ,n );
839
847
end
0 commit comments