@@ -579,6 +579,14 @@ function validate(obj)
579579 obj.State.Figure.NumLegends = 0 ;
580580 obj.State.Figure.NumColorbars = 0 ;
581581 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
582590
583591 % find axes of figure
584592 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)
616624 ax = temp_ax ;
617625 % ---------- checking the overlaping of the graphs ----------%
618626
627+ % update number of axes
619628 obj.State.Figure.NumAxes = length(ax );
620629
621630 % update number of annotations (one title per axis)
@@ -712,7 +721,7 @@ function validate(obj)
712721 obj.State.Figure.NumTexts = obj .State .Figure .NumTexts + length(texts );
713722
714723 end
715-
724+
716725 % find legends of figure
717726 if isHG2
718727 legs = findobj(obj .State .Figure .Handle ,' Type' ,' Legend' );
@@ -778,24 +787,13 @@ function validate(obj)
778787 end
779788 end
780789 catch
781- % TODO to the future
782- % disp('catch at line 647 in plotlyfig.m file')
790+ % TODO
783791 end
784792 end
785793
786794 % update plots
787795 for n = 1 : obj .State .Figure .NumPlots
788796 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-
799797 end
800798
801799 % update annotations
@@ -804,20 +802,28 @@ function validate(obj)
804802 if obj .PlotOptions .is_headmap_axis
805803 updateHeatmapAnnotation(obj ,n );
806804 obj.PlotOptions.CleanFeedTitle = false ;
805+
807806 elseif obj .PlotlyDefaults .isGeoaxis
808- % TODO
807+ % TODO
808+
809809 else
810810 if ~obj .PlotlyDefaults .isTernary
811811 updateAnnotation(obj ,n );
812+
812813 if obj .State .Figure .NumAxes == 1
813814 obj.PlotOptions.CleanFeedTitle = false ;
814815 end
815816 end
816817 end
817818 catch
818- % TODO to the future
819+ % TODO
819820 end
820821 end
822+
823+ % update tiled layout annotations
824+ if isTiledLayout
825+ updateTiledLayoutAnnotation(obj , tiledLayoutStruct );
826+ end
821827
822828 % update legends
823829 if obj .State .Figure .NumLegends < 2
@@ -826,6 +832,7 @@ function validate(obj)
826832 updateLegend(obj ,n );
827833 end
828834 end
835+
829836 else
830837 updateLegendMultipleAxes(obj ,1 );
831838 end
@@ -834,6 +841,7 @@ function validate(obj)
834841 for n = 1 : obj .State .Figure .NumColorbars
835842 if ~obj .PlotlyDefaults .isTernary
836843 updateColorbar(obj ,n );
844+
837845 else
838846 updateTernaryColorbar(obj ,n );
839847 end
0 commit comments