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

[FR] grid function: Throw errors on bad settings #4212

Closed
diegozea opened this issue May 25, 2022 · 0 comments · Fixed by #4902
Closed

[FR] grid function: Throw errors on bad settings #4212

diegozea opened this issue May 25, 2022 · 0 comments · Fixed by #4902

Comments

@diegozea
Copy link
Contributor

Hi! It would be great if the grid function errors when the heights and widths are not correctly set — so the users can understand the incorrect behavior through the error messages. In the following example, we should throw an error if one of the values is zero or if the sum is greater than one. Also, the argument should allow PlotMeasures units as they create error messages that are difficult to understand for newcomers. Cheers

# ╔═╡ dd200ca8-dc0a-11ec-09bc-6b12e6752417
using Plots

# ╔═╡ bb729008-f813-422c-b976-64f1a8f51195
using PlutoUI

# ╔═╡ 0022b3c5-1883-434d-9d03-31be2f5ebb0f
@bind fraction Slider(0.0:0.1:1.0, default=0.4, show_value=true)

# ╔═╡ c93e3243-b265-4c4b-8b98-4ecf011d6ba6
plot(
	plot(log), plot(exp), plot(sqrt), plot(x -> x^2),
	legend = false,
	layout = grid(2, 2, 
		heights = [fraction, 1.0 - fraction],
		widths = [fraction, 1.0 - fraction])
)

image

image

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

Successfully merging a pull request may close this issue.

2 participants