diff --git a/docs/f-23f/scale_lablim.ipynb b/docs/f-23f/scale_lablim.ipynb
new file mode 100644
index 00000000000..192f588cea7
--- /dev/null
+++ b/docs/f-23f/scale_lablim.ipynb
@@ -0,0 +1,314 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "d13bb6d9-afd1-4f5d-90ed-83892a0ed8d2",
+ "metadata": {},
+ "source": [
+ "## `lablim` parameter to control the length of scale labels.\n",
+ "With this parameter each scale can be configured independently. Note that this parameter doesn't affect tooltip content. "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "96bdba02-7084-4a95-a363-bfaf2fdc00f6",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ " \n",
+ " \n",
+ " "
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
+ "source": [
+ "from lets_plot import *\n",
+ "LetsPlot.setup_html()"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "40f63905-9c3f-4593-9795-b8667d1daf91",
+ "metadata": {},
+ "source": [
+ "#### By default lets-plot now displays labels without any modification:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "89f7671f-5e1f-4830-b5f8-dee8e5142c4b",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "
\n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "data = {\n",
+ " 'x': ['ABCDEFGHIJKLMNOPQRSTUVWXYZ', '1234567890']\n",
+ "}\n",
+ "\n",
+ "p = ggplot(data, aes(x='x', color='x')) \\\n",
+ " + geom_point() \\\n",
+ " + geom_text(aes(label='x'))\n",
+ "p"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "cf8daa5e-0887-4353-a18f-129b66916de9",
+ "metadata": {},
+ "source": [
+ "#### Each scale has its own `lablim`:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "1235d88c-0ca4-424f-93d6-54e8d36086b2",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "p \\\n",
+ " + scale_x_discrete(lablim=5) \\\n",
+ " + scale_color_hue(lablim=10)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "23bd0079-7398-4684-a556-30cd92db8562",
+ "metadata": {},
+ "source": [
+ "#### Tooltips are not affected by `lablim`:"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "3032a387-8e1a-424b-b9ca-69cb9e41c893",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ " \n",
+ " "
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "ggplot(data, aes(x='x', color='x')) \\\n",
+ " + geom_point(tooltips=layer_tooltips().line(\"^x\")) \\\n",
+ " + geom_text(aes(label='x')) \\\n",
+ " + scale_x_discrete(lablim=10) \\\n",
+ " + scale_color_hue(lablim=5)"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3 (ipykernel)",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.8.15"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/future_changes.md b/future_changes.md
index 77411dde9af..5665368097a 100644
--- a/future_changes.md
+++ b/future_changes.md
@@ -13,6 +13,11 @@
See: [example notebook](https://nbviewer.jupyter.org/github/JetBrains/lets-plot/blob/master/docs/f-23f/scale_params_with_dict.ipynb).
+- The `lablim` parameter for `scale_xxx()` functions [[#939](https://github.com/JetBrains/lets-plot/issues/939), [#946](https://github.com/JetBrains/lets-plot/issues/946)].
+
+ See: [example notebook](https://nbviewer.jupyter.org/github/JetBrains/lets-plot/blob/master/docs/f-23f/scale_lablim.ipynb).
+
+
### Changed
- The `plot_margin` parameter in `theme()` and the `margin` parameter in `element_text()` accept a number or a list of numbers:
diff --git a/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/Scale.kt b/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/Scale.kt
index b1f93b8333e..6d8f432ada4 100644
--- a/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/Scale.kt
+++ b/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/Scale.kt
@@ -32,6 +32,9 @@ interface Scale {
fun getScaleBreaks(): ScaleBreaks
+ // For axis and legend (truncated labels). For tooltips the getScaleBreaks functions should be used (full labels).
+ fun getShortenedScaleBreaks(): ScaleBreaks
+
fun with(): Builder
interface Builder {
@@ -41,6 +44,8 @@ interface Scale {
fun labels(l: List): Builder
+ fun labelWidthLimit(v: Int): Builder
+
fun labelFormatter(v: (Any) -> String): Builder
fun multiplicativeExpand(v: Double): Builder
diff --git a/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/scale/AbstractScale.kt b/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/scale/AbstractScale.kt
index 61fd1c7dadd..f74418a7f38 100644
--- a/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/scale/AbstractScale.kt
+++ b/plot-base/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/base/scale/AbstractScale.kt
@@ -11,6 +11,7 @@ internal abstract class AbstractScale : Scale {
private val definedBreaks: List?
private val definedLabels: List?
+ private val labelWidthLimit: Int
final override val name: String
@@ -23,6 +24,7 @@ internal abstract class AbstractScale : Scale {
protected constructor(name: String, breaks: List? = null) {
this.name = name
this.definedBreaks = breaks
+ labelWidthLimit = 0
definedLabels = null
labelFormatter = null
}
@@ -31,6 +33,7 @@ internal abstract class AbstractScale : Scale {
name = b.myName
definedBreaks = b.myBreaks
definedLabels = b.myLabels
+ labelWidthLimit = b.myLabelWidthLimit
labelFormatter = b.myLabelFormatter
multiplicativeExpand = b.myMultiplicativeExpand
@@ -54,12 +57,20 @@ internal abstract class AbstractScale : Scale {
}
override fun getScaleBreaks(): ScaleBreaks {
+ return createScaleBreaks(shortenLabels = false)
+ }
+
+ override fun getShortenedScaleBreaks(): ScaleBreaks {
+ return createScaleBreaks(shortenLabels = true)
+ }
+
+ private fun createScaleBreaks(shortenLabels: Boolean): ScaleBreaks {
if (!hasBreaks()) {
return ScaleBreaks.EMPTY
}
val breakValuesIntern = getBreaksIntern()
- val labels = getLabels(breakValuesIntern)
+ val labels = getLabels(breakValuesIntern).map { if (shortenLabels) shorten(it) else it }
val transformCore = transform.unwrap() // make sure 'original' transform is used.
val transformed = ScaleUtil.applyTransform(breakValuesIntern, transformCore)
@@ -77,6 +88,14 @@ internal abstract class AbstractScale : Scale {
)
}
+ private fun shorten(str: String): String {
+ return if (labelWidthLimit > 0 && str.length > labelWidthLimit) {
+ str.substring(0, labelWidthLimit) + "..."
+ } else {
+ str
+ }
+ }
+
private fun getLabels(breaks: List): List {
if (definedLabels != null) {
val labels = getLabelsIntern()
@@ -97,6 +116,7 @@ internal abstract class AbstractScale : Scale {
internal var myBreaks: List? = scale.definedBreaks
internal var myLabels: List? = scale.definedLabels
+ internal var myLabelWidthLimit: Int = scale.labelWidthLimit
internal var myLabelFormatter: ((Any) -> String)? = scale.labelFormatter
internal var myMultiplicativeExpand: Double = scale.multiplicativeExpand
@@ -120,6 +140,11 @@ internal abstract class AbstractScale : Scale {
return this
}
+ override fun labelWidthLimit(v: Int): Scale.Builder {
+ myLabelWidthLimit = v
+ return this
+ }
+
override fun labelFormatter(v: (Any) -> String): Scale.Builder {
myLabelFormatter = v
return this
diff --git a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/BogusScale.kt b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/BogusScale.kt
index 70603dc4758..07baee58b3c 100644
--- a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/BogusScale.kt
+++ b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/BogusScale.kt
@@ -40,6 +40,10 @@ internal class BogusScale : Scale {
throw IllegalStateException("Bogus scale is not supposed to be used.")
}
+ override fun getShortenedScaleBreaks(): ScaleBreaks {
+ throw IllegalStateException("Bogus scale is not supposed to be used.")
+ }
+
override fun getBreaksGenerator(): BreaksGenerator {
throw IllegalStateException("Bogus scale is not supposed to be used.")
}
diff --git a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/assemble/LegendAssembler.kt b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/assemble/LegendAssembler.kt
index f23a9fb6bf9..3c58fa06006 100644
--- a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/assemble/LegendAssembler.kt
+++ b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/assemble/LegendAssembler.kt
@@ -143,7 +143,7 @@ class LegendAssembler(
}
check(scale.hasBreaks()) { "No breaks were defined for scale $aes" }
- val scaleBreaks = scale.getScaleBreaks()
+ val scaleBreaks = scale.getShortenedScaleBreaks()
val aesValues = scaleBreaks.transformedValues.map {
scaleMappers.getValue(aes)(it) as Any // Don't expect nulls.
}
diff --git a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisBreaksProviderFactory.kt b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisBreaksProviderFactory.kt
index 7493008a178..b18f7759e81 100644
--- a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisBreaksProviderFactory.kt
+++ b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisBreaksProviderFactory.kt
@@ -15,7 +15,7 @@ abstract class AxisBreaksProviderFactory {
companion object {
fun forScale(scale: Scale): AxisBreaksProviderFactory {
return if (scale.hasBreaks()) {
- FixedBreaksProviderFactory(FixedAxisBreaksProvider(scale.getScaleBreaks()))
+ FixedBreaksProviderFactory(FixedAxisBreaksProvider(scale.getShortenedScaleBreaks()))
} else {
AdaptableBreaksProviderFactory(scale.getBreaksGenerator())
}
diff --git a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisLayouter.kt b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisLayouter.kt
index e90346d0c14..c748bd43e8c 100644
--- a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisLayouter.kt
+++ b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/layout/axis/AxisLayouter.kt
@@ -8,14 +8,16 @@ package org.jetbrains.letsPlot.core.plot.builder.layout.axis
import org.jetbrains.letsPlot.commons.interval.DoubleSpan
import org.jetbrains.letsPlot.core.plot.base.ScaleMapper
import org.jetbrains.letsPlot.core.plot.base.scale.Mappers
-import org.jetbrains.letsPlot.core.plot.base.scale.ScaleBreaks
import org.jetbrains.letsPlot.core.plot.base.theme.AxisTheme
import org.jetbrains.letsPlot.core.plot.builder.guide.Orientation
import org.jetbrains.letsPlot.core.plot.builder.layout.AxisLayoutInfo
import org.jetbrains.letsPlot.core.plot.builder.layout.axis.label.AxisLabelsLayout
+import org.jetbrains.letsPlot.core.plot.builder.layout.axis.label.AxisLabelsLayout.Companion.horizontalFixedBreaks
+import org.jetbrains.letsPlot.core.plot.builder.layout.axis.label.AxisLabelsLayout.Companion.horizontalFlexBreaks
+import org.jetbrains.letsPlot.core.plot.builder.layout.axis.label.AxisLabelsLayout.Companion.verticalFixedBreaks
+import org.jetbrains.letsPlot.core.plot.builder.layout.axis.label.AxisLabelsLayout.Companion.verticalFlexBreaks
import org.jetbrains.letsPlot.core.plot.builder.layout.axis.label.BreakLabelsLayoutUtil
import org.jetbrains.letsPlot.core.plot.builder.layout.util.Insets
-import org.jetbrains.letsPlot.core.plot.builder.presentation.Defaults.Common.Axis
internal abstract class AxisLayouter(
val orientation: Orientation,
@@ -62,51 +64,22 @@ internal abstract class AxisLayouter(
geomAreaInsets: Insets,
theme: AxisTheme
): AxisLayouter {
-
- if (orientation.isHorizontal) {
- val labelsLayout: AxisLabelsLayout = if (breaksProvider.isFixedBreaks) {
- val trimmedScaleBreaks = with(breaksProvider.fixedBreaks) {
- ScaleBreaks(domainValues, transformedValues, labels.map(::trimLongValues))
+ val labelsLayout =
+ if (breaksProvider.isFixedBreaks) {
+ if (orientation.isHorizontal) {
+ horizontalFixedBreaks(orientation, axisDomain, breaksProvider.fixedBreaks, geomAreaInsets, theme)
+ } else {
+ verticalFixedBreaks(orientation, axisDomain, breaksProvider.fixedBreaks, theme)
}
- AxisLabelsLayout.horizontalFixedBreaks(
- orientation,
- axisDomain,
- trimmedScaleBreaks,
- geomAreaInsets,
- theme
- )
} else {
- AxisLabelsLayout.horizontalFlexBreaks(orientation, axisDomain, breaksProvider, theme)
- }
- return HorizontalAxisLayouter(
- orientation,
- axisDomain,
- labelsLayout
- )
- }
-
- // vertical
- val labelsLayout: AxisLabelsLayout = if (breaksProvider.isFixedBreaks) {
- val trimmedScaleBreaks = with(breaksProvider.fixedBreaks) {
- ScaleBreaks(domainValues, transformedValues, labels.map(::trimLongValues))
+ if (orientation.isHorizontal) {
+ horizontalFlexBreaks(orientation, axisDomain, breaksProvider, theme)
+ } else {
+ verticalFlexBreaks(orientation, axisDomain, breaksProvider, theme)
+ }
}
- AxisLabelsLayout.verticalFixedBreaks(orientation, axisDomain, trimmedScaleBreaks, theme)
- } else {
- AxisLabelsLayout.verticalFlexBreaks(orientation, axisDomain, breaksProvider, theme)
- }
- return VerticalAxisLayouter(
- orientation,
- axisDomain,
- labelsLayout
- )
- }
- private fun trimLongValues(text: String): String {
- return if (text.length <= Axis.LABEL_MAX_LENGTH) {
- text
- } else {
- text.take(Axis.LABEL_MAX_LENGTH) + ".."
- }
+ return VerticalAxisLayouter(orientation, axisDomain, labelsLayout)
}
}
}
diff --git a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/scale/ScaleProviderBuilder.kt b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/scale/ScaleProviderBuilder.kt
index 8623f497383..2617be927c3 100644
--- a/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/scale/ScaleProviderBuilder.kt
+++ b/plot-builder/src/commonMain/kotlin/org/jetbrains/letsPlot/core/plot/builder/scale/ScaleProviderBuilder.kt
@@ -17,6 +17,7 @@ class ScaleProviderBuilder constructor(private val aes: Aes) {
private var myName: String? = null
private var myBreaks: List? = null
private var myLabels: List? = null
+ private var myLabelWidthLimit: Int? = null
private var myLabelFormat: String? = null
private var myMultiplicativeExpand: Double? = null
private var myAdditiveExpand: Double? = null
@@ -56,6 +57,11 @@ class ScaleProviderBuilder constructor(private val aes: Aes) {
return this
}
+ fun labelWidthLimit(v: Int): ScaleProviderBuilder {
+ myLabelWidthLimit = v
+ return this
+ }
+
fun labelFormat(format: String?): ScaleProviderBuilder {
myLabelFormat = format
return this
@@ -129,6 +135,7 @@ class ScaleProviderBuilder constructor(private val aes: Aes) {
private val myName: String? = b.myName
private val myLabels: List? = b.myLabels?.let { ArrayList(it) }
+ private val myLabelWidthLimit: Int? = b.myLabelWidthLimit
private val myLabelFormat: String? = b.myLabelFormat
private val myMultiplicativeExpand: Double? = b.myMultiplicativeExpand
private val myAdditiveExpand: Double? = b.myAdditiveExpand
@@ -216,6 +223,9 @@ class ScaleProviderBuilder constructor(private val aes: Aes) {
if (myLabels != null) {
with.labels(myLabels)
}
+ if (myLabelWidthLimit != null) {
+ with.labelWidthLimit(myLabelWidthLimit)
+ }
if (myLabelFormat != null) {
with.labelFormatter(StringFormat.forOneArg(myLabelFormat)::format)
}
diff --git a/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/Option.kt b/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/Option.kt
index da1cac09e63..3327145fc3d 100644
--- a/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/Option.kt
+++ b/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/Option.kt
@@ -499,6 +499,7 @@ object Option {
const val AES = "aesthetic"
const val BREAKS = "breaks"
const val LABELS = "labels"
+ const val LABLIM = "lablim"
const val EXPAND = "expand"
const val LIMITS = "limits"
const val DISCRETE_DOMAIN = "discrete"
diff --git a/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/config/ScaleConfig.kt b/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/config/ScaleConfig.kt
index 185fbbfc546..a119f2f22d9 100644
--- a/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/config/ScaleConfig.kt
+++ b/plot-stem/src/commonMain/kotlin/org/jetbrains/letsPlot/core/spec/config/ScaleConfig.kt
@@ -30,6 +30,7 @@ import org.jetbrains.letsPlot.core.spec.Option.Scale.GUIDE
import org.jetbrains.letsPlot.core.spec.Option.Scale.HIGH
import org.jetbrains.letsPlot.core.spec.Option.Scale.HUE_RANGE
import org.jetbrains.letsPlot.core.spec.Option.Scale.LABELS
+import org.jetbrains.letsPlot.core.spec.Option.Scale.LABLIM
import org.jetbrains.letsPlot.core.spec.Option.Scale.LIMITS
import org.jetbrains.letsPlot.core.spec.Option.Scale.LOW
import org.jetbrains.letsPlot.core.spec.Option.Scale.LUMINANCE
@@ -251,24 +252,31 @@ class ScaleConfig constructor(
if (has(NAME)) {
b.name(getString(NAME)!!)
}
+
if (has(BREAKS)) {
b.breaks(getList(BREAKS).mapNotNull { it })
}
+
if (has(LABELS)) {
b.labels(getStringList(LABELS))
} else {
// Skip format is labels are defined
b.labelFormat(getString(FORMAT))
}
+
+ if (has(LABLIM)) {
+ b.labelWidthLimit(getInteger(LABLIM)!!)
+ }
+
if (has(EXPAND)) {
- val list = getList(EXPAND)
- if (list.isNotEmpty()) {
- val multiplicativeExpand = list[0] as Number
- b.multiplicativeExpand(multiplicativeExpand.toDouble())
- if (list.size > 1) {
- val additiveExpand = list[1] as Number
- b.additiveExpand(additiveExpand.toDouble())
- }
+ val expandList = getDoubleList(EXPAND)
+
+ expandList.getOrNull(0)?.let {
+ b.multiplicativeExpand(it)
+ }
+
+ expandList.getOrNull(1)?.let {
+ b.additiveExpand(it)
}
}
if (has(LIMITS)) {
diff --git a/python-package/lets_plot/plot/scale.py b/python-package/lets_plot/plot/scale.py
index 8d97db35be9..27883bd3b7d 100644
--- a/python-package/lets_plot/plot/scale.py
+++ b/python-package/lets_plot/plot/scale.py
@@ -25,7 +25,7 @@
]
-def scale_shape(solid=True, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, format=None):
+def scale_shape(solid=True, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, format=None):
"""
Scale for shapes.
@@ -39,6 +39,8 @@ def scale_shape(solid=True, name=None, breaks=None, labels=None, limits=None, na
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -86,6 +88,7 @@ def scale_shape(solid=True, name=None, breaks=None, labels=None, limits=None, na
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -101,7 +104,7 @@ def scale_shape(solid=True, name=None, breaks=None, labels=None, limits=None, na
#
def scale_manual(aesthetic, values, *,
- name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, format=None):
+ name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, format=None):
"""
Create your own discrete scale for the specified aesthetics.
@@ -121,6 +124,8 @@ def scale_manual(aesthetic, values, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -185,6 +190,7 @@ def scale_manual(aesthetic, values, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -195,7 +201,7 @@ def scale_manual(aesthetic, values, *,
values=values)
-def scale_color_manual(values, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None,
+def scale_color_manual(values, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None,
format=None):
"""
Create your own discrete scale for `color` aesthetic.
@@ -214,6 +220,8 @@ def scale_color_manual(values, name=None, breaks=None, labels=None, limits=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -262,13 +270,14 @@ def scale_color_manual(values, name=None, breaks=None, labels=None, limits=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_fill_manual(values, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, format=None):
+def scale_fill_manual(values, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, format=None):
"""
Create your own discrete scale for `fill` aesthetic.
@@ -286,6 +295,8 @@ def scale_fill_manual(values, name=None, breaks=None, labels=None, limits=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -334,13 +345,14 @@ def scale_fill_manual(values, name=None, breaks=None, labels=None, limits=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_size_manual(values, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, format=None):
+def scale_size_manual(values, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, format=None):
"""
Create your own discrete scale for `size` aesthetic.
@@ -358,6 +370,8 @@ def scale_size_manual(values, name=None, breaks=None, labels=None, limits=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -405,13 +419,14 @@ def scale_size_manual(values, name=None, breaks=None, labels=None, limits=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_shape_manual(values, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None,
+def scale_shape_manual(values, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None,
format=None):
"""
Create your own discrete scale for `shape` aesthetic.
@@ -430,6 +445,8 @@ def scale_shape_manual(values, name=None, breaks=None, labels=None, limits=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -477,13 +494,14 @@ def scale_shape_manual(values, name=None, breaks=None, labels=None, limits=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_linetype_manual(values, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None,
+def scale_linetype_manual(values, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None,
format=None):
"""
Create your own discrete scale for line type aesthetic.
@@ -502,6 +520,8 @@ def scale_linetype_manual(values, name=None, breaks=None, labels=None, limits=No
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -550,13 +570,14 @@ def scale_linetype_manual(values, name=None, breaks=None, labels=None, limits=No
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_alpha_manual(values, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None,
+def scale_alpha_manual(values, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None,
format=None):
"""
Create your own discrete scale for `alpha` (transparency) aesthetic.
@@ -575,6 +596,8 @@ def scale_alpha_manual(values, name=None, breaks=None, labels=None, limits=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -621,6 +644,7 @@ def scale_alpha_manual(values, name=None, breaks=None, labels=None, limits=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -631,7 +655,7 @@ def scale_alpha_manual(values, name=None, breaks=None, labels=None, limits=None,
# Gradient (continuous) Color Scales
#
def scale_continuous(aesthetic, *,
- low=None, high=None, name=None, breaks=None, labels=None,
+ low=None, high=None, name=None, breaks=None, labels=None, lablim=None,
limits=None, na_value=None, guide=None, trans=None, format=None):
"""
General purpose scale for continuous data.
@@ -653,6 +677,8 @@ def scale_continuous(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
na_value
@@ -701,6 +727,7 @@ def scale_continuous(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -713,7 +740,7 @@ def scale_continuous(aesthetic, *,
def scale_gradient(aesthetic, *,
- low=None, high=None, name=None, breaks=None, labels=None,
+ low=None, high=None, name=None, breaks=None, labels=None, lablim=None,
limits=None, na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between two colors for the specified aesthetics.
@@ -734,6 +761,8 @@ def scale_gradient(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -786,6 +815,7 @@ def scale_gradient(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -793,7 +823,7 @@ def scale_gradient(aesthetic, *,
format=format)
-def scale_fill_gradient(low=None, high=None, name=None, breaks=None, labels=None,
+def scale_fill_gradient(low=None, high=None, name=None, breaks=None, labels=None, lablim=None,
limits=None, na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between two colors for `fill` aesthetic.
@@ -812,6 +842,8 @@ def scale_fill_gradient(low=None, high=None, name=None, breaks=None, labels=None
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -863,6 +895,7 @@ def scale_fill_gradient(low=None, high=None, name=None, breaks=None, labels=None
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -870,7 +903,7 @@ def scale_fill_gradient(low=None, high=None, name=None, breaks=None, labels=None
format=format)
-def scale_fill_continuous(low=None, high=None, name=None, breaks=None, labels=None,
+def scale_fill_continuous(low=None, high=None, name=None, breaks=None, labels=None, lablim=None,
limits=None, na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between two colors for `fill` aesthetic.
@@ -889,6 +922,8 @@ def scale_fill_continuous(low=None, high=None, name=None, breaks=None, labels=No
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
na_value
@@ -938,6 +973,7 @@ def scale_fill_continuous(low=None, high=None, name=None, breaks=None, labels=No
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -945,7 +981,7 @@ def scale_fill_continuous(low=None, high=None, name=None, breaks=None, labels=No
format=format)
-def scale_color_gradient(low=None, high=None, name=None, breaks=None, labels=None, limits=None,
+def scale_color_gradient(low=None, high=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between two colors for `color` aesthetic.
@@ -964,6 +1000,8 @@ def scale_color_gradient(low=None, high=None, name=None, breaks=None, labels=Non
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1015,6 +1053,7 @@ def scale_color_gradient(low=None, high=None, name=None, breaks=None, labels=Non
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1022,7 +1061,7 @@ def scale_color_gradient(low=None, high=None, name=None, breaks=None, labels=Non
format=format)
-def scale_color_continuous(low=None, high=None, name=None, breaks=None, labels=None, limits=None,
+def scale_color_continuous(low=None, high=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between two colors for `color` aesthetic.
@@ -1041,6 +1080,8 @@ def scale_color_continuous(low=None, high=None, name=None, breaks=None, labels=N
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
na_value
@@ -1084,6 +1125,7 @@ def scale_color_continuous(low=None, high=None, name=None, breaks=None, labels=N
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1092,7 +1134,7 @@ def scale_color_continuous(low=None, high=None, name=None, breaks=None, labels=N
def scale_gradient2(aesthetic, *,
- low=None, mid=None, high=None, midpoint=0, name=None, breaks=None, labels=None, limits=None,
+ low=None, mid=None, high=None, midpoint=0, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Define diverging color gradient for the specified aesthetics.
@@ -1117,6 +1159,8 @@ def scale_gradient2(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1167,6 +1211,7 @@ def scale_gradient2(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -1179,7 +1224,7 @@ def scale_gradient2(aesthetic, *,
scale_mapper_kind='color_gradient2')
-def scale_fill_gradient2(low=None, mid=None, high=None, midpoint=0, name=None, breaks=None, labels=None, limits=None,
+def scale_fill_gradient2(low=None, mid=None, high=None, midpoint=0, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Define diverging color gradient for `fill` aesthetic.
@@ -1202,6 +1247,8 @@ def scale_fill_gradient2(low=None, mid=None, high=None, midpoint=0, name=None, b
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1254,6 +1301,7 @@ def scale_fill_gradient2(low=None, mid=None, high=None, midpoint=0, name=None, b
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1261,8 +1309,8 @@ def scale_fill_gradient2(low=None, mid=None, high=None, midpoint=0, name=None, b
format=format)
-def scale_color_gradient2(low=None, mid=None, high=None, midpoint=0, name=None, breaks=None, labels=None, limits=None,
- na_value=None, guide=None, trans=None, format=None):
+def scale_color_gradient2(low=None, mid=None, high=None, midpoint=0, name=None, breaks=None, labels=None, lablim=None,
+ limits=None, na_value=None, guide=None, trans=None, format=None):
"""
Define diverging color gradient for `color` aesthetic.
@@ -1284,6 +1332,8 @@ def scale_color_gradient2(low=None, mid=None, high=None, midpoint=0, name=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1336,6 +1386,7 @@ def scale_color_gradient2(low=None, mid=None, high=None, midpoint=0, name=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1344,7 +1395,7 @@ def scale_color_gradient2(low=None, mid=None, high=None, midpoint=0, name=None,
def scale_gradientn(aesthetic, *,
- colors=None, name=None, breaks=None, labels=None, limits=None,
+ colors=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between multiple colors for the specified aesthetics.
@@ -1367,6 +1418,8 @@ def scale_gradientn(aesthetic, *,
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
and the default order of their display in guides.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
na_value
Missing values will be replaced with this value.
guide
@@ -1414,6 +1467,7 @@ def scale_gradientn(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -1425,7 +1479,7 @@ def scale_gradientn(aesthetic, *,
scale_mapper_kind='color_gradientn')
-def scale_color_gradientn(colors=None, name=None, breaks=None, labels=None, limits=None,
+def scale_color_gradientn(colors=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between multiple colors for `color` aesthetic.
@@ -1442,6 +1496,8 @@ def scale_color_gradientn(colors=None, name=None, breaks=None, labels=None, limi
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1494,6 +1550,7 @@ def scale_color_gradientn(colors=None, name=None, breaks=None, labels=None, limi
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1501,7 +1558,7 @@ def scale_color_gradientn(colors=None, name=None, breaks=None, labels=None, limi
format=format)
-def scale_fill_gradientn(colors=None, name=None, breaks=None, labels=None, limits=None,
+def scale_fill_gradientn(colors=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Define smooth color gradient between multiple colors for `fill` aesthetic.
@@ -1518,6 +1575,8 @@ def scale_fill_gradientn(colors=None, name=None, breaks=None, labels=None, limit
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1570,6 +1629,7 @@ def scale_fill_gradientn(colors=None, name=None, breaks=None, labels=None, limit
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1578,7 +1638,7 @@ def scale_fill_gradientn(colors=None, name=None, breaks=None, labels=None, limit
def scale_hue(aesthetic, *,
- h=None, c=None, l=None, h_start=None, direction=None, name=None, breaks=None, labels=None,
+ h=None, c=None, l=None, h_start=None, direction=None, name=None, breaks=None, labels=None, lablim=None,
limits=None, na_value=None, guide=None, trans=None, format=None):
"""
Qualitative color scale with evenly spaced hues for the specified aesthetics.
@@ -1603,6 +1663,8 @@ def scale_hue(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1653,6 +1715,7 @@ def scale_hue(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -1665,7 +1728,7 @@ def scale_hue(aesthetic, *,
scale_mapper_kind='color_hue')
-def scale_fill_hue(h=None, c=None, l=None, h_start=None, direction=None, name=None, breaks=None, labels=None,
+def scale_fill_hue(h=None, c=None, l=None, h_start=None, direction=None, name=None, breaks=None, labels=None, lablim=None,
limits=None, na_value=None, guide=None, trans=None, format=None):
"""
Qualitative color scale with evenly spaced hues for `fill` aesthetic.
@@ -1690,6 +1753,8 @@ def scale_fill_hue(h=None, c=None, l=None, h_start=None, direction=None, name=No
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1743,6 +1808,7 @@ def scale_fill_hue(h=None, c=None, l=None, h_start=None, direction=None, name=No
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1750,7 +1816,7 @@ def scale_fill_hue(h=None, c=None, l=None, h_start=None, direction=None, name=No
format=format)
-def scale_color_hue(h=None, c=None, l=None, h_start=None, direction=None, name=None, breaks=None, labels=None,
+def scale_color_hue(h=None, c=None, l=None, h_start=None, direction=None, name=None, breaks=None, labels=None, lablim=None,
limits=None, na_value=None, guide=None, trans=None, format=None):
"""
Qualitative color scale with evenly spaced hues for `color` aesthetic.
@@ -1773,6 +1839,8 @@ def scale_color_hue(h=None, c=None, l=None, h_start=None, direction=None, name=N
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -1826,6 +1894,7 @@ def scale_color_hue(h=None, c=None, l=None, h_start=None, direction=None, name=N
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -1835,7 +1904,7 @@ def scale_color_hue(h=None, c=None, l=None, h_start=None, direction=None, name=N
def scale_discrete(aesthetic, *,
direction=None,
- name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, format=None):
+ name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, format=None):
"""
General purpose scale for discrete data.
Use it to adjust most common properties of a default scale for given aesthetic.
@@ -1855,6 +1924,8 @@ def scale_discrete(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -1904,6 +1975,7 @@ def scale_discrete(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -1915,7 +1987,7 @@ def scale_discrete(aesthetic, *,
def scale_fill_discrete(direction=None,
- name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, format=None):
+ name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, format=None):
"""
Qualitative colors.
Defaults to the Brewer 'Set2' palette (or 'Set3' if the categories count > 8).
@@ -1933,6 +2005,8 @@ def scale_fill_discrete(direction=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -1990,7 +2064,7 @@ def scale_fill_discrete(direction=None,
def scale_color_discrete(direction=None,
- name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, format=None):
+ name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, format=None):
"""
Qualitative colors.
Defaults to the Brewer 'Set2' palette (or 'Set3' if the categories count > 8).
@@ -2008,6 +2082,8 @@ def scale_color_discrete(direction=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -2058,6 +2134,7 @@ def scale_color_discrete(direction=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -2065,7 +2142,7 @@ def scale_color_discrete(direction=None,
def scale_grey(aesthetic, *,
- start=None, end=None, name=None, breaks=None, labels=None, limits=None,
+ start=None, end=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Sequential grey color scale for the specified aesthetics.
@@ -2086,6 +2163,8 @@ def scale_grey(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2138,6 +2217,7 @@ def scale_grey(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -2149,7 +2229,7 @@ def scale_grey(aesthetic, *,
scale_mapper_kind='color_grey')
-def scale_fill_grey(start=None, end=None, name=None, breaks=None, labels=None, limits=None,
+def scale_fill_grey(start=None, end=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Sequential grey color scale for `fill` aesthetic.
@@ -2168,6 +2248,8 @@ def scale_fill_grey(start=None, end=None, name=None, breaks=None, labels=None, l
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2219,6 +2301,7 @@ def scale_fill_grey(start=None, end=None, name=None, breaks=None, labels=None, l
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -2226,7 +2309,7 @@ def scale_fill_grey(start=None, end=None, name=None, breaks=None, labels=None, l
format=format)
-def scale_color_grey(start=None, end=None, name=None, breaks=None, labels=None, limits=None,
+def scale_color_grey(start=None, end=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Sequential grey color scale for `color` aesthetic.
@@ -2245,6 +2328,8 @@ def scale_color_grey(start=None, end=None, name=None, breaks=None, labels=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2296,6 +2381,7 @@ def scale_color_grey(start=None, end=None, name=None, breaks=None, labels=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -2324,7 +2410,7 @@ def _greyscale_check_parameters(start=None, end=None):
def scale_brewer(aesthetic, *,
- type=None, palette=None, direction=None, name=None, breaks=None, labels=None, limits=None,
+ type=None, palette=None, direction=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Sequential, diverging and qualitative color scales from colorbrewer2.org for the specified aesthetics.
@@ -2350,6 +2436,8 @@ def scale_brewer(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2413,6 +2501,7 @@ def scale_brewer(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -2426,7 +2515,7 @@ def scale_brewer(aesthetic, *,
scale_mapper_kind='color_brewer')
-def scale_fill_brewer(type=None, palette=None, direction=None, name=None, breaks=None, labels=None, limits=None,
+def scale_fill_brewer(type=None, palette=None, direction=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Sequential, diverging and qualitative color scales from colorbrewer2.org for `fill` aesthetic.
@@ -2450,6 +2539,8 @@ def scale_fill_brewer(type=None, palette=None, direction=None, name=None, breaks
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2516,6 +2607,7 @@ def scale_fill_brewer(type=None, palette=None, direction=None, name=None, breaks
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -2523,7 +2615,7 @@ def scale_fill_brewer(type=None, palette=None, direction=None, name=None, breaks
format=format)
-def scale_color_brewer(type=None, palette=None, direction=None, name=None, breaks=None, labels=None, limits=None,
+def scale_color_brewer(type=None, palette=None, direction=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Sequential, diverging and qualitative color scales from colorbrewer2.org for `color` aesthetic.
@@ -2547,6 +2639,8 @@ def scale_color_brewer(type=None, palette=None, direction=None, name=None, break
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2611,6 +2705,7 @@ def scale_color_brewer(type=None, palette=None, direction=None, name=None, break
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -2620,7 +2715,7 @@ def scale_color_brewer(type=None, palette=None, direction=None, name=None, break
def scale_viridis(aesthetic, *,
alpha=None, begin=None, end=None, direction=None, option=None,
- name=None, breaks=None, labels=None, limits=None,
+ name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
The `viridis` color maps are designed to be perceptually-uniform,
@@ -2661,6 +2756,8 @@ def scale_viridis(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2712,6 +2809,7 @@ def scale_viridis(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -2728,7 +2826,7 @@ def scale_viridis(aesthetic, *,
def scale_fill_viridis(alpha=None, begin=None, end=None, direction=None, option=None,
- name=None, breaks=None, labels=None, limits=None,
+ name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
The `viridis` color maps are designed to be perceptually-uniform,
@@ -2767,6 +2865,8 @@ def scale_fill_viridis(alpha=None, begin=None, end=None, direction=None, option=
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2821,6 +2921,7 @@ def scale_fill_viridis(alpha=None, begin=None, end=None, direction=None, option=
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -2829,7 +2930,7 @@ def scale_fill_viridis(alpha=None, begin=None, end=None, direction=None, option=
def scale_color_viridis(alpha=None, begin=None, end=None, direction=None, option=None,
- name=None, breaks=None, labels=None, limits=None,
+ name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
The `viridis` color maps are designed to be perceptually-uniform,
@@ -2868,6 +2969,8 @@ def scale_color_viridis(alpha=None, begin=None, end=None, direction=None, option
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -2920,6 +3023,7 @@ def scale_color_viridis(alpha=None, begin=None, end=None, direction=None, option
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -2930,7 +3034,7 @@ def scale_color_viridis(alpha=None, begin=None, end=None, direction=None, option
# Range Scale (alpha and size)
#
-def scale_alpha(range=None, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, trans=None,
+def scale_alpha(range=None, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, trans=None,
format=None):
"""
Scale for alpha.
@@ -2947,6 +3051,8 @@ def scale_alpha(range=None, name=None, breaks=None, labels=None, limits=None, na
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -2991,6 +3097,7 @@ def scale_alpha(range=None, name=None, breaks=None, labels=None, limits=None, na
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -3001,7 +3108,7 @@ def scale_alpha(range=None, name=None, breaks=None, labels=None, limits=None, na
range=range)
-def scale_size(range=None, name=None, breaks=None, labels=None, limits=None, na_value=None, guide=None, trans=None,
+def scale_size(range=None, name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide=None, trans=None,
format=None):
"""
Scale for size.
@@ -3018,6 +3125,8 @@ def scale_size(range=None, name=None, breaks=None, labels=None, limits=None, na_
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -3063,6 +3172,7 @@ def scale_size(range=None, name=None, breaks=None, labels=None, limits=None, na_
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -3073,7 +3183,7 @@ def scale_size(range=None, name=None, breaks=None, labels=None, limits=None, na_
range=range)
-def scale_size_area(max_size=None, name=None, breaks=None, labels=None, limits=None,
+def scale_size_area(max_size=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Continuous scale for size that maps 0 to 0.
@@ -3090,6 +3200,8 @@ def scale_size_area(max_size=None, name=None, breaks=None, labels=None, limits=N
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -3139,6 +3251,7 @@ def scale_size_area(max_size=None, name=None, breaks=None, labels=None, limits=N
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -3150,7 +3263,7 @@ def scale_size_area(max_size=None, name=None, breaks=None, labels=None, limits=N
scale_mapper_kind='size_area')
-def scale_linewidth(range=None, name=None, breaks=None, labels=None, limits=None,
+def scale_linewidth(range=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Scale for linewidth.
@@ -3167,6 +3280,8 @@ def scale_linewidth(range=None, name=None, breaks=None, labels=None, limits=None
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -3211,6 +3326,7 @@ def scale_linewidth(range=None, name=None, breaks=None, labels=None, limits=None
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -3221,7 +3337,7 @@ def scale_linewidth(range=None, name=None, breaks=None, labels=None, limits=None
range=range)
-def scale_stroke(range=None, name=None, breaks=None, labels=None, limits=None,
+def scale_stroke(range=None, name=None, breaks=None, labels=None, lablim=None, limits=None,
na_value=None, guide=None, trans=None, format=None):
"""
Scale for stroke.
@@ -3238,6 +3354,8 @@ def scale_stroke(range=None, name=None, breaks=None, labels=None, limits=None,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale
and the default order of their display in guides.
@@ -3282,6 +3400,7 @@ def scale_stroke(range=None, name=None, breaks=None, labels=None, limits=None,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -3295,6 +3414,7 @@ def scale_stroke(range=None, name=None, breaks=None, labels=None, limits=None,
def _scale(aesthetic, *,
name=None,
breaks=None, labels=None,
+ lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -3316,6 +3436,8 @@ def _scale(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
diff --git a/python-package/lets_plot/plot/scale_identity_.py b/python-package/lets_plot/plot/scale_identity_.py
index 074480b72ff..1a21d78dabe 100644
--- a/python-package/lets_plot/plot/scale_identity_.py
+++ b/python-package/lets_plot/plot/scale_identity_.py
@@ -21,7 +21,7 @@
def scale_identity(aesthetic, *,
- name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None, **other):
+ name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None, **other):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that the library can handle directly.
@@ -37,6 +37,8 @@ def scale_identity(aesthetic, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -81,6 +83,7 @@ def scale_identity(aesthetic, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=None,
na_value=na_value,
@@ -92,7 +95,7 @@ def scale_identity(aesthetic, *,
**other)
-def scale_color_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_color_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that the library can handle directly.
@@ -106,6 +109,8 @@ def scale_color_identity(name=None, breaks=None, labels=None, limits=None, na_va
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -156,13 +161,14 @@ def scale_color_identity(name=None, breaks=None, labels=None, limits=None, na_va
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_fill_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_fill_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that the library can handle directly.
@@ -176,6 +182,8 @@ def scale_fill_identity(name=None, breaks=None, labels=None, limits=None, na_val
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -226,13 +234,14 @@ def scale_fill_identity(name=None, breaks=None, labels=None, limits=None, na_val
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_shape_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_shape_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that the library can handle directly.
@@ -246,6 +255,8 @@ def scale_shape_identity(name=None, breaks=None, labels=None, limits=None, na_va
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -293,6 +304,7 @@ def scale_shape_identity(name=None, breaks=None, labels=None, limits=None, na_va
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -302,7 +314,7 @@ def scale_shape_identity(name=None, breaks=None, labels=None, limits=None, na_va
discrete=True)
-def scale_linetype_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_linetype_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that the library can handle directly.
@@ -316,6 +328,8 @@ def scale_linetype_identity(name=None, breaks=None, labels=None, limits=None, na
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -367,6 +381,7 @@ def scale_linetype_identity(name=None, breaks=None, labels=None, limits=None, na
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
@@ -375,7 +390,7 @@ def scale_linetype_identity(name=None, breaks=None, labels=None, limits=None, na
discrete=True)
-def scale_alpha_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_alpha_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that the library can handle directly.
@@ -389,6 +404,8 @@ def scale_alpha_identity(name=None, breaks=None, labels=None, limits=None, na_va
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -436,13 +453,14 @@ def scale_alpha_identity(name=None, breaks=None, labels=None, limits=None, na_va
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_size_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_size_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that the library can handle directly.
@@ -456,6 +474,8 @@ def scale_size_identity(name=None, breaks=None, labels=None, limits=None, na_val
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -503,13 +523,14 @@ def scale_size_identity(name=None, breaks=None, labels=None, limits=None, na_val
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_linewidth_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_linewidth_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that can be handled directly.
@@ -523,6 +544,8 @@ def scale_linewidth_identity(name=None, breaks=None, labels=None, limits=None, n
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -568,13 +591,14 @@ def scale_linewidth_identity(name=None, breaks=None, labels=None, limits=None, n
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
format=format)
-def scale_stroke_identity(name=None, breaks=None, labels=None, limits=None, na_value=None, guide='none', format=None):
+def scale_stroke_identity(name=None, breaks=None, labels=None, lablim=None, limits=None, na_value=None, guide='none', format=None):
"""
Use this scale when your data has already been scaled.
I.e. it already represents aesthetic values that can be handled directly.
@@ -588,6 +612,8 @@ def scale_stroke_identity(name=None, breaks=None, labels=None, limits=None, na_v
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
Continuous scale: a numeric vector of length two providing limits of the scale.
Discrete scale: a vector specifying the data range for the scale
@@ -633,6 +659,7 @@ def scale_stroke_identity(name=None, breaks=None, labels=None, limits=None, na_v
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
na_value=na_value,
guide=guide,
diff --git a/python-package/lets_plot/plot/scale_position.py b/python-package/lets_plot/plot/scale_position.py
index 0921f0740ce..cc8190372fe 100644
--- a/python-package/lets_plot/plot/scale_position.py
+++ b/python-package/lets_plot/plot/scale_position.py
@@ -25,7 +25,7 @@
#
def scale_x_continuous(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -46,6 +46,8 @@ def scale_x_continuous(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -95,6 +97,7 @@ def scale_x_continuous(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -106,7 +109,7 @@ def scale_x_continuous(name=None, *,
def scale_y_continuous(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -127,6 +130,8 @@ def scale_y_continuous(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -176,6 +181,7 @@ def scale_y_continuous(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -187,7 +193,7 @@ def scale_y_continuous(name=None, *,
def scale_x_log10(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -207,6 +213,8 @@ def scale_x_log10(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -251,6 +259,7 @@ def scale_x_log10(name=None, *,
return scale_x_continuous(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -261,7 +270,7 @@ def scale_x_log10(name=None, *,
def scale_y_log10(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -281,6 +290,8 @@ def scale_y_log10(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -325,6 +336,7 @@ def scale_y_log10(name=None, *,
return scale_y_continuous(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -335,7 +347,7 @@ def scale_y_log10(name=None, *,
def scale_x_log2(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -355,6 +367,8 @@ def scale_x_log2(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -399,6 +413,7 @@ def scale_x_log2(name=None, *,
return scale_x_continuous(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -409,7 +424,7 @@ def scale_x_log2(name=None, *,
def scale_y_log2(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -429,6 +444,8 @@ def scale_y_log2(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -473,6 +490,7 @@ def scale_y_log2(name=None, *,
return scale_y_continuous(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -483,7 +501,7 @@ def scale_y_log2(name=None, *,
def scale_x_reverse(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -503,6 +521,8 @@ def scale_x_reverse(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -547,6 +567,7 @@ def scale_x_reverse(name=None, *,
return scale_x_continuous(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -557,7 +578,7 @@ def scale_x_reverse(name=None, *,
def scale_y_reverse(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -577,6 +598,8 @@ def scale_y_reverse(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -621,6 +644,7 @@ def scale_y_reverse(name=None, *,
return scale_y_continuous(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -635,7 +659,7 @@ def scale_y_reverse(name=None, *,
#
def scale_x_discrete(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -656,6 +680,8 @@ def scale_x_discrete(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale and the default order of their display in guides.
expand : list
@@ -706,6 +732,7 @@ def scale_x_discrete(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -720,7 +747,7 @@ def scale_x_discrete(name=None, *,
def scale_x_discrete_reversed(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -740,6 +767,8 @@ def scale_x_discrete_reversed(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale and the default order of their display in guides.
expand : list
@@ -787,6 +816,7 @@ def scale_x_discrete_reversed(name=None, *,
return scale_x_discrete(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -798,7 +828,7 @@ def scale_x_discrete_reversed(name=None, *,
def scale_y_discrete(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -819,6 +849,8 @@ def scale_y_discrete(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale and the default order of their display in guides.
expand : list
@@ -869,6 +901,7 @@ def scale_y_discrete(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -883,7 +916,7 @@ def scale_y_discrete(name=None, *,
def scale_y_discrete_reversed(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -903,6 +936,8 @@ def scale_y_discrete_reversed(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector specifying the data range for the scale and the default order of their display in guides.
expand : list of two numbers
@@ -950,6 +985,7 @@ def scale_y_discrete_reversed(name=None, *,
return scale_y_discrete(name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -968,6 +1004,7 @@ def scale_y_discrete_reversed(name=None, *,
def scale_x_datetime(name=None, *,
breaks=None,
labels=None,
+ lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -987,6 +1024,8 @@ def scale_x_datetime(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector of length two providing limits of the scale.
expand : list
@@ -1039,6 +1078,7 @@ def scale_x_datetime(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -1051,7 +1091,7 @@ def scale_x_datetime(name=None, *,
def scale_y_datetime(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -1071,6 +1111,8 @@ def scale_y_datetime(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A vector of length two providing limits of the scale.
expand : list of two numbers
@@ -1124,6 +1166,7 @@ def scale_y_datetime(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -1136,7 +1179,7 @@ def scale_y_datetime(name=None, *,
def scale_x_time(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -1156,6 +1199,8 @@ def scale_x_time(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -1200,6 +1245,7 @@ def scale_x_time(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,
@@ -1212,7 +1258,7 @@ def scale_x_time(name=None, *,
def scale_y_time(name=None, *,
- breaks=None, labels=None,
+ breaks=None, labels=None, lablim=None,
limits=None,
expand=None,
na_value=None,
@@ -1232,6 +1278,8 @@ def scale_y_time(name=None, *,
A list of data values specifying the positions of ticks, or a dictionary which maps the tick labels to the breaks values.
labels : list of str or dict
A list of labels on ticks, or a dictionary which maps the breaks values to the tick labels.
+ lablim : int, default=None
+ The maximum label length (in characters) before trimming is applied.
limits : list
A numeric vector of length two providing limits of the scale.
expand : list
@@ -1276,6 +1324,7 @@ def scale_y_time(name=None, *,
name=name,
breaks=breaks,
labels=labels,
+ lablim=lablim,
limits=limits,
expand=expand,
na_value=na_value,