Skip to content

Issue236 fixed stem3 #344

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
merged 4 commits into from
Aug 17, 2021
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 #240
  • Loading branch information
galvisgilberto committed Aug 14, 2021
commit b64e170507ffadabd261926c04fc09866a1fc7b9
8 changes: 4 additions & 4 deletions plotly/plotlyfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ function validate(obj)
updateAxis(obj,n);
catch
% TODO to the future
disp('warning: error in updateAxis')
disp('catch at line 643 in plotlyfog.m file')
end
end

Expand All @@ -657,7 +657,7 @@ function validate(obj)
end
catch
% TODO to the future
disp('warning: error using update_opac')
disp('catch at line 660 in plotlyfog.m file')
end

end
Expand All @@ -668,7 +668,7 @@ function validate(obj)
updateAnnotation(obj,n);
catch
% TODO to the future
disp('warning: error in updateAnnotation')
disp('catch at line 671 in plotlyfog.m file')
end
end

Expand Down Expand Up @@ -972,7 +972,7 @@ function delete(obj)
strcmpi(fieldname,'surface') || strcmpi(fieldname,'scatter3d') ...
|| strcmpi(fieldname,'mesh3d') || strcmpi(fieldname,'bar') ...
|| strcmpi(fieldname,'scatterpolar') || strcmpi(fieldname,'barpolar') ...
|| strcmpi(fieldname,'scene') ...
|| strcmpi(fieldname,'scene') || strcmpi(fieldname,'layout') ...
)
fprintf(['\nWhoops! ' exception.message(1:end-1) ' in ' fieldname '\n\n']);
end
Expand Down
4 changes: 3 additions & 1 deletion plotly/plotlyfig_aux/core/updateData.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
updatePie3(obj, dataIndex);
elseif strcmpi(obj.PlotOptions.TreatAs, 'pcolor')
updatePColor(obj, dataIndex);
elseif strcmpi(obj.PlotOptions.TreatAs, 'polarplot')
updatePolarplot(obj, dataIndex);
end

%-update plot based on plot call class-%
Expand Down Expand Up @@ -150,7 +152,7 @@
end
catch
% TODO to the future
disp('waring: error in updateData at AXIS/DATA CLEAN UP section')
disp('catch at line 155 in updateData.m file')
end

%-------------------------------------------------------------------------%
Expand Down
135 changes: 135 additions & 0 deletions plotly/plotlyfig_aux/handlegraphics/updatePolarplot.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
function updatePolarplot(obj,plotIndex)

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

%-Get plot class-%
plotclass = obj.State.Plot(plotIndex).Class;

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

%-run the correct plot class-%
if strcmpi(plotclass, 'line')
updatePolarline(obj,plotIndex)
elseif strcmpi(plotclass, 'polaraxes')
updatePolaraxes(obj,plotIndex)
end

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

end


%-------------------------------------------------------------------------%
%-HELPERS FUNCTIONS-%
%-------------------------------------------------------------------------%

function updatePolaraxes(obj,plotIndex)

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

%-PLOT DATA STRUCTURE-%
plot_data = get(obj.State.Plot(plotIndex).Handle);

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

%-setting polar axes-%
gridcolor = 'rgb(235,235,235)';
linecolor = 'rgb(210,210,210)';

%-R-axis-%
obj.layout.polar.angularaxis.tickmode = 'array';
obj.layout.polar.angularaxis.tickvals = plot_data.ThetaTick(1:end-1);
obj.layout.polar.angularaxis.gridcolor = gridcolor;
obj.layout.polar.angularaxis.linecolor = linecolor;
obj.layout.polar.angularaxis.ticks = '';

%-Theta-axis-%
obj.layout.polar.radialaxis.angle = plot_data.RAxisLocation;
obj.layout.polar.radialaxis.tickmode = 'array';
obj.layout.polar.radialaxis.tickvals = plot_data.RTick;
obj.layout.polar.radialaxis.gridcolor = gridcolor;
obj.layout.polar.radialaxis.showline = false;
obj.layout.polar.radialaxis.tickangle = 90;
obj.layout.polar.radialaxis.ticks = '';

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

end

function updatePolarline(obj,plotIndex)

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

%-PLOT DATA STRUCTURE- %
plot_data = get(obj.State.Plot(plotIndex).Handle);

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

%-scatterpolar type-%
obj.data{plotIndex}.type = 'scatterpolar';

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

%-scatter visible-%
obj.data{plotIndex}.visible = strcmp(plot_data.Visible,'on');

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

%-scatter r-data-%
obj.data{plotIndex}.r = abs(plot_data.RData);

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

%-scatter theta-data-%
obj.data{plotIndex}.theta = rad2deg(plot_data.ThetaData);

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

%-scatterpolar name-%
obj.data{plotIndex}.name = plot_data.DisplayName;

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

%-scatterpolar mode-%
if ~strcmpi('none', plot_data.Marker) ...
&& ~strcmpi('none', plot_data.LineStyle)
mode = 'lines+markers';
elseif ~strcmpi('none', plot_data.Marker)
mode = 'markers';
elseif ~strcmpi('none', plot_data.LineStyle)
mode = 'lines';
else
mode = 'none';
end

obj.data{plotIndex}.mode = mode;

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

%-scatter line-%
obj.data{plotIndex}.line = extractLineLine(plot_data);
obj.data{plotIndex}.line.width = 2 * obj.data{plotIndex}.line.width;

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

%-scatter marker-%
obj.data{plotIndex}.marker = extractLineMarker(plot_data);

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

%-scatter showlegend-%
leg = get(plot_data.Annotation);
legInfo = get(leg.LegendInformation);

switch legInfo.IconDisplayStyle
case 'on'
showleg = true;
case 'off'
showleg = false;
end

obj.data{plotIndex}.showlegend = showleg;

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

end