Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example(s) for ticks in plot doc #16857

Closed
kcrisman opened this issue Aug 20, 2014 · 28 comments
Closed

Add example(s) for ticks in plot doc #16857

kcrisman opened this issue Aug 20, 2014 · 28 comments

Comments

@kcrisman
Copy link
Member

This ask.sagemath question suggests we need more documentation on how to change ticks for only one axis. One suggested example is

xx = np.logspace(1,100,1000) 
yy = np.linspace(-180,180,1000) 
list_plot(xx,yy,scale=semilogx,ticks=[None, 30])

though neither of us has tested this yet.

Component: graphics

Author: Lennart Jern

Branch/Commit: 8d10514

Reviewer: Paul Masson

Issue created by migration from https://trac.sagemath.org/ticket/16857

@sagetrac-paulgraham5
Copy link
Mannequin

sagetrac-paulgraham5 mannequin commented Nov 15, 2014

comment:1

I was unable to get the suggested example to work, as i get this error when trying it:

TypeError: The second argument 'plotjoined' should be boolean (True or False).  
If you meant to plot two lists 'x' and 'y' against each other, 
use 'list_plot(zip(x,y))'.

Also i needed to add single quotes around semilogx, so i ended up with this:

list_plot(zip(xx,yy),scale='semilogx',ticks=[None, Integer(30)])

And it produces a plot successfully, but i have no idea if that plot is correct, now with these changes?

@kcrisman
Copy link
Member Author

comment:2

Certainly this would be the correct syntax, now that I see it. Probably we should add some (non-semilog, non list plot) examples in a few other places where there are already ticks examples. Nice!

@vbraun
Copy link
Member

vbraun commented Dec 3, 2014

comment:3

no branch to review

@lentzi90
Copy link

lentzi90 commented Oct 8, 2016

Branch: u/ljern/doc_ticks_in_plot

@lentzi90
Copy link

lentzi90 commented Oct 8, 2016

Commit: 9c7d90c

@lentzi90
Copy link

lentzi90 commented Oct 8, 2016

comment:5

First attempt at contributing to sage...


New commits:

9c7d90cAdded more documentation about ticks in plots

@lentzi90 lentzi90 self-assigned this Oct 8, 2016
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 16, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

d2a7a27More documentation for ticks in plots

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 16, 2016

Changed commit from 9c7d90c to d2a7a27

@lentzi90
Copy link

comment:7

I added an example to plot where only one axis is changed.
Since list_plot has no other examples with keywords, I decided to just add a reference to show there rather than adding the same example in two places.
All the other plot functions also makes references to show or plot for full details.

I realized now that I branched from develop, is this OK? Should I branch from master instead?

@tscrim
Copy link
Collaborator

tscrim commented Oct 16, 2016

comment:8

Replying to @lentzi90:

I added an example to plot where only one axis is changed.
Since list_plot has no other examples with keywords, I decided to just add a reference to show there rather than adding the same example in two places.
All the other plot functions also makes references to show or plot for full details.

I would redirect to plot instead of show since show does more than plot. plot returns a plot object, whereas show returns None and displays a plot. In an analogy, plot is like a function that returns a string, whereas show is like print.

I realized now that I branched from develop, is this OK? Should I branch from master instead?

You should always try to base things off develop as it is far less likely to have any merge conflicts or behavior changes.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 18, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

7c0d150Changed reference from show to plot

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 18, 2016

Changed commit from d2a7a27 to 7c0d150

@paulmasson
Copy link
Mannequin

paulmasson mannequin commented Oct 18, 2016

comment:10

We've been putting white space between the arguments of Sage commands but not within the arguments. The command

plot(x^2,(x,300,500),ticks=[100,50000])

reads better as

plot(x^2, (x,300,500), ticks=[100,50000])

Please make that change in the immediate section on which you're working. Thanks!

@paulmasson
Copy link
Mannequin

paulmasson mannequin commented Oct 18, 2016

comment:11

Please also put your full real name in the "Authors" field.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 22, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

2135954Added myself to authors, improved readability of examples

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 22, 2016

Changed commit from 7c0d150 to 2135954

@paulmasson
Copy link
Mannequin

paulmasson mannequin commented Nov 14, 2016

comment:13

Lennart, when I asked you to add yourself to authors I meant on the Trac ticket, not in the documentation.

One more change I would like to see it four instances of 1,27 changed to 1, 27. Thanks!

@paulmasson
Copy link
Mannequin

paulmasson mannequin commented Nov 14, 2016

Reviewer: Paul Masson

@paulmasson paulmasson mannequin added this to the sage-7.5 milestone Nov 14, 2016
@lentzi90
Copy link

Author: Lennart Jern

@lentzi90
Copy link

comment:15

Oh I see, that makes sense! Thank you for the guidance :)
I guess I should also merge the develop branch into this to make it up to date, right?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 14, 2016

Changed commit from 2135954 to 4d3ceb4

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 14, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

61f558bAdded space between some arguments, removed from authors
4d3ceb4Merge branch 'develop' into t/16857/doc_ticks_in_plot

@lentzi90
Copy link

Patch with all changes

@paulmasson
Copy link
Mannequin

paulmasson mannequin commented Nov 14, 2016

comment:17

Attachment: ticks.patch.gz

You aren't required to merge the current develop branch if it doesn't affect your code. Some people do that regularly to avoid possible merge conflicts and to decrease the time it takes to rebuild after changes. I personally don't because it complicates the history of a branch in the Git repository, and rebuild time can be decreased significantly in any case by installing ccache.

You also don't need to include a patch with all changes. The commits to Git are cumulative, and you can see the total result by clicking on the branch at the top of this ticket.

The documentation builds and looks good. One more minor change: add a space so x^2,(x,480,500) is x^2, (x,480,500) to match the edit in the Sphinx plot. After that its good to go and I'll give it positive review.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 15, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

8d10514More space for readability

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 15, 2016

Changed commit from 4d3ceb4 to 8d10514

@paulmasson
Copy link
Mannequin

paulmasson mannequin commented Nov 15, 2016

comment:19

Thanks!

@vbraun
Copy link
Member

vbraun commented Nov 17, 2016

Changed branch from u/ljern/doc_ticks_in_plot to 8d10514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants