Using the following line of code, I am trying to plot a few curves side-by-side. However, it turns out that the output curves are not that smooth as seen from the ups and downs (oscillating pattern) of the curves. (This is more pronounced in PDF format which I couldn't upload into this website but I am using it for LaTeX). I am wondering if there is any way to make the plots smoother even after turning them into pdf files. Here is the PNG format of the plot: enter image description here

logSigmaG5[M_] := 0.56*(M - 12) + 2.62;
yfunc[M_] := 10^(12 - M);
sigma[M_] := (16.9*(yfunc[M])^0.41)/(1 + 1.102*(yfunc[M])^0.20 + 6.22*(yfunc[M])^0.333);
dsigmadM[M_] := (Log[10]*10^M)^-1*Derivative[1][sigma][M] // N;
xfunc[M_] := 1.686/sigma[M];
func[M_] := 0.322*Sqrt[(2*0.707)/\[Pi]]*(1 + (0.707*(xfunc[M])^2)^-0.3)*xfunc[M]*Exp[-((0.707*(xfunc[M])^2)/2)];
func1[M_] := -(Log[10]*8.49262*10^10)*func[M]/sigma[M]*dsigmadM[M];
CumulativeG5[M_?NumericQ] := 1301.98*(0.7)^2*10^-6*NIntegrate[10^logSigmaG5[x]*func1[x]*Log[10], {x, M, \[Infinity]}];
func3[M_?NumericQ] := -Derivative[1][CumulativeG5][M] // N;    
a = Interval[0.08 + 0.05 {-1, 9/5}]; b = Interval[0.042 + 0.015 {-1, 1}]; q = Interval[0.026 + 0.003 {-1, 1}]; d = Interval[10 + 1 {-1, 1}];
LogPlot[{Min[a], Max[a], Min[q], Max[q], func1[M], 0.0333564095*10^-6.*func3[M]}, {M, 10.25, 12.95}, 
    PlotRange -> {10^-3, 10^6.5}, 
    PlotStyle -> {Green, Green, Orange, Orange, Black, Cyan, Thick}, 
    Frame -> True, 
    FrameTicksStyle -> Directive[FontSize -> 30], 
    PlotLegend -> {Style["Orange", 20], Style["Orange", 20], Style["Green", 20], Style["Green", 20],Style["Black", 20], Style["Cyan", 20]}

I have included the functional form of two of the functions $func1$ and $func3$. I noticed that this is more pronounced when you actually make the plot in mathematica notebook larger than its usual size and in the PDF format.

Your help is greatly appreciated,

  • $\begingroup$ "I have not included the exact forms of the functions" - but what if it's exactly your functions that have rough-looking plots? $\endgroup$ – J. M. is in limbo Jun 21 '16 at 23:00
  • $\begingroup$ I have tried those separately in small plots. This is only the case when I make the plot bigger in order to fit my needs (e.g. including legends etc.) In other words, you can assume that curves are all smooth mathematical functions with continuity in their first and second derivatives. Actually, the problem is still there even with smaller size of the figure. $\endgroup$ – Benjamin Jun 21 '16 at 23:03
  • $\begingroup$ I am adding the analytical form of one of them to help you with that. $\endgroup$ – Benjamin Jun 21 '16 at 23:09
  • $\begingroup$ You should be able to reproduce the cyan and black curves now side by side with the horizontal bands. $\endgroup$ – Benjamin Jun 21 '16 at 23:27

Your Answer

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

Browse other questions tagged or ask your own question.