Contouring roadmap #12234
Replies: 2 comments
-
The next item I plan to implement here is to better support for users to specify vector visual properties without knowing the number of levels contoured. This support is required before we relax the Currently non-color vector visual properties must be sequences of exactly the right length.
I propose two enhancements, one for colors and one general purpose for all visual properties. Colors onlyRather than use This functionality could be put in the existing
Edit: GeneralThis enhancement is specific to contour plots and does not add any new public functions. If a def line_dash(levels):
return ["solid" if level >= 0.0 else "dashed" for level in levels]
p.contour(..., line_dash=line_dash) It could be a lambda of course, and some This will be on the Python side of Bokeh only. |
Beta Was this translation helpful? Give feedback.
-
Selfishely I woul love to see the |
Beta Was this translation helpful? Give feedback.
-
Now that we have support for contour plots (#12020) here is my roadmap for further work, in roughly priority order.
fig.contour(levels=10, ...)
) rather than the levels themselves. The code will choose sensible levels based on the data range ofz
. Initially the levels will be linearly-spaced. Thelevels
kwarg will then be optional and the default will be some integer TBD. It won't guarantee you receive that exact number of levels as the requirement that the levels are sensibly spaced is more important.linear_palette()
. Example use case would be different line color and dash depending on whether contour level is positive or negative. Also consider use ofcolor
for bothfill_color
andline_color
(and relatedalpha
) as other glyphs do.levels
range in min/low and max/high directions. For example, if you uselevels=[0, 1, 2]
at the moment you'll get 3 contour lines, one at each level, and two sets of filled polygons, the first fromz=0
toz=1
and the second fromz=1
toz=2
. When you ask to "extend in max/high direction" (API is TBD) it will calculate and render another set of filled contour polygons forz=2
up to az
of infinity (probably maxz
value) and the top of the colorbar will have a colored triangle to indicate this. See https://matplotlib.org/stable/tutorials/colors/colorbar_only.html for Matplotlib's equivalent.z
levels. This is initially a research project to identify how other libraries do it and come up with a sensible design, and doesn't necessarily have to be done by me 😄Beta Was this translation helpful? Give feedback.
All reactions