Coder Social home page Coder Social logo

Comments (2)

tomasaschan avatar tomasaschan commented on June 16, 2024

As you'll note, length(c.lines) == 2. You'll get the other branch if you do xs2, ys2 = coordinates(c.lines[2]) and plot them too :)

More generally, contour lines will be traced either in loops or reaching the domain boundaries, and each continuous curve will be returned as a separate Curve2 object in c.lines.

Plotting this example again (with Gadfly this time, since I don't have matplotlib on this computer):

x = -3:0.01:3
y = -3:0.01:3
z = [Float64((xi^2 - yi^2)) for xi in x, yi in y];
h = 2

using Contour
c = contour(x,y,z,h)

using Gadfly
plot([layer(x=xs,y=ys,Geom.path) for (xs,ys) in map(coordinates, c.lines)]...)

shows both branches.

(If you want to use Gadfly for plotting, this is built-in there, so you don't have to worry about the Contour package at all if plotting is all you want to do.)

from contour.jl.

mgr327 avatar mgr327 commented on June 16, 2024

Thank you!

It is probably going to benefit everyone if you add your example to the readme.md file of the package.

from contour.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.