You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our instructor selected the color channels out instead of multiplying the others by 0 when he plotted the red, green, and blue channels separately. From what I could tell, the way the lesson is written with multiplying the other channels by 0 it inverts the colors when plotting, where the light red is dark red and vise versa and the selection method doesn't do that. Maybe should switch to selecting the channel instead of multiplying by 0's?
Which part of the content does your suggestion apply to?
Thanks a lot @sstevens2! We have discussed today this issues and we agreed that selecting the channels with the list multiplication is a little unexpected.
The reason behind it is that it keeps the red_channel / green_channel / blue_channel arrays as RGB arrays (with shape (4,4,3)) which will default to the expected RGB rendering when displayed with Matplotlib. In this case low values are close to black and high values go towards the bright red/green/blue.
Selecting a single channel and keeping it as a 2D array, it would render it automatically with the viridis cmap. Unfortunately matplotlib default colormaps don't have a traditional black-to-red / black-to-green / black-to-blue colormaps which can be used to emulate the RGB array display behaviour.
I will propose a few solutions for this better clarify this section in the coming weeks. We are possibly thinking of having an additional callout block to suggest the alternatives.
Activity
marcodallavecchia commentedon Aug 27, 2026
Thanks a lot @sstevens2! We have discussed today this issues and we agreed that selecting the channels with the list multiplication is a little unexpected.
The reason behind it is that it keeps the
red_channel/green_channel/blue_channelarrays as RGB arrays (with shape(4,4,3)) which will default to the expected RGB rendering when displayed with Matplotlib. In this case low values are close to black and high values go towards the bright red/green/blue.Selecting a single channel and keeping it as a 2D array, it would render it automatically with the viridis cmap. Unfortunately matplotlib default colormaps don't have a traditional black-to-red / black-to-green / black-to-blue colormaps which can be used to emulate the RGB array display behaviour.
I will propose a few solutions for this better clarify this section in the coming weeks. We are possibly thinking of having an additional callout block to suggest the alternatives.