3
$\begingroup$

If we have two or more labels graphs, and we want to put them in a bigger graph at specific locations, how can we do it?

I tried the following and it does not work

graph1 = Labeled[Graphics[Circle[{0, 0}]], "Circle"];
graph2 = Labeled[Graphics[Circle[{0, 0}]], "Circle 2"];
Graphics[{graph1, graph2}]

Update, I need to put the smaller graphs at certain position, not necessarily in a grid.

$\endgroup$
  • $\begingroup$ Your figures are not "graphs," and thus your original title was misleading. (I've fixed it.) $\endgroup$ – David G. Stork Jan 25 at 19:30
4
$\begingroup$

I suggest using Inset which will let specify arbitrary locations. Like so:

circles =
  {Labeled[Graphics[Circle[{0, 0}]], "Circle"],
   Labeled[Graphics[Circle[{0, 0}]], "Circle 2"]};
locations = {{-1, -1}, {1, 1}};
Graphics[MapThread[Inset[#1, #2] &, {circles, locations}],
  PlotRangePadding -> 1.5,
  Frame -> True]

graphics

$\endgroup$
4
$\begingroup$

Maybe Grid?

Grid[{{graph1, graph2}}]

enter image description here

You can rearrange the location by listing. For example,

Grid[{{graph1}, {graph2}}]

will put them vertically. enter image description here

$\endgroup$
  • $\begingroup$ I don't really want them to be in a grid. $\endgroup$ – ablmf Jan 25 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.