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 a variant of ridgeplot example that uses sub-coordinates #12068

Merged
merged 6 commits into from
Sep 28, 2023

Conversation

mattpap
Copy link
Contributor

@mattpap mattpap commented Mar 31, 2022

Keeps the original look, but allows to preserve actual data (see data (x, y) in the tooltip).

image

@bryevdv
Copy link
Member

bryevdv commented Mar 31, 2022

This is great, but there is a little more updating required. This example is also used here:

https://docs.bokeh.org/en/latest/docs/user_guide/categorical.html#categorical-offsets

as a demonstration of categorical offsets. We shouldn't use the same example in two different ways in different places. (If we want to compare/contrast methods it should be explicit and side by side) cc @tcmetzger for thoughts on how to organize. Some comments:

  • we still need to document categorical offsets somewhere
  • we should probably make sub-coordinates be the default way to do "series of data per category"
  • there may be other examples that use offsets for series that could be updated

@tcmetzger
Copy link
Member

That's a good point! I agree that we shouldn't use something that looks the same to illustrate two different concepts in two different places. I see basically the following options:

It sounds to me like using sub-coordinates is now the definitive way to go for ridge plots, so that means we should probably look at option one: creating a new example to serve as an illustration of categorical offsets. Do you have any ideas what that could be? If not, we can also just leave it at one example (the current fruit count example) in the user guide's 'categorical offsets' section and just not have a "more sophisticated example".

@bryevdv bryevdv modified the milestones: 3.0, 3.1 Jun 22, 2022
@mattpap mattpap modified the milestones: 3.1, 3.2 Feb 9, 2023
@mattpap mattpap changed the base branch from branch-3.0 to branch-3.2 March 4, 2023 15:49
@droumis droumis added the grant: CZI R5 Funded by CZI Round 5 grant label Apr 28, 2023
@mattpap mattpap force-pushed the mattpap/ridgeplot_subcoordinates branch from 981facc to f315ddf Compare May 31, 2023 14:21
@codecov
Copy link

codecov bot commented May 31, 2023

Codecov Report

Merging #12068 (143c75b) into branch-3.3 (7cd6b36) will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           branch-3.3   #12068   +/-   ##
===========================================
  Coverage       92.45%   92.45%           
===========================================
  Files             317      317           
  Lines           20268    20268           
===========================================
  Hits            18738    18738           
  Misses           1530     1530           

@mattpap mattpap modified the milestones: 3.2, 3.3 Jun 7, 2023
@mattpap mattpap changed the base branch from branch-3.2 to branch-3.3 June 15, 2023 07:50
@mattpap mattpap force-pushed the mattpap/ridgeplot_subcoordinates branch from f315ddf to 7908b82 Compare August 5, 2023 12:42
@mattpap mattpap force-pushed the mattpap/ridgeplot_subcoordinates branch from 7908b82 to 7ce25ed Compare September 4, 2023 13:27
@mattpap mattpap changed the title Rework ridgeplot example to use sub-coordinates Add a variant of ridgeplot example that uses sub-coordinates Sep 4, 2023
@mattpap
Copy link
Contributor Author

mattpap commented Sep 4, 2023

I took a different approach with this. I added a new category to examples/topics: subcoordinates, where I added a variant of ridgeplot.py that uses sub-coordinates. Whereas I reverted changes to examples/topics/categorical, while updating descriptions. This allows ridgeplot to be used for showing and comparing both approaches. I will continue in PR #13346, where I will add more examples and add documentation for sub-coordinates and update documentation for categoricals (pointing to sub-coordinates and explaining differences between both).

@bryevdv
Copy link
Member

bryevdv commented Sep 5, 2023

@mattpap There is intended to be a 1-1 correspondence between examples/topics/foo directories, and subchapters under the Topics chapter of the user's guide. Do you actually envision an entire subchapter for this? If there aren't at least 3-4 subheadings and examples to flesh out a sub-chapter then it would be better to find an existing diretory corresponding to and existing chapter to add it to. Or of you don't want it to be in the User's guide, then it can go in one of the "grab bag" examples dirs that don't correspond to the docs hierarchy e.g. examples/models or examples/plotting

Edit: Here is the current chapter/subchapter hierarchy with the top level directories noted:

Basic plotting # examples/basic

Appearance # examples/styling

Topic guides # examples/topics

I could imaging Basic Plotting -> Sub-coordinates as making sense, or it could potentially go under Appearance if we wanted to broaden the scope of that chapter (cc @tcmetzger) but if you want to punt on this for now just move it to one of the grab-bag dirs and open an issue to discuss future docs work around it.

@bryevdv
Copy link
Member

bryevdv commented Sep 20, 2023

@mattpap for expediency I think the simplest thing to do is to move the example to examples/plotting for now, to get this merged, and open an issue for future docs work. As you mention this really merits a full discussion/comparison so we'll just need to figure out the best place to land that.

@mattpap mattpap force-pushed the mattpap/ridgeplot_subcoordinates branch from 3c10e51 to 60e5110 Compare September 27, 2023 22:02
Copy link
Member

@bryevdv bryevdv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of wording suggestions

examples/topics/categorical/ridgeplot.py Outdated Show resolved Hide resolved
examples/topics/categorical/ridgeplot.py Outdated Show resolved Hide resolved
@mattpap mattpap merged commit 3f90a6e into branch-3.3 Sep 28, 2023
27 checks passed
@mattpap mattpap deleted the mattpap/ridgeplot_subcoordinates branch September 28, 2023 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants