I am trying to make a relatively complex 3D plot in order to show the variation of a curve with a parameter. Here is the code
AnsNf[x_, nf_] = (2 \[Pi] x^4)/((11 - (2 (2 + nf))/3) (1 + 1/2 x^6 Log[4. x^2])) + (14.298 (1 + (1.81 - 0.292 nf) x^2 - 2.276 x^2 Log[x^2/(1 + x^2)]))/(1 + (9.926 + 1.795 nf) x^2 + (1.1 - 4.964 nf) x^4 + (22.412 +5.612 nf) x^6);
AnsNfnoc[x_, nf_] = (2 \[Pi] x^4)/((11 - (2 (2 + nf))/3) (1 + 1/2 x^6 Log[4. x^2])) + (14.298 (1 + (1.81` - 0.292 nf) x^2 - 0.569 x^2 Log[x^2/(1 + x^2)]))/(1 + (9.926 + 1.795 nf) x^2 + (1.1 - 4.964 nf) x^4 + (22.412 +5.612 nf) x^6);
AnsatzINf[t_, i_] := t^2*AnsNf[t, i - 1];
AnsatzINfNoc[t_, i_] := t^2*AnsNfnoc[t, i - 1];
colsandthick = {{RGBColor[175/255, 0, 28/255], Thickness[0.004]}, {RGBColor[14/255, 95/255, 177/255], Thickness[0.004]}, {RGBColor[130/255, 120/255, 106/255], Thickness[0.004]}, {RGBColor[0/255, 102/255, 128/255],Thickness[0.004]}};
colsandthickanddot = {{RGBColor[175/255, 0, 28/255], Thickness[0.004],CapForm["Round"],Dashing[{1*^-10, 0.01}]}, {RGBColor[14/255, 95/255, 177/255],Thickness[0.004], CapForm["Round"],Dashing[{1*^-10, 0.01}]}, {RGBColor[130/255, 120/255, 106/255],Thickness[0.004], CapForm["Round"],Dashing[{1*^-10, 0.01}]}, {RGBColor[0/255, 102/255, 128/255],Thickness[0.004], CapForm["Round"], Dashing[{1*^-10, 0.01}]}};
p1 = Graphics3D[Table[{Plot[{AnsatzINf[t, i], AnsatzINfNoc[t, i]}, {t, 0, 5},PlotStyle -> {colsandthick[[i]], colsandthickanddot[[i]]}][[
1]]} /. {x_?NumericQ, y_?NumericQ} :> {x, i, y}, {i, 1, 4}], Axes -> {True, True, True}, Boxed -> {Left, Bottom, Back},BoxRatios -> {1, 1, 0.5},FaceGrids -> {{0, 0, -1}, {0, 1, 0}, {-1, 0, 0}},AxesStyle ->Directive[FontFamily -> "Helvetica", FontSize -> 16,Thickness[0.003], Black],FaceGridsStyle ->Directive[GrayLevel[0.3, 1], AbsoluteDashing[{1, 2}]], ViewPoint -> {2.477268549689875`, -2.189130098344112`,0.566436179318843`}, ViewVertical -> {0, 0, 1},ImageSize -> Large]
This code produces the following plot which is already weird because each continuous curve should be accompanied by a lower line (specified by the function "AnsNfnoc") that should be rendered through a dotted line as specified by the "colsandthickanddot" styling option.
While I could live with this (but why is this so?), the real problem comes when I export the plot in pdf: as shown below, the dotted curves are now rendered, but the dashing is unevenly spaced.
I am under the impression that this is due to some mesh applied when rendering the 3D plot, but do you have any idea how this could be corrected in such a way that the space between the dots is rendered evenly?
Export["test.pdf", ParametricPlot3D[{t, 4, AnsatzINf[t, 4]}, {t, 0, 4}, PlotStyle -> colsandthickanddot[[4]]] ]
and see if that shows the dashing in the plot. $\endgroup$Dashing
command and replaces them with 3 numbers. To confine the replacement rule to the lines only, try using/. Line[a_] :> Line[{#1, i, #2} & @@@ a]
instead. Or, better yet, useParametricPlot3D
and you won't need to do any replacemnts. $\endgroup$