Skip to content

SizeUnit Source

Bases: Enum

Units of the width and the height of a Plot, used by Size.

Added in version 0.1.0

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([12.0, 15.5, 14.0, 17.0])
style = ndp.PlotStyle(size=ndp.Size(width=16, height=8, unit=ndp.SizeUnit.CENTIMETER))
plot = ndp.Plot.line(prices, style=style)
plot.show()

Plot drawn by the example

Attributes

INCH = auto() Source

Inches, as matplotlib counts sizes. Default value.

Added in version 0.1.0

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([12.0, 15.5, 14.0, 17.0])
style = ndp.PlotStyle(size=ndp.Size(width=6, height=3, unit=ndp.SizeUnit.INCH))
plot = ndp.Plot.line(prices, style=style)
plot.show()

Plot drawn by the example

CENTIMETER = auto() Source

Centimeters, 2.54 per inch.

Added in version 0.1.0

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([12.0, 15.5, 14.0, 17.0])
style = ndp.PlotStyle(size=ndp.Size(width=16, height=8, unit=ndp.SizeUnit.CENTIMETER))
plot = ndp.Plot.line(prices, style=style)
plot.show()

Plot drawn by the example

PIXEL = auto() Source

Pixels, 100 per inch, the resolution of a PNG image saved without ImageOptions.

Added in version 0.1.0

Examples:

import numdaplot as ndp

prices = ndp.Array.from_list([12.0, 15.5, 14.0, 17.0])
style = ndp.PlotStyle(size=ndp.Size(width=600, height=300, unit=ndp.SizeUnit.PIXEL))
plot = ndp.Plot.line(prices, style=style)
plot.show()

Plot drawn by the example