Skip to content

Commit 1ab673b

Browse files
committed
added more param
1 parent fe48c6c commit 1ab673b

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

draw_real_data_evaluation_result.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@ def plot_evalution_result(results,
1414
titles,
1515
output_path,
1616
legend_in_which_subplot=1,
17-
layout=(2, 2)):
17+
layout=(2, 2),
18+
figure_size=(None, None)):
1819
"""
1920
subplots across different dataset
2021
"""
22+
if figure_size[0] and figure_size[1]:
23+
from pylab import rcParams
24+
rcParams['figure.figsize'] = figure_size
25+
2126
output_dir=os.path.dirname(output_path)
2227
if not os.path.exists(output_dir):
2328
os.makedirs(output_dir)
@@ -61,6 +66,8 @@ def main():
6166
parser.add_argument('--legend_in_which_subplot', type=int)
6267
parser.add_argument('--ncols', type=int, default=2)
6368
parser.add_argument('--nrows', type=int, default=2)
69+
parser.add_argument('--figure_height', type=int)
70+
parser.add_argument('--figure_width', type=int)
6471
parser.add_argument('--output_path')
6572

6673
args = parser.parse_args()
@@ -75,7 +82,8 @@ def main():
7582
titles=args.titles,
7683
output_path=args.output_path,
7784
legend_in_which_subplot=args.legend_in_which_subplot,
78-
layout=(args.nrows, args.ncols)
85+
layout=(args.nrows, args.ncols),
86+
figure_size=(args.figure_width, args.figure_height)
7987
)
8088

8189
if __name__ == '__main__':

scripts/draw_sampler_experiment_figure.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ python draw_real_data_evaluation_result.py \
1111
--output_path tmp/sampler_experiment/fig.png \
1212
--legend_in_which_subplot 4 \
1313
--nrows 1 \
14-
--ncols 4
14+
--ncols 4 \
15+
--figure_width 20 \
16+
--figure_height 5
1517

1618
scp tmp/sampler_experiment/fig.png shell.cs.helsinki.fi:/cs/home/hxiao/public_html/figures/sampler_experiment_together.png
1719
ssh shell.cs.helsinki.fi chmod -R a+rx /cs/home/hxiao/public_html/figures/

0 commit comments

Comments
 (0)