I need to plot massive data stored in external ASCII files. Below is the Mathematica code I use for this job:
Clear["Global`*"];
SetDirectory[" ... "];
dataRG = ReadList["dataRG.out", Number, RecordLists -> True];
dataCH = ReadList["dataCH.out", Number, RecordLists -> True];
Vd = -((Md*(1 + δ))/
Sqrt[(1 + δ)*(b^2 + y^2) +
x^2 + (a + Sqrt[h^2 + (1 + δ^2)*z^2])^2]);
Vn = -(Mn/Sqrt[x^2 + y^2 + z^2 + cn^2]);
Vh = -(Mh/Sqrt[x^2 + y^2 + z^2 + ch^2]);
V = Vd + Vn + Vh;
Md = 8200; b = 8; a = 3; h = 0.3; δ = 0.1;
Mn = 400; cn = 0.25;
Mh = 0; ch = 25;
E0 = -700;
z0 = 1;
f[x_, px_] := 1/2*px^2 + V /. {y -> 0, z -> z0};
xmax = 11;
pxmax = 41;
plrange = {{-xmax, xmax}, {-pxmax, pxmax}};
C0 = ContourPlot[Evaluate[f[x, px]], {x, -20, 20}, {px, -80, 80},
Contours -> {E0}, ContourStyle -> {Black, Thick}, AspectRatio -> 1,
ContourShading -> False, PlotPoints -> 200,
PerformanceGoal -> "Speed", PlotRange -> plrange];
S1 = ListPlot[Flatten[List /@ dataRG[[All, {1, 2}]], 1],
PlotStyle -> {GrayLevel[0.8], PointSize[0.003]}];
S2 = ListPlot[Flatten[List /@ dataCH[[All, {1, 2}]], 1],
PlotStyle -> {GrayLevel[0.05], PointSize[0.003]}];
P0 = Show[{S1, S2, C0}, Frame -> True, Axes -> False,
FrameLabel -> {"x", OverDot["x"]}, RotateLabel -> False,
FrameStyle -> Directive[FontSize -> 17, FontFamily -> "Helvetica"],
AspectRatio -> 1, PlotRange -> plrange, ImageSize -> 550]
which produces the following output
As you may see from the image two are the main issues:
(1). How can I get rid off the vertical blank gaps?
(2). Why there are some "bold horizontal lines" in the plot and again how can I get rid off them?
I observed, that both issues are influenced by the ImageSize
option. In particular, if you play with this option between 400 and 600, it might eliminate the problems. However, I suspect that the cause must be something more profound. So, I would be very grateful, if you suggest me how can I solve these issues and also if you could provide me with a more correct way to plot my data files.
Many many thanks in advance!