• Array of String \pm

    From gompiemathur@gmail.com@21:1/5 to All on Sun Aug 6 12:02:58 2017
    Hi
    I want to declare an array of strings whose elements I wish to use in title of plot function.

    I declare it as...

    freq=['23.8 GHz','31.399 GHz', '50.299 GHz', '52.8 GHz', '53.595+'$\pm$'+ 0.115 GHz']

    the \pm is the symbol for +- .

    when I say print, freq, I see nothing printed. However when I don't use \pm I see printout the right values.
    Any help
    GlanPlon

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From benjamin.castellani@gmail.com@21:1/5 to Richa Mathur on Thu Oct 26 07:25:05 2017
    On Sunday, August 6, 2017 at 1:02:59 PM UTC-6, Richa Mathur wrote:
    Hi
    I want to declare an array of strings whose elements I wish to use in title of plot function.

    I declare it as...

    freq=['23.8 GHz','31.399 GHz', '50.299 GHz', '52.8 GHz', '53.595+'$\pm$'+ 0.115 GHz']

    the \pm is the symbol for +- .

    when I say print, freq, I see nothing printed. However when I don't use \pm I see printout the right values.
    Any help
    GlanPlon

    Hi there!

    IDL only supports the LaTex syntax for graphics. It does not work for data storage or display in the IDL console or IDL Command Line.

    You will want to use the BYTE/STRING functions together to create the special character....like...

    PM_SYMBOL = string(byte(177))

    177 is the byte value for the plus/minus symbol. Other symbol values can be found here: http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=dec&unicodeinhtml=dec

    Now that +/- is stored as a string, you can use it like:

    freq=['23.8 GHz','31.399 GHz', '50.299 GHz', '52.8 GHz', '53.595 '+PM_SYMBOL+' 0.115 GHz']

    Hope this helps.

    Ben C
    IDL Team
    Harris Geospatial Solutions

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)