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

Improve contours, fix fill colors for contours #1558

Closed
5 tasks done
ea42gh opened this issue Jun 17, 2017 · 5 comments
Closed
5 tasks done

Improve contours, fix fill colors for contours #1558

ea42gh opened this issue Jun 17, 2017 · 5 comments
Milestone

Comments

@ea42gh
Copy link
Contributor

ea42gh commented Jun 17, 2017

%%output backend='bokeh'
%%opts Polygons (cmap='hot')
from holoviews.operation import contours as hv_contours

x,y = np.meshgrid(np.linspace(-5,5,101), np.linspace(5,-5,101))
z=np.sin(x**2+y**2)*np.exp(-0.3*x)
hv.Image(z)+hv_contours(hv.Image(z), levels=[.2,.4,.6,.7,.85], filled=True, overlaid=False)

Suggestions:

  • make overlaid=False the default
  • autocompute n levels with levels=n
  • allow overlaid=True while setting an alpha level for the image
  • fix the colors of the fill between levels
    (a simpler plot showing the issue uses z = np.sin(x**2+y**2)
  • ensure contour lines are not overlaid by the color fill
@ea42gh
Copy link
Contributor Author

ea42gh commented Jun 17, 2017

geoviews has FilledContour and LineContour types with corresponding plotting classes for matplotlib

A uniform API for both holoviews and geoviews seems desirable

@ea42gh
Copy link
Contributor Author

ea42gh commented Sep 20, 2017

  • colorbar does not display the full range of the contour levels, e.g.,
%%opts Polygons [colorbar=True colorbar_position='left' ] (alpha=0.5 cmap='viridis')
hv_contours(hv.Image( (x_vals,y_vals, radii ) ),levels=[radii.min(), 20., 50., 70., radii.max()],overlaid=False,filled=True )

shows a colorbar running from 0(?) to 70 rather than radii.max()?

  • the radii.max() level must be included, since otherwise the corresponding Polygon will not be filled

@jlstevens
Copy link
Contributor

A uniform API for both holoviews and geoviews seems desirable

I agree. The contour operation needs some thought especially now the multi-interface PR is merged improving contour/path elements. I'm just not sure when we will get round to improving it...

@philippjfr
Copy link
Member

Until we support holes in our polygons this will likely not be fixed. I do think we can support using the DictInterface eventually but it likely won't be in the next release.

@philippjfr
Copy link
Member

As far as I can all the issues here have now been addressed by #3092. Please reopen if you encounter issues.

@philippjfr philippjfr added this to the v1.11.0 milestone Oct 23, 2018
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