<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creating a function to make multiple graphs at a time in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883821#M104794</link>
    <description>&lt;P&gt;Besides "how to create the graphs?" - one cold also consider the "how to organize the graphs?".&lt;BR /&gt;Maybe use a &lt;STRONG&gt;single window and store the graphs as tabs&lt;/STRONG&gt;?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jul 2025 06:31:52 GMT</pubDate>
    <dc:creator>hogi</dc:creator>
    <dc:date>2025-07-08T06:31:52Z</dc:date>
    <item>
      <title>Creating a function to make multiple graphs at a time</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883710#M104781</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;I have a question regarding a function to create multiple graphs. So I am making a function which calls the graph builder with certain settings to create multiple graphs. The graphs are similar but do have different amount of columns used and formatting is a bit different. The only input to the function is the datatable with the data.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The function works to create the graphs and I save each one as a variable and then in the end add all of the variables to a list. Later I would like to call each one of the variables (graphs) from the list and place them in different windows. However, that does not work and I get a blank space when calling the list with an index.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried making the graphs into reports but that renders them noninteractive.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I call the function in the place where I want to place the graph it will place all 3 graphs at once instead of one at a time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help on how to navigate this would be appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2025 15:35:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883710#M104781</guid>
      <dc:creator>AdditiveRange10</dc:creator>
      <dc:date>2025-07-07T15:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a function to make multiple graphs at a time</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883724#M104782</link>
      <description>&lt;P&gt;You should be able to call the function where you wish to have the graphs at&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

create_plot = function({dt, colname}, {Default Local},
	gb = dt &amp;lt;&amp;lt; Graph Builder(
		Variables(X(:age), Y(Eval(colname)), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	);

	return(gb);
);

plots = {};

nw = new window("",
	V List Box(
		Insert Into(plots, create_plot(dt, "height")),
		Insert Into(plots, create_plot(dt, "weight"))
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you do not need the list for reference collection, you can just drop it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw = new window("",
	V List Box(
		gb_height = create_plot(dt, "height"),
		gb_weight = create_plot(dt, "weight")
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or just&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;nw = new window("",
	V List Box(
		create_plot(dt, "height"),
		create_plot(dt, "weight")
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and idea would be similar for multiple windows&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

create_plot = function({dt, colname}, {Default Local},
	gb = dt &amp;lt;&amp;lt; Graph Builder(
		Variables(X(:age), Y(Eval(colname)), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	);

	return(gb);
);

nw = new window("",
	create_plot(dt, "height")
);

nw = new window("",
	create_plot(dt, "weight")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or sometimes you might not need the new window&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = open("$SAMPLE_DATA/Big Class.jmp");

create_plot = function({dt, colname}, {Default Local},
	gb = dt &amp;lt;&amp;lt; Graph Builder(
		Variables(X(:age), Y(Eval(colname)), Overlay(:sex)),
		Elements(Points(X, Y, Legend(9)), Line Of Fit(X, Y, Legend(11)))
	);

	return(gb);
);

gb1 = create_plot(dt, "height");
gb2 = create_plot(dt, "weight");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jul 2025 15:58:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883724#M104782</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-07-07T15:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a function to make multiple graphs at a time</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883806#M104785</link>
      <description>&lt;P&gt;Thanks Jarmo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the end I did something similar. I made a Match clause and just had the choice of which of the three types of graphs to make and then called the function as many times as I needed with the choice to produce the individual graphs. I think that is equivalent to what you did in the end. I wanted to have all three plots made in the same function since they all have some small differences in formatting, more than just replacing the column name as in your example and I did not want to make 3 different functions for each type which would work as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 00:08:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883806#M104785</guid>
      <dc:creator>AdditiveRange10</dc:creator>
      <dc:date>2025-07-08T00:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a function to make multiple graphs at a time</title>
      <link>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883821#M104794</link>
      <description>&lt;P&gt;Besides "how to create the graphs?" - one cold also consider the "how to organize the graphs?".&lt;BR /&gt;Maybe use a &lt;STRONG&gt;single window and store the graphs as tabs&lt;/STRONG&gt;?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 06:31:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Creating-a-function-to-make-multiple-graphs-at-a-time/m-p/883821#M104794</guid>
      <dc:creator>hogi</dc:creator>
      <dc:date>2025-07-08T06:31:52Z</dc:date>
    </item>
  </channel>
</rss>

