diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f51720..5a57718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ ### Added * AxesAnaglyph for red-cyan anaglyphs ### Changed +* Only apply inaccurate axis label transparency to x axis labels ### Removed diff --git a/README.md b/README.md index 5dfb7d0..40a4d0a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ axstereo.scatter(x, y, z, c=z, cmap='viridis', s=10)

When you are viewing the stereogram properly, you should see the knot weave in and out of the page! -*Warning*: Please note that for 2D plots the stereoscopic effect requires shifting data, so the data will *not* necessarily line up with the axis labels! Right now this is controlled with the `focal_plane` parameter. Calling `AxesStereo2D(focal_plane=-1)` (the default) will ensure that the left axes data is not shifted, whereas `AxesStereo2D(focal_plane=1)` will lock down the right axes data. The tick labels for axes where the data is not aligned will have transparency applied. So in the plot above, the right side labels being lighter gray indicates that you should not trust that data to be positioned correctly, but the left subplot with its black labeling is accurate. +*Warning*: Please note that for 2D plots the stereoscopic effect requires shifting data, so the data will *not* necessarily line up with the x-axis labels! Right now this is controlled with the `focal_plane` parameter. Calling `AxesStereo2D(focal_plane=-1)` (the default) will ensure that the left x-axis data is not shifted, whereas `AxesStereo2D(focal_plane=1)` will lock down the right x-axis data. The tick labels for x-axes where the data is not aligned will have transparency applied. So in the plot above, the right side labels being lighter gray indicates that you should not trust that x-axis data to be positioned correctly, but the left subplot with its black labeling is accurate. ### 3D Stereogram plots The stereoscopic effect in 3D is made just by rotating the plot view, so all of matplotlib's 3D plot types are supported, and there are no concerns about data not lining up with the axis labels. diff --git a/docs/trefoil_2d.png b/docs/trefoil_2d.png index abc9aff..378351a 100644 Binary files a/docs/trefoil_2d.png and b/docs/trefoil_2d.png differ diff --git a/src/mpl_stereo/AxesStereo.py b/src/mpl_stereo/AxesStereo.py index 5126aa7..db9c711 100644 --- a/src/mpl_stereo/AxesStereo.py +++ b/src/mpl_stereo/AxesStereo.py @@ -180,9 +180,8 @@ def __init__(self, is_3d=False) self.known_methods = ['plot', 'scatter', 'stem', 'bar'] - # Turn on all the axis labels then make semitransparent not accurate at the edges - self.ax_right.yaxis.set_tick_params(labelleft=True) - self.set_axlabel_alphas(0.5) + # Give the innacurate x-axis labels some transparency + self.set_axlabel_alphas(alpha=0.5) def __getattr__(self, name: str): """ @@ -225,13 +224,9 @@ def set_axlabel_alphas(self, alpha: float): if self.focal_plane != -1: for label in self.ax_left.get_xticklabels(): label.set_alpha(alpha) - for label in self.ax_left.get_yticklabels(): - label.set_alpha(alpha) elif self.focal_plane != 1: for label in self.ax_right.get_xticklabels(): label.set_alpha(alpha) - for label in self.ax_right.get_yticklabels(): - label.set_alpha(alpha) class AxesStereo3D(AxesStereo):