столкнулся с проблемой с приказом графика на python

изучаю самостоятельно из книге и не понимаю в чем ошибаюсь но график не хочет выстроить..

import requests

from plotly.graph_objs import Bar
from plotly import offline

# создание вызова API и сохранение ответа
url = 'https://api.github.com/search/repositories?q=language:python&sort=stars'

headers = {'Accept': 'application/vnd.github.v3+json'}

r = requests.get(url, headers=headers)

print(f"Status code: {r.status_code}")

# обработка результатов
response_dict = r.json()

repo_dicts = response_dict['items']

repo_names, stars = [], []

for repo_dict in repo_dicts:

    repo_names.append(repo_dict['name'])

    stars.append(repo_dict['stargazers_count'])

# построенная визуализация
data = [{
    'type': 'bar',
    'x': 'repo_names',
    'y': 'stars',
}]


my_layout = {

    'title': "Most-Starred Python Projects on GitHub",

    'xaxis': {'title': 'Repository'},

    'ysxis': {'title': 'Stars'},
}

fig = {'data': data, 'layout': my_layout}

offline.plot(fig, filename='python_repos.html')

Ответы (1 шт):

Автор решения: Эникейщик

Замени

data = [{
    'type': 'bar',
    'x': 'repo_names',
    'y': 'stars',
}]

на

data = [{
    'type': 'bar',
    'x': repo_names, # здесь без кавычек!
    'y': 'stars',
}]
→ Ссылка