1
$\begingroup$

I have a very long code which at the end, I get two plot (main energy plot and energy bar attached pictures). I need these two plots next to each other (for paper). Problem is I can not save the pictures to gather, and they are in two different boxes, and I have to save them one by one then put them together manually. This my code

    ListContourPlot[graphpointogather3d3,
      PlotLegends -> 
  BarLegend[Automatic, LegendMarkerSize -> 1550, 
   LegendLabel -> "\[CapitalDelta]G(kT)", 
   LabelStyle -> {FontSize -> 100, FontFamily -> "Times New Roman", 
     Black, Bold}], ColorFunction -> ColorData[{"Rainbow", {0, 8}}], 
 ColorFunctionScaling -> False

 , FrameLabel -> {{"Number of Contacts", 
    None}, {"End to End Distance(\[Angstrom])", "All K Acylated"}}, 
 ImageSize -> Full, PlotTheme -> "Scientific",
 Frame -> True, FrameTicks -> {{All, None}, {All, None}}, 
 FrameTicksStyle -> Directive[Black, 80, Thickness[0.01]], 
 LabelStyle -> 
  Directive[Black, Bold, FontFamily -> "Times New Roman"], 
 RotateLabel -> True, 
 BaseStyle -> {FontWeight -> Bold, FontSize -> 100}, AspectRatio -> 1,
  PlotRange -> {{2, 85}, {20, 130}}


 ]

and this the result of the code: the main energy plot enter image description here

and This the energy bar which I need to be next to the main plot: enter image description here

At the end I need something Like this Picture: enter image description here

$\endgroup$

1 Answer 1

2
$\begingroup$

You are making the image too large to fit on the screen. I know that you are seeking a high quality image but I think you can work with a smaller image size.

I created some fake data because I didn't have access to graphpointogather3d3.

graphpointogather3d3 = 
  Flatten[Table[{x, y, N[Cosh[(x - 80)/20*(y - 15)/20]]}, {x, 27, 
     118}, {y, 5, 70}], 1];

I changed ImageSize to be 600 and divided all of your dimensions by 4 (e.g., FontSize, LegendMarkerSize, FrameTickStyle, ...)

ListContourPlot[
 graphpointogather3d3,
 PlotLegends -> BarLegend[
   Automatic,
   LegendMarkerSize -> 1550/4,
   LegendLabel -> "\[CapitalDelta]G(kT)",
   LabelStyle -> {FontSize -> 100/4, FontFamily -> "Times New Roman", 
     Black, Bold}
   ],
 ColorFunction -> ColorData[{"Rainbow", {0, 8}}],
 ColorFunctionScaling -> False,
 FrameLabel -> {{"Number of Contacts", 
    None}, {"End to End Distance(\[Angstrom])", "All K Acylated"}},
 ImageSize -> 600,
 PlotTheme -> "Scientific",
 Frame -> True,
 FrameTicks -> {{All, None}, {All, None}},
 FrameTicksStyle -> Directive[Black, 80/4, Thickness[0.01/4]],
 LabelStyle -> Directive[Black, Bold, FontFamily -> "Times New Roman"],
 RotateLabel -> True,
 BaseStyle -> {FontWeight -> Bold, FontSize -> 100/4},
 AspectRatio -> 1,
 PlotRange -> {{2, 85}, {20, 130}}
 ]

Mathematica graphics

Update

In order to make the bar the same size and position of the main plot, adjust LegendMarkerSize and LegendMargins until they match.

ListContourPlot[
 graphpointogather3d3,
 PlotLegends -> BarLegend[
   Automatic,
   LegendMarkerSize -> 1550/2.7,
   LegendLabel -> "\[CapitalDelta]G(kT)",
   LabelStyle -> {FontSize -> 100/4, FontFamily -> "Times New Roman", 
     Black, Bold},
   LegendMargins -> {{0, 0}, {40, 0}}
   ],
 ColorFunction -> ColorData[{"Rainbow", {0, 8}}],
 ColorFunctionScaling -> False,
 FrameLabel -> {{"Number of Contacts", 
    None}, {"End to End Distance(\[Angstrom])", "All K Acylated"}},
 ImageSize -> 600,
 PlotTheme -> "Scientific", Frame -> True, 
 FrameTicks -> {{All, None}, {All, None}},
 FrameTicksStyle -> Directive[Black, 80/4, Thickness[0.01/4]],
 LabelStyle -> Directive[Black, Bold, FontFamily -> "Times New Roman"],
 RotateLabel -> True,
 BaseStyle -> {FontWeight -> Bold, FontSize -> 100/4},
 AspectRatio -> 1,
 PlotRange -> {{2, 85}, {20, 130}}
 ]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ How can I change the size of the bar and make it the high of the main plot? $\endgroup$
    – Parviz
    Commented Sep 23, 2019 at 16:00
  • $\begingroup$ Adjust LegendMarkerSize and LegendMargins in order to get it to align with the main plot. See update. $\endgroup$ Commented Sep 24, 2019 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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