Ticket #8570 (new enhancement)
make points() take all the options for scatter_plot or list_plot that apply to plotting points
| Reported by: | ronanpaixao | Owned by: | was |
|---|---|---|---|
| Priority: | major | Milestone: | sage-5.11 |
| Component: | graphics | Keywords: | plot marker |
| Cc: | jason, kcrisman | Work issues: | |
| Report Upstream: | N/A | Reviewers: | |
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
Currently, there's no obvious way to pass the marker option to matplotlib when plotting individual points, which would be mostly with this option.
It appears that plot() has deviated from other plot types, since it does allow the marker option, but apparently only for function plots.
using plot(points(point_list),marker='x') ignores the marker option using list_plot(point_list,marker='x') or points(point_list,marker='x') gives a warning:
verbose 0 (136: primitive.py, options) WARNING: Ignoring option 'marker'=x
but displays the points nevertheless, though ignoring the marker option.
Also, setting plot.optionsmarker? = 'x' or Graphics().SHOW_OPTIONSmarker? = 'x' do not work.
Somewhat related to #4529, #1431 and #5448, which seem to be related to not passing kwargs to matplotlib.
So far, I haven't been able to find a way to seamless join matplotlib's system with the sage.plot options.
Change History
comment:2 Changed 3 years ago by jason
I think it would be a good design decision to just bundle the plotjoined=True features in with line() (i.e., eliminate the plotjoined=True features in listplot, and just make listplot about plotting points).
comment:3 Changed 3 years ago by jason
In fact, I think a better design decision would be to completely deprecate list_plot. Replace it with line() in the connected case, and scatter_plot in the disconnected case. Each of those commands does better than list_plot.
comment:4 Changed 3 years ago by jason
For that matter, the listplot3d should maybe be called surface_plot() instead, as it is clearer what it is plotting.
comment:5 Changed 3 years ago by jason
- Summary changed from Allow "marker" option to be passed to matplotlib on list_plot() and point() to deprecate list_plot in favor of line or scatter_plot
comment:6 Changed 3 years ago by jason
Another reason for the deprecation: I think every other graphics command is named after the *output* (like "line"), not the *input* (like "list_plot")
comment:7 Changed 3 years ago by jason
In fact, scatter_plot should be deprecated in favor of just points(). If we do that, then we need to make points() have more options (like edgecolor, markerstyle, etc.).
comment:9 Changed 3 years ago by jason
- Summary changed from deprecate list_plot in favor of line or scatter_plot to make points() take all the options for scatter_plot or list_plot that apply to plotting points
comment:11 Changed 17 months ago by kcrisman
Just noting that this is still really unfortunate. Here is a workaround in the meantime for getting markers.
line([(1,2),(2,3)],marker=7,linestyle='')
comment:12 Changed 6 months ago by kcrisman
Incidentally, I think the list_plot syntax in 2 and 3 dims is because Mma uses this, right? We'd need a deprecation period or to keep the alias.
See also #13830.
