I'm working on creating a graph in Matplotlib. I'm having issues where the graph's borders are cutting into my labels as seen in this screenshot:
I'm trying to remove the boundary line on the top and right side of the graph. I know that the code looks like this in plotly, but I'm unsure of matplotlib's equivalent.
fig.update_xaxes(showline=True, linewidth=1, linecolor='#FBFBFB', mirror=False)
fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor="#FBFBFB",showline=True, linewidth=2, linecolor='#FBFBFB', mirror=False)
Here is my entire code for context:
import matplotlib.pyplot as plt
from connect_to_db import get_df2
df = get_df2()
ax = df.plot(x='A', y='B', fontsize=10, color='#6C90B6', linewidth=3.0, legend=False,
xlabel='', ylabel='B', figsize=(10, 5)).grid(axis='y')
for i in range(len(df)):
x = df['A'][i]
y = df['B'][i]
plt.plot(x, y, 'bo', color='#6C90B6')
plt.text(x, y + 3, y, fontsize=12, horizontalalignment='center')
plt.show()