Выдвиньте график с matplotlib - PullRequest
1 голос
/ 07 января 2020

Ниже сценария создайте диаграмму и массив в верхнем левом углу.

Как мы можем выдвинуть массив, чтобы мы не могли видеть ось Y через него?

import matplotlib.pyplot as plt
import pandas as pd
import numpy as np

fig = plt.figure(figsize=(13,4))
ax = fig.gca()

f = lambda x : np.power(1.2, x)
x0 = np.arange(*(0,100))
y0 = f(x0)

ax.plot(x0,y0)
ax.legend(['f(x)'])
ax.set_title('Exp')

index = ['index1', 'index2', 'index3', 'index4', 'index5']
values = [['1'], ['2'], ['3'], ['4'], ['5']]

table = ax.table(cellText=values, colWidths=[0.15, 0.15], rowLabels=index, loc='upper left')

plt.show()

1 Ответ

2 голосов
/ 07 января 2020

Используйте zorder для контроля своей позиции.

table = ax.table(cellText=values, colWidths=[0.15, 0.15], rowLabels=index, loc='upper left', zorder=10)
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...