mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-29 21:42:22 +00:00
ran 'pyupgrade --py36-plus gamestonk_terminal/options/volume.py' to pass tests
This commit is contained in:
@@ -30,7 +30,6 @@ def volume_graph(raw_data, ticker_name, exp_date, volume_percentile_threshold=50
|
||||
# Initialize the matplotlib figure
|
||||
|
||||
_, ax = plt.subplots(figsize=(12, 10))
|
||||
sns.set_style(style="darkgrid")
|
||||
|
||||
# make x axis symmetric
|
||||
axis_origin = max(abs(max(puts["oi+v"])), abs(max(calls["oi+v"])))
|
||||
@@ -38,6 +37,8 @@ def volume_graph(raw_data, ticker_name, exp_date, volume_percentile_threshold=50
|
||||
|
||||
VOLUME_THRESHOLD = np.percentile(calls["oi+v"], PERCENTILE_THRESHOLD)
|
||||
|
||||
sns.set_style(style="darkgrid")
|
||||
|
||||
g = sns.barplot(
|
||||
x="oi+v",
|
||||
y="strike",
|
||||
@@ -87,7 +88,7 @@ def volume_graph(raw_data, ticker_name, exp_date, volume_percentile_threshold=50
|
||||
# ax.axhline(max_pain_index, ls='--')
|
||||
# format ticklabels without - for puts
|
||||
g.set_xticks(g.get_xticks())
|
||||
xlabels = ["{:,.0f}".format(x).replace("-", "") for x in g.get_xticks()]
|
||||
xlabels = [f"{x:,.0f}".replace("-", "") for x in g.get_xticks()]
|
||||
g.set_xticklabels(xlabels)
|
||||
|
||||
plt.title(
|
||||
@@ -113,7 +114,6 @@ def volume_graph(raw_data, ticker_name, exp_date, volume_percentile_threshold=50
|
||||
]
|
||||
|
||||
plt.legend(handles=handles[:], labels=labels)
|
||||
|
||||
sns.despine(left=True, bottom=True)
|
||||
plt.show()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user