From 35c63652dd12babe0370c3c2efd36a9acf975955 Mon Sep 17 00:00:00 2001 From: BestLocation <115041500+BestLocation@users.noreply.github.com> Date: Fri, 23 May 2025 22:07:42 -0400 Subject: [PATCH 1/2] fixed documentation --- MatPlus/StemPlot.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/MatPlus/StemPlot.py b/MatPlus/StemPlot.py index 5a93efc..f0157fc 100644 --- a/MatPlus/StemPlot.py +++ b/MatPlus/StemPlot.py @@ -18,30 +18,35 @@ def __init__( orientation="vertical", ): """ - A class to create stem plots with optional axis limits and styling. + A class for creating Stem plots with customizable properties. + The StemPlot class provides a simplified interface for creating stem plots + with customizable axis limits and line properties such as line format, marker format, + and base format. + Parameters: + ---------- x : array-like The x-values of the stem plot. y : array-like The y-values of the stem plot. lowerlimx : float, optional - The lower limit of the x-axis. + The lower limit of the x-axis. Default is 90% of the minimum x-value. lowerlimy : float, optional - The lower limit of the y-axis. + The lower limit of the y-axis. Default is 90% of the minimum y-value. upperlimx : float, optional - The upper limit of the x-axis. + The upper limit of the x-axis. Default is 110% of the maximum x-value. upperlimy : float, optional - The upper limit of the y-axis. + The upper limit of the y-axis. Default is 110% of the maximum y-value. linefmt : str, optional - A string defining the properties of the vertical lines in the stem plot. + Format string for the vertical lines in the stem plot. Default is '-'. markerfmt : str, optional - A string defining the properties of the markers at the stem heads. + Format string for the markers at the stem heads. Default is 'o'. basefmt : str, optional - A string defining the properties of the baseline. + Format string for the baseline. Default is ' ' (invisible). label : str, optional - The label for the stem plot. + Label for the stem plot. Default is None. orientation : str, optional - The orientation of the stem plot, either 'vertical' or 'horizontal'. + Orientation of the stem plot, either 'vertical' or 'horizontal'. Default is 'vertical'. """ self.x = np.array(x) From 0534aa912731db8110d20e108e2aa42e6fb4aa03 Mon Sep 17 00:00:00 2001 From: BestLocation <115041500+BestLocation@users.noreply.github.com> Date: Sat, 24 May 2025 18:19:50 -0400 Subject: [PATCH 2/2] Made change --- MatPlus/StemPlot.py | 64 ++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/MatPlus/StemPlot.py b/MatPlus/StemPlot.py index f0157fc..cae31d7 100644 --- a/MatPlus/StemPlot.py +++ b/MatPlus/StemPlot.py @@ -3,6 +3,38 @@ class StemPlot: + """ + A class for creating Stem plots with customizable properties. + The StemPlot class provides a simplified interface for creating stem plots + with customizable axis limits and line properties such as line format, marker format, + and base format. + + Parameters: + ---------- + x : array-like + The x-values of the stem plot. + y : array-like + The y-values of the stem plot. + lowerlimx : float, optional + The lower limit of the x-axis. Default is 90% of the minimum x-value. + lowerlimy : float, optional + The lower limit of the y-axis. Default is 90% of the minimum y-value. + upperlimx : float, optional + The upper limit of the x-axis. Default is 110% of the maximum x-value. + upperlimy : float, optional + The upper limit of the y-axis. Default is 110% of the maximum y-value. + linefmt : str, optional + Format string for the vertical lines in the stem plot. Default is '-'. + markerfmt : str, optional + Format string for the markers at the stem heads. Default is 'o'. + basefmt : str, optional + Format string for the baseline. Default is ' ' (invisible). + label : str, optional + Label for the stem plot. Default is None. + orientation : str, optional + Orientation of the stem plot, either 'vertical' or 'horizontal'. Default is 'vertical'. + """ + def __init__( self, x, @@ -17,38 +49,6 @@ def __init__( label=None, # Keep for backward compatibility but it won't be used orientation="vertical", ): - """ - A class for creating Stem plots with customizable properties. - The StemPlot class provides a simplified interface for creating stem plots - with customizable axis limits and line properties such as line format, marker format, - and base format. - - Parameters: - ---------- - x : array-like - The x-values of the stem plot. - y : array-like - The y-values of the stem plot. - lowerlimx : float, optional - The lower limit of the x-axis. Default is 90% of the minimum x-value. - lowerlimy : float, optional - The lower limit of the y-axis. Default is 90% of the minimum y-value. - upperlimx : float, optional - The upper limit of the x-axis. Default is 110% of the maximum x-value. - upperlimy : float, optional - The upper limit of the y-axis. Default is 110% of the maximum y-value. - linefmt : str, optional - Format string for the vertical lines in the stem plot. Default is '-'. - markerfmt : str, optional - Format string for the markers at the stem heads. Default is 'o'. - basefmt : str, optional - Format string for the baseline. Default is ' ' (invisible). - label : str, optional - Label for the stem plot. Default is None. - orientation : str, optional - Orientation of the stem plot, either 'vertical' or 'horizontal'. Default is 'vertical'. - """ - self.x = np.array(x) self.y = np.array(y) self.lowerlimx = lowerlimx