cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
RandomFed
Level I

How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

Hi,

I'm doing a very simple graph in graph builder. I have very long name for the sample (used as group X variable). 
How can I  wrap in multiple lines the labels? I would like to avoid to have half graph which are labels!!

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

If you want to wrap them on axis, sometimes you might manage with axis settings Wrap Lines, but I think it wont wrap one long string without any whitespace

jthi_0-1646403280544.png

You might also end up with some missing labels when using this:

jthi_1-1646403440512.png

 

 

When I had this problem in some earlier version of JMP (I think it was 14), I did create new label column with some very complicated regex to handle the splitting at correct place

-Jarmo

View solution in original post

6 REPLIES 6
Georg
Level VII

Re: How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

Welcome to the Community!

There are many ways to perform this:

  • One is to make a Calculation (Transform) on that column in the Graph Builder (in your case you may need character function word to get a part of your column content, my formula was subtr(name, 1,1), that gives the first character, Based on data table "Big Class.jmp" from the Help-Sample Data menu
  • another would be to generate a new Column by "Recode" (right click on Column name ...)

see also documentation that you can find under Help, or press ? and click on a part of the platform

 

Georg_0-1646392195778.png

Georg_2-1646392441989.png

 

Georg_1-1646392252573.png

 

 

Georg
RandomFed
Level I

Re: How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

Thanks a lot for your answer!

Actually I would not change the labels, but only display them in two lines in the graph as in the example below (I did it in power point because I cannot do it in JMP).

 

ian_jmp
Level X

Re: How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

FWIW, when dropping a variable into the 'Group X' zone, I found that (JMP 16.2 on a Mac) Graph Builder did a reasonable job in breaking up the labels. And, if that's not to your taste, you can just drag to make changes to the widths:

Screenshot 2022-03-04 at 11.56.41.png

Screenshot 2022-03-04 at 11.56.59.png

jthi
Super User

Re: How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

If you want to wrap them on axis, sometimes you might manage with axis settings Wrap Lines, but I think it wont wrap one long string without any whitespace

jthi_0-1646403280544.png

You might also end up with some missing labels when using this:

jthi_1-1646403440512.png

 

 

When I had this problem in some earlier version of JMP (I think it was 14), I did create new label column with some very complicated regex to handle the splitting at correct place

-Jarmo
RandomFed
Level I

Re: How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

Thanks a lot! It was exactly my point!
Which version are you using now? I have JMP14 and there is not that option in Axis Label Row, but I will move soon at 15.

jthi
Super User

Re: How do I wrap in multiple lines the label of a Group X variable in Graph Builder?

It seems to be already in JMP15, but I'm using JMP16 so it might behave a little differently when compared to JMP15

 

A little extra: here is the very very scary looking regex I used with JMP14 that I cannot remember anymore how it worked, but I think the idea was to wrap at 15th character if there are no whitespaces which could be used:

Names Default To Here(1);

regex_wrapping = "(?:((?>.{1,15}(?:(?<=[^\S\r\n])[^\S\r\n]?|(?=\r?\n)|$|[^\S\r\n]))|.{1,15})(?:\r?\n)?|(?:\r?\n|$))";

long_str_without_spaces = "very_long_string_with_many_words_and_requires_wrapping";
long_str_with_spaces = "very long string with many words and requires wrapping";

Show(Regex(long_str_without_spaces, regex_wrapping, "\1\!N", GLOBALREPLACE));
Show(Regex(long_str_with_spaces, regex_wrapping, "\1\!N", GLOBALREPLACE));
-Jarmo