Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 389287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:51:08+00:00 2026-05-12T15:51:08+00:00

In GNU Octave you can make a picture where different colors represent different values

  • 0

In GNU Octave you can make a picture where different colors represent different values in a matrix. You can also add a colorbar, which shows what color corresponds to what value.

Is it possible to somehow add units to the values shown in the colorbar? Instead of saying “0.36” it would say “0.36 V/nm”? I know this is possible in Matlab, but I can’t figure out how to do it in Octave. Any good workarounds?

I assume someone here will mention that I should use matplotlib instead (that usually happens). How would you accomplish the same thing with that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T15:51:08+00:00Added an answer on May 12, 2026 at 3:51 pm

    The matplotlib answer (using pylab) is

    imshow(random((20,20)))
    colorbar(format='%.2f V/nm')
    

    In Octave it seems that the following works (but I’m no Octave expert so maybe there’s a better way):

    c=colorbar();
    labels = {};
    for v=get(c,'ytick'), labels{end+1} = sprintf('%.2f V/nm',v); end
    set(c,'yticklabel',labels);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am testing a GNU Radio program which can tunnel TCP traffic over a
Using GNU Make I want to remove values from a variable: VAR := x.c
In GNU Octave version 3.4.3 I want to round a matrix to 2 units
GNU make can handle parallel tasks with a -jN argument, and it's common to
I have the following gnu make script: for hdrfile in $(_PUBLIC_HEADERS) ; do \
(this is similar to GNU make: Execute target but take dependency from file but
i'm new to gnu make. i searched around but i cannot find anything working...
I recently downloaded the latest stable release of Gnu Octave, and was attempting to
GNU Emacs 23.1.1 Fedora 13 I can select the colour theme by M-x color-theme-select
With GNU Make and one of the compilers in gcc: Is it possible to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.