I am trying to clean up the x-axis of a vbar
created by the below code, but am running into issues. The graph shows account balances by quarter dating back to the early 90s, which shows a lot of clutter by quarter. I've seen date_time
referenced in this question: Datetime on an X Axis in Bokeh but I don't believe that it is directly applicable to what i'm trying to accomplish. I simply want to decrease the number of quarterly labels so that the axis is cleaner and more presentable. Currently, they are stored as strings, which I believe to be problem #1. Is there an easy way to do this in Bokeh?
def create_plot(top_level_data, source):
#Builds initial plot with styles
#Returns Graph obj
#Create figure
plot = figure(x_range = sorted(set(top_level_data['QTR'])), title="Account Balance",
tools=["save, wheel_zoom,box_zoom,reset, pan"],
background_fill_color = "white",
plot_width=1000, plot_height=800)
#main title formatting
plot.title.align = "center"
plot.title.text_color = "midnightblue"
plot.title.text_font_size = '18pt'
#axis title formatting
plot.yaxis.axis_label = "Millions"
plot.xaxis.axis_label = "Quarters"
plot.xaxis.axis_label_text_color = "midnightblue"
plot.yaxis.axis_label_text_color = "midnightblue"
plot.xaxis.axis_label_text_font_size = "14pt"
plot.yaxis.axis_label_text_font_size = "14pt"
plot.y_range.start = 0
plot.xaxis.major_label_orientation = "vertical"
plot.xgrid.grid_line_color = None
#formating of VBar
plot.vbar(x = "x", top ="top", source=source, width = 1, fill_color="#036564", line_color="#033649")
return plot