Skip to content

Commit 279e60c

Browse files
committed
Add some marks to x axis.
1 parent 1d92ce6 commit 279e60c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

jmhplot.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
import numpy as np
3737
import matplotlib.pyplot as plt
38+
import matplotlib.ticker as ticker
3839
import pandas as pd
3940
from pandas.core.frame import DataFrame
4041
import re
@@ -273,6 +274,12 @@ def plot_result_set(xaxisparam:Dict, indexKeys: Tuple, indexTuple: Tuple, result
273274

274275
plot_result_axis_bars(ax, resultSet)
275276

277+
# Ensure more marks on the x-axis for log scale
278+
ax.xaxis.set_major_locator(ticker.LogLocator(base=10.0, numticks=15))
279+
ax.xaxis.set_minor_locator(ticker.LogLocator(base=10.0, subs='auto', numticks=15))
280+
ax.xaxis.set_major_formatter(ticker.ScalarFormatter())
281+
ax.xaxis.set_minor_formatter(ticker.NullFormatter())
282+
276283
plt.suptitle(system_info)
277284
title = f'{str(indexKeys)}={str(indexTuple)} include={include_benchmarks} exclude={exclude_benchmarks} Value Size="{value_size_title}"'
278285
plt.title(title)

0 commit comments

Comments
 (0)