Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.9K Views
|
3 Replies
|
6 Total Likes
View groups...
Share
Share this post:

[?] Plot rational functions?

Attachments:
3 Replies

The problem is the f[x]= in the function to be plotted. Try it with a plain expression or define the function outside Plot. (Plot analyzes the expression passed for discontinuities, but it apparently does not handle the case when the expression is of the form Set[f[x], expr].)

Either

Plot[(1 + x^2)/(-4 + x^2), {x, -6, 6}, 
  PlotStyle -> 
   Directive[RGBColor[1, 0, 0], AbsoluteThickness[2.25], 
    Arrowheads[{-.05, .05}]], 
  GridLines -> {Range[-6, 6, 1], Range[-6, 6, 1]}, 
  Ticks -> {Range[-6, 6, 1], Range[-6, 6, 1]}] /. Line -> Arrow

or

ClearAll[f];
f[x_] = (1 + x^2)/(-4 + x^2);
Plot[f[x], {x, -6, 6}, 
  PlotStyle -> 
   Directive[RGBColor[1, 0, 0], AbsoluteThickness[2.25], 
    Arrowheads[{-.05, .05}]], 
  GridLines -> {Range[-6, 6, 1], Range[-6, 6, 1]}, 
  Ticks -> {Range[-6, 6, 1], Range[-6, 6, 1]}] /. Line -> Arrow
POSTED BY: Michael Rogers

You can use Exclusions:

Plot[(1 + x^2)/(-4 + x^2), {x, -6, 6}, 
  PlotStyle -> 
   Directive[RGBColor[1, 0, 0], AbsoluteThickness[2.25], 
    Arrowheads[{-.05, .05}]], Exclusions -> (-4 + x^2) == 0] /. 
 Line -> Arrow
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard