prop_to_size#
- graph_tool.draw.prop_to_size(prop, mi=0, ma=5, log=False, power=0.5)[source]#
Convert property map values to be more useful as a vertex size, or edge width. The new values are taken to be
\[y_i = mi + (ma - mi) \left(\frac{x_i - \min(x)} {\max(x) - \min(x)}\right)^\text{power}\]If
log=True, \(x_i\) is replaced with \(\ln(x_i)\).If \(\max(x) - \min(x)\) is zero, \(y_i = mi\).
- Parameters:
- prop
PropertyMap Scalar property map with the values to be converted.
- mifloat (optional, default:
0) Minimum output value.
- mafloat (optional, default:
5) Maximum output value.
- logbool (optional, default:
False) If
True, the logarithm of the values is used.- powerfloat (optional, default:
0.5) Exponent applied to the normalized values.
- prop
- Returns:
- prop
PropertyMap Property map of type
doublewith the converted values.
- prop