Consider we have two different plot commands in Mathematica. In the output there are one plot and another one below. But I want the output to be organized in one row: on the left there is one plot, while on the right there is another plot. Is there any way to do this?
1 Answer
I often use this kind of code :
gr00=Plot[Sin[x],{x,0,2 Pi}]
gr01=Plot[Cos[x],{x,0,2 Pi}]
Row[{gr00,gr01}]
If you don't want to see the first two graphs, simply add
;
at the end of the lines of codeThe two graphs in the same row are shrinked. To avoid the shrinking, you can do
Style[Row[{gr00,gr01}],ImageSizeMultipliers->{1, 1}]
.If the two graphs take more space that the windows width, the second graph is displayed under the first one (resulting in a layout that looks like a column). Simply enlarge the windows width and you will see immediatly the two graphs one next to the other.
-
$\begingroup$ Thank you! Do you know whether is possible to get 3 plots in one row? I tried, but it still displays maximum two plots. $\endgroup$ Commented Jun 16, 2018 at 18:48
-
$\begingroup$ @JohnTaylor I don't understand what you mean. It works fine with
gr00=Plot[Sin[x],{x,0,2 Pi}]; gr01=Plot[Cos[x],{x,0,2 Pi}]; gr02=Plot[Cos[x],{x,0,2 Pi}]; Row[{gr00,gr01,gr02}]
$\endgroup$– andre314Commented Jun 16, 2018 at 19:14 -
$\begingroup$ @JohnTaylor this works too :
Style[Row[{gr00,gr01,gr02}],ImageSizeMultipliers->{1, 1}]
({1,1}
, not{1,1,1}
) $\endgroup$– andre314Commented Jun 16, 2018 at 20:18
GraphicsRow
. $\endgroup$plot row
in the help-center and the second hit isGraphicsRow
. We always have the standard that at least a minimum amount of work should be done by the OP which did not happen here. Therefore, this question will most likey be closed as "can be found in the documentation". $\endgroup$