well-log-toolkit 0.1.133__py3-none-any.whl → 0.1.134__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3667,6 +3667,7 @@ class Crossplot:
3667
3667
  bbox_transform=self.fig.transFigure
3668
3668
  )
3669
3669
  shape_legend.get_title().set_fontweight('bold')
3670
+ shape_legend.set_clip_on(False) # Prevent clipping outside axes
3670
3671
  self.ax.add_artist(shape_legend)
3671
3672
 
3672
3673
  # Calculate offset for color legend below shape legend
@@ -3692,6 +3693,7 @@ class Crossplot:
3692
3693
  bbox_transform=self.fig.transFigure
3693
3694
  )
3694
3695
  color_legend.get_title().set_fontweight('bold')
3696
+ color_legend.set_clip_on(False) # Prevent clipping outside axes
3695
3697
  else:
3696
3698
  # Place side by side for non-edge locations (top, bottom, center)
3697
3699
  # Estimate width of each legend
@@ -3713,6 +3715,7 @@ class Crossplot:
3713
3715
  bbox_transform=self.fig.transFigure
3714
3716
  )
3715
3717
  shape_legend.get_title().set_fontweight('bold')
3718
+ shape_legend.set_clip_on(False) # Prevent clipping outside axes
3716
3719
  self.ax.add_artist(shape_legend)
3717
3720
 
3718
3721
  color_legend = self.ax.legend(
@@ -3726,6 +3729,7 @@ class Crossplot:
3726
3729
  bbox_transform=self.fig.transFigure
3727
3730
  )
3728
3731
  color_legend.get_title().set_fontweight('bold')
3732
+ color_legend.set_clip_on(False) # Prevent clipping outside axes
3729
3733
  else:
3730
3734
  # For other positions, fall back to stacking
3731
3735
  shape_legend = self.ax.legend(
@@ -3737,6 +3741,7 @@ class Crossplot:
3737
3741
  edgecolor='black'
3738
3742
  )
3739
3743
  shape_legend.get_title().set_fontweight('bold')
3744
+ shape_legend.set_clip_on(False) # Prevent clipping outside axes
3740
3745
  self.ax.add_artist(shape_legend)
3741
3746
 
3742
3747
  # Estimate offset
@@ -3757,6 +3762,7 @@ class Crossplot:
3757
3762
  bbox_transform=self.fig.transFigure
3758
3763
  )
3759
3764
  color_legend.get_title().set_fontweight('bold')
3765
+ color_legend.set_clip_on(False) # Prevent clipping outside axes
3760
3766
 
3761
3767
  def _format_regression_label(self, name: str, reg, include_equation: bool = None, include_r2: bool = None) -> str:
3762
3768
  """Format a modern, compact regression label.
@@ -3786,11 +3792,8 @@ class Crossplot:
3786
3792
 
3787
3793
  # Add R² on second line if requested (will be styled grey later)
3788
3794
  if include_r2:
3789
- # Format R² with appropriate note
3790
- if self.y_log:
3791
- r2_label = f"R² = {reg.r_squared:.3f} (log)"
3792
- else:
3793
- r2_label = f"R² = {reg.r_squared:.3f}"
3795
+ # Format R² (no suffix needed)
3796
+ r2_label = f"R² = {reg.r_squared:.3f}"
3794
3797
  return f"{first_line}\n{r2_label}"
3795
3798
  else:
3796
3799
  return first_line
@@ -3833,6 +3836,16 @@ class Crossplot:
3833
3836
  # Fallback if data not available
3834
3837
  secondary_loc = 'lower right'
3835
3838
 
3839
+ # Determine descriptive title based on regression type
3840
+ if self.regression_by_color_and_shape:
3841
+ regression_title = 'Regressions by color and shape'
3842
+ elif self.regression_by_color:
3843
+ regression_title = 'Regressions by color'
3844
+ elif self.regression_by_group:
3845
+ regression_title = 'Regressions by group'
3846
+ else:
3847
+ regression_title = 'Regressions'
3848
+
3836
3849
  # Import legend from matplotlib
3837
3850
  from matplotlib.legend import Legend
3838
3851
 
@@ -3848,7 +3861,7 @@ class Crossplot:
3848
3861
  fancybox=False,
3849
3862
  shadow=False,
3850
3863
  fontsize=9,
3851
- title='Regressions',
3864
+ title=regression_title,
3852
3865
  title_fontsize=10
3853
3866
  )
3854
3867
 
@@ -3902,20 +3915,16 @@ class Crossplot:
3902
3915
 
3903
3916
  # Determine grouping column based on what's being used for colors in the plot
3904
3917
  group_column = None
3905
- group_label = None
3906
3918
 
3907
3919
  if self.color and 'color_val' in data.columns:
3908
3920
  # User specified explicit color mapping
3909
3921
  group_column = 'color_val'
3910
- group_label = self.color
3911
3922
  elif self.shape == "well" and 'well' in data.columns:
3912
3923
  # When shape="well", each well gets a different color in the plot
3913
3924
  group_column = 'well'
3914
- group_label = 'well'
3915
3925
  elif self.shape and self.shape != "well" and 'shape_val' in data.columns:
3916
3926
  # When shape is a property, each shape group gets a different color
3917
3927
  group_column = 'shape_val'
3918
- group_label = self.shape
3919
3928
 
3920
3929
  if group_column is None:
3921
3930
  warnings.warn(
@@ -3961,12 +3970,15 @@ class Crossplot:
3961
3970
  # Use the same color as the data points for this group
3962
3971
  group_config['line_color'] = group_colors_map.get(group_name, regression_colors[color_idx % len(regression_colors)])
3963
3972
 
3973
+ # Get display label for group name (converts codes to formation names)
3974
+ group_display = self._get_display_label(group_name, 'color')
3975
+
3964
3976
  # Skip legend update for all but last regression
3965
3977
  is_last = (idx == n_groups - 1)
3966
3978
  self._add_group_regression(
3967
3979
  x_vals[mask], y_vals[mask],
3968
3980
  reg_type,
3969
- name=f"{group_label}={group_name}",
3981
+ name=group_display,
3970
3982
  config=group_config,
3971
3983
  update_legend=is_last
3972
3984
  )
@@ -3999,12 +4011,15 @@ class Crossplot:
3999
4011
  # Use the same color as the data points for this group
4000
4012
  group_config['line_color'] = group_colors_map.get(group_name, regression_colors[color_idx % len(regression_colors)])
4001
4013
 
4014
+ # Get display label for group name (converts codes to formation names)
4015
+ group_display = self._get_display_label(group_name, 'color')
4016
+
4002
4017
  # Skip legend update for all but last regression
4003
4018
  is_last = (idx == n_groups - 1)
4004
4019
  self._add_group_regression(
4005
4020
  x_vals[mask], y_vals[mask],
4006
4021
  reg_type,
4007
- name=f"{group_label}={group_name}",
4022
+ name=group_display,
4008
4023
  config=group_config,
4009
4024
  update_legend=is_last
4010
4025
  )
@@ -4269,6 +4284,14 @@ class Crossplot:
4269
4284
  if self.y_log:
4270
4285
  self.ax.set_yscale('log')
4271
4286
 
4287
+ # Disable scientific notation on axes
4288
+ from matplotlib.ticker import ScalarFormatter
4289
+ formatter = ScalarFormatter(useOffset=False)
4290
+ formatter.set_scientific(False)
4291
+ self.ax.yaxis.set_major_formatter(formatter)
4292
+ if not self.x_log:
4293
+ self.ax.xaxis.set_major_formatter(formatter)
4294
+
4272
4295
  # Labels and title
4273
4296
  self.ax.set_xlabel(self.xlabel, fontsize=12, fontweight='bold')
4274
4297
  self.ax.set_ylabel(self.ylabel, fontsize=12, fontweight='bold')
@@ -4449,6 +4472,7 @@ class Crossplot:
4449
4472
  framealpha=0.9,
4450
4473
  edgecolor='black')
4451
4474
  legend.get_title().set_fontweight('bold')
4475
+ legend.set_clip_on(False) # Prevent clipping outside axes
4452
4476
  self.ax.add_artist(legend)
4453
4477
  elif not is_categorical and self.show_colorbar:
4454
4478
  # Add colorbar for continuous colors
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: well-log-toolkit
3
- Version: 0.1.133
3
+ Version: 0.1.134
4
4
  Summary: Fast LAS file processing with lazy loading and filtering for well log analysis
5
5
  Author-email: Kristian dF Kollsgård <kkollsg@gmail.com>
6
6
  License: MIT
@@ -7,9 +7,9 @@ well_log_toolkit/property.py,sha256=B-3mXNJmvIqjjMdsu1kgVSwMgEwbJ36wn_n_oppdJFw,
7
7
  well_log_toolkit/regression.py,sha256=7D3oI-1XVlFb-mOoHTxTTtUHERFyvQSBAzJzAGVoZnk,25192
8
8
  well_log_toolkit/statistics.py,sha256=_huPMbv2H3o9ezunjEM94mJknX5wPK8V4nDv2lIZZRw,16814
9
9
  well_log_toolkit/utils.py,sha256=O2KPq4htIoUlL74V2zKftdqqTjRfezU9M-568zPLme0,6866
10
- well_log_toolkit/visualization.py,sha256=rzwSkqUOEeSnnuvPvNMQ56-F316JBk0XSqAdqyoRjEc,195237
10
+ well_log_toolkit/visualization.py,sha256=xpui0fOv6JRaQTIK8o7QC8FNaJbjzdNCwnJ2KyOi4lk,196670
11
11
  well_log_toolkit/well.py,sha256=Aav5Y-rui8YsJdvk7BFndNPUu1O9mcjwDApAGyqV9kw,104535
12
- well_log_toolkit-0.1.133.dist-info/METADATA,sha256=F10zbt2b4FNQY76xM0eWAhG_y_ZABGkmY1nvem8doUY,59810
13
- well_log_toolkit-0.1.133.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
- well_log_toolkit-0.1.133.dist-info/top_level.txt,sha256=BMOo7OKLcZEnjo0wOLMclwzwTbYKYh31I8RGDOGSBdE,17
15
- well_log_toolkit-0.1.133.dist-info/RECORD,,
12
+ well_log_toolkit-0.1.134.dist-info/METADATA,sha256=afUQvTYy5a4E2vvkdKjjrrWsvkC491apUHSUNQNw1jE,59810
13
+ well_log_toolkit-0.1.134.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
14
+ well_log_toolkit-0.1.134.dist-info/top_level.txt,sha256=BMOo7OKLcZEnjo0wOLMclwzwTbYKYh31I8RGDOGSBdE,17
15
+ well_log_toolkit-0.1.134.dist-info/RECORD,,