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

wrap matplotlib's title functionality #10512

Closed
jasongrout opened this issue Dec 22, 2010 · 19 comments
Closed

wrap matplotlib's title functionality #10512

jasongrout opened this issue Dec 22, 2010 · 19 comments

Comments

@jasongrout
Copy link
Member

We should wrap matplotlib's ability to add titles to axes, perhaps as an option to show.

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.title

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.suptitle


Apply attachment: trac-10512-plot-title.1.patch and attachment: trac_10512_review-sl.patch to devel/sage

CC: @kcrisman @seblabbe

Component: graphics

Author: Jason Grout, Punarbasu Purkayastha, Sébastien Labbé

Reviewer: Sébastien Labbé, Punarbasu Purkayastha

Merged: sage-5.3.beta2

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

@jasongrout
Copy link
Member Author

Attachment: trac-10512-plot-title.patch.gz

@jasongrout
Copy link
Member Author

comment:2

I've attached a patch. There is still an issue that needs to be solved, though. In this plot:

plot(sin(x^2), (x, -3, 3), title='Plot of sin(x)', axes_labels=['x','y'],frame=True)

the title overwrites the axis label. Maybe the axis label should be smarter here, or the plot title should be slightly adjusted up in this situation.

@seblabbe
Copy link
Contributor

seblabbe commented Mar 8, 2011

comment:4

plot(sin(x^2), (x, -3, 3), title='Plot of sin(x)', axes_labels=['x','y'],frame=True)

I get no problem when frame=True but do get the described problem when frame=False.

Sébastien

@ppurka

This comment has been minimized.

@ppurka
Copy link
Member

ppurka commented Aug 5, 2012

Author: Jason Grout

@ppurka
Copy link
Member

ppurka commented Aug 5, 2012

comment:5

Updated the patch to sage-5.2 and fixed the positioning of the title. Please review.

@ppurka
Copy link
Member

ppurka commented Aug 6, 2012

updated to sage-5.2, fixed position

@ppurka
Copy link
Member

ppurka commented Aug 6, 2012

comment:6

Attachment: trac-10512-plot-title.1.patch.gz

There was a small typo in the backticks used around the title docstring. Fixed it now.

@seblabbe
Copy link
Contributor

seblabbe commented Aug 9, 2012

Applies over the preceding patche

@seblabbe
Copy link
Contributor

seblabbe commented Aug 9, 2012

comment:7

Attachment: trac_10512_review-sl.patch.gz

I added a patch which adds a doctest about the fact that

plot(sin(x^2), (x, -3, 3), title='Plot of sin(x^2)', axes_labels=['x','y'],frame=True)

should be ok (no overlap between title and axes labels). I know the doctest system won't see in the future if it is not the case, but at least the documentation will recall it.

Also added some x^2 in title instead of x.

My patch needs review.

I tested ppurka patch. All tests passed on sage/combinat/graphics.py and plot.py. Documentation builds fine. I give a positive review to his patch.

BTW I am wondering why ppurka started from scratch instead of applying a patch over jason's one? Jason work will not appear in the log...

@seblabbe

This comment has been minimized.

@ppurka
Copy link
Member

ppurka commented Aug 12, 2012

comment:9

Hello, the patch still contains Jason's name in the patch header. The patch fails in many places in 5.2, and I had to move many of the patch lines from plot.py to graphics.py. Otherwise the code is almost the same as what Jason had.

@ppurka
Copy link
Member

ppurka commented Aug 13, 2012

Changed author from Jason Grout to Jason Grout, Punarbasu Purkayastha, Sebastien Labbe

@ppurka
Copy link
Member

ppurka commented Aug 13, 2012

Reviewer: Sebastien Labbe, Punarbasu Purkayastha

@ppurka
Copy link
Member

ppurka commented Aug 13, 2012

comment:10

Thanks for the patch. That was a good catch on the typos. :) Positive review from me.

I see now what you actually meant in comment:7. I am setting the authors as all three of us. That should be good enough.

@jdemeyer
Copy link

Merged: sage-5.3.beta2

@jdemeyer
Copy link

jdemeyer commented Sep 8, 2012

Changed reviewer from Sebastien Labbe, Punarbasu Purkayastha to Sébastien Labbé, Punarbasu Purkayastha

@jdemeyer
Copy link

jdemeyer commented Sep 8, 2012

Changed author from Jason Grout, Punarbasu Purkayastha, Sebastien Labbe to Jason Grout, Punarbasu Purkayastha, Sébastien Labbé

@kcrisman
Copy link
Member

comment:13

Replying to @jasongrout:

I've attached a patch. There is still an issue that needs to be solved, though. In this plot:

plot(sin(x^2), (x, -3, 3), title='Plot of sin(x)', axes_labels=['x','y'],frame=True)

the title overwrites the axis label. Maybe the axis label should be smarter here, or the plot title should be slightly adjusted up in this situation.

It turns out that this happens in matrix plots as well, even with this code (because it has a frame). See this ask.sagemath.org question. I've opened #13625 for this.

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

6 participants