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$
  • 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 Jan 25 '16 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 Jan 25 '16 at 14:34
  • $\begingroup$ I have tagged this question with bugs for the reasons I give in my answer below. $\endgroup$ – m_goldberg Jan 25 '16 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 Jan 25 '16 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$ – egwene sedai Jan 25 '16 at 16:17
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$
  • $\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$ – egwene sedai Jan 25 '16 at 16:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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