JuliaPlots / JuliaPlots/PlotlyJS.jl

Overloading Base.vect

Open
#354 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
444
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Overloading `Base.vect(::Plot...)` (`[p1, p2]` syntax) to return a new `Plot` instance is really counter-intuitive and violates the contract of the function. The docstring is "Create a Vector with element type computed from the `promote_typeof` of the argument, containing the argument list" so I would expect this to at the very least return an `AbstractVector{Plot}` if not a `Vector`. This result is very unexpected if the user wants to create an actual vector of plots.

In my opinion, the methods for `vect`, `vcat`, and `hcat` should be removed so that they create the expected 1D or 2D array of plots, and there should be a specific function (or maybe just another method of `plot`) to combine them as subplots. This would be much more clear and explicit.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.