Opened 6 years ago

Last modified 5 years ago

#15320 new enhancement

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-6.4
Component: graphics Keywords: adaptive refinement, log scale
Cc: ppurka, jason Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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).

plot_semilogx(1/log(x),10,10^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 (5)

comment:1 Changed 6 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 6 years ago by ppurka

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

comment:3 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.