1
$\begingroup$

I have several figures, like the one posted here, as follows:

logdata1 = {{2, 2.977288135593221`}, {3, 5.057966101694916`}, {4, 9.12474576271186`}, {Log[31]/Log[2], 18}, {Log[63]/Log[2], 31}, {Log[125]/Log[2], 51.494915254237284`}, {Log[250]/Log[2], 76.4315254237288`}, {Log[500]/Log[2], 95.`}};

logdata02 = {{2, 2}, {3, 3}, {4, 8}, {Log[31]/Log[2], Around[18., 4.]}, {Log[63]/Log[2], Around[31., 8.]}, {Log[125]/Log[2], Around[53., 3.]}, {Log[250]/Log[2], Around[75., 4.]}, {Log[500]/Log[2], Around[88., 2.]}};

logdat = {{0, 2.`}, {1, 3.5043174775051944`}, {2,6.324897077853707`}, {3, 14.065864097515846`}, {4,28.10616055423098`}, {5, 47.787647551590595`}, {6,70.94786871568094`}, {7, 90.50399592324848`}, {8,99.3732010510395`}, {9, 100.`}, {10, 100.`}};

logdata111 = {{0, Around[7.139735711502354, {7.139735711502354, 10.780941922120547`}]}, {1,Around[8.173953977287177, {8.173953977287177,8.80652523289498}]}, {2, Around[12.216807198082378`,8.806525232894987]}, {3, Around[22.08889064421021, 8.900545075239052]}, {4, Around[43.99551391037958, 11.909180030249445`]}, {5, Around[57.97313047219867, 10.937641659360658`]}, {6, Around[77.99935689148654, 9.872083446127846]}, {7, Around[87.84010039016637, 5.0143915916839745`]}, {8,92.91717187674638`}, {9, Around[94.04540998487528, 5.045731539131978]}, {10, Around[94.89158856597196, 5.045731539132007]}};

logdata002 = {{2, 1.3673647550499184`}, {3, 1.505112607383329`}, {4,1.6734803807754814`}, {Log[31]/Log[2], 2.255119572788484`}, {Log[63]/Log[2], 3.0625000585768176`}, {Log[125]/Log[2],4.385423276084257`}, {Log[250]/Log[2], 7.345358434572939`}, {Log[500]/Log[2], 12.650797488956057`}};

logdata001 = {{2, 0.9619732030511365`}, {3, Around[1.0615567283096428`, 0.0829973108613199]}, {4, Around[1.6148368066515686`, 0.19646949168300437`]}, {Log[31]/Log[2],Around[1.9799984788912215`, 0.22744045238090516`]}, {Log[63]/Log[2], Around[3.0256586135432313`, 0.4441779651996193]}, {Log[125]/Log[2], Around[4.751870201707909, 0.5186565213910944]}, {Log[250]/Log[2], Around[8.353662042037488, 1.0279834833435684`]}, {Log[500]/Log[2],Around[13.333103260464355`, 1.3421587275991116`]}};

logdata10 = {{2, 0.037290259768610834`}, {3, 0.08203857149094367`}, {4, 0.18272227286619303`}, {Log[31]/Log[2],0.3729025976861083`}, {Log[63]/Log[2], 0.7980059655093062`}, {Log[125]/Log[2], 2.1628294730404627`}, {Log[250]/Log[2], 5.313856423488078`}, {Log[500]/Log[2], 11.612181298406448`}};   

logdata20 = {{2, 0.01923946406102273`}, {3, Around[0.03184670184928928, 0.0024899193258395955`]}, {4, Around[0.12918694453212548`, 0.015717559334640346`]}, {Log[31]/Log[2],Around[0.3563997262004199, 0.08961820005530305]}, {Log[63]/Log[2],Around[0.9379541701984017, 0.28073501016321956`]}, {Log[125]/Log[2], Around[2.518491206905192, 0.31004473232138824`]}, {Log[250]/Log[2], Around[6.265246531528116, 0.8412886365140424]}, {Log[500]/Log[2], Around[11.733130869208633`, 1.2111257852990607`]}};

logdata3T = {{2, 0.037290259768610834`}, {3, 0.08203857149094367`}, {4, 0.18272227286619303`}, {Log[31]/Log[2],0.3729025976861083`}, {Log[63]/Log[2], 0.7721444737782013`}, {Log[125]/Log[2],1.5927850770236485`}, {Log[250]/Log[2],3.2266059143941286`}, {Log[500]/Log[2],6.456945743533025`}};

logdata4E = {{2, 0.01923946406102273`}, {3, Around[0.03184670184928928, 0.0024899193258395955`]}, {4, Around[0.11936590592661056`, 0.007469757977518787]}, {Log[31]/Log[2], Around[0.30214121919217246`, 0.01680695544941727]}, {Log[63]/Log[2], Around[0.7423029972965487, 0.03672631005613403]}, {Log[125]/Log[2], Around[1.5032606475786903`, 0.07532005960664777]}, {Log[250]/Log[2], Around[3.069938162865453, 0.15313003853913512`]}, {Log[500]/Log[2], Around[6.199563008878771, 0.3087499964041098]}};


g1 = ListLinePlot[{logdata1, logdata02}, IntervalMarkers -> "Fences", Frame -> True, PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
LabelStyle -> {22, GrayLevel[0]}, 
PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
  Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}},ImageSize -> Large, 
BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
PlotLegends -> Placed[PointLegend[{Style["Simulation", 
    FontFamily -> "Latin Modern Roman 10"], 
   Style["Experiment", FontFamily -> "Latin Modern Roman 10"]}, 
  LegendFunction -> "Frame"], Scaled[{0.2, 0.77}]], 
 FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
  Style["% Cells with membrane ruffles", 
  FontFamily -> "Latin Modern Roman 10"]}, 
FrameTicks -> {{{{20, "20%"}, {40, "40%"}, {60, "60%"}, {80, 
    "80%"}, {100, "100%"}}, 
  None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
    125}, {8, 250}, {9, 500}}, None}}];


g2 = ListLinePlot[{logdat, logdata111}, IntervalMarkers -> "Fences", 
Frame -> True, 
PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
LabelStyle -> {22, GrayLevel[0]}, 
PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
  Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
ImageSize -> Large, 
BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
PlotLegends -> 
Placed[PointLegend[{Style["Simulation", 
    FontFamily -> "Latin Modern Roman 10"], 
   Style["Experiment", FontFamily -> "Latin Modern Roman 10"]}, 
  LegendFunction -> "Frame"], Scaled[{0.2, 0.77}]], 
FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
  Style["Infection efficiency", 
  FontFamily -> "Latin Modern Roman 10"]}, 
FrameTicks -> {{{{20, "20%"}, {40, "40%"}, {60, "60%"}, {80, 
    "80%"}, {100, "100%"}}, 
  None}, {{{0, 1}, {1, 2}, {2, 4}, {3, 8}, {4, 16}, {5, 32}, {6, 
    64}, {7, 128}, {8, 256}, {9, 512}, {10, 1024}}, None}}];


g3 = ListLinePlot[{logdata002, logdata001}, 
IntervalMarkers -> "Fences", Frame -> True, 
PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
LabelStyle -> {22, GrayLevel[0]}, 
PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
  Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
ImageSize -> Large, 
BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
PlotLegends -> 
Placed[PointLegend[{Style["Simulation", 
    FontFamily -> "Latin Modern Roman 10"], 
   Style["Experiment", FontFamily -> "Latin Modern Roman 10"]}, 
  LegendFunction -> "Frame"], Scaled[{0.2, 0.77}]], 
FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
  Style["\[NumberSign] \!\(\*
StyleBox[\"Salmonella\",\nFontSlant->\"Italic\"]\)\!\(\*
StyleBox[\" \",\nFontSlant->\"Italic\"]\)per ruffle", 
  FontFamily -> "Latin Modern Roman 10"]
 }, FrameTicks -> {{{2, 4, 6, 8, 10, 12, 14}, 
  None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
    125}, {8, 250}, {9, 500}}, None}}];


g4 = ListLinePlot[{logdata10, logdata20, logdata3T, logdata4E}, 
IntervalMarkers -> "Fences", Frame -> True, 
PlotMarkers -> {Graphics[{Disk[], {Thick, Dashing[{}], Circle[]}}],
  0.04}, LabelStyle -> {22, GrayLevel[0]}, 
PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
  Thick}, {RGBColor[0.922526, 0.385626, 0.209179], 
  Thick}, {RGBColor[0.736782672705901, 0.358, 0.5030266573755369],
   Thick, Dashed}, {RGBColor[0.9728288904374106, 
   0.621644452187053, 0.07336199581899142], Thick, Dashed}}, 
ImageSize -> Large, 
BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
PlotLegends -> 
Placed[PointLegend[{Style["Simulation", 
    FontFamily -> "Latin Modern Roman 10", FontSize -> 18], 
   Style["Experiment", FontFamily -> "Latin Modern Roman 10", 
    FontSize -> 18], 
   Style["Simulation, extrapolated from low MOI", 
    FontFamily -> "Latin Modern Roman 10", FontSize -> 18], 
   Style["Experiment, extrapolated from low MOI", 
    FontFamily -> "Latin Modern Roman 10", FontSize -> 18]}, 
  LegendFunction -> "Frame"], Scaled[{0.41, 0.67}]], 
FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
  Style["\[NumberSign] Invaded \!\(\*
StyleBox[\"Salmonella\",\nFontSlant->\"Italic\"]\)\!\(\*
StyleBox[\" \",\nFontSlant->\"Italic\"]\)per cell", 
  FontFamily -> "Latin Modern Roman 10"]}, 
FrameTicks -> {{{2, 4, 6, 8, 10, 12}, 
  None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
    125}, {8, 250}, {9, 500}}, None}}];


 Grid[{{g1, g2}, {g3, g4}}]

How can I make my plots' frames to be the same size?

enter image description here

P.S.

@bmf approach results in (but now labels are not in the same lines!):

enter image description here

$\endgroup$
5
  • 2
    $\begingroup$ One perceives the sizes as different when the frames have different sizes. If one fixes the ImageSizes of all images to be equal, it means that the overall sizes including the frame labels and ticks will be equal. Thus, to adjust the sizes of the frames one has to adjust the ImageSize of each image manually. $\endgroup$ Jan 23 at 14:54
  • 1
    $\begingroup$ This is a friendly comment to hopefully improve future posts and make them useful for other users that might face same difficulties. You should try to reduce your issues to some minimal working examples. For instance, you can create random data and random functions and ask about the size of individual frames. Then, you can do the formatting for yourself. In this manner your posts will be more relevant and helpful to more people. I think that my answer encapsulates the main aspects of the issue you are facing. $\endgroup$
    – bmf
    Jan 23 at 15:08
  • 1
    $\begingroup$ I agree with @bmf this goes equally to the Op and to the people offering answers. The relevant part of the code is buried among code that is unnecessary to understand the core of the question. Please ALWAYS use minimal working Wolfram Language code and synthetic data as examples. $\endgroup$
    – rhermans
    Jan 23 at 16:12
  • $\begingroup$ Furthermore, be careful if publishing original research data plots. Many time journals require that the data has not been made public before. $\endgroup$
    – rhermans
    Jan 23 at 16:14
  • $\begingroup$ @Marteen Don't worry too much. As far as I know there is no precedent of journals complaining about this, you are not the only person doing that. However, I think it is something to be avoided. $\endgroup$
    – rhermans
    Jan 23 at 16:25

2 Answers 2

2
$\begingroup$

Try "Grid":

logdata001 = {{2., 0.961973}, {3., 
   Around[1.0615567283096428`, 0.0829973108613199]}, {4., 
   Around[1.6148368066515686`, 0.19646949168300437`]}, {4.9542, 
   Around[1.9799984788912215`, 0.22744045238090516`]}, {5.97728, 
   Around[3.0256586135432313`, 0.4441779651996193]}, {6.96578, 
   Around[4.751870201707909, 0.5186565213910944]}, {7.96578, 
   Around[8.353662042037488, 1.0279834833435684`]}, {8.96578, 
   Around[13.333103260464355`, 1.3421587275991116`]}}

logdata002 = {{2., 1.36736}, {3., 1.50511}, {4., 1.67348}, {4.9542, 
   2.25512}, {5.97728, 3.0625}, {6.96578, 4.38542}, {7.96578, 
   7.34536}, {8.96578, 12.6508}}


g1 = ListLinePlot[{logdata002, logdata001}, 
  IntervalMarkers -> "Fences", Frame -> True, 
  PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
  LabelStyle -> {22, GrayLevel[0]}, 
  PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
     Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
  ImageSize -> Large, 
  BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
  PlotLegends -> 
   Placed[PointLegend[{Style["Theory", 
       FontFamily -> "Latin Modern Roman 10"], 
      Style["Experiment", FontFamily -> "Latin Modern Roman 10"]}, 
     LegendFunction -> "Frame"], Scaled[{0.2, 0.77}]], 
  FrameLabel -> {Style["City", FontFamily -> "Latin Modern Roman 10"],
     Style["Crimes", FontFamily -> "Latin Modern Roman 10"]}, 
  FrameTicks -> {{{2, 4, 6, 8, 10, 12, 14}, 
     None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 125}, {8,
        250}, {9, 500}}, None}}];

g2 = ListLinePlot[{logdata002, logdata001}, 
  IntervalMarkers -> "Fences", Frame -> True, 
  PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
  LabelStyle -> {22, GrayLevel[0]}, 
  PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
     Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
  ImageSize -> Large, 
  BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
  PlotLegends -> 
   Placed[PointLegend[{Style["A lot of blah blah blah blah", 
       FontFamily -> "Latin Modern Roman 10"], 
      Style["More blah blah blah blah", 
       FontFamily -> "Latin Modern Roman 10"]}, 
     LegendFunction -> "Frame"], Scaled[{0.5, 0.77}]], 
  FrameLabel -> {Style["City", FontFamily -> "Latin Modern Roman 10"],
     Style["Crimes", FontFamily -> "Latin Modern Roman 10"]}, 
  FrameTicks -> {{{2, 4, 6, 8, 10, 12, 14}, 
     None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 125}, {8,
        250}, {9, 500}}, None}}];

Grid[{{g1, g2}, {g2, g1}}]

enter image description here

Addendum

Your problem comes from custom tick labels. You have to ensure that all the tick labels have the same length:

g1 = ListLinePlot[{logdata1, logdata02}, IntervalMarkers -> "Fences", 
   Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
   LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10"], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10"]}, 
      LegendFunction -> "Frame"], Scaled[{0.2, 0.77}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["% Cells with membrane ruffles", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{{20, "20%"}, {40, "40%"}, {60, "60%"}, {80, 
        "80%"}, {100, "100%"}}, 
      None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
        125}, {8, 250}, {9, 500}}, None}}];


g2 = ListLinePlot[{logdat, logdata111}, IntervalMarkers -> "Fences", 
   Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
   LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10"], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10"]}, 
      LegendFunction -> "Frame"], Scaled[{0.2, 0.77}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["Infection efficiency", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{{20, "20%"}, {40, "40%"}, {60, "60%"}, {80, 
        "80%"}, {100, "100%"}}, 
      None}, {{{0, 1}, {1, 2}, {2, 4}, {3, 8}, {4, 16}, {5, 32}, {6, 
        64}, {7, 128}, {8, 256}, {9, 512}, {10, 1024}}, None}}];


g3 = ListLinePlot[{logdata002, logdata001}, 
   IntervalMarkers -> "Fences", Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
   LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10"], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10"]}, 
      LegendFunction -> "Frame"], Scaled[{0.2, 0.77}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["\[NumberSign] \!\(\*
StyleBox[\"Salmonella\",\nFontSlant->\"Italic\"]\)\!\(\*
StyleBox[\" \",\nFontSlant->\"Italic\"]\)per ruffle", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{{2, "      2"}, {4, "      4"}, {6, 
        "      6"}, {8, "      8"}, {10, "     10"}, {12, 
        "     12"}, {14, "     14"}}, 
      None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
        125}, {8, 250}, {9, 500}}, None}}];


g4 = ListLinePlot[{logdata10, logdata20, logdata3T, logdata4E}, 
   IntervalMarkers -> "Fences", Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Dashing[{}], Circle[]}}],
      0.04}, LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], 
      Thick}, {RGBColor[0.736782672705901, 0.358, 0.5030266573755369],
       Thick, Dashed}, {RGBColor[0.9728288904374106, 
       0.621644452187053, 0.07336199581899142], Thick, Dashed}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> 18], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10", 
        FontSize -> 18], 
       Style["Simulation, extrapolated from low MOI", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> 18], 
       Style["Experiment, extrapolated from low MOI", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> 18]}, 
      LegendFunction -> "Frame"], Scaled[{0.41, 0.67}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["\[NumberSign] Invaded \!\(\*
StyleBox[\"Salmonella\",\nFontSlant->\"Italic\"]\)\!\(\*
StyleBox[\" \",\nFontSlant->\"Italic\"]\)per cell", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{{2, "     2"}, {4, "     4"}, {6, "     6"}, {8, 
        "     8"}, {10, "     10"}, {12, "     12"}, 4, 6, 8, 10, 12},
       None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
        125}, {8, 250}, {9, 500}}, None}}];


Grid[{{g1, g2}, {g3, g4}}]

enter image description here

$\endgroup$
3
  • $\begingroup$ The problem shows up when the plots have FrameTicks of different lengths, or one has axes labeled and another doesn't. MMA holds the full graphic width the same and shrinks the framed area to accommodate - it's always a huge headache. $\endgroup$
    – N.J.Evans
    Jan 23 at 14:55
  • $\begingroup$ I can not see this in your original post. $\endgroup$ Jan 23 at 14:57
  • $\begingroup$ @Marteen I think your problem are the different length of the custom ticks. Look at what I have added. $\endgroup$ Jan 23 at 15:55
2
$\begingroup$

Edit: in order to make my point even clearer

is = 300;
pad = 91;
fs = 11;
g1 = ListLinePlot[{logdata1, logdata02}, IntervalMarkers -> "Fences", 
   Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
   LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> fs], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10", 
        FontSize -> fs]}, LegendFunction -> "Frame"], 
     Scaled[{0.2, 0.77}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["% Cells with membrane ruffles", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{{20, "20%"}, {40, "40%"}, {60, "60%"}, {80, 
        "80%"}, {100, "100%"}}, 
      None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
        125}, {8, 250}, {9, 500}}, None}}, 
   ImagePadding -> {{pad, pad}, {pad, pad}}, ImageSize -> is];
g2 = ListLinePlot[{logdat, logdata111}, IntervalMarkers -> "Fences", 
   Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
   LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> fs], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10", 
        FontSize -> fs]}, LegendFunction -> "Frame"], 
     Scaled[{0.2, 0.77}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["Infection efficiency", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{{20, "20%"}, {40, "40%"}, {60, "60%"}, {80, 
        "80%"}, {100, "100%"}}, 
      None}, {{{0, 1}, {1, 2}, {2, 4}, {3, 8}, {4, 16}, {5, 32}, {6, 
        64}, {7, 128}, {8, 256}, {9, 512}, {10, 1024}}, None}}, 
   ImagePadding -> {{pad, pad}, {pad, pad}}, ImageSize -> is];
g3 = ListLinePlot[{logdata002, logdata001}, 
   IntervalMarkers -> "Fences", Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Circle[]}}], 0.04}, 
   LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], Thick}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> fs], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10", 
        FontSize -> fs]}, LegendFunction -> "Frame"], 
     Scaled[{0.2, 0.77}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["\[NumberSign] \!\(\*
StyleBox[\"Salmonella\",\nFontSlant->\"Italic\"]\)\!\(\*
StyleBox[\" \",\nFontSlant->\"Italic\"]\)per ruffle", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{2, 4, 6, 8, 10, 12, 14}, 
      None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
        125}, {8, 250}, {9, 500}}, None}}, 
   ImagePadding -> {{pad, pad}, {pad, pad}}, ImageSize -> is];
g4 = ListLinePlot[{logdata10, logdata20, logdata3T, logdata4E}, 
   IntervalMarkers -> "Fences", Frame -> True, 
   PlotMarkers -> {Graphics[{Disk[], {Thick, Dashing[{}], Circle[]}}],
      0.04}, LabelStyle -> {22, GrayLevel[0]}, 
   PlotStyle -> {{RGBColor[0.368417, 0.506779, 0.709798], 
      Thick}, {RGBColor[0.922526, 0.385626, 0.209179], 
      Thick}, {RGBColor[0.736782672705901, 0.358, 0.5030266573755369],
       Thick, Dashed}, {RGBColor[0.9728288904374106, 
       0.621644452187053, 0.07336199581899142], Thick, Dashed}}, 
   ImageSize -> Large, 
   BaseStyle -> {FontFamily -> "Latin Modern Math"}, 
   PlotLegends -> 
    Placed[PointLegend[{Style["Simulation", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> fs], 
       Style["Experiment", FontFamily -> "Latin Modern Roman 10", 
        FontSize -> fs], 
       Style["Simulation, extrapolated from low MOI", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> fs], 
       Style["Experiment, extrapolated from low MOI", 
        FontFamily -> "Latin Modern Roman 10", FontSize -> fs]}, 
      LegendFunction -> "Frame"], Scaled[{0.41, 0.67}]], 
   FrameLabel -> {Style["MOI", FontFamily -> "Latin Modern Roman 10"],
      Style["\[NumberSign] Invaded \!\(\*
StyleBox[\"Salmonella\",\nFontSlant->\"Italic\"]\)\!\(\*
StyleBox[\" \",\nFontSlant->\"Italic\"]\)per cell", 
      FontFamily -> "Latin Modern Roman 10"]}, 
   FrameTicks -> {{{2, 4, 6, 8, 10, 12}, 
      None}, {{{2, 4}, {3, 8}, {4, 16}, {5, 31}, {6, 63}, {7, 
        125}, {8, 250}, {9, 500}}, None}}, 
   ImagePadding -> {{pad, pad}, {pad, pad}}, ImageSize -> is];
Grid[{{g1, g2}, {g3, g4}}]

plf

Original: see below

I think that the issue described here has to be dealt with using ImagePadding in the following manner

I am creating a toy-model that will be useful for other users as well. Note that the toy model respects the requirement of different data etc

d1 = Range[1000]; d2 = Range[100]; pad = 23; pl1 = ListLinePlot[Sqrt[d1], Frame -> True, ImagePadding -> {{pad, 1}, {1, 1}}, ImageSize -> 300]; pl2 = ListLinePlot[10 + 2 d2^2, Frame -> True, ImagePadding -> {{pad, 1}, {1, 1}}, ImageSize -> 300]; Row@{pl1, pl2} Column@{pl1, pl2}

Exactly the same size which was the goal. Now, the formatting is left as an exercise to the reader.

pl1

pl2

$\endgroup$
1
  • $\begingroup$ @Marteen see the edit. the only task left for you is to adjust the size of the size of the numbers in x- and y-axes and in principle try to play a bit around with all the points I suggested in this and the other post. $\endgroup$
    – bmf
    Jan 23 at 15:37

Your Answer

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