5858 obj.PlotOptions.OpenURL = true ;
5959 obj.PlotOptions.Strip = false ;
6060 obj.PlotOptions.Visible = ' on' ;
61- obj.PlotOptions.TriangulatePatch = false ;
61+ obj.PlotOptions.TriangulatePatch = false ;
62+ obj.PlotOptions.StripMargins = false ;
6263
6364 % offline options
6465 obj.PlotOptions.Offline = true ;
192193 if (strcmpi(varargin{a },' data' ))
193194 obj.data = varargin{a + 1 };
194195 end
196+ if (strcmpi(varargin{a },' StripMargins' ))
197+ obj.PlotOptions.StripMargins = varargin{a + 1 };
198+ end
195199 end
196200 end
197201
237241
238242 % plotly reference
239243 plotlyref = load(' plotly_reference.mat' );
240- % rmfield(plotlyref.pr, 'xbins');
241- % plotlyref.pr.xbins.size
242244
243245 % update the PlotlyRef property
244246 obj.PlotlyReference = plotlyref .pr ;
@@ -425,6 +427,14 @@ function validate(obj)
425427 obj .strip ;
426428 end
427429
430+ % strip margins
431+ if obj .PlotOptions .StripMargins
432+ obj.layout.margin.l = 0 ;
433+ obj.layout.margin.r = 0 ;
434+ obj.layout.margin.b = 0 ;
435+ obj.layout.margin.t = 0 ;
436+ end
437+
428438 % validate keys
429439 validate(obj );
430440
@@ -436,7 +446,7 @@ function validate(obj)
436446 cleanFeedTitle(obj );
437447 end
438448
439- % args
449+ % get args
440450 args.filename = obj .PlotOptions .FileName ;
441451 args.fileopt = obj .PlotOptions .FileOpt ;
442452 args.world_readable = obj .PlotOptions .WorldReadable ;
@@ -480,7 +490,32 @@ function validate(obj)
480490 obj.State.Figure.NumTexts = 0 ;
481491
482492 % find axes of figure
483- ax = findobj(obj .State .Figure .Handle ,' Type' ,' axes' ,' -and' ,{' Tag' ,' ' ,' -or' ,' Tag' ,' PlotMatrixBigAx' ,' -or' ,' Tag' ,' PlotMatrixScatterAx' });
493+ ax = findobj(obj .State .Figure .Handle ,' Type' ,' axes' ,' -and' ,{' Tag' ,' ' ,' -or' ,' Tag' ,' PlotMatrixBigAx' ,' -or' ,' Tag' ,' PlotMatrixScatterAx' , ' -or' ,' Tag' ,' PlotMatrixHistAx' });
494+ if isempty(ax )
495+ ax = gca ;
496+ end
497+
498+ % ---------- checking the overlaping of the graphs ----------%
499+ temp_ax = ax ; deleted_idx = 0 ;
500+ for i = 1 : length(ax )
501+ for j = i : length(ax )
502+ if ((mean(eq(ax(i ).Position, ax(j ).Position)) == 1 ) && (i ~= j ) && strcmp(ax(i ).Children.Type, ' histogram' ))
503+ temp_plots = findobj(temp_ax(i ),' -not' ,' Type' ,' Text' ,' -not' ,' Type' ,' axes' ,' -depth' ,1 );
504+ if isprop(temp_plots , ' FaceAlpha' )
505+ update_opac(i ) = true ;
506+ else
507+ update_opac(i ) = false ;
508+ end
509+ temp_ax(i ).YTick = temp_ax(j - deleted_idx ).YTick;
510+ temp_ax(i ).XTick = temp_ax(j - deleted_idx ).XTick;
511+ temp_ax(j - deleted_idx ) = [];
512+ deleted_idx = deleted_idx + 1 ;
513+ end
514+ end
515+ end
516+ ax = temp_ax ;
517+ % ---------- checking the overlaping of the graphs ----------%
518+
484519 obj.State.Figure.NumAxes = length(ax );
485520
486521 % update number of annotations (one title per axis)
@@ -586,17 +621,29 @@ function validate(obj)
586621
587622 % update axes
588623 for n = 1 : obj .State .Figure .NumAxes
589- updateAxis(obj ,n );
624+ try
625+ updateAxis(obj ,n );
626+ end
590627 end
591628
592629 % update plots
593630 for n = 1 : obj .State .Figure .NumPlots
594631 updateData(obj ,n );
632+
633+ try
634+ if (strcmp(obj.data{n }.type, ' bar' ) && update_opac(length(ax )-n ))
635+ obj.data{1 , n }.opacity = 0.9 ;
636+ obj.data{1 , n }.marker.color = ' rgb(0,113.985,188.955)' ;
637+ end
638+ end
639+
595640 end
596641
597642 % update annotations
598643 for n = 1 : obj .State .Figure .NumTexts
599- updateAnnotation(obj ,n );
644+ try
645+ updateAnnotation(obj ,n );
646+ end
600647 end
601648
602649 % update legends
@@ -838,7 +885,7 @@ function delete(obj)
838885 fnmod = fn ;
839886
840887 try
841- for d = 1 : length(fn );
888+ for d = 1 : length(fn )
842889
843890 % clean up axis keys
844891 if any(strfind(fn{d },' xaxis' )) || any(strfind(fn{d },' yaxis' ))
@@ -898,6 +945,7 @@ function delete(obj)
898945 if ~( ...
899946 strcmpi(fieldname ,' surface' ) || strcmpi(fieldname ,' scatter3d' ) ...
900947 || strcmpi(fieldname ,' mesh3d' ) || strcmpi(fieldname ,' bar' ) ...
948+ || strcmpi(fieldname ,' scatterpolar' ) ...
901949 )
902950 fprintf([' \n Whoops! ' exception .message(1 : end - 1 ) ' in ' fieldname ' \n\n ' ]);
903951 end
0 commit comments