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 explicit xlabel/ylabel(/zlabel) plot options #3154

Merged
merged 4 commits into from
Nov 8, 2018

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Nov 7, 2018

Overriding the axis labels is currently a fairly complex procedure because you have to redimension a bunch of elements. Particularly when you are working with a DynamicMap where you can't necessarily inspect the dimensions of returned elements it is, in some cases, not feasible at all. It also would add huge complexity to perform operations like this in hvplot. Various users have therefore requested explicit xlabel/ylabel(/zlabel) plot options, which are easy to add and much easier to control.

@philippjfr philippjfr added tag: component: plotting type: enhancement Minor feature or improvement to an existing feature labels Nov 7, 2018
@jlstevens
Copy link
Contributor

This approach is useful for an explicit override but it should not be something you keep repeating (that just means you've not declared your dimension right).

I'm fine with the code in this PR (and happy to merge) but I would like to know how we should communicate this. Essentially, 'you can use xlabel as a plot option but if you keep re-using the same xlabel you should declare your dimension properly instead'.

@philippjfr
Copy link
Member Author

That's pretty much exactly how I see it, Dimensions are the recommended way to declare and persist metadata about your dimensions but if you're trying to make a quick tweak to an existing plot or have been given an object by some third-party API this let's you make that change without going through hoops.

@jlstevens
Copy link
Contributor

Ok, I think I'll merge so we can add the docs in a subsequent PR. Here is the minimum I would expect for docs:

  • In the User guide when people are introduced to how dimensions determine axis labels, we can add a pointer forwards to options to say 'if you need to override a label on a plot where changing the dimension temporarily is inappropriate, you can use the options system'.
  • In the new section in the options user guide to a reverse pointer 'if you find yourself setting the same label frequently, declare the correct label at the dimension level'.

Otherwise, I am happy with the code here so I will merge.

@jlstevens jlstevens merged commit 6ddd311 into master Nov 8, 2018
@philippjfr philippjfr deleted the axis_labelling_options branch November 12, 2018 17:59
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tag: component: plotting type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants