Вот изображение моего текущего графика:

Чего я хочу достичь:< /p>
Вертикальные линии должны располагайтесь ближе друг к другу, чтобы расстояние между ними было меньше.
Линии по краям графика не должны прилипать к краю или исчезать, а иметь тот же интервал, что и другие линии.
Что я пробовал На данный момент:
Регулировка ширины линии, ширины маркера и размера маркера.
Изменение размера фигуры и ограничений по осям с помощью plt.xlim() и plt.ylim().
Использование plt.tight_layout() и настройка subplots_adjust().
Исследование решений в Интернете за последние два дня, но безуспешно.
import pandas as pd
import glob
import numpy as np
import seaborn as sns
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import matplotlib.patches as mpatches
data = {
"Variant": [
"Variant 1: Photovoltaic system", "Variant 1: Photovoltaic system", "Variant 1: Photovoltaic system",
"Variant 1: Photovoltaic system", "Variant 1: Photovoltaic system", "Variant 2: Onshore wind turbine",
"Variant 2: Onshore wind turbine", "Variant 2: Onshore wind turbine", "Variant 2: Onshore wind turbine",
"Variant 2: Onshore wind turbine", "Variant 3: Offshore wind turbine", "Variant 3: Offshore wind turbine",
"Variant 3: Offshore wind turbine", "Variant 3: Offshore wind turbine", "Variant 3: Offshore wind turbine",
"Variant 4: Geothermal plant", "Variant 4: Geothermal plant", "Variant 4: Geothermal plant",
"Variant 4: Geothermal plant", "Variant 4: Geothermal plant"
],
"Type": ["Utility value"] * 20,
"Person": [
"Person 1", "Person 2", "Person 3", "Person 4", "Person 5", "Person 1", "Person 2", "Person 3", "Person 4",
"Person 5", "Person 1", "Person 2", "Person 3", "Person 4", "Person 5", "Person 1", "Person 2", "Person 3",
"Person 4", "Person 5"
],
"Criterion": ["Overall utility value"] * 20,
"Rating": [
370, 510, 470, 625, 750, 475, 605, 500, 665, 790, 710, 600, 715, 575, 700, 370, 350, 100, 585, 100
]
}
# Create the DataFrame:
df = pd.DataFrame(data)
df_2 = df
# Set colors:
palette = ["#007CAA", "#A8005C", "#AED3E7", "#7B0040", "#00597A", "#55A930", "#D50C2F"]
# Function to insert a line break after the second space:
def split_label(label):
words = label.split(" ")
if len(words)
Подробнее здесь: https://stackoverflow.com/questions/792 ... matplotlib
Мобильная версия