Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have seen this strange plotting artifact occur before and I was able to make it go away by changing the PlotRange. However, this time I need the prescribed PlotRange to be what I define and I get a strange vertical line within my plot.

The questions are, "What causes this?" and "How do I prevent it from happening?" This is happening for me in Version 9.0 on Mac and Windows.

Here is the code:

ur[x_, a_] := 1 - (1/a) Log[1 + a x]
g[x_, go_, s_, m_] := 1/2 (go x Exp[-(x/s)])/(1 + m x)
uh[x_, a_, go_, s_, m_, k_] := ur[x, a] + g[x, go, s, m]/(1 - g[x, go, s, m]) (k - 1)

a = 5; go = 1; s = 2; m = 0.5; 

plt[k_] := ParametricPlot[{ uh[x, a, go, s, m, k], x}, {x, 0, 1}, 
           AspectRatio -> 1/1.5, Frame -> True, PlotStyle -> {Darker[Green]}, 
           FrameLabel -> {Style["Volume Compression", 14], 
           Style["Normalized Pressure", 14]}, 
           LabelStyle -> {FontSize -> 12, FontFamily -> "Times"}]

Show[Table[plt[k], {k, 1.0, 3.5, 0.5}], PlotRange -> {{0.5, 1.5}, {0, 1.2}}]

The resulting graphic is produced with the line artifact at x=0.65. Not certain as to why this happens. If I tweak the PlotRange to PlotRange -> {{0.6, 1.4}, {0, 1.2}} the line goes away. However, I need the PlotRange to be PlotRange -> {{0.5, 1.5}, {0, 1.2}}. If I move the PlotRange into the ParametricPlot function I get the same result.

Plot with line artifact at x=0.65

Thanks in advance for any assistance...

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

That is the y-axis. Frame -> True does not always turn off the Axes when it is supposed to. Looking at the Options passed to Graphics shows this clearly

FilterRules[
  Options@Show[Table[plt[k], {k, 1.0, 3.5, 0.5}], PlotRange -> {{0.5, 1.5}, {0, 1.2}}],
  {Axes, AxesOrigin}]
(* {Axes -> True, AxesOrigin -> {0.65, 0}} *)

and AxesOrigin explains why you see the artifact at x = 0.65.

To fix that add Axes -> False to plt. Then, it disappears:

enter image description here

share|improve this answer
    
, AxesOrigin -> {0, 0} is also ok –  HyperGroups May 8 '13 at 16:38
    
Or turn the Frame off Frame->False –  bill s May 8 '13 at 16:39
    
That was the issue! Never would have guessed that one, Thank you! –  Joseph May 8 '13 at 16:41
    
@HyperGroups in this case, yes. But, turning off the Axes entirely is superior as you do not have to manually set the origin off screen. –  rcollyer May 8 '13 at 16:42
    
@bills works, except if you want the Frame. –  rcollyer May 8 '13 at 16:42
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.