- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Organize journal in a grid while copying open charts to journal within a loop
Currently my code snippet below copies open charts (distributions and heatmaps) into a journal depending on the occurrence of specific text (e.g. "Distribution") in window name list (postWindowList) of the open charts.
However, the journal gets the chart one below the other in one column. I would like them the charts to be in a MXN grid. How to achieve this from within the loop?
istart = LengthOfpreWindowList + 2; //e.g. istart = 10
iend = LengthOfpostWindowList; //e.g. iend = 24
nw = New Window( "My Report" , <<journal);
For( i = istart, i <= iend, i++,
If( Contains(postWindowList[i], "Distribution" ),
Window (postWindowList [i])[outlinebox(2)]<< journal,
Window (postWindowList [i])[outlinebox(1)]<< journal;
)
);
I am on JMP 13.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Organize journal in a grid while copying open charts to journal within a loop
Thanks, your script changes what I getting by default (i.e. vertically aligned charts in one column) to horizontally aligned charts.
However, I was able to use hlb1, hlb2, and so on (and assigning them appropriately within the for loop) to copy what I wanted in a MxN grid of the journal.
This will do nicely for what I am after at the moment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Organize journal in a grid while copying open charts to journal within a loop
I believe this will work.
nw = New Window( "My Report" , <<journal,
hlb = H List Box()
);
For( i = istart, i <= iend, i++,
If( Contains(postWindowList[i], "Distribution" ),
hlb << Append(Window (postWindowList [i])[outlinebox(2)]),
hlb << Append(Window (postWindowList [i])[outlinebox(1)]);
)
);
I strongly recommend that you take the time to read the Scripting Guide, found in the JMP Documentation Library, available under the Help pull down menu.!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Organize journal in a grid while copying open charts to journal within a loop
Thanks, your script changes what I getting by default (i.e. vertically aligned charts in one column) to horizontally aligned charts.
However, I was able to use hlb1, hlb2, and so on (and assigning them appropriately within the for loop) to copy what I wanted in a MxN grid of the journal.
This will do nicely for what I am after at the moment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Organize journal in a grid while copying open charts to journal within a loop
I believe a better solution for you is to take my script and add @pauldeen suggestion. It will give you the MxN matrix without having to do the hb1,hb2 coding
nw = New Window( "My Report" , <<journal,
hlb = Lineup Box( NCol( 5 ))
);
For( i = istart, i <= iend, i++,
If( Contains(postWindowList[i], "Distribution" ),
hlb << Append(Window (postWindowList [i])[outlinebox(2)]),
hlb << Append(Window (postWindowList [i])[outlinebox(1)]);
)
);
If you replace the 5 in the NCol() function with the number of columns you want in your output, it will automatically fill in as many rows as necessary to present all of your output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Organize journal in a grid while copying open charts to journal within a loop
You should look at a lineup box where you can specify the N part of your M*N list. Then you can just append things to that box and eventually journal the box.