The details from the above post provide the answer to this see below. You can also read → Color bar in slice viewers
If you are wanting to create an image for a presentation or something you can use the “Screen Capture” module to generate an image that includes your image + scalar bar .