|
| 1 | +from types import MethodType |
| 2 | + |
1 | 3 | import numpy as np
|
2 | 4 |
|
3 | 5 | from .axes_divider import make_axes_locatable, Size
|
4 |
| -from .mpl_axes import Axes |
| 6 | +from .mpl_axes import Axes, SimpleAxisArtist |
5 | 7 |
|
6 | 8 |
|
7 | 9 | def make_rgb_axes(ax, pad=0.01, axes_class=None, **kwargs):
|
@@ -108,8 +110,17 @@ def __init__(self, *args, pad=0, **kwargs):
|
108 | 110 | ax, pad=pad, axes_class=axes_class, **kwargs)
|
109 | 111 | # Set the line color and ticks for the axes.
|
110 | 112 | for ax1 in [self.RGB, self.R, self.G, self.B]:
|
111 |
| - ax1.axis[:].line.set_color("w") |
112 |
| - ax1.axis[:].major_ticks.set_markeredgecolor("w") |
| 113 | + if isinstance(ax1.axis, MethodType): |
| 114 | + ad = Axes.AxisDict(self) |
| 115 | + ad.update( |
| 116 | + bottom=SimpleAxisArtist(ax1.xaxis, 1, ax1.spines["bottom"]), |
| 117 | + top=SimpleAxisArtist(ax1.xaxis, 2, ax1.spines["top"]), |
| 118 | + left=SimpleAxisArtist(ax1.yaxis, 1, ax1.spines["left"]), |
| 119 | + right=SimpleAxisArtist(ax1.yaxis, 2, ax1.spines["right"])) |
| 120 | + else: |
| 121 | + ad = ax1.axis |
| 122 | + ad[:].line.set_color("w") |
| 123 | + ad[:].major_ticks.set_markeredgecolor("w") |
113 | 124 |
|
114 | 125 | def imshow_rgb(self, r, g, b, **kwargs):
|
115 | 126 | """
|
|
0 commit comments