исправь ошибку
import matplotlib.pyplot as plt
import numpy as np

# Создаем фигуру с высоким разрешением
plt.figure(figsize=(12, 16), dpi=300)
plt.axis('off')

# Настраиваем стиль блоков
block_style = dict(
    facecolor='white',
    edgecolor='black',
    boxstyle='round,pad=1',
    linewidth=2
)

# Функция для создания блока
def add_block(y, text, fontsize=12):
    plt.text(0.5, y, text,
             horizontalalignment='center',
             verticalalignment='center',
             bbox=block_style,
             transform=plt.gca().transAxes,
             fontsize=fontsize,
             fontweight='bold',
             family='sans-serif')

# Функция для создания стрелки
def add_arrow(start_y, end_y):
    plt.arrow(0.5, start_y,
             0, end_y - start_y,
             transform=plt.gca().transAxes,
             head_width=0.02,
             head_length=0.02,
             fc='black',
             ec='black',
             linewidth=2,
             length_includes_head=True)

# Определяем блоки с их позициями
blocks = [
    (0.95, "НАЧАЛО"),
    (0.85, "Ввод массива C\n(8 элементов)"),
    (0.75, "i = 0"),
    (0.65, "i < 8"),
    (0.55, "i нечётное?"),
    (0.45, "C[i] > 3?"),
    (0.35, "Вывод C[i]"),
    (0.25, "i = i + 1"),
    (0.15, "КОНЕЦ")
]

# Рисуем блоки
for y, text in blocks:
    add_block(y, text)

# Определяем и рисуем стрелки
arrows = [
    (0.92, 0.88),
    (0.82, 0.78),
    (0.72, 0.68),
    (0.62, 0.58),
    (0.52, 0.48),
    (0.42, 0.38),
    (0.32, 0.28),
    (0.22, 0.18)
]

# Рисуем основные стрелки
for start_y, end_y in arrows:
    add_arrow(start_y, end_y)

# Добавляем стрелку возврата для цикла
plt.annotate('', 
            xy=(0.3, 0.75), 
            xytext=(0.3, 0.25),
            arrowprops=dict(
                arrowstyle='->',
                linewidth=2,
                mutation_scale=20
            ),
            annotation_clip=False)

# Добавляем надписи "Да" и "Нет" для условий
conditions_y = [0.65, 0.55, 0.45]
for y in conditions_y:
    plt.text(0.55, y-0.03, 'Да', fontsize=10, fontweight='bold')
    plt.text(0.43, y-0.03, 'Нет', fontsize=10, fontweight='bold')

# Добавляем заголовок
plt.title('Блок-схема алгоритма\nПоиск элементов с нечётными индексами > 3', 
         pad=20, 
         fontsize=14, 
         fontweight='bold')

# Настраиваем поля
plt.tight_layout()

# Сохраняем с высоким качеством
plt.savefig
2 minutes ago 
You
:96: UserWarning: Tight layout not applied. The left and right margins cannot be made large enough to accommodate all axes decorations.
plt.tight_layout()
matplotlib.pyplot.savefig
def savefig(*args, **kwargs)
/usr/local/lib/python3.10/dist-packages/matplotlib/pyplot.py
Save the current figure.

Call signature::

savefig(fname, *, dpi='figure', format=None, metadata=None,
bbox_inches=None, pad_inches=0.1,
facecolor='auto', edgecolor='auto',
backend=None, **kwargs
)

The available output formats depend on the backend being used.

Parameters
fname : str or path-like or binary file-like
A path, or a Python file-like object, or
possibly some backend-dependent object such as
matplotlib.backends.backend_pdf.PdfPages.

If *format* is set, it determines the output format, and the file is saved as *fname*. Note that *fname* is used verbatim, and there is no attempt to make the extension, if any, of *fname* match *format*, and no extension is appended. If *format* is not set, then the format is inferred from the extension of *fname*, if there is one. If *format* is not set and *fname* has no extension, then the file is saved with :rc:`savefig.format` and the appropriate extension is appended to *fname*.
Other Parameters
dpi : float or 'figure', default: :rc:savefig.dpi
The resolution in dots per inch. If 'figure', use the figure's
dpi value.

format : str
The file format, e.g. 'png', 'pdf', 'svg', ... The behavior when
this is unset is documented under fname.

metadata : dict, optional
Key/value pairs to store in the image metadata. The supported keys
and defaults depend on the image format and backend:

- 'png' with Agg backend: See the parameter ``metadata`` of `~.FigureCanvasAgg.print_png`. - 'pdf' with pdf backend: See the parameter ``metadata`` of `~.backend_pdf.PdfPages`. - 'svg' with svg backend: See the parameter ``metadata`` of `~.FigureCanvasSVG.print_svg`. - 'eps' and 'ps' with PS backend: Only 'Creator' is supported.
bbox_inches : str or .Bbox, default: :rc:savefig.bbox
Bounding box in inches: only the given portion of the figure is
saved. If 'tight', try to figure out the tight bbox of the figure.

pad_inches : float, default: :rc:savefig.pad_inches
Amount of padding around the figure when bbox_inches is 'tight'.

facecolor : color or 'auto', default: :rc:savefig.facecolor
The facecolor of the figure. If 'auto', use the current figure
facecolor.

edgecolor : color or 'auto', default: :rc:savefig.edgecolor
The edgecolor of the figure. If 'auto', use the current figure
edgecolor.

backend : str, optional
Use a non-default backend to render the file, e.g. to render a
png file with the "cairo" backend rather than the default "agg",
or a pdf file with the "pgf" backend rather than the default
"pdf". Note that the default backend is normally sufficient. See
:ref:the-builtin-backends for a list of valid backends for each
file format. Custom backends can be referenced as "module://...".

orientation : {'landscape', 'portrait'}
Currently only supported by the postscript backend.

papertype : str
One of 'letter', 'legal', 'executive', 'ledger', 'a0' through
'a10', 'b0' through 'b10'. Only supported for postscript
output.

transparent : bool
If True, the Axes patches will all be transparent; the
Figure patch will also be transparent unless facecolor
and/or edgecolor are specified via kwargs.

If *False* has no effect and the color of the Axes and Figure patches are unchanged (unless the Figure patch is specified via the *facecolor* and/or *edgecolor* keyword arguments in which case those colors are used). The transparency of these patches will be restored to their original values upon exit of this function. This is useful, for example, for displaying a plot on top of a colored background on a web page.
bbox_extra_artists : list of ~matplotlib.artist.Artist, optional
A list of extra artists that will be considered when the
tight bbox is calculated.

pil_kwargs : dict, optional
Additional keyword arguments that are passed to
PIL.Image.Image.save when saving the figure.