반응형
import plotly.express as px
from plotly.subplots import make_subplots
import plotly.graph_objects as go
# Create a 2x2 subplot layout
fig = make_subplots(rows=2, cols=2)
# Add each image as a heatmap
fig.add_trace(go.Heatmap(z=label.squeeze().detach().to('cpu').numpy(),
colorscale='gray', showscale=False), row=1, col=1)
fig.add_trace(go.Heatmap(z=prediction.squeeze().detach().to('cpu').numpy(),
colorscale='gray', showscale=False), row=1, col=2)
fig.add_trace(go.Heatmap(z=error_mag.squeeze().detach().to('cpu').numpy(),
colorscale='gray', showscale=False), row=2, col=1)
fig.add_trace(go.Heatmap(z=mask.squeeze().detach().to('cpu').numpy(),
colorscale='gray', showscale=False), row=2, col=2)
fig.update_layout(height=600, width=600, title_text="4 Images in One Figure")
fig.show()
'Python' 카테고리의 다른 글
Rendering a 3D scene given 3D coordinate points using open3D (0) | 2025.02.13 |
---|---|
Install a conda environment compatible with 'Resnoise' (0) | 2024.12.03 |
3D points data scatter plot (2) | 2024.10.08 |
Scatter plot with subfigures (0) | 2023.11.13 |
현재 모델의 state_dict()가 갖는 key값만 저장된 state_dict()로 부터 불러오기 (0) | 2023.06.02 |