Skip to content

Commit 21945a6

Browse files
Merge branch 'master' of https://github.com/ashishpvora/MATLAB-Online into ashishpvora-master
2 parents 814bf16 + 9c1d9bc commit 21945a6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

plotly/plotly_offline_aux/plotlyoffline.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
html_filename = [clean_filename '.html'];
7979

8080
% save the html file in the working directory
81-
plotly_offline_file = fullfile(pwd, html_filename);
81+
plotly_offline_file = fullfile(plotlyfig.PlotOptions.SaveFolder, html_filename);
8282
file_id = fopen(plotly_offline_file, 'w');
8383
fprintf(file_id, offline_script);
8484
fclose(file_id);

plotly/plotlyfig.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
obj.PlotOptions.ShowLinkText = true;
6666
obj.PlotOptions.LinkText = obj.get_link_text;
6767
obj.PlotOptions.IncludePlotlyjs = true;
68-
68+
obj.PlotOptions.SaveFolder = pwd;
69+
6970
%-PlotlyDefaults-%
7071
obj.PlotlyDefaults.MinTitleMargin = 80;
7172
obj.PlotlyDefaults.TitleHeight = 0.01;
@@ -152,6 +153,9 @@
152153
% overwrite if filename provided
153154
obj.PlotOptions.FileOpt = 'overwrite';
154155
end
156+
if(strcmpi(varargin{a},'savefolder'))
157+
obj.PlotOptions.SaveFolder = varargin{a+1};
158+
end
155159
if(strcmpi(varargin{a},'fileopt'))
156160
obj.PlotOptions.FileOpt = varargin{a+1};
157161
end

0 commit comments

Comments
 (0)