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

Add info about NaNs and line/shape segments #2

Closed
tbreloff opened this issue Jul 14, 2016 · 2 comments
Closed

Add info about NaNs and line/shape segments #2

tbreloff opened this issue Jul 14, 2016 · 2 comments

Comments

@tbreloff
Copy link
Member

tbreloff commented Jul 14, 2016

should add to "input data"

@FelipeLema
Copy link
Contributor

Since this is my fault, I might as well add a comment:

NaN provides a way to disjoint data. This comes in handy when grouping separate polygons that share some attribute.

using Plots; plotly()

function rectangle_from_coords(xb,yb,xt,yt)
    [
     xb yb
     xt yb
     xt yt
     xb yt
     xb yb
     NaN NaN
     ]
end

some_rects=[
       rectangle_from_coords(1 ,1 ,5 ,5 )
       rectangle_from_coords(10,10,15,15)
       ]
other_rects=[
       rectangle_from_coords(1 ,10,5 ,15)
       rectangle_from_coords(10,1 ,15,5 )

plot(some_rects[:,1], some_rects[:,2],label="some group")
plot!(other_rects[:,1], other_rects[:,2],label="other group")

@mkborregaard
Copy link
Member

@FelipeLema if this is your fault, would you consider adding this in a PR? :-)

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

No branches or pull requests

3 participants