#4530 closed enhancement (duplicate)
Implement plots with logarithmic scale
Reported by: | ronanpaixao | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | graphics | Keywords: | plot log scale |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | Work issues: | ||
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
Currently plot() has no option to use logarithmic scales.
One workaround is to use matplotlib directly, with its semilogy(), semilogx() and loglog() functions, but that wouldn't produce plots with the customisations implemented in sage. Another workaround is messing with the plot figure like:
import pylab p=plot(x,marker='.') f=pylab.figure() f.gca().set_xscale('log') p.save(figure=f)
But that creates two problems:
- The first problem is that the adaptive choosing of points just considers linear scale, so the points get too much spaced apart in the beginning of the plot and too close in the end.
- The second problem relates to the axis, which, for the same reason, isn't located right.
Also, this requires the user to know how to deal with figures, which is not directly exposed by sage.
There are some possibilities to fix that:
- Make plot() detect if the figure changes the scales and modify the adaptive algorithm and the axis codes accordingly
- Create a kwarg to tell plot() to implement the scale-change internally
- Create other functions to use loglog(), semilogx() and semilogy()
- Many (or all) of the above together, since they aren't mutually exclusive
From what I noticed, Mathematica implements the separate functions way, but it may be better to fix the issue in plot() itself and if the other functions are wanted, just make it so that they call plot() with the correct arguments
Attachments (1)
Change History (3)
Changed 12 years ago by
comment:1 Changed 12 years ago by
- Resolution set to duplicate
- Status changed from new to closed
Duplicate of bug #4529 (Submitted two times)
comment:2 Changed 12 years ago by
- Milestone changed from sage-wishlist to sage-duplicate/invalid/wontfix
"Wrong" sage plot with log scale