utils

mng

This module provides basic writing Mulitple-image Network Graphics files.

It only supports RGB888 images of the same shape stored as MNG-VLC (very low complexity) format.

silx.gui.plot3d.utils.mng.convert(images, nb_images=0, fps=25)[source]

Convert RGB images to MNG-VLC format.

See http://www.libpng.org/pub/mng/spec/ See http://www.libpng.org/pub/png/book/ See http://www.libpng.org/pub/png/spec/1.2/

Parameters:
  • images (iterator of numpy.ndarray of dimension 3) – iterator of RGB888 images
  • nb_images (int) – The number of images indicated in the MNG header
  • fps (int) – The frame rate indicated in the MNG header
Returns:

An iterator of MNG chunks as bytes

ticklayout

This module implements labels layout on graph axes.

silx.gui.plot3d.utils.ticklayout.numberOfDigits(tickSpacing)[source]

Returns the number of digits to display for text label.

Parameters:tickSpacing (float) – Step between ticks in data space.
Returns:Number of digits to show for labels.
Return type:int
silx.gui.plot3d.utils.ticklayout.niceNumbers(vMin, vMax, nTicks=5)[source]

Returns tick positions.

This function implements graph labels layout using nice numbers by Paul Heckbert from “Graphics Gems”, Academic Press, 1990. See C code.

Parameters:
  • vMin (float) – The min value on the axis
  • vMax (float) – The max value on the axis
  • nTicks (int) – The number of ticks to position
Returns:

min, max, increment value of tick positions and number of fractional digit to show

Return type:

tuple

silx.gui.plot3d.utils.ticklayout.ticks(vMin, vMax, nbTicks=5)[source]

Returns tick positions and labels using nice numbers algorithm.

This enforces ticks to be within [vMin, vMax] range. It returns at least 2 ticks.

Parameters:
  • vMin (float) – The min value on the axis
  • vMax (float) – The max value on the axis
  • nbTicks (int) – The number of ticks to position
Returns:

tick positions and corresponding text labels

Return type:

2-tuple: list of float, list of string

silx.gui.plot3d.utils.ticklayout.niceNumbersAdaptative(vMin, vMax, axisLength, tickDensity)[source]

Returns tick positions using niceNumbers() and a density of ticks.

axisLength and tickDensity are based on the same unit (e.g., pixel).

Parameters:
  • vMin (float) – The min value on the axis
  • vMax (float) – The max value on the axis
  • axisLength (float) – The length of the axis.
  • tickDensity (float) – The density of ticks along the axis.
Returns:

min, max, increment value of tick positions and number of fractional digit to show

Return type:

tuple

silx.gui.plot3d.utils.ticklayout.niceNumbersForLog10(minLog, maxLog, nTicks=5)[source]

Return tick positions for logarithmic scale

Parameters:
  • minLog (float) – log10 of the min value on the axis
  • maxLog (float) – log10 of the max value on the axis
  • nTicks (int) – The number of ticks to position
Returns:

log10 of min, max and increment value of tick positions

Return type:

tuple of int

Table Of Contents

Previous topic

scene

Next topic

_font

This Page