Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/labcore/analysis/hvplotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from pathlib import Path
from typing import Any, Dict, Optional, Union

import hvplot.xarray # noqa: F401 — registers .hvplot accessor on xarray objects
import numpy as np
import pandas as pd
import panel as pn
Expand Down Expand Up @@ -1064,7 +1065,11 @@ def plot_panel(self) -> Any:
)
else:
raise NotImplementedError
plot = plot.cols(2)
if not isinstance(plot, str):
try:
plot = plot.cols(2)
except AttributeError:
pass
return plot

def fit_axis_options(self) -> Any:
Expand Down Expand Up @@ -1322,11 +1327,10 @@ def plot_xr_as_2d(
ylabel=dim_labels.get(y, y),
clabel=f"Mean {dim_labels.get(d, d)}",
)
# FIXME: QuadMesh object has no attribute 'cols' error for longsweep
try:
return plot.cols(1)
except AttributeError:
return "*Not a valid plot* Attribute Error occurred"
return plot

else:
return "*Not a valid plot*"
Expand Down
Loading