Skip to content

Commit

Permalink
Made entropy plots more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
devttys0 committed Sep 13, 2017
1 parent 0b592bf commit d2fa6bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/binwalk/modules/entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ def plot_entropy(self, fname):
ax.set_ylabel(self.YLABEL)
ax.plot(x, y, lw=2)

# Add a fake, invisible plot entry so that offsets at/near the
# minimum x value (0) are actually visible on the plot.
ax.plot(-(max(x)*.001), 0, lw=0)

if self.show_legend and has_key(self.file_markers, fname):
for (offset, description) in self.file_markers[fname]:
Expand All @@ -292,7 +295,7 @@ def plot_entropy(self, fname):

ax.plot([offset, offset], [0, 1.1], '%s-' % color, lw=2, label=description)

ax.legend(loc='upper right', shadow=True)
ax.legend(loc='lower right', shadow=True)

if self.save_plot:
out_file = os.path.join(os.getcwd(), os.path.basename(fname)) + '.png'
Expand Down

0 comments on commit d2fa6bd

Please sign in to comment.