All Downloads are FREE. Search and download functionalities are using the official Maven repository.

matplotlib.pyplot.plot.kt Maven / Gradle / Ivy

package matplotlib.pyplot

import extensions.emptyIfNullOrComma
import extensions.toPythonNumberArrayStringOrEmpty
import extensions.toPythonStringQuotedOrEmpty
import matplotlib.KwargValue
import matplotlib.Line2D
import matplotlib.toKwargPythonStringOrEmpty
import python.PythonScriptBuilder

fun plot(
    x: List? = null,
    y: List,
    fmt: String? = null,
    kwargs: Map? = null
): Line2D {
    return object: Line2D {
        override val variableName: String = "line2D_${Line2D.line2DNumber}"
        init {
            PythonScriptBuilder.addCommand("$variableName = plt.plot(" +
                    "${x.toPythonNumberArrayStringOrEmpty()}${x.emptyIfNullOrComma()}" +
                    "${y.toPythonNumberArrayStringOrEmpty()}${fmt.emptyIfNullOrComma()}" +
                    "${fmt.toPythonStringQuotedOrEmpty()}${kwargs.emptyIfNullOrComma()}" +
                    kwargs.toKwargPythonStringOrEmpty() +
                    ")")
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy