Use quart inner drawer for seaborn violinplot
This commit is contained in:
parent
c3827ed4f0
commit
c7798a9358
5 changed files with 12 additions and 6 deletions
|
|
@ -5,24 +5,27 @@ parser = argparse.ArgumentParser(
|
||||||
description="Personal use. Visualize ftrace function_graph statistics."
|
description="Personal use. Visualize ftrace function_graph statistics."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Positional
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"directory", type=str, help="ftrace-cmd output .dat directory"
|
"directory", type=str, help="ftrace-cmd output .dat directory"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Flags
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-g", "--glob", type=bool, help="infer given directory as glob pattern"
|
"-g", "--glob", type=bool, help="infer given directory as glob pattern"
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-p", "--percentile", type=float, help="clip to <PERCENTILE> in both ends",
|
"-p", "--percentile", type=float, help="clip to <PERCENTILE> in both ends",
|
||||||
default=1.
|
default=1.
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-l", "--use-log-scale", type=bool, help="use logarithmic scale (log10)",
|
"-l", "--use-log-scale", type=bool, help="use logarithmic scale (log10)",
|
||||||
default=False
|
default=False
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--output", "-o", type=str, help="output file", default="out.pdf"
|
"-o", "--output", type=str, help="output file", default="out.pdf"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-i", "--interactive", type=bool, help="show pyplot when finished drawing",
|
||||||
|
default=True
|
||||||
)
|
)
|
||||||
|
|
@ -105,12 +105,15 @@ def run(args: Namespace):
|
||||||
# plot violin plot
|
# plot violin plot
|
||||||
fig, ax = plt.subplots(figsize=(12, 8))
|
fig, ax = plt.subplots(figsize=(12, 8))
|
||||||
sns.violinplot(
|
sns.violinplot(
|
||||||
data=plot_df, orient="h", fill=False, log_scale=args.use_log_scale)
|
data=plot_df, orient="h", fill=False, log_scale=args.use_log_scale,
|
||||||
|
inner="quart")
|
||||||
ax.set_xlabel("Runtime (μs)")
|
ax.set_xlabel("Runtime (μs)")
|
||||||
ax.set_ylabel("Write amount (KiB)")
|
ax.set_ylabel("Write amount (KiB)")
|
||||||
ax.set_title("Percentile: {}{}"
|
ax.set_title("Percentile: {}{}"
|
||||||
.format(args.percentile, ", log scale" if args.use_log_scale else ""))
|
.format(args.percentile, ", log scale" if args.use_log_scale else ""))
|
||||||
fig.savefig(args.output)
|
fig.savefig(args.output)
|
||||||
|
|
||||||
|
if args.interactive:
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue