Opened 9 years ago

Closed 2 years ago

#15320 closed enhancement (duplicate)

plot_semilogx(1/log(x),10,10^15) should look like plot(1/x,1,15)

Reported by: Sébastien Labbé Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords: adaptive refinement, log scale
Cc: Punarbasu Purkayastha, Jason Grout Merged in:
Authors: Reviewers: Sébastien Labbé, Samuel Lelièvre
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


The adaptive refinement plotting code is not well adapted for a logarithmic scale on the x axis.

In the following example, where the x ranges from 10 to 10^15 no values are computed between 10 and 10^12 which is a big part of the plot when drawn on a logarithmic scale. The plot is linear from x=10 to x=10^12 which is quite weird; it should look like the inverse of x : plot(1/x,1,15).


By changing the left most point of the interval, we confirm the problem:

sage: p = plot(1/log(x),10,10^15,scale='semilogx',color='blue',thickness=3)
sage: q = plot(1/log(x),100,10^15,scale='semilogx',color='red', thickness=3)
sage: r = plot(1/log(x),1000,10^15,scale='semilogx',color='green',thickness=3)
sage: p+q+r

Also, the semilogx plots looks thinner than usual. I don't know why. This is why I increase the thickness.

Change History (9)

comment:1 Changed 9 years ago by Karl-Dieter Crisman

Cc: Punarbasu Purkayastha Jason Grout added
Type: defectenhancement

That's an interesting question. Currently the (semi)log plots are just regular plots with a different scale, which is done in the show method - see here, for instance.

That doesn't mean we couldn't make this happen, but it would be nontrivial. I feel like this is more of an enhancement request, maybe? But I'm not wedded to it.

comment:2 Changed 9 years ago by Punarbasu Purkayastha

Workaround before someone introduces true logarithmic plots - create the data points yourself and use list_plot :)

comment:3 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:4 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:5 Changed 8 years ago by For batch modifications

Milestone: sage-6.3sage-6.4

comment:6 Changed 3 years ago by Samuel Lelièvre

Possibly solved by #29523.

comment:7 Changed 3 years ago by Sébastien Labbé

Milestone: sage-6.4sage-duplicate/invalid/wontfix
Status: newneeds_review

I suggest to close this ticket as a duplicate of #29523.

comment:8 Changed 3 years ago by Samuel Lelièvre

Reviewers: Sébastien Labbé, Samuel Lelièvre
Status: needs_reviewpositive_review

comment:9 Changed 2 years ago by Frédéric Chapoton

Resolution: duplicate
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.