Using ascii codes in graph annotations

The selection of 'special symbols' available in a graph annotation is rather small, and missing some fairly standard items, like σ and ∝. Is there some way to get Igor to recognize ascii codes, or perhaps extend the menu selection to include these items?

Ive been searching the forums but no luck, until now Ive been forced to edit this stuff in using photoshop.
If you have the Symbol font loaded, then you can annotate your graph with the alpha symbol using:
TextBox/C/N=textAlpha/A=MC "\\F'Symbol'a"

and the sigma symbol using:
TextBox/C/N=textSigma/A=MC "\\F'Symbol's"


When it is ready, Igor version 7 should solve this by supporting Unicode characters (http://www.igorexchange.com/node/4361).

Hope this helps,
Kurt
Quote:
The selection of 'special symbols' available in a graph annotation is rather small, and missing some fairly standard items, like σ and ∝. Is there some way to get Igor to recognize ascii codes, or perhaps extend the menu selection to include these items?


Technical Note: ASCII defines codes from 0 to 127 and these represent only non-printing control characters (such as linefeed), unaccented uppercase and lowercase letters, decimal digits and basic punctuation. So it is more accurate to ask:
Quote:
Is there some way to get Igor to recognize numeric codes, or perhaps extend the menu selection to include these items?


You can use num2char to convert a numeric code into the corresponding character:
Print num2char(65)  // 65 is the ASCII code for "A"


This gives the the character in the current font corresponding to the numeric code. On western systems for normal fonts the code is MacRoman on Macintosh and Windows-1252 on Windows. For special fonts such as Symbol and Wingdings the codes map to different characters.

However this will be of little use to you. The Special->Character popup menu in the Add Annotation dialog already gives you access to all of the characters (other than non-printing control characters) in your selected font.

Similarly Character Map on Windows will not give you any more characters than you can get through Igor's Special->Character popup menu.

So, if the currently selected font does not contain a character that you want (as shown in the Special->Character popup menu), select Symbol and look for the character there.

Igor Pro 6 uses "system text encoding" (on western systems, MacRoman on Macintosh, Windows-1252 on Windows). In western system text encodings a given font can represent only 256 distinct characters.

Igor Pro 7 (still a long way off) will use Unicode. In Unicode a given font can, in theory, represent about a million distinct characters. Most fonts represent only a small fraction of the total but still represent many more than system text encoding.

Thanks for the responses, will look into some of the temporary solutions.

For whatever reason, our lab uses adobe illustrator to resize/finetune all figures before inclusion and manuscript submission. Im still trying to figure out why they havent just gotten the correct default settings in Igor, since 99% of all our figures are originally done in Igor.
daggaz wrote:
Thanks for the responses, will look into some of the temporary solutions.

For whatever reason, our lab uses adobe illustrator to resize/finetune all figures before inclusion and manuscript submission. Im still trying to figure out why they havent just gotten the correct default settings in Igor, since 99% of all our figures are originally done in Igor.


My lab did the same thing, and I felt the same way you do. I did the layout of almost all of my figures entirely in Igor. There were a few things that would have been easier to do in Illustrator but changing a figure would have been more work because I would have needed to export from Igor, re-import in Illustrator, change in Illustrator, and then export the final figure. I think others in my lab were just more experienced using Illustrator than Igor for these kinds of things.

For what it's worth, the character picker in Igor 7 contains all of the Greek characters plus a bunch of other symbols that I thought would are frequently used in science. But, as Howard said, it will be a while before that can be helpful to you.
I usually can find all the symbols I need for annotations, but I'm having trouble with labelling graphs using textwaves (actually a category plot). Is this the unicode problem? I really want to use a minus sign in my label, but when I edit the textwave in a table, and paste the minus sign in from Character Map, it converts it back to a hyphen. Trying to change the text wave element on the command line causes the minus to be replaced with a '?'. Any ideas? Use textboxes instead? Thanks for any help!

-Matthew
Quote:
but when I edit the textwave in a table, and paste the minus sign in from Character Map, it converts it back to a hyphen.


The Unicode chart (search for HYPHEN-MINUS) show the following codes (all numbers are hexadecimal):
002D = HYPEN-MINUS (hyphen or minus)
2010 = hyphen
2011 = non-breaking hyphen
2013 = en dash
2043 = hyphen bullet
2212 = minus sign

I assume that the "minus sign" that you are referring to is Unicode 2212.

When running in English on Windows, Igor uses Windows 1252 text encoding. That encoding supports the following hyphen-like characters (all numbers are hexadecimal):
2D = HYPEN-MINUS
96 = en dash
97 = em dash

When you copy 2212 in Character Map and paste it into Igor, the system must convert it to some Windows-1252 code because Igor is not a Unicode program. So it converts it to 2D.

In Igor on Windows your only choices are 2D, 96 and 97. You can print them to the history like this:
// Windows-1252
Print num2char(0x2D)        // hyphen-minus
Print num2char(0x96)        // en dash
Print num2char(0x97)        // em dash


Since those are Windows-1252 codes they will not work on Macintosh. On Macintosh in MacRoman:
// MacRoman
Print num2char(0x2D)        // hyphen-minus
Print num2char(0xD0)        // en dash
Print num2char(0xD1)        // em dash