Skip to content
Snippets Groups Projects
Unverified Commit 5236b81b authored by Benjamin Loison's avatar Benjamin Loison
Browse files

Improve native MLS rendering

parent baf3e4bc
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,8 @@ with open('data_constant_difficulty.json') as f:
fig, targetsAxis = plt.subplots()
fig.subplots_adjust(right = 0.8)
fig.subplots_adjust(bottom = 0.4)
axes = [targetsAxis, targetsAxis.twinx(), targetsAxis.twinx()]
compressedScoreAxis = targetsAxis.twinx()
axes = [targetsAxis, targetsAxis.twinx(), compressedScoreAxis, targetsAxis.twinx(), compressedScoreAxis]
targets = data['targets']
......@@ -35,10 +36,8 @@ axesColors = ['blue', 'green', 'brown', 'orange', 'brown']
axesLabels = ['targets', 'compressed blockchain size (in blocks)', 'compressed blockchain score', 'constant difficulty compressed blockchain size (in blocks)', 'constant difficulty compressed blockchain score']
axesYValues = [targets, data['compressSize'], data['compressScore'], dataConstantDifficulty['compressSize'], dataConstantDifficulty['compressScore']]
compressedSizeAxis = targetsAxis.twinx()
curves = []
for curvesIndex, (axis, color, label, yValues) in enumerate(zip(axes + [compressedSizeAxis] + [axes[-1]], axesColors, axesLabels, axesYValues)):
for curvesIndex, (axis, color, label, yValues) in enumerate(zip(axes, axesColors, axesLabels, axesYValues)):
dashes = (None, None) if curvesIndex != 4 else [1, 25]
alpha = 1 if curvesIndex != 3 else 0.5
curves += axis.plot(yValues, label = label, color = color, dashes = dashes, alpha = alpha)
......@@ -48,7 +47,7 @@ targetsAxis.set_yscale('log')
axes[2].spines.right.set_position(('axes', 1.1))
axes[2].set_yscale('log')
compressedSizeAxis.spines.right.set_position(('axes', 1.2))
axes[-2].spines.right.set_position(('axes', 1.2))
legendNewLine = targetsAxis.plot([], [], color='none', label=' ')
curves.insert(-2, legendNewLine[0])
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment