MCPcopy Create free account
hub / github.com/plotly/plotly.py / create_ternary_contour

Function create_ternary_contour

plotly/figure_factory/_ternary_contour.py:511–692  ·  view source on GitHub ↗

Ternary contour plot. Parameters ---------- coordinates : list or ndarray Barycentric coordinates of shape (2, N) or (3, N) where N is the number of data points. The sum of the 3 coordinates is expected to be 1 for all data points. values : array-like

(
    coordinates,
    values,
    pole_labels=["a", "b", "c"],
    width=500,
    height=500,
    ncontours=None,
    showscale=False,
    coloring=None,
    colorscale="Bluered",
    linecolor=None,
    title=None,
    interp_mode="ilr",
    showmarkers=False,
)

Source from the content-addressed store, hash-verified

509
510
511def create_ternary_contour(
512 coordinates,
513 values,
514 pole_labels=["a", "b", "c"],
515 width=500,
516 height=500,
517 ncontours=None,
518 showscale=False,
519 coloring=None,
520 colorscale="Bluered",
521 linecolor=None,
522 title=None,
523 interp_mode="ilr",
524 showmarkers=False,
525):
526 """
527 Ternary contour plot.
528
529 Parameters
530 ----------
531
532 coordinates : list or ndarray
533 Barycentric coordinates of shape (2, N) or (3, N) where N is the
534 number of data points. The sum of the 3 coordinates is expected
535 to be 1 for all data points.
536 values : array-like
537 Data points of field to be represented as contours.
538 pole_labels : str, default ['a', 'b', 'c']
539 Names of the three poles of the triangle.
540 width : int
541 Figure width.
542 height : int
543 Figure height.
544 ncontours : int or None
545 Number of contours to display (determined automatically if None).
546 showscale : bool, default False
547 If True, a colorbar showing the color scale is displayed.
548 coloring : None or 'lines'
549 How to display contour. Filled contours if None, lines if ``lines``.
550 colorscale : None or str (Plotly colormap)
551 colorscale of the contours.
552 linecolor : None or rgb color
553 Color used for lines. ``colorscale`` has to be set to None, otherwise
554 line colors are determined from ``colorscale``.
555 title : str or None
556 Title of ternary plot
557 interp_mode : 'ilr' (default) or 'cartesian'
558 Defines how data are interpolated to compute contours. If 'irl',
559 ILR (Isometric Log-Ratio) of compositional data is performed. If
560 'cartesian', contours are determined in Cartesian space.
561 showmarkers : bool, default False
562 If True, markers corresponding to input compositional points are
563 superimposed on contours, using the same colorscale.
564
565 Examples
566 ========
567
568 Example 1: ternary contour plot with filled contours

Callers

nothing calls this directly

Calls 8

add_scatterternaryMethod · 0.95
add_traceMethod · 0.95
_compute_gridFunction · 0.85
_ternary_layoutFunction · 0.85
_contour_traceFunction · 0.85
intFunction · 0.85
minMethod · 0.45

Tested by

no test coverage detected