Skip to content
Snippets Groups Projects
Commit 6e883e98 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'update-task-plots' into 'master'

Move the task plot legend so that it does not overlap the top of the graphic

See merge request !646
parents ae0d4d25 2facb6ac
Branches
Tags
1 merge request!646Move the task plot legend so that it does not overlap the top of the graphic
......@@ -245,7 +245,10 @@ for rank in ranks:
fig = pl.figure()
ax = fig.add_subplot(1,1,1)
ax.set_xlim(-delta_t * 0.01 / CPU_CLOCK, delta_t * 1.01 / CPU_CLOCK)
ax.set_ylim(0, nthread*expand)
if nthread == 0:
ax.set_ylim(0, expand)
else:
ax.set_ylim(0, nthread*expand)
if mintic < 0:
start_t = tic_step
else:
......@@ -305,7 +308,7 @@ for rank in ranks:
fig = pl.figure()
ax = fig.add_subplot(1,1,1)
ax.set_xlim(-delta_t * 0.01 / CPU_CLOCK, delta_t * 1.01 / CPU_CLOCK)
ax.set_ylim(0, nethread)
ax.set_ylim(0.5, nethread+1.0)
for i in range(nethread):
# Collect ranges and colours into arrays.
......@@ -327,19 +330,16 @@ for rank in ranks:
typesseen.append(qtask)
# Now plot.
ax.broken_barh(tictocs, [i+0.05,0.90], facecolors = colours, linewidth=0)
ax.broken_barh(tictocs, [i+0.55,0.9], facecolors = colours, linewidth=0)
# Legend and room for it.
nrow = len(typesseen) / 5
ax.fill_between([0, 0], nethread+0.5, nethread + nrow + 0.5, facecolor="white")
ax.set_ylim(0, nethread + 0.5)
nrow = len(typesseen) / 8
ax.fill_between([0, 0], nethread, nethread + nrow, facecolor="white")
if data.size > 0 and not args.nolegend:
ax.fill_between([0, 0], nethread+0.5, nethread + nrow + 0.5, facecolor="white")
ax.set_ylim(0, nethread + 0.5)
ax.legend(loc=1, shadow=True, bbox_to_anchor=(0., 1.05 ,1., 0.2), mode="expand", ncol=5)
box = ax.get_position()
ax.set_position([box.x0, box.y0, box.width, box.height*0.8])
ax.fill_between([0, 0], nethread, nethread + nrow, facecolor="white")
ax.legend(loc="lower left", shadow=True,
bbox_to_anchor=(0., 1.0, 1., 0.2), mode="expand", ncol=8)
# Start and end of time-step
if mintic < 0:
......@@ -366,7 +366,7 @@ for rank in ranks:
outpng = outbase + str(rank) + ".png"
else:
outpng = outbase + ".png"
pl.savefig(outpng)
pl.savefig(outpng, bbox_inches="tight")
print("Graphics done, output written to", outpng)
sys.exit(0)
......@@ -87,10 +87,22 @@ echo $list | xargs -n 3 | while read f s g; do
<ul style="list-style-type:none">
<li>
EOF
cat <<EOF3 > step${s}r.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
EOF3
for i in $(seq 0 $nrank); do
cat <<EOF2 >> index.html
<a href="step${s}r${i}.html"><img src="step${s}r${i}.png" width=400px/></a>
EOF2
cat <<EOF >> index.html
<a href="step${s}r.html"><img src="step${s}r${i}.png" width=400px/></a>
EOF
cat <<EOF3 >> step${s}r.html
<a href="step${s}r${i}.html"><img src="step${s}r${i}.png"/></a>
EOF3
cat <<EOF2 > step${s}r${i}.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
......@@ -104,7 +116,14 @@ cat <<EOF2 >> step${s}r${i}.html
</body>
</html>
EOF2
done
cat <<EOF3 >> step${s}r.html
</body>
</html>
EOF3
cat <<EOF >> index.html
</li>
</ul>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment