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

[New Features] Quartiles styles, half violins and histograms on the side #38

Merged
merged 7 commits into from
May 19, 2022
Merged

Conversation

mikelgg93
Copy link
Collaborator

This pull request includes several new features.

  • Ability to plot either the right, left-half or the full violin independently of the comparison mode.
  • Ability to change how quartiles are plotted, as a shadow on the violin plot, the prior boxplot or completely omit them.
  • New plot data style, instead of a scatter plot, a histogram on the side.

Notes:
I did these changes before the last changes were made, therefore new features are not fully implemented with the comparison mode. However, I did ensure that these changes did not break anything, in the future, a clean-up can be made to not repeat so much how jitter is generated.

  • Working without including regressions.
  • New test added, showcasing new options.

Todo:

  • Include the qStyles to the comparison mode.

For the sake of simplicity I leave here the new output from the test function:

testplot

mikelgg93 and others added 5 commits May 16, 2022 12:31
Added options for plotting only half violin on the right, left or full, independently of comparison or not. 'vHalf'
Added plot quartiles options as shadow, boxplot or none. 'qStyles'
Added plot data as histogram on the side. 'barpltBool'
Added opt to disable scatter plot. 'scpltBool'

Added test cases.
	modified:   Violin.m
	modified:   test_cases/testviolinplot.m
modified:   Violin.m

Added options for plotting only half violin on the right, left or full, independently of comparison or not. 'vHalf'
Added plot quartiles options as shadow, boxplot or none. 'qStyles'
Added plot data as histogram on the side. 'barpltBool'
Added opt to disable scatter plot. 'scpltBool'

modified:   test_cases/testviolinplot.m
Added new test cases to test this options.
Change to subplots to prevent opening 7 figures.
modified:   Violin.m
Added options for plotting only half violin on the right, left or full, independently of comparison or not. 'vHalf'
Added plot quartiles options as shadow, boxplot or none. 'qStyles'
Added plot data as histogram on the side. 'barpltBool'
Added opt to disable scatter plot. 'scpltBool'

modified:   test_cases/testviolinplot.m
Added new test case, to test and show how do they work.
@bastibe
Copy link
Owner

bastibe commented May 17, 2022

Thank you! This is awesome!

I would ask you however to rename the parameters vHalf, qStyles, barpltBool to match the style of the remainder of the parameters, e.g. to HalfViolin, ShowQuartiles, ShowHistogram. Also, I think scpltBool is a duplication of ShowData, and should be removed.

mikelgg93 added 2 commits May 17, 2022 15:23
…p was also performed.

Removed the boolean parameter 'scpltBool' and 'barpltBool' in favour of 'DataStyles.

HalfViolin     - Whether to do a half violin(left, right side) or full. Defaults to full.
QuartileStyle  - Option on how to display quartiles, with a boxplot, shadow or none. Defaults to boxplot.
DataStyle      - Defines the style to show the data points. Opts: 'scatter', 'histogram' or 'none'. Default is 'scatter'.

	modified:   Violin.m
	modified:   test_cases/testviolinplot.m
@mikelgg93
Copy link
Collaborator Author

ShowQuartiles

As requested, the names of the parameters have been changed, a small clean up was also performed.
Removed the boolean parameter 'scpltBool' and 'barpltBool' in favour of 'DataStyles.

HalfViolin - Whether to do a half violin(left, right side) or full. Defaults to full.
QuartileStyle - Option on how to display quartiles, with a boxplot, shadow or none. Defaults to boxplot.
DataStyle - Defines the style to show the data points. Opts: 'scatter', 'histogram' or 'none'. Default is 'scatter'.

I kept the ShowData, because of the method, now it also removes the histogram.
A new test case was added to test the ability to remove the data, after plotting it.

@bastibe
Copy link
Owner

bastibe commented May 18, 2022

Great work! This looks really good! Thank you so much!

Regrettably, Github doesn't show me a proper diff, and anyways I don't have access to Matlab any longer, so I can't really test your code in any meaningful way. But I'll trust you that everything works as it should. Does the original test suite still run? We don't want to break existing code.

If all of that is in order, I'll gladly merge your contribution when you say it's ready.

@mikelgg93
Copy link
Collaborator Author

Thanks to you! Yeah! I also notice that Github oddly did not show proper differences, although in VSCode it does for me...

I don't have access to Matlab any longer
That´s sad, let me know if you want me to help you maintain the repo.

And yes, the original test, still runs, in fact, the modified testviolinplot.m still includes the 4 original tests.
I include a screenshot of the original one (the screenshot will disappear after one day).

imageoftheoriginaltest

From my side, everything is ready so merge at your wish! Have a nice day!

@bastibe bastibe merged commit 7bbf6dd into bastibe:master May 19, 2022
@bastibe
Copy link
Owner

bastibe commented May 19, 2022

Perfect! If you'd like to help maintain the Violinplot, I'd be happy to have you on board!

@mikelgg93
Copy link
Collaborator Author

Perfect! If you'd like to help maintain the Violinplot, I'd be happy to have you on board!
Count me in, I don´t think it will rob me of too much time.

@bastibe
Copy link
Owner

bastibe commented May 19, 2022

I've sent you an invite to become a collaborator on this repository! Thank you for your help!

@bastibe
Copy link
Owner

bastibe commented May 20, 2022

Would you like to add your cool new graph variants to the screenshot in the README?

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

Successfully merging this pull request may close these issues.

2 participants