mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-01 03:07:56 +00:00
changed x-axis range in bar plot
This commit is contained in:
@@ -83,8 +83,9 @@ class lf_bar_graph():
|
||||
i = i + 1
|
||||
plt.xlabel(self.xaxis_name, fontweight='bold', fontsize=15)
|
||||
plt.ylabel(self.yaxis_name, fontweight='bold', fontsize=15)
|
||||
plt.xticks([r + self.bar_width for r in range(len(self.data_set[0]))],
|
||||
self.xaxis_categories)
|
||||
"""plt.xticks([r + self.bar_width for r in range(len(self.data_set[0]))],
|
||||
self.xaxis_categories)"""
|
||||
plt.xticks(np.arange(0, len(self.xaxis_categories), step=5))
|
||||
plt.legend()
|
||||
|
||||
fig = plt.gcf()
|
||||
|
||||
@@ -25,6 +25,7 @@ import pandas as pd
|
||||
import pdfkit
|
||||
from lf_report import lf_report
|
||||
from lf_graph import lf_bar_graph, lf_scatter_graph, lf_stacked_graph, lf_horizontal_stacked_graph
|
||||
import random
|
||||
|
||||
# Unit Test
|
||||
if __name__ == "__main__":
|
||||
@@ -72,10 +73,19 @@ if __name__ == "__main__":
|
||||
|
||||
report.set_table_dataframe(dataframe2)
|
||||
report.build_table()
|
||||
set_xaxis = []
|
||||
y_set1 = []
|
||||
y_set2 = []
|
||||
y_set3 = []
|
||||
for i in range(0, 30):
|
||||
set_xaxis.append(i)
|
||||
y_set1.append(random.randint(1, 50))
|
||||
y_set2.append(random.randint(1, 50))
|
||||
y_set3.append(random.randint(1, 50))
|
||||
|
||||
# test lf_graph in report
|
||||
dataset = [[45, 67, 34, 22], [22, 45, 12, 34], [30, 55, 69, 37]]
|
||||
x_axis_values = [1, 2, 3, 4]
|
||||
dataset = [y_set1, y_set2, y_set3]
|
||||
x_axis_values = set_xaxis
|
||||
|
||||
report.set_graph_title("Graph Title")
|
||||
report.build_graph_title()
|
||||
|
||||
Reference in New Issue
Block a user