10
$\begingroup$

Bug introduced in 10.1 or earlier and persisting through 11.0.1 or later


When I use the following command to plot a graph:

Plot[x^Gamma[x - 1], {x, 0, 1}]

or:

Plot[x^Gamma[x - 1], {x, 0, 1}, PlotRange -> Automatic]

it works fine.

If I use:

Plot[x^Gamma[x - 1], {x, 0, 1}, PlotRange -> Full]
Plot[x^Gamma[x - 1], {x, 0, 1}, PlotRange -> All]

Edited: 25.05.2016

Plot[(x^6000 - Sin[x]^6000)/(x^2*Sin[x]^6000), {x, -10, 10}, PlotRange -> All]
Plot[(x^6000 - Sin[x]^6000)/(x^2*Sin[x]^6000), {x, -10, 10}, PlotRange -> Full]

it does not show any Plot(Invisible Plot)!

I have: (* MMA 10.2.0 for Microsoft Windows (64-bit) (July 7, 2015)*)

$\endgroup$
6
  • 1
    $\begingroup$ confirmed with 10.1. Weird, no plot at all, no axes or anything. I will say those options don't really make sense for a singular function, but in other cases you do get a plot at least. $\endgroup$
    – george2079
    Commented Jan 25, 2016 at 14:28
  • 1
    $\begingroup$ Can reproduce the blank plot with PlotRange -> {0, 10.^306} ( just a bit smaller than $MaxMachineNumber.) Useless as that is anyway you'd still expect an error message. $\endgroup$
    – george2079
    Commented Jan 25, 2016 at 14:34
  • $\begingroup$ I have tagged this question with bugs for the reasons I give in my answer below. $\endgroup$
    – m_goldberg
    Commented Jan 25, 2016 at 16:00
  • $\begingroup$ Same problem with 10.3.1. Interesting position of vertical axis for: Plot[x^Gamma[x - 1], {x, 0.1, 1}, PlotRange -> Full] $\endgroup$
    – mrz
    Commented Jan 25, 2016 at 16:08
  • $\begingroup$ Reproduced on the Mac version 10.2.0. Also, Plot[x^Gamma[x - 1], {x, 0, 1}, PlotPoints -> 8, PlotRange -> All] gives the plot. $\endgroup$ Commented Jan 25, 2016 at 16:17

1 Answer 1

8
$\begingroup$

I think what is reported in this question is a bug that is affecting many of the Plot family of functions in V10.X for X >= ?. The problem occurs when a plot has to deal with numbers outside the range

{$MinMachineNumber, $MaxMachineNumber}

{2.22507*10^-308, 1.79769*10^308}

Since the OP's problem only occurs near the singularity at zero, let's reduce the domain to {1/1000, 1/100} for discussion purposes and look at a table of x^Gamma[x - 1] in this domain.

data = Table[N[x^Gamma[x - 1]], {x, 1/1000, 1/100, 1/1000}];
Column @ data

data

You can see that Mathematica is automatically using precision outside the range of machine numbers to get the values larger than 10^303 even though no extra precision was requested. Is this new in V10.X for some value of X? I don't know. I don't have any versions older than 10.2 on my computer, and 10.2 shows this behavior.

So how does this affect plotting? I don't think this numeric behavior bothers the graphics computations (but I am not sure), but it certainly affects tick label generation. I know this because some to plot functions do produce a message in situations like the one reported in the question.

ListPlot[data, PlotRange -> All, DataRange -> {1/1000, 1/100}]

msg

However, ListLogPlot seems immune to the problem.

ListLogPlot[data, PlotRange -> All, DataRange -> {1/1000, 1/100}]

plot

Perhaps that is because the developer who worked on ListLogPlot realized the function was going to be regularly dealing with very large or very small numbers, but this is pure conjecture on my part.

BYW, here is an even more amusing variation on the OP's plot:

Plot[x^Gamma[x - 1], {x, 1/1000, 1/100}, 
  PlotTheme -> "Detailed", 
  PlotRange -> All, 
  WorkingPrecision -> 100]

no-plot

Well, at least the label shows up.

$\endgroup$
1
  • $\begingroup$ btw, {plot1, {points1}} = Reap@Plot[Last@Sow@{x, x^Gamma[x - 1]}, {x, 0, 1}] and {plot2, {points2}} = Reap@Plot[Last@Sow@{x, x^Gamma[x - 1]}, {x, 0, 1}, PlotRange -> All] gives points1 == points2 // Simplify: True. Also, ListLinePlot[Select[points1, NumericQ[#[[1]]] &]] displays $\endgroup$ Commented Jan 25, 2016 at 16:11

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