Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Commit

Permalink
bug fix with saving png format
Browse files Browse the repository at this point in the history
  • Loading branch information
Lab41PaulM committed Feb 21, 2014
1 parent 76f79cb commit 752c603
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions Filters/filter_prevalence.py
Expand Up @@ -160,7 +160,7 @@ def discover_histogram_by_os(self, os_name, output=None):
of the specified OS
:param os_name: name of the operating system
:param output: (optional) output filename. Note: A suffix of .png will be appended to the filename
:param output: (optional) output filename in PNG format
"""

print '[+] Running \"Histogram by OS\"..."'
Expand Down Expand Up @@ -196,17 +196,16 @@ def discover_histogram_by_os(self, os_name, output=None):
if output is None:
plt.show()
else:
out = output + ".png"
print "Saving histogram to {}".format(out)
plt.savefig(out)
print "Saving histogram to {}".format(output)
plt.savefig(output)

def discover_histogram_by_source(self, source_name, output=None):
"""
Displays a histogram of the file distribution of a single source as it relates
to all occurrences of that file across all systems
:param source_name: The name of the source
:param output: (optional) output filename. Note: A suffix of .png will be appended to the filename
:param output: (optional) output filename in PNG format
"""

print '[+] Running \"Histogram by Source\"...'
Expand Down Expand Up @@ -248,9 +247,8 @@ def discover_histogram_by_source(self, source_name, output=None):
if output is None:
plt.show()
else:
out = output + ".png"
print "Saving histogram to {}".format(out)
plt.savefig(out)
print "Saving histogram to {}".format(output)
plt.savefig(output)

def discover_detect_anomalies(self, source, out=None):
"""
Expand Down

0 comments on commit 752c603

Please sign in to comment.