0
$\begingroup$

I'm using Show to draw a graph showing a Log Plot and a LogListPlot at once. However, the image size errors come up suddenly after changing the y-axis ranging from 0.01 to 1.0 -> from 0.01 to 1.2. The graph shows like this. enter image description here

    data1 = Import[
   "Downloads/n3/dmde_n3_e98_b1.dat", {"Data", {All}, {1, 2}}];
model1[a_] = ampl Evaluate[PDF[NormalDistribution[x0, sigma], a]];
fit = FindFit[data1, model1[a], {ampl, x0, sigma}, a]

g1 = LogPlot[{model1[a] /. fit}, {a, -6.5, 1.5}, 
   Axes -> {False, True, False}, 
   PlotRange -> {{-6.5, 1.5}, {0.01, 1.2}}, 
   AxesStyle -> Directive[Black, AbsoluteThickness[1.0], Dashed], 
   Frame -> True, FrameStyle -> AbsoluteThickness[1.0], 
   ImageSize -> 140*72/25.4, 
   PlotLabel -> 
    Style["(c) Marginally Eccentric TDE (n=3, e=0.98)" , 
     FontFamily -> "", Black, FontSize -> 18], 
   FrameTicksStyle -> 
    Directive[AbsoluteThickness[0.5], FontFamily -> "Times New Roman",
      FontSize -> 18], 
   FrameLabel -> {Style["ϵ/Δϵ", 18, 
      FontFamily -> "Times New Roman"], 
     Style["dM/dϵ [\!\(\*SubscriptBox[\(m\), \(*\)]\)/\
Δϵ]", 18, FontFamily -> "Times New Roman"]},
   PlotStyle -> {
     Directive[Red, AbsoluteThickness[2.2]]}, 
   PlotLegend -> {Style["β=1.0", 16.5, 
      FontFamily -> "Times New Roman"]
     }, LegendBorderSpace -> 0.2, 
   LegendBorder -> Directive[Black, AbsoluteThickness[0.5]], 
   LegendPosition -> {0.05, 0.25}, LegendShadow -> None, 
   LegendSize -> 0.5, LegendSpacing -> 0, LegendTextSpace -> 3, 
   Joined -> {True, True, True, True}];


g = ListLogPlot[{data1}, Axes -> {False, True, False}, 
   PlotRange -> {{-6.5, 1.5}, {0.01, 1.2}},
   AxesStyle -> Directive[Black, AbsoluteThickness[1.0], Dashed], 
   Frame -> True, FrameStyle -> AbsoluteThickness[1.0], 
   ImageSize -> 140*72/25.4, 
   PlotLabel -> 
    Style["(c) Marginally Eccentric TDE (n=3, e=0.98)" , 
     FontFamily -> "", Black, FontSize -> 18], 
   FrameTicksStyle -> 
    Directive[AbsoluteThickness[0.5], FontFamily -> "Times New Roman",
      FontSize -> 18], 
   FrameLabel -> {Style["ϵ/Δϵ", 18, 
      FontFamily -> "Times New Roman"], 
     Style["dM/dϵ [\!\(\*SubscriptBox[\(m\), \(*\)]\)/\
Δϵ]", 18, FontFamily -> "Times New Roman"]},
   PlotStyle -> {Directive[Darker[Red], AbsoluteThickness[1.5]]}, 
   PlotLegend -> {Style["β=1.0", 16.5, 
      FontFamily -> "Times New Roman"]
     }, LegendBorderSpace -> 0.2, 
   LegendBorder -> Directive[Black, AbsoluteThickness[0.5]], 
   LegendPosition -> {0.05, 0.25}, LegendShadow -> None, 
   LegendSize -> 0.5, LegendSpacing -> 0, LegendTextSpace -> 3, 
   Joined -> {False}];

Show[ {g, g1}, ImageSize -> Large]

Could you guess what is the problem here?

$\endgroup$
6
  • 1
    $\begingroup$ Please provide the data. $\endgroup$ Commented Jan 4, 2020 at 14:37
  • $\begingroup$ @OkkesDulgerci Sorry! You can download the data, but its format is .txt but not .dat here blog.naver.com/jumpkid93/221760854816 $\endgroup$ Commented Jan 5, 2020 at 12:01
  • $\begingroup$ What version you use. It works fine in M12. $\endgroup$ Commented Jan 5, 2020 at 14:12
  • $\begingroup$ I use Mac Catalina and Mathematica version 12 $\endgroup$ Commented Jan 6, 2020 at 0:14
  • $\begingroup$ Did you try my answer with fresh notebook? $\endgroup$ Commented Jan 6, 2020 at 0:22

1 Answer 1

1
$\begingroup$

It works fine in 12.0.0 for Microsoft Windows (64-bit) (April 6, 2019).

    model1[a_] = ampl Evaluate[PDF[NormalDistribution[x0, sigma], a]];
    fit = FindFit[data, model1[a], {ampl, x0, sigma}, a];

    g1 = LogPlot[{model1[a] /. fit}, {a, -6.5, 1.5}, 
   PlotStyle -> {Directive[Red, AbsoluteThickness[2.2]]}, 
   PlotLegends -> 
    Placed[LineLegend[{Style["β=1.0", 16.5, 
        FontFamily -> "Times New Roman"]}, 
      LegendFunction -> (Framed[#, RoundingRadius -> 5] &), 
      LegendMargins -> 5], Scaled[{0.15, 0.8}]]];


g = ListLogPlot[data, Axes -> {False, True}, 
   PlotRange -> {{-6.5, 1.5}, {0.01, 1.3}}, 
   AxesStyle -> Directive[Black, AbsoluteThickness[1.0], Dashed], 
   Frame -> True, FrameStyle -> AbsoluteThickness[1.0], 
   ImageSize -> 140*72/25.4, 
   PlotLabel -> 
    Style["(c) Marginally Eccentric TDE (n=3, e=0.98)", 
     FontFamily -> "", Black, FontSize -> 18], 
   FrameTicksStyle -> 
    Directive[AbsoluteThickness[0.5], FontFamily -> "Times New Roman",
      FontSize -> 18], 
   FrameLabel -> {Style["ϵ/Δϵ", 18, 
      FontFamily -> "Times New Roman"], 
     Style["dM/dϵ [\!\(\*SubscriptBox[\(m\), \(*\)]\)/\
Δϵ]", 18, FontFamily -> "Times New Roman"]}, 
   PlotStyle -> {Directive[Darker[Red], AbsoluteThickness[1.5]]}];

    Show[{g, g1}, ImageSize -> Large]

enter image description here

data={{-2.99, 0.}, {-2.98, 0.}, {-2.97, 0.}, {-2.96, 0.}, {-2.95, 
      0.}, {-2.94, 0.}, {-2.93, 0.}, {-2.92, 0.}, {-2.91, 0.}, {-2.9, 
      0.}, {-2.89, 0.}, {-2.88, 0.}, {-2.87, 0.}, {-2.86, 0.}, {-2.85, 
      0.}, {-2.84, 0.}, {-2.83, 0.}, {-2.82, 0.}, {-2.81, 0.}, {-2.8, 
      0.}, {-2.79, 0.}, {-2.78, 0.}, {-2.77, 0.}, {-2.76, 0.}, {-2.75, 
      0.}, {-2.74, 0.}, {-2.73, 0.}, {-2.72, 0.}, {-2.71, 0.}, {-2.7, 
      0.}, {-2.69, 0.}, {-2.68, 0.}, {-2.67, 0.}, {-2.66, 0.}, {-2.65, 
      0.}, {-2.64, 0.}, {-2.63, 0.}, {-2.62, 0.}, {-2.61, 0.}, {-2.6, 
      0.}, {-2.59, 0.}, {-2.58, 0.}, {-2.57, 0.}, {-2.56, 0.}, {-2.55, 
      0.}, {-2.54, 0.}, {-2.53, 0.}, {-2.52, 0.}, {-2.51, 0.}, {-2.5, 
      0.}, {-2.49, 0.}, {-2.48, 0.}, {-2.47, 0.}, {-2.46, 0.}, {-2.45, 
      0.}, {-2.44, 0.}, {-2.43, 0.}, {-2.42, 0.}, {-2.41, 0.}, {-2.4, 
      0.}, {-2.39, 0.}, {-2.38, 0.}, {-2.37, 0.}, {-2.36, 0.}, {-2.35, 
      0.}, {-2.34, 0.}, {-2.33, 0.000995699}, {-2.32, 
      0.000995699}, {-2.31, 0.}, {-2.3, 0.000995699}, {-2.29, 
      0.00398279}, {-2.28, 0.0019914}, {-2.27, 0.}, {-2.26, 
      0.0019914}, {-2.25, 0.}, {-2.24, 0.0019914}, {-2.23, 
      0.00398279}, {-2.22, 0.00597419}, {-2.21, 0.00497849}, {-2.2, 
      0.00696989}, {-2.19, 0.000995699}, {-2.18, 0.0019914}, {-2.17, 
      0.00896129}, {-2.16, 0.00696989}, {-2.15, 0.0109527}, {-2.14, 
      0.00896129}, {-2.13, 0.00597419}, {-2.12, 0.0129441}, {-2.11, 
      0.0139398}, {-2.1, 0.0238968}, {-2.09, 0.0119484}, {-2.08, 
      0.0149355}, {-2.07, 0.0189183}, {-2.06, 0.0129441}, {-2.05, 
      0.0209097}, {-2.04, 0.0308667}, {-2.03, 0.0288753}, {-2.02, 
      0.029871}, {-2.01, 0.0398279}, {-2., 0.0458021}, {-1.99, 
      0.0497849}, {-1.98, 0.052772}, {-1.97, 0.0597419}, {-1.96, 
      0.0587462}, {-1.95, 0.0896129}, {-1.94, 0.0886172}, {-1.93, 
      0.136411}, {-1.92, 0.141389}, {-1.91, 0.193166}, {-1.9, 
      0.215071}, {-1.89, 0.245938}, {-1.88, 0.238968}, {-1.87, 
      0.227019}, {-1.86, 0.230006}, {-1.85, 0.233989}, {-1.84, 
      0.231998}, {-1.83, 0.223036}, {-1.82, 0.233989}, {-1.81, 
      0.235981}, {-1.8, 0.212084}, {-1.79, 0.205114}, {-1.78, 
      0.207105}, {-1.77, 0.222041}, {-1.76, 0.219054}, {-1.75, 
      0.229011}, {-1.74, 0.209097}, {-1.73, 0.228015}, {-1.72, 
      0.229011}, {-1.71, 0.230006}, {-1.7, 0.231002}, {-1.69, 
      0.231002}, {-1.68, 0.232993}, {-1.67, 0.250916}, {-1.66, 
      0.259877}, {-1.65, 0.237972}, {-1.64, 0.238968}, {-1.63, 
      0.238968}, {-1.62, 0.274813}, {-1.61, 0.273817}, {-1.6, 
      0.314641}, {-1.59, 0.276804}, {-1.58, 0.333559}, {-1.57, 
      0.304684}, {-1.56, 0.320615}, {-1.55, 0.34252}, {-1.54, 
      0.346503}, {-1.53, 0.29871}, {-1.52, 0.341525}, {-1.51, 
      0.405249}, {-1.5, 0.394297}, {-1.49, 0.373387}, {-1.48, 
      0.429146}, {-1.47, 0.390314}, {-1.46, 0.405249}, {-1.45, 
      0.440099}, {-1.44, 0.443086}, {-1.43, 0.445077}, {-1.42, 
      0.488888}, {-1.41, 0.494862}, {-1.4, 0.535686}, {-1.39, 
      0.5556}, {-1.38, 0.522742}, {-1.37, 0.572527}, {-1.36, 
      0.582484}, {-1.35, 0.589454}, {-1.34, 0.64123}, {-1.33, 
      0.63426}, {-1.32, 0.626294}, {-1.31, 0.650191}, {-1.3, 
      0.681058}, {-1.29, 0.676079}, {-1.28, 0.758722}, {-1.27, 
      0.783615}, {-1.26, 0.767684}, {-1.25, 0.780628}, {-1.24, 
      0.772662}, {-1.23, 0.769675}, {-1.22, 0.766688}, {-1.21, 
      0.804524}, {-1.2, 0.815477}, {-1.19, 0.885176}, {-1.18, 
      0.848335}, {-1.17, 0.894137}, {-1.16, 0.915047}, {-1.15, 
      0.945914}, {-1.14, 0.956866}, {-1.13, 0.922017}, {-1.12, 
      0.946909}, {-1.11, 0.977776}, {-1.1, 0.978772}, {-1.09, 
      1.04548}, {-1.08, 0.986737}, {-1.07, 1.00167}, {-1.06, 
      1.0654}, {-1.05, 1.06341}, {-1.04, 1.03951}, {-1.03, 
      1.05046}, {-1.02, 1.03453}, {-1.01, 1.10722}, {-1., 
      1.07038}, {-0.99, 1.04747}, {-0.98, 1.1102}, {-0.97, 
      1.09726}, {-0.96, 1.02457}, {-0.95, 1.03553}, {-0.94, 
      1.03752}, {-0.93, 1.02557}, {-0.92, 0.939939}, {-0.91, 
      1.0425}, {-0.9, 1.0196}, {-0.89, 0.991716}, {-0.88, 
      0.999681}, {-0.87, 0.958858}, {-0.86, 0.943922}, {-0.85, 
      0.899116}, {-0.84, 0.921021}, {-0.83, 0.89115}, {-0.82, 
      0.888163}, {-0.81, 0.961845}, {-0.8, 0.894137}, {-0.79, 
      0.857296}, {-0.78, 0.857296}, {-0.77, 0.814481}, {-0.76, 
      0.804524}, {-0.75, 0.775649}, {-0.74, 0.761709}, {-0.73, 
      0.757727}, {-0.72, 0.763701}, {-0.71, 0.736817}, {-0.7, 
      0.681058}, {-0.69, 0.693006}, {-0.68, 0.71292}, {-0.67, 
      0.626294}, {-0.66, 0.668114}, {-0.65, 0.593436}, {-0.64, 
      0.642226}, {-0.63, 0.570535}, {-0.62, 0.568544}, {-0.61, 
      0.563565}, {-0.6, 0.529712}, {-0.59, 0.567548}, {-0.58, 
      0.475944}, {-0.57, 0.459017}, {-0.56, 0.494862}, {-0.55, 
      0.473953}, {-0.54, 0.451051}, {-0.53, 0.421181}, {-0.52, 
      0.397284}, {-0.51, 0.405249}, {-0.5, 0.407241}, {-0.49, 
      0.387327}, {-0.48, 0.360443}, {-0.47, 0.324598}, {-0.46, 
      0.348495}, {-0.45, 0.338538}, {-0.44, 0.327585}, {-0.43, 
      0.318624}, {-0.42, 0.310658}, {-0.41, 0.302692}, {-0.4, 
      0.281783}, {-0.39, 0.289748}, {-0.38, 0.287757}, {-0.37, 
      0.299705}, {-0.36, 0.276804}, {-0.35, 0.239963}, {-0.34, 
      0.282778}, {-0.33, 0.236976}, {-0.32, 0.289748}, {-0.31, 
      0.234985}, {-0.3, 0.255895}, {-0.29, 0.211088}, {-0.28, 
      0.24992}, {-0.27, 0.200135}, {-0.26, 0.213079}, {-0.25, 
      0.230006}, {-0.24, 0.221045}, {-0.23, 0.188187}, {-0.22, 
      0.214075}, {-0.21, 0.259877}, {-0.2, 0.214075}, {-0.19, 
      0.200135}, {-0.18, 0.204118}, {-0.17, 0.255895}, {-0.16, 
      0.26386}, {-0.15, 0.19914}, {-0.14, 0.234985}, {-0.13, 
      0.240959}, {-0.12, 0.24295}, {-0.11, 0.250916}, {-0.1, 
      0.251912}, {-0.09, 0.188187}, {-0.08, 0.170264}, {-0.07, 
      0.142385}, {-0.06, 0.0926}, {-0.05, 0.0906086}, {-0.04, 
      0.072686}, {-0.03, 0.0657161}, {-0.02, 0.0637247}, {-0.01, 
      0.0448064}, {-1.96752*10^-14, 0.0448064}, {0.01, 0.0438107}, {0.02, 
      0.0408236}, {0.03, 0.0308667}, {0.04, 0.0288753}, {0.05, 
      0.0308667}, {0.06, 0.0209097}, {0.07, 0.0159312}, {0.08, 
      0.0169269}, {0.09, 0.00995699}, {0.1, 0.0179226}, {0.11, 
      0.0159312}, {0.12, 0.0219054}, {0.13, 0.0119484}, {0.14, 
      0.00497849}, {0.15, 0.00696989}, {0.16, 0.00995699}, {0.17, 
      0.00497849}, {0.18, 0.00497849}, {0.19, 0.00696989}, {0.2, 
      0.0019914}, {0.21, 0.0029871}, {0.22, 0.0029871}, {0.23, 
      0.00497849}, {0.24, 0.00497849}, {0.25, 0.0019914}, {0.26, 
      0.000995699}, {0.27, 0.}, {0.28, 0.0029871}, {0.29, 
      0.000995699}, {0.3, 0.0019914}, {0.31, 0.000995699}, {0.32, 
      0.000995699}, {0.33, 0.}, {0.34, 0.000995699}, {0.35, 
      0.000995699}, {0.36, 0.}, {0.37, 0.}, {0.38, 0.}, {0.39, 0.}, {0.4, 
      0.}, {0.41, 0.}, {0.42, 0.}, {0.43, 0.}, {0.44, 0.}, {0.45, 
      0.}, {0.46, 0.}, {0.47, 0.}, {0.48, 0.}, {0.49, 0.}, {0.5, 
      0.}, {0.51, 0.}, {0.52, 0.}, {0.53, 0.}, {0.54, 0.}, {0.55, 
      0.}, {0.56, 0.}, {0.57, 0.}, {0.58, 0.}, {0.59, 0.}, {0.6, 
      0.}, {0.61, 0.}, {0.62, 0.}, {0.63, 0.}, {0.64, 0.}, {0.65, 
      0.}, {0.66, 0.}, {0.67, 0.}, {0.68, 0.}, {0.69, 0.}, {0.7, 
      0.}, {0.71, 0.}, {0.72, 0.}, {0.73, 0.}, {0.74, 0.}, {0.75, 
      0.}, {0.76, 0.}, {0.77, 0.}, {0.78, 0.}, {0.79, 0.}, {0.8, 
      0.}, {0.81, 0.}, {0.82, 0.}, {0.83, 0.}, {0.84, 0.}, {0.85, 
      0.}, {0.86, 0.}, {0.87, 0.}, {0.88, 0.}, {0.89, 0.}, {0.9, 
      0.}, {0.91, 0.}, {0.92, 0.}, {0.93, 0.}, {0.94, 0.}, {0.95, 
      0.}, {0.96, 0.}, {0.97, 0.}, {0.98, 0.}, {0.99, 0.}, {1., 0.}};
$\endgroup$
1
  • $\begingroup$ Thank you, Happy new year! $\endgroup$ Commented Jan 6, 2020 at 6:39

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.