ldbc: Use a part of the query name for x-tick labels

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D761
This commit is contained in:
Teon Banek 2017-09-07 11:07:27 +02:00
parent 0227eae88a
commit 020afd7f4b

View File

@ -98,8 +98,15 @@ def main():
ax.set_ylabel('Mean Latency (ms)') # YAxis title
ax.set_facecolor('#dcdcdc') # plot bg color (light gray)
ax.set_xticks(ind + width / len(vendors)) # TODO: adjust (more vendors)
# IMPORTANT! Long query names on the XAxis don't look compelling.
ax.set_xticklabels(['Q%s' % x for x in range(len(query_names))])
def shorten_query_name(query_name):
# IMPORTANT! Long query names on the XAxis don't look compelling.
if query_name.lower().startswith('ldbc'):
query_name = query_name[4:]
if len(query_name) > 10:
query_name = query_name[:10] + '\N{HORIZONTAL ELLIPSIS}'
return query_name
ax.set_xticklabels(map(shorten_query_name, query_names), rotation=30)
# set only horizontal grid lines
for line in ax.get_xgridlines():
line.set_linestyle(' ')
@ -128,5 +135,6 @@ def main():
ax.legend(rects, titles) # Draw the legend.
plt.show()
if __name__ == '__main__':
main()