修改深色模式下结果图片显示异常
This commit is contained in:
@@ -4,6 +4,7 @@ Step 2 重构:从 pqAutomationApp.PQAutomationApp.plot_eotf 原样搬迁。
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
from app.views.modern_styles import get_theme_palette
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
@@ -14,15 +15,21 @@ if TYPE_CHECKING:
|
||||
|
||||
def plot_eotf(self: "PQAutomationApp", L_bar, results_with_eotf_list, test_type):
|
||||
"""绘制 EOTF 曲线 + 数据表格(HDR 专用,包含实测亮度)"""
|
||||
palette = get_theme_palette()
|
||||
|
||||
# ========== 1. 清空并重置左侧曲线 ==========
|
||||
self.eotf_ax.clear()
|
||||
self.eotf_fig.patch.set_facecolor(palette["bg"])
|
||||
self.eotf_ax.set_facecolor(palette["card_bg"])
|
||||
self.eotf_ax.set_xlim(0, 105)
|
||||
self.eotf_ax.set_ylim(0, 1.1)
|
||||
self.eotf_ax.set_xlabel("灰阶 (%)", fontsize=10)
|
||||
self.eotf_ax.set_ylabel("L_bar", fontsize=10)
|
||||
self.eotf_ax.grid(True, linestyle="--", alpha=0.3)
|
||||
self.eotf_ax.tick_params(labelsize=9)
|
||||
self.eotf_ax.tick_params(colors=palette["fg"])
|
||||
for spine in self.eotf_ax.spines.values():
|
||||
spine.set_color(palette["border"])
|
||||
|
||||
# 生成横坐标(灰阶百分比)
|
||||
x_values = np.linspace(0, 100, len(L_bar))
|
||||
@@ -120,17 +127,17 @@ def plot_eotf(self: "PQAutomationApp", L_bar, results_with_eotf_list, test_type)
|
||||
# 表头样式
|
||||
for i in range(4):
|
||||
cell = table[(0, i)]
|
||||
cell.set_facecolor("#4472C4")
|
||||
cell.set_text_props(weight="bold", color="white")
|
||||
cell.set_facecolor(palette["primary"])
|
||||
cell.set_text_props(weight="bold", color=palette["select_fg"])
|
||||
|
||||
# 数据行交替颜色
|
||||
for i in range(1, len(table_data)):
|
||||
for j in range(4):
|
||||
cell = table[(i, j)]
|
||||
if i % 2 == 0:
|
||||
cell.set_facecolor("#E7E6E6")
|
||||
cell.set_facecolor(palette["surface_alt_bg"])
|
||||
else:
|
||||
cell.set_facecolor("#FFFFFF")
|
||||
cell.set_facecolor(palette["card_bg"])
|
||||
|
||||
# ========== 3. 总标题 ==========
|
||||
test_type_name = self.get_test_type_name(test_type)
|
||||
@@ -139,6 +146,7 @@ def plot_eotf(self: "PQAutomationApp", L_bar, results_with_eotf_list, test_type)
|
||||
fontsize=12,
|
||||
y=0.98,
|
||||
fontweight="bold",
|
||||
color=palette["fg"],
|
||||
)
|
||||
|
||||
# 选中 EOTF Tab
|
||||
|
||||
Reference in New Issue
Block a user