Skip to content

Commit 64ba480

Browse files
Fixed some bugs with Plotter
1 parent eea5845 commit 64ba480

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

pica/utils/PlotterUtil_GUI.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,12 @@ def _plot_file_data(self, filepath, x_col, y_col):
900900
raw_x = file_info['data'][x_col]
901901
raw_y = file_info['data'][y_col]
902902

903+
# Log-scale with non-positive data warnings
904+
if self.x_log_var.get() and np.any(raw_x <= 0):
905+
self.log(f"Warning: X log-scale active for '{os.path.basename(filepath)}', but non-positive data exists.")
906+
if self.y_log_var.get() and np.any(raw_y <= 0):
907+
self.log(f"Warning: Y log-scale active for '{os.path.basename(filepath)}', but non-positive data exists.")
908+
903909
finite_mask = np.isfinite(raw_x) & np.isfinite(raw_y)
904910
plot_x = raw_x[finite_mask]
905911
plot_y = raw_y[finite_mask]
@@ -934,12 +940,6 @@ def _finalize_plot(self, x_col, y_col, selected_filepaths):
934940
self.ax_main.set_xlabel(x_col)
935941
self.ax_main.set_ylabel(y_col)
936942

937-
# Log-scale with non-positive data warnings
938-
if self.x_log_var.get() and np.any(raw_x <= 0):
939-
self.log(f"Warning: X log-scale active for '{os.path.basename(filepath)}', but non-positive data exists.")
940-
if self.y_log_var.get() and np.any(raw_y <= 0):
941-
self.log(f"Warning: Y log-scale active for '{os.path.basename(filepath)}', but non-positive data exists.")
942-
943943
if len(selected_filepaths) == 1:
944944
self.ax_main.set_title(
945945
os.path.basename(

0 commit comments

Comments
 (0)