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 am trying to use the following input

Plot[Log[E,x+1],{x,-50,50},PlotRange->50]

however the output is:

plotted function

How can I adjust it so the line goes down to the PlotRange mark specified. Or is this a limitation of mathematica?

share|improve this question
    
Your question is not especially original, it's going to be closed in a while. I'd do this: Plot[{Re@#, Im@#}&@Log[x + 1], {x, -50, 50}, Evaluated -> True, PlotStyle -> Thick], PlotRange serves a different purpose than you seem to expect, see documentation pages. –  Artes Aug 19 '13 at 9:46
    
I just tried that and got the following: Link To Graph –  user9053 Aug 19 '13 at 9:53
    
Does it make you wonder? If it does, start to learn complex functions, there are many helpful questions. –  Artes Aug 19 '13 at 9:59
2  
It's a problem of how Plot[] works. There is only one pixel per x-value, and the curve at x=-1 is so steep that it doesn't take up more than one pixel in width. Use this instead: ParametricPlot[{x, Log[x + 1]}, {x, -1, 3}, PlotRange -> {{-2, 3}, {-10, 2}}] –  Volker Aug 19 '13 at 10:12
1  
@SjoerdC.deVries This poor question is not even a bit clear what the OP wants, why not e.g. Plot[Log[x + 1], {x, -2, 50}, PlotRange -> {{-2, 50}, All}] –  Artes Aug 19 '13 at 12:23
show 11 more comments

2 Answers

up vote 7 down vote accepted

As I mentioned in the comments, it's a problem of Plot[]. Mathematica won't draw more than one pixel per pixel column. So I'd use ParametricPlot instead, which makes it a little better, but still not perfect. The line becomes so steep that you can't tell the difference between it and a straight line, so you just extend it manually:

ParametricPlot[{{x, Log[x + 1]}, {-1, -x - 9}}, {x, -2, 50},
     PlotRange -> {{-2, 50}, {-50, 10}}, PlotStyle -> {Blue, Blue}]

enter image description here

share|improve this answer
1  
Works perfectly, I decided to use a method similar to this, I still used Plot, but I added Epilog->Line[{{-1,-4},{-1,50}}] –  user9053 Aug 19 '13 at 10:29
    
@user9053 I don't think your soulution is in any way similar to the one given here. –  Sjoerd C. de Vries Aug 19 '13 at 12:59
    
what I'm saying is, is that he explained why it wasn't working and said that I should manually extend the line, so instead of manually extending it in ParametricPlot, I did it in Plot –  user9053 Aug 20 '13 at 7:21
add comment

This is what I'd do, the idea is to use ParametricPlot[{b^y, y}] for Log[b, x]. So we can use Solve to make it a little bit more general:

Block[{x, y}, 
 With[{notimportantoptions = Sequence[PlotStyle -> Thick, PlotRange -> {All, {-25, 6}}, 
                                      AspectRatio -> 1,  AxesStyle -> Arrowheads@.05,
                                      AxesOrigin -> {0, 0}, BaseStyle -> {18, Bold}]
      },

  ParametricPlot[{x, y} /. Solve[y == 2 Log[15 + x], x, Reals][[1]], {y, -25, 6}, 
                 RegionFunction -> (# < 10 &), notimportantoptions, Evaluated -> True]
  ]]

enter image description here

share|improve this answer
add comment

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.