-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fixed example axes_grid demo_axes_rgb.py figure 1 #6759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7738401
7444c6b
dfddf82
dd1164d
d4e27ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,13 +42,20 @@ def make_cube(r, g, b): | |
def demo_rgb(): | ||
fig, ax = plt.subplots() | ||
ax_r, ax_g, ax_b = make_rgb_axes(ax, pad=0.02) | ||
#fig.add_axes(ax_r) | ||
#fig.add_axes(ax_g) | ||
#fig.add_axes(ax_b) | ||
# fig.add_axes(ax_r) | ||
# fig.add_axes(ax_g) | ||
# fig.add_axes(ax_b) | ||
|
||
r, g, b = get_rgb() | ||
im_r, im_g, im_b, im_rgb = make_cube(r, g, b) | ||
kwargs = dict(origin="lower", interpolation="nearest") | ||
|
||
# make tickmarks invisible | ||
ax.tick_params(length=0) | ||
ax_r.tick_params(length=0) | ||
ax_g.tick_params(length=0) | ||
ax_b.tick_params(length=0) | ||
|
||
ax.imshow(im_rgb, **kwargs) | ||
ax_r.imshow(im_r, **kwargs) | ||
ax_g.imshow(im_g, **kwargs) | ||
|
@@ -58,22 +65,20 @@ def demo_rgb(): | |
def demo_rgb2(): | ||
fig = plt.figure(2) | ||
ax = RGBAxes(fig, [0.1, 0.1, 0.8, 0.8], pad=0.0) | ||
#fig.add_axes(ax) | ||
#ax.add_RGB_to_figure() | ||
# fig.add_axes(ax) | ||
# ax.add_RGB_to_figure() | ||
|
||
r, g, b = get_rgb() | ||
kwargs = dict(origin="lower", interpolation="nearest") | ||
ax.imshow_rgb(r, g, b, **kwargs) | ||
|
||
ax.RGB.set_xlim(0., 9.5) | ||
ax.RGB.set_xlim(0., 10.6) | ||
ax.RGB.set_ylim(0.9, 10.6) | ||
|
||
for ax1 in [ax.RGB, ax.R, ax.G, ax.B]: | ||
for sp1 in ax1.spines.values(): | ||
sp1.set_color("w") | ||
for tick in ax1.xaxis.get_major_ticks() + ax1.yaxis.get_major_ticks(): | ||
tick.tick1line.set_mec("w") | ||
tick.tick2line.set_mec("w") | ||
ax1.tick_params(axis='both', direction='in') | ||
ax1.xaxis.set_ticks(np.arange(0, 12, 2)) | ||
ax1.yaxis.set_ticks(np.arange(0, 12, 2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can take the two tick-setters outside the loop and apply them to |
||
|
||
return ax | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to leave these commented lines in?