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

improve error message for size parameter #1

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ end
function prepare_output(plt::Plot)
_before_layout_calcs(plt)

w, h = plt.attr[:size]
size = plt.attr[:size]
if length(size) != 2
throw(ArgumentError("size must be a tuple of length 2, for example size = (800,600)"))
end
w, h = size
plt.layout.bbox = BoundingBox(0mm, 0mm, w * px, h * px)

# One pass down and back up the tree to compute the minimum padding
Expand Down