I have a data set (shared below) and I intend to plot the hf_gen(s)
against the initial records
. I used the following matplotlib
script to generate the plot. I like to have my "x axis" figures in 10 to the powers of six. I tried using ScalarFormatter
. The x axis is in powers of 9.
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter
fig = plt.figure()#figsize=(11,8)
ax1 = fig.add_subplot(111)
ax1.plot(bulk_ingest_data['initial_records'][0:5], bulk_ingest_data['hf_gen(s)'][0:5], color='r', marker='o', label='LAS data in text form') #500
ax1.plot(bulk_ingest_data['initial_records'][5:10], bulk_ingest_data['hf_gen(s)'][5:10], color='b', marker='o', label='Binary encoded LAS points') #200
ax1.xaxis.set_major_formatter(ScalarFormatter(useMathText=True))
plt.xlabel('Number of records ingested)')
plt.ylabel('HFile generation time(s)')
handles, labels = ax1.get_legend_handles_labels()
lgd = ax1.legend(handles, labels, loc='upper left')#, bbox_to_anchor=(1.15,1)
ax1.grid('on')
What is the correct way to make it powers of six, so that I have my x axis values in the powers of six having 3 digit value as the base value.