Opened 7 years ago

Closed 10 months ago

#15320 closed enhancement (duplicate)

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

Reported by: slabbe Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: graphics Keywords: adaptive refinement, log scale
Cc: ppurka, jason 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 7 years ago by kcrisman

  • Cc ppurka jason added
  • Type changed from defect to enhancement

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 7 years ago by ppurka

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

comment:3 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:6 Changed 12 months ago by slelievre

Possibly solved by #29523.

comment:7 Changed 11 months ago by slabbe

  • Milestone changed from sage-6.4 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

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

comment:8 Changed 11 months ago by slelievre

  • Reviewers set to Sébastien Labbé, Samuel Lelièvre
  • Status changed from needs_review to positive_review

comment:9 Changed 10 months ago by chapoton

  • Resolution set to duplicate
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.