Ticket #4985 (closed enhancement: fixed)
[with patch, positive review] Expand documentation for list_plot to point out the utility of zip
| Reported by: | jason | Owned by: | was |
|---|---|---|---|
| Priority: | minor | Milestone: | sage-3.4.1 |
| Component: | graphics | Keywords: | |
| Cc: | jhpalmieri | Work issues: | |
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
We should expand the documentation for list_plot so that questions like on the latter half of this thread don't happen:
http://groups.google.com/group/sage-support/browse_thread/thread/e523b8ade175746c
Basically, we should explain how to use zip like thus:
list_plot(zip(list of x-coords, list of y-coords))
so that people from Matlab don't get confused by the very unhelpful error message. Maybe the error message ought to be changed too.
Attachments
Change History
comment:2 Changed 4 years ago by jhpalmieri
- Cc jhpalmieri added
- Priority changed from major to minor
- Summary changed from Expand documentation for list_plot to point out the utility of zip to [with patch, needs review] Expand documentation for list_plot to point out the utility of zip
Here's a patch, adding to the list_plot docstring. I feel neutral, or maybe a little negative, about the suggestion to add plot_list as an alias. Would we then need to do the same for list_plot3d? Anyway, that can be dealt with as a separate ticket.
By the way, I wasn't sure what "the very unhelpful error message" is. We might consider testing whether the second argument to list_plot (which is "plotjoined", should be boolean) is a list or tuple, and then print a warning, because perhaps someone ran "list_plot([list1], [list2])" without meaning to. Opinions?
comment:4 Changed 4 years ago by jason
- Summary changed from [with patch, needs review] Expand documentation for list_plot to point out the utility of zip to [with patch, positive review] Expand documentation for list_plot to point out the utility of zip
(applies cleanly to 3.4, doctests in plot.py pass, and the plot looks right).


Good idea, IMHO. I wonder if it also a good idea to add plot_list as an alias to the namespace so people who hunt for plot commands (and the documentation for them) using tab completion can find this more easily?