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

title_format plot option now includes dimensions #436

Merged
merged 9 commits into from Feb 3, 2016

Conversation

Projects
None yet
2 participants
@philippjfr
Copy link
Contributor

philippjfr commented Feb 2, 2016

As the title says this allows more customizing the plot title_format as suggested in #425.

@philippjfr philippjfr added the plotting label Feb 2, 2016

@philippjfr philippjfr added this to the v1.4.2 milestone Feb 2, 2016

@philippjfr philippjfr self-assigned this Feb 2, 2016

Philipp Rudiger Philipp Rudiger
@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Feb 3, 2016

The title_format plot option now allows enabling or disabling dimensions in the title. The only way I was able to do so without losing flexibility was to let the title accept a separator variable: "{label} {group}{separator}{dimensions}". Since bokeh doesn't support newline characters I'm tempted to remove this again and simply set different default title_format, for matplotlib I'd have "{label} {group}\n{dimensions}" and for bokeh I'd have "{label} {group} - {dimensions}".

@@ -916,7 +916,7 @@ def _compute_gridspec(self, layout):

# Create title handle
if self.show_title and len(self.coords) > 1:
title = self.handles['fig'].suptitle('', **self._fontsize('title'))
title = self.handles['fig'].suptitle('', y=1.05, **self._fontsize('title'))

This comment has been minimized.

@jlstevens

jlstevens Feb 3, 2016

Contributor

Is this a magic number? I assume this makes it look better.

This comment has been minimized.

@philippjfr

philippjfr Feb 3, 2016

Author Contributor

Yea, generally avoids overlap between the plot title and the overall layout title. Not sure how best to provide control over it.

The formatting string for the title of this plot.""")
title_format = param.String(default="{label} {group}\n{dimensions}", doc="""
The formatting string for the title of this plot, allows defining
a label group separator and dimension labels.""")

This comment has been minimized.

@jlstevens

jlstevens Feb 3, 2016

Contributor

Definitely an improvement as long as the old tests pass (i.e backwards compatible).

This comment has been minimized.

@philippjfr

philippjfr Feb 3, 2016

Author Contributor

It probably won't be, there may be fewer whitespace now and things may have shifted around a little bit.

This comment has been minimized.

@jlstevens

jlstevens Feb 3, 2016

Contributor

Ok. That means there will be quite a lot of test data to update. We need to be careful about transient glitches and need to review the display output thoroughly.

@philippjfr

This comment has been minimized.

Copy link
Contributor Author

philippjfr commented Feb 3, 2016

Looks good for merging, the display changes are the deletion of trailing whitespace in the titles when no label is supplied.

@jlstevens

This comment has been minimized.

Copy link
Contributor

jlstevens commented Feb 3, 2016

Ok. Tests are passing. Merging.

jlstevens added a commit that referenced this pull request Feb 3, 2016

Merge pull request #436 from ioam/dim_title
The title_format plot option now includes dimensions

@jlstevens jlstevens merged commit 4e3e0bf into master Feb 3, 2016

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.05%) to 69.68%
Details
s3-reference-data-cache Test data is cached.
Details

@jlstevens jlstevens deleted the dim_title branch Feb 4, 2016

@jlstevens jlstevens restored the dim_title branch Feb 4, 2016

@jlstevens jlstevens deleted the dim_title branch Feb 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.