cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
Emmerich38
Level II

"E" for powers of 10

Hello,

For a publication in a scientific paper I made graph under JMP (file attached). Editor asks me to change the "E" for powers of 10. In other words, 3.4 × 10⁵ instead of 3.4e+5. Could you please tell me if there is an easy way to do this ?

puissance.JPG

 

Thanks in advance,

best regards

Sébastien

5 REPLIES 5

Re: "E" for powers of 10

Hi Sébastien,

 

with JMP 17 the best way would be to copy a vector graph into another graphing program and change the axis as you need it.

 

JMP 18 will be released in a couple of weeks with an option for scientific notations to make this natively possible in JMP.  

 

Hope that helps.

 

Jonas

Katz0801
Level II

Re: "E" for powers of 10

Local( {supers = "⁰¹²³⁴⁵⁶⁷⁸⁹", d, parts},
	parts = Words( Format( value, "Scientific", width, dec ), "e" ); // split on e
	Substitute Into( parts[2], "+", "", "-", "⁻" ); // ignore +, superscript -
	For( d = 0, d <= 9, d++, // superscript each digit
		Substitute Into( parts[2], Char( d ), Substr( supers, d + 1, 1 ))
	);
	if (value == 0, "0", parts[1] || " × 10" || parts[2]); // add x10 unless 0
)

Hi. There was a previous discussion on how to achieve this: https://community.jmp.com/t5/The-Plot-Thickens/Reply-All-Scientific-notation-such-as-6-02-10-using-c.... Essentially you use the script above to replace the e numbers with the x10 format. The link is to that previous discussion which gives more details.

 

edit:@Katz0801  - thanks for cross referencing! Sorry, this was stuck in the spam filter for no obvious reason. - Craige

Craige_Hales
Super User

Re: "E" for powers of 10

You can use a JMP 17 custom format to do it. (Test this code to make sure it does what you want!) Copy this

If(
	Pat Match(
		Format( :value, "Scientific", :width ),
		Pat Pos( 0 ) + Pat Immediate( Pat Break( "e" ), f ) + "e"
		+Pat Immediate( Pat Rem(), e )
	),
	f || "⨉10" || Substitute( e,
		"+", "⁺",
		"-", "⁻",
		"0", "⁰",
		"1", "¹",
		"2", "²",
		"3", "³",
		"4", "⁴",
		"5", "⁵",
		"6", "⁶",
		"7", "⁷",
		"8", "⁸",
		"9", "⁹"
	),
	Char( :value, :width, :dec )
)

Then open the axis dialog, Format->custom, set custom, paste.

The custom format uses the scientific format to make the "e" format then parses the fraction and exponent. It then reassembles the number with some Unicode characters. If you are not seeing exponents and multiplies and signs, your font might not include them. If the parse step fails, the custom format falls back to the char() function.

 

edit: @XanGregg  post Reply All: Scientific notation such as 6.02×10²³ using custom axis formats 

Craige
MRB3855
Super User

Re: "E" for powers of 10

Re: "E" for powers of 10

Nice, wished I new that earlier...

 

just leaving this here in case someone is looking into this thread after the JMP 18 release: 

 

Jonas_Rinne_0-1708966728241.png