-
Notifications
You must be signed in to change notification settings - Fork 34
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
Base.vect(ps::Plot...) = vcat(ps...) is a very strange and unintuitive overload #31
Comments
I must say that I also stumbled here. What confused me the most was Julia's internal mechanism of array and matrix construction. I was not aware that
(@waralex, @sglyon: I know that you know this, but others might not 😉) The last line introduces quite a convenient syntax to define a plot with subplots, particularly when allowing different numbers of subplots in each row, which I recently added, cf. #51. So defining I started digging deeper, when I realised that comprehensions did not produce subplots ... |
There's a small typo here -
|
Hmm, does this mean we can get what we are looking for without In paricular, if we remove the |
Yes, my original issue would say that when I write |
@waralex Thanks for correcting my error above. I thought, I would have tested correctly, but I was probably mislead due to the existing definition |
When using the array creation syntax, it is very strange to get this result:
Concatenation of elements is not what the user expects to see when creating an array.
From a practical point of view, this leads to problems in
Dash
. InDash
, the user may need to return an array of Plots from the callback. Moreover, even if the user returns a single Plot, for technical reasons, it is wrapped in an array of one element. And all this doesn't work because of this function overload. And it does not work in a way that puts the novice in a complete dead end. I wrote a workaround for the part that wraps a single element in an array here (now it explicitly doesT[el]
instead of[el]
). Apparently I will need to write about this issue in the user documentation. But ideally, it would be better to remove this overload, because its behavior clearly contradicts the meaning of thevect
functionThe text was updated successfully, but these errors were encountered: