-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Contour plots #36
Comments
Contour doesn't have exactly what I want, so I'll do it myself, and maybe submit a PR at some point. I'm sure I'm not the first person to come up with an algorithm like this, but here's the back-of-the-napkin idea that I'm thinking through:
Repeat this process for each contour level needed.
|
Looking at using Delaunay triangulation which is implemented in https://github.com/JuliaGeometry/VoronoiDelaunay.jl, which would replace the need for the grid and triangle creation steps, as well as reducing the effort to estimate z-values. I think it's probably a good idea to smooth the z-values somehow... this could be parameterized. |
Basics are done. For now, I'm just allowing the inputs and passing through to a backend function. (Geom.contour in Gadfly/Immerse, contour/contourf in PyPlot). I currently accept a function mapping (x,y) to a z-value, and z-matrices (similar to Gadfly's interface). In the future I'll expand the allowed inputs to arbitrary points in 3D space, so I'll leave this open until I have more native support for estimating surfaces and contours and generically plotting them. Here's some examples: Gadfly/Immerse: PyPlot: |
I think there is a bug with the Gadfly backend. I get different results for pyplot and gadfly, where I know for a fact that the minimum in the gadfly plot is wrong gadfly()
p_cost = plot(-4:.1:4, -4:.1:4, (θ1, θ2) -> cost(X, [θ1, θ2], y), nlevels = 100) pyplot()
p_cost = plot(-4:.1:4, -4:.1:4, (θ1, θ2) -> cost(X, [θ1, θ2], y), nlevels = 100) |
Can you post a full example so I can run it? (Or make a gist) does this happen if you do contours directly through pyplot/gadfly?
|
Sure, I'll look into it |
Ah, I confused this issue with the closed one. So sorry that I opened a new one for this. see #80 |
Can maybe depend on https://github.com/tlycken/Contour.jl
The text was updated successfully, but these errors were encountered: