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 tricontour #4795

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

Add tricontour #4795

wants to merge 7 commits into from

Conversation

mikeliux
Copy link

@mikeliux mikeliux commented Feb 15, 2025

Description

Fixes #2715

This is a work in progress to implement tricontour.jl It is working already, with some improvements required, as described below.
Example:

using Random
Random.seed!(3)
# Adapted from existing tests
x = randn(Float32, (100,));
y = randn(Float32, (100,));
z = -sqrt.(x .^ 2 .+ y .^ 2) .+ 0.1 .* randn(Float32, (100,));
levels = 5;
fig3, ax3, trf = tricontourf(x, y, z, levels = levels);
scatter!(x, y, color = z, strokewidth = 1, strokecolor = :black)
Colorbar(fig3[1, 2], trf);
# Add contour lines (color not working properly yet)
trl = tricontour!(
    ax3, x, y, z,
    levels = levels,
    colormap=:reds,
    linewidth=3,  linestyle=:dashdot,
    );
Colorbar(fig3[1, 3], trl);
display(fig3)

tricontour_example

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

Extended implementation Checklist

  • Add tricontour methods, based on the existing tricontourf
  • Update doctstring
  • Update basic docstring for functions
  • Plot 2D contour lines from unstructured data (at this point, colormap is not used
  • Be able to pass desired plot attributes for lines!(), such as linewidth, linestyle,...
  • Solve issue with colors, so plot can plot in colors
  • Allow user to set a fixed color for all contour lines
  • Allow user to define colorrange
  • Fix issue with number of levels
  • Add text labels
  • Refactor common functions with contour.jl, contourf.jl and tricontourf.jl.

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

Successfully merging this pull request may close these issues.

How to plot contourlines when the geometry is irregular
1 participant