Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Move definition of Shape here? #51

Closed
chethega opened this issue Sep 29, 2018 · 3 comments
Closed

Move definition of Shape here? #51

chethega opened this issue Sep 29, 2018 · 3 comments

Comments

@chethega
Copy link

I'd like to use Shape in recipes: I need to draw some polygons (basically for custom error bars), and don't want to incur Plots.jl as a dependency for users that don't actually want to plot. Unfortunately, the Shape struct is currently defined in Plots.jl.

Can we move the definition here?

@mkborregaard
Copy link
Member

You don't have to - simply set seriestype := :shape in your recipe.

@dlfivefifty
Copy link

I had some old code using Shape that's broken:

@recipe function f::Partition)
    legend --> false
    ratio --> 1.0
    axis --> false
    grid --> false

    ret = Shape[]
    m = length(σ)
    for j = 1:m, k = 1:σ[j]
        push!(ret, Shape([k-1,k-1,k,k],[1-j,-j,-j,1-j]))
    end
    ret
end

Any hints how to change it to seriestype := :shape?

@BeastyBlacksmith
Copy link
Member

Would be easier with a MWE, but essentially you take the first argument of Shape as x-values, the second as y-values and then set seriestype = :shape and then one series per shape as far as I can see.

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

No branches or pull requests

4 participants