Skip to content

ColorScale Source

Bases: Enum

Color scales of a HeatmapChart and of a ScatterChart, from the smallest value to the largest one.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([5.5, 3.0, 8.0])
february = ndp.Array.from_list([6.0, 4.5, 9.0])
march = ndp.Array.from_list([9.5, 8.0, 11.5])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.BLUES)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example

Attributes

VIRIDIS = auto() Source

From dark purple for the smallest values to yellow for the largest. Default value.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([5.5, 3.0, 8.0])
february = ndp.Array.from_list([6.0, 4.5, 9.0])
march = ndp.Array.from_list([9.5, 8.0, 11.5])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.VIRIDIS)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example

BLUES = auto() Source

From white for the smallest values to dark blue for the largest.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([5.5, 3.0, 8.0])
february = ndp.Array.from_list([6.0, 4.5, 9.0])
march = ndp.Array.from_list([9.5, 8.0, 11.5])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.BLUES)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example

REDS = auto() Source

From white for the smallest values to dark red for the largest.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([5.5, 3.0, 8.0])
february = ndp.Array.from_list([6.0, 4.5, 9.0])
march = ndp.Array.from_list([9.5, 8.0, 11.5])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.REDS)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example

RED_BLUE = auto() Source

From blue for the smallest values to red for the largest, through white. When the values are on both sides of 0, the scale is centered on 0, so white means 0.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([1.5, -2.0, 0.5])
february = ndp.Array.from_list([-0.5, 1.0, 2.5])
march = ndp.Array.from_list([-3.0, 0.5, 1.0])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.RED_BLUE)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example

GREENS = auto() Source

From white for the smallest values to dark green for the largest.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([5.5, 3.0, 8.0])
february = ndp.Array.from_list([6.0, 4.5, 9.0])
march = ndp.Array.from_list([9.5, 8.0, 11.5])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.GREENS)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example

GRAYS = auto() Source

From white for the smallest values to black for the largest, for a printing in black and white.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([5.5, 3.0, 8.0])
february = ndp.Array.from_list([6.0, 4.5, 9.0])
march = ndp.Array.from_list([9.5, 8.0, 11.5])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.GRAYS)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example

CIVIDIS = auto() Source

From dark blue for the smallest values to yellow for the largest, readable with most forms of color blindness.

Added in version 0.1.0

Examples:

import numdaplot as ndp

cities = ndp.Array.from_list(["Paris", "Lyon", "Pau"])
january = ndp.Array.from_list([5.5, 3.0, 8.0])
february = ndp.Array.from_list([6.0, 4.5, 9.0])
march = ndp.Array.from_list([9.5, 8.0, 11.5])
temperatures = ndp.Table.from_arrays({"city": cities, "jan": january, "feb": february, "mar": march})
chart = ndp.HeatmapChart(columns=["jan", "feb", "mar"], labels="city", scale=ndp.ColorScale.CIVIDIS)
plot = ndp.Plot.heatmap(temperatures, chart)
plot.show()

Plot drawn by the example