diff --git a/README.md b/README.md index a252a118b..53f711389 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ $ pip install 'plotnine[extra]' # 2. includes extra/optional packages $ pip install 'plotnine[test]' # 3. testing $ pip install 'plotnine[doc]' # 4. generating docs $ pip install 'plotnine[dev]' # 5. development (making releases) -$ pip install 'plotnine[all]' # 6. everyting +$ pip install 'plotnine[all]' # 6. everything # Or using conda $ conda install -c conda-forge plotnine diff --git a/doc/_config.py b/doc/_config.py index d8f9d30cd..43914be3f 100644 --- a/doc/_config.py +++ b/doc/_config.py @@ -10,7 +10,7 @@ EXAMPLES_DIR = DOC_DIR / "reference" / "examples" TUTORIALS_DIR = DOC_DIR / "tutorials" -# The varibables file holds the version +# The variables file holds the version variables_filepath = DOC_DIR / "_variables.yml" VARIABLES_TPL = """\ version: {version} diff --git a/doc/changelog.qmd b/doc/changelog.qmd index d8c72833a..1b6869cb3 100644 --- a/doc/changelog.qmd +++ b/doc/changelog.qmd @@ -303,7 +303,7 @@ title: Changelog - You can now pickle the drawn matplotlib figures. ({{< issue 729 >}}) - The facet titles in the `strip_text` are now better aligned are appear more - centered withing the `strip_background`. + centered within the `strip_background`. ## v0.12.4 @@ -411,7 +411,7 @@ title: Changelog renamed to [](:class:`~plotnine.themes.themeable.strip_align`), [](:class:`~plotnine.themes.themeable.strip_align_x`) - [](:class:`~plotnine.themes.themeable.strip_align_y`) repectively. + [](:class:`~plotnine.themes.themeable.strip_align_y`) respectively. - [](:class:`~plotnine.themes.themeable.subplots_adjust`) has been deprecated. You no longer need to use `theme(subplots_adjust={"right": 0.85})`{.py} and @@ -475,7 +475,7 @@ not exist, got no description. This release is fixes error. ### New Features - [](:class:`~plotnine.geom_ribbon`) acquired new parameter `where` - which can be used shade withing given limits . + which can be used shade within given limits . - Added support for objects with a `to_pandas` method to convert them to a pandas dataframe. You can now pass in [polars](https://pola.rs) dataframes. @@ -490,7 +490,7 @@ not exist, got no description. This release is fixes error. - The automatic groups generated by the system and depending on the aesthetic mappings now only depend those aesthetics that have scales. This is more strict than has been, should affect very few cases of code that has been - written and it should be less suprising to the users. + written and it should be less surprising to the users. - [](:class:`~plotnine.geom_area`) and [](:class:`~plotnine.geom_density`) now default to showing only the upper outline/boundary of the area. @@ -604,7 +604,7 @@ not exist, got no description. This release is fixes error. for gaussian densities with no weights. This was probably a regression. - [](:class:`~plotnine.geom_map`) can now draw MultiPoints, - MultiLineStrings and MultiPolgons. + MultiLineStrings and MultiPolygons. - [](:class:`~plotnine.geom_text`) with `adjust_text` can now be used in more than one layer with good enough results. @@ -717,7 +717,7 @@ not exist, got no description. This release is fixes error. ### API Changes -- Changed the default method of caculating bandwidth for all stats that +- Changed the default method of calculating bandwidth for all stats that use kernel density estimation. The affected stats are [](:class:`~plotnine.stat_density`), [](:class:`~plotnine.stat_ydensity`), and @@ -842,7 +842,7 @@ not exist, got no description. This release is fixes error. ({{< issue 242 >}}) - Fixed bug in [](:class:`~plotnine.position_dodge`) where by bar plot - could get thinner when facetting and useing `preserve = 'single'`. + could get thinner when facetting and using `preserve = 'single'`. ({{< issue 224 >}}) - Fixed bug in [](:class:`~plotnine.coord_trans`) where if the transformation @@ -905,7 +905,7 @@ not exist, got no description. This release is fixes error. - The `width` of the boxplot can now be set irrespective of the stat. - The mid-point color of [](:class:`~plotnine.scale_color_distiller`) now - matches that of the trainned data. + matches that of the trained data. - The way in which layers are created has been refactored to give packages that that extend plotnine more flexibility in manipulating the layers. @@ -952,7 +952,7 @@ not exist, got no description. This release is fixes error. - Fixed bug in [](:class:`~plotnine.geom_abline`) where passing the mapping as a keyword parameter lead to a wrong plot. ({{< issue 196 >}}) -- Fixed issue where `minor_breaks` for tranformed scaled would have to be given +- Fixed issue where `minor_breaks` for transformed scaled would have to be given in the transformed coordinates. Know they are given the data coordinates just like the major `breaks`. @@ -965,7 +965,7 @@ not exist, got no description. This release is fixes error. is controlled by the new `na_translate` option. - The `minor_breaks` parameter for continuous scales can now be given as an - integer. An integer is taken to controll the number of minor breaks between + integer. An integer is taken to control the number of minor breaks between any set of major breaks. ## v0.4.0 diff --git a/plotnine/_mpl/_plot_side_space.py b/plotnine/_mpl/_plot_side_space.py index 75963fcd6..85410a37f 100644 --- a/plotnine/_mpl/_plot_side_space.py +++ b/plotnine/_mpl/_plot_side_space.py @@ -46,8 +46,8 @@ ] # Note -# Margins around the plot are specfied in figure coordinates -# We interprete that value to be a fraction of the width. So along +# Margins around the plot are specified in figure coordinates +# We interpret that value to be a fraction of the width. So along # the vertical direction we multiply by W/H to get equal space # in both directions @@ -117,7 +117,7 @@ def _legend_size(self) -> TupleFloat2: """ Return size of legend in figure coordinates - We need this to accurately justify the legend by proprotional + We need this to accurately justify the legend by proportional values e.g. 0.2, instead of just left, right, top, bottom & center. """ @@ -477,7 +477,7 @@ def _calculate_panel_spacing_facet_grid( sw = theme.getp("panel_spacing_x") sh = theme.getp("panel_spacing_y") * W / H - # width and height of axes as fraction of figure width & heigt + # width and height of axes as fraction of figure width & height w = ((spaces.right - spaces.left) - sw * (ncol - 1)) / ncol h = ((spaces.top - spaces.bottom) - sh * (nrow - 1)) / nrow @@ -511,7 +511,7 @@ def _calculate_panel_spacing_facet_wrap( # +ve: Away from the panel # 0: Top of the panel # -ve: Into the panel - # Where values <= -1, put the strip completly into + # Where values <= -1, put the strip completely into # the panel. We do not worry about larger -ves. strip_align_x = theme.getp("strip_align_x") @@ -527,7 +527,7 @@ def _calculate_panel_spacing_facet_wrap( sw += max_ylabels_width(pack) sw += max_yticks_width(pack) - # width and height of axes as fraction of figure width & heigt + # width and height of axes as fraction of figure width & height w = ((spaces.right - spaces.left) - sw * (ncol - 1)) / ncol h = ((spaces.top - spaces.bottom) - sh * (nrow - 1)) / nrow diff --git a/plotnine/_mpl/_plotnine_tight_layout.py b/plotnine/_mpl/_plotnine_tight_layout.py index b13e2e52d..1b52c4cd2 100644 --- a/plotnine/_mpl/_plotnine_tight_layout.py +++ b/plotnine/_mpl/_plotnine_tight_layout.py @@ -159,24 +159,24 @@ def set_figure_artist_positions( if pack.plot_title: ha = theme.getp(("plot_title", "ha")) pack.plot_title.set_y(sides.t.edge("plot_title")) - horizonally_align_text_with_panels(pack.plot_title, params, ha, pack) + horizontally_align_text_with_panels(pack.plot_title, params, ha, pack) if pack.plot_subtitle: ha = theme.getp(("plot_subtitle", "ha")) pack.plot_subtitle.set_y(sides.t.edge("plot_subtitle")) - horizonally_align_text_with_panels( + horizontally_align_text_with_panels( pack.plot_subtitle, params, ha, pack ) if pack.plot_caption: ha = theme.getp(("plot_caption", "ha"), "right") pack.plot_caption.set_y(sides.b.edge("plot_caption")) - horizonally_align_text_with_panels(pack.plot_caption, params, ha, pack) + horizontally_align_text_with_panels(pack.plot_caption, params, ha, pack) if pack.axis_title_x: ha = theme.getp(("axis_title_x", "ha"), "center") pack.axis_title_x.set_y(sides.b.edge("axis_title_x")) - horizonally_align_text_with_panels(pack.axis_title_x, params, ha, pack) + horizontally_align_text_with_panels(pack.axis_title_x, params, ha, pack) if pack.axis_title_y: va = theme.getp(("axis_title_y", "va"), "center") @@ -187,7 +187,7 @@ def set_figure_artist_positions( set_legends_position(pack.legends, tparams, pack.figure) -def horizonally_align_text_with_panels( +def horizontally_align_text_with_panels( text: Text, params: GridSpecParams, ha: str | float, pack: LayoutPack ): """ diff --git a/plotnine/_mpl/patches.py b/plotnine/_mpl/patches.py index d83d6888e..b9f67a246 100644 --- a/plotnine/_mpl/patches.py +++ b/plotnine/_mpl/patches.py @@ -81,7 +81,7 @@ class InsideStrokedRectangle(Rectangle): @artist.allow_rasterization def draw(self, renderer): """ - Draw with the bounds of the rectangle adjusted to accomodate the stroke + Draw with the bounds of the rectangle adjusted to accommodate the stroke """ x, y = self.xy w, h = self.get_width(), self.get_height() diff --git a/plotnine/_utils/__init__.py b/plotnine/_utils/__init__.py index 991e7d854..bcd92d9ae 100644 --- a/plotnine/_utils/__init__.py +++ b/plotnine/_utils/__init__.py @@ -285,7 +285,7 @@ def ninteraction(df: pd.DataFrame, drop: bool = False) -> list[int]: Returns ------- out : list - Row asssignments. + Row assignments. Notes ----- @@ -548,7 +548,7 @@ def to_rgba( alpha: float | Sequence[float] | AnySeries, ) -> Sequence[ColorType] | ColorType: """ - Covert hex colors to rgba values. + Convert hex colors to rgba values. Parameters ---------- @@ -585,7 +585,7 @@ def no_color(c): def to_rgba_hex(c: ColorType, a: float) -> str: """ - Conver rgb color to rgba hex value + Convert rgb color to rgba hex value If color c has an alpha channel, then alpha value a is ignored @@ -1230,14 +1230,14 @@ def simple_table( def no_init(default: T) -> T: """ - Set defaut value of a dataclass field that will not be __init__ed + Set default value of a dataclass field that will not be __init__ed """ return field(init=False, default=default) def no_init_mutable(default: T) -> T: """ - Set defaut value of a dataclass field that will not be __init__ed + Set default value of a dataclass field that will not be __init__ed """ return field(init=False, default_factory=lambda: deepcopy(default)) diff --git a/plotnine/animation.py b/plotnine/animation.py index 0151475b6..99feba8fe 100644 --- a/plotnine/animation.py +++ b/plotnine/animation.py @@ -108,7 +108,7 @@ def __draw_plots( def initialise_artist_offsets(n: int): """ - Initilise artists_offsets arrays to zero + Initialise artists_offsets arrays to zero Parameters ---------- diff --git a/plotnine/coords/coord.py b/plotnine/coords/coord.py index 28888cc73..2865b2ce1 100644 --- a/plotnine/coords/coord.py +++ b/plotnine/coords/coord.py @@ -49,7 +49,7 @@ def setup_data(self, data: list[pd.DataFrame]) -> list[pd.DataFrame]: Parameters ---------- data : - Data for alls Layer + Data for all Layer Returns ------- diff --git a/plotnine/data/__init__.py b/plotnine/data/__init__.py index 52677e386..bacadfbe4 100644 --- a/plotnine/data/__init__.py +++ b/plotnine/data/__init__.py @@ -43,7 +43,7 @@ faithfuld = pd.read_csv(DATA_DIR / "faithfuld.csv") faithful = pd.read_csv(DATA_DIR / "faithful.csv") -# For conveniece to the user, we set some columns in these +# For convenience to the user, we set some columns in these # dataframes to categoricals. diamonds = pd.read_csv(DATA_DIR / "diamonds.csv") midwest = pd.read_csv(DATA_DIR / "midwest.csv") @@ -288,7 +288,7 @@ def _process_categories(): (https://www.uaf.edu/cfos/people/faculty/detail/kristen-gorman.php) and the [Palmer Station, Antarctica LTER](https://pallter.marine.rutgers.edu/). -Made conveniently availabe by +Made conveniently available by [Alison Horst](https://github.com/allisonhorst/palmerpenguins/) to serve as a dataset exploration and visualisation. """ diff --git a/plotnine/facets/labelling.py b/plotnine/facets/labelling.py index 037666c16..c21a98004 100644 --- a/plotnine/facets/labelling.py +++ b/plotnine/facets/labelling.py @@ -94,7 +94,7 @@ def label_context( Returns ------- out : str - Contatenated label values (or pairs of variable names + Concatenated label values (or pairs of variable names & values) """ if len(label_info) == 1: diff --git a/plotnine/facets/layout.py b/plotnine/facets/layout.py index b523d52c6..58b9f3bd5 100644 --- a/plotnine/facets/layout.py +++ b/plotnine/facets/layout.py @@ -51,7 +51,7 @@ def setup(self, layers: Layers, plot: ggplot): Create a layout for the panels The layout is a dataframe that stores all the - structual information about the panels that will + structural information about the panels that will make up the plot. The actual layout depends on the type of facet. diff --git a/plotnine/geoms/geom_label.py b/plotnine/geoms/geom_label.py index e91c00e18..9498d28a5 100644 --- a/plotnine/geoms/geom_label.py +++ b/plotnine/geoms/geom_label.py @@ -22,7 +22,7 @@ _params.update( { # boxstyle is one of - # cirle, larrow, rarrow, round, round4, + # circle, larrow, rarrow, round, round4, # roundtooth, sawtooth, square # # Documentation at matplotlib.patches.BoxStyle diff --git a/plotnine/geoms/geom_raster.py b/plotnine/geoms/geom_raster.py index bf9731720..17f1f19ab 100644 --- a/plotnine/geoms/geom_raster.py +++ b/plotnine/geoms/geom_raster.py @@ -184,7 +184,7 @@ def draw_panel( yidx, xidx = nrow - y_pos - 1, x_pos # Create and "color" the matrix. - # Any gaps left whites (ones) colors pluse zero alpha values + # Any gaps left whites (ones) colors plus zero alpha values # allows makes it possible to have a "neutral" interpolation # into the gaps when intervals are uneven. X = np.ones((nrow, ncol, 4)) diff --git a/plotnine/geoms/geom_rect.py b/plotnine/geoms/geom_rect.py index 41b0097eb..882813e64 100644 --- a/plotnine/geoms/geom_rect.py +++ b/plotnine/geoms/geom_rect.py @@ -107,7 +107,7 @@ def _rectangles_to_polygons(df: pd.DataFrame) -> pd.DataFrame: """ Convert rect data to polygons - Paramters + Parameters --------- df : dataframe Dataframe with *xmin*, *xmax*, *ymin* and *ymax* columns, @@ -128,7 +128,7 @@ def _rectangles_to_polygons(df: pd.DataFrame) -> pd.DataFrame: ymax_idx = ~ymin_idx # There are 2 x and 2 y values for each of xmin, xmax, ymin & ymax - # The positions are as layed out in the indexing arrays + # The positions are as laid out in the indexing arrays # x and y values x = np.empty(n * 4) y = np.empty(n * 4) diff --git a/plotnine/geoms/geom_text.py b/plotnine/geoms/geom_text.py index 3f40c1121..97c3437f4 100644 --- a/plotnine/geoms/geom_text.py +++ b/plotnine/geoms/geom_text.py @@ -186,7 +186,7 @@ def __init__( else: check_adjust_text() - # Accomodate the old names + # Accommodate the old names if mapping and "hjust" in mapping: mapping["ha"] = mapping.pop("hjust") diff --git a/plotnine/guides/guide_colorbar.py b/plotnine/guides/guide_colorbar.py index 6b0fa834d..78c30c26d 100644 --- a/plotnine/guides/guide_colorbar.py +++ b/plotnine/guides/guide_colorbar.py @@ -52,7 +52,7 @@ class guide_colorbar(guide): alpha: Optional[float] = None """ - Opacity (in the range `[0, 1]`) of the colorbar. The defualt + Opacity (in the range `[0, 1]`) of the colorbar. The default `None`, is to use the opacity of the plot. """ @@ -284,7 +284,7 @@ def add_gradient_colorbar( if len(colors) == 1: colors = [colors[0], colors[0]] - # Number of horizontal egdes(breaks) in the grid + # Number of horizontal edges(breaks) in the grid # No need to create more nbreak than colors, provided # no. of colors = no. of breaks = no. of cmap colors # the shading does a perfect interpolation diff --git a/plotnine/guides/guide_legend.py b/plotnine/guides/guide_legend.py index 90c52add8..a64d42ab5 100644 --- a/plotnine/guides/guide_legend.py +++ b/plotnine/guides/guide_legend.py @@ -150,7 +150,7 @@ def create_geoms(self): will be used in the call to geom. """ # A layer either contributes to the guide, or it does not. The - # guide entries may be ploted in the layers + # guide entries may be plotted in the layers for l in self.plot_layers: exclude = set() if isinstance(l.show_legend, dict): diff --git a/plotnine/iapi.py b/plotnine/iapi.py index fc4263387..10be9d946 100644 --- a/plotnine/iapi.py +++ b/plotnine/iapi.py @@ -41,7 +41,7 @@ class scale_view: scale: scale aesthetics: list[ScaledAestheticsName] name: Optional[str] - # Trainned limits of the scale + # Trained limits of the scale limits: ScaleLimits # Physical size of scale, including expansions range: CoordRange @@ -53,7 +53,7 @@ class scale_view: @dataclass class range_view: """ - Range information after trainning + Range information after training """ range: TupleFloat2 diff --git a/plotnine/options.py b/plotnine/options.py index 044f745e3..df7b1fd0f 100644 --- a/plotnine/options.py +++ b/plotnine/options.py @@ -20,7 +20,7 @@ base_family: str = "sans-serif" """ The base font family for all text that is part of the theme. -Default is sans-serif and one is choosen automatically from +Default is sans-serif and one is chosen automatically from rcParams["font.san-serif"] """ @@ -41,7 +41,7 @@ figure_format: Optional[FigureFormat] = None """ -The format for the inline figures outputed by the jupyter kernel. +The format for the inline figures outputted by the jupyter kernel. If `None`, it is the value of diff --git a/plotnine/qplot.py b/plotnine/qplot.py index 42160cf4b..592b080e6 100644 --- a/plotnine/qplot.py +++ b/plotnine/qplot.py @@ -128,7 +128,7 @@ def I(value: Any) -> Any: # Work out plot data, and modify aesthetics, if necessary def replace_auto(lst: list[str], str2: str) -> list[str]: """ - Replace all occurences of 'auto' in with str2 + Replace all occurrences of 'auto' in with str2 """ for i, value in enumerate(lst): if value == "auto": @@ -168,7 +168,7 @@ def replace_auto(lst: list[str], str2: str) -> list[str]: xlab = "range(len(y))" ylab = "y" else: - # We could solve the issue in layer.compute_asthetics + # We could solve the issue in layer.compute_aesthetics # but it is not worth the extra complexity raise PlotnineError("Cannot infer how long x should be.") replace_auto(geom, "point") diff --git a/plotnine/scales/limits.py b/plotnine/scales/limits.py index f604f417e..2195415e4 100644 --- a/plotnine/scales/limits.py +++ b/plotnine/scales/limits.py @@ -50,7 +50,7 @@ def get_scale(self, plot): # aesthetic is mapped to a categorical but the limits # are not provided in categorical form. We only handle # the case where the mapping uses an expression to - # conver to categorical e.g `aes(color="factor(cyl)")`. + # convert to categorical e.g `aes(color="factor(cyl)")`. # However if `"cyl"` column is a categorical and the # mapping is `aes(color="cyl")`, that will result in # an error. If later case proves common enough then we @@ -62,7 +62,7 @@ def get_scale(self, plot): # Look through all the mappings for this aesthetic, # if we detect any factor stuff then we convert the # limits data to categorical so that the right scale - # can be choosen. This should take care of the most + # can be chosen. This should take care of the most # common use cases. for layer in plot.layers: with suppress(KeyError): diff --git a/plotnine/scales/scale.py b/plotnine/scales/scale.py index d86e651b2..f429469cd 100644 --- a/plotnine/scales/scale.py +++ b/plotnine/scales/scale.py @@ -207,7 +207,7 @@ def expand_limits( trans, # : Trans | Type[Trans] ) -> range_view: """ - Exand the limits of the scale + Expand the limits of the scale """ raise NotImplementedError diff --git a/plotnine/scales/scale_color.py b/plotnine/scales/scale_color.py index 71c26e7ec..93c6b7c6b 100644 --- a/plotnine/scales/scale_color.py +++ b/plotnine/scales/scale_color.py @@ -372,7 +372,7 @@ class scale_color_distiller(scale_color_gradientn): """ Sequential and diverging continuous color scales - This is a convinience scale around + This is a convenience scale around [](`~plotnine.scales.scale_color_gradientn`) with colors from [colorbrewer.org](http://colorbrewer2.org). It smoothly interpolates 7 colors from a brewer palette to create a diff --git a/plotnine/stats/smoothers.py b/plotnine/stats/smoothers.py index 9bc91cdb7..b2872317c 100644 --- a/plotnine/stats/smoothers.py +++ b/plotnine/stats/smoothers.py @@ -103,7 +103,7 @@ def lm_formula(data, xseq, **params): import statsmodels.api as sm import statsmodels.formula.api as smf - eval_env = _to_patsy_env(params["enviroment"]) + eval_env = _to_patsy_env(params["environment"]) formula = params["formula"] weights = data.get("weight", None) @@ -178,7 +178,7 @@ def rlm_formula(data, xseq, **params): import statsmodels.api as sm import statsmodels.formula.api as smf - eval_env = _to_patsy_env(params["enviroment"]) + eval_env = _to_patsy_env(params["environment"]) formula = params["formula"] init_kwargs, fit_kwargs = separate_method_kwargs( params["method_args"], sm.RLM, sm.RLM.fit @@ -236,7 +236,7 @@ def gls_formula(data, xseq, **params): import statsmodels.api as sm import statsmodels.formula.api as smf - eval_env = _to_patsy_env(params["enviroment"]) + eval_env = _to_patsy_env(params["environment"]) formula = params["formula"] init_kwargs, fit_kwargs = separate_method_kwargs( params["method_args"], sm.GLS, sm.GLS.fit @@ -301,7 +301,7 @@ def glm_formula(data, xseq, **params): import statsmodels.api as sm import statsmodels.formula.api as smf - eval_env = _to_patsy_env(params["enviroment"]) + eval_env = _to_patsy_env(params["environment"]) init_kwargs, fit_kwargs = separate_method_kwargs( params["method_args"], sm.GLM, sm.GLM.fit ) diff --git a/plotnine/stats/stat.py b/plotnine/stats/stat.py index 2fa28b1ab..73737a98c 100644 --- a/plotnine/stats/stat.py +++ b/plotnine/stats/stat.py @@ -196,7 +196,7 @@ def use_defaults(self, data: pd.DataFrame) -> pd.DataFrame: def setup_params(self, data: pd.DataFrame) -> dict[str, Any]: """ - Overide this to verify or adjust parameters + Override this to verify or adjust parameters Parameters ---------- @@ -212,7 +212,7 @@ def setup_params(self, data: pd.DataFrame) -> dict[str, Any]: def setup_data(self, data: pd.DataFrame) -> pd.DataFrame: """ - Overide to modify data before compute_layer is called + Override to modify data before compute_layer is called Parameters ---------- @@ -247,7 +247,7 @@ def finish_layer( data : Data for the layer params : - Paremeters + Parameters Returns ------- @@ -316,7 +316,7 @@ def compute_panel( Return the results in a single dataframe. - This is a default function that can be overriden + This is a default function that can be overridden by individual stats Parameters diff --git a/plotnine/stats/stat_bin.py b/plotnine/stats/stat_bin.py index 47bfdb6e4..4e5ff234e 100644 --- a/plotnine/stats/stat_bin.py +++ b/plotnine/stats/stat_bin.py @@ -33,7 +33,7 @@ class stat_bin(stat): Number of bins. Overridden by binwidth. If `None`{.py}, a number is computed using the freedman-diaconis method. breaks : array_like, default=None - Bin boundaries. This supercedes the `binwidth`, `bins`, + Bin boundaries. This supersedes the `binwidth`, `bins`, `center` and `boundary`. center : float, default=None The center of one of the bins. Note that if center is above diff --git a/plotnine/stats/stat_bin_2d.py b/plotnine/stats/stat_bin_2d.py index fa0fe7df6..c7a27fdf1 100644 --- a/plotnine/stats/stat_bin_2d.py +++ b/plotnine/stats/stat_bin_2d.py @@ -24,7 +24,7 @@ class stat_bin_2d(stat): bins : int, default=30 Number of bins. Overridden by binwidth. breaks : array_like | tuple[array_like, array_like] , default=None - Bin boundaries. This supercedes the `binwidth`, `bins`, + Bin boundaries. This supersedes the `binwidth`, `bins`, `center` and `boundary`. It can be an array_like or a list of two array_likes to provide distinct breaks for the `x` and `y` axes. diff --git a/plotnine/stats/stat_bindot.py b/plotnine/stats/stat_bindot.py index 5e6bd618a..8d37f4b7a 100644 --- a/plotnine/stats/stat_bindot.py +++ b/plotnine/stats/stat_bindot.py @@ -40,7 +40,7 @@ class stat_bindot(stat): binwidth : float, default=None When `method="dotdensity"`{.py}, this specifies the maximum binwidth. When `method="histodot"`{.py}, this specifies the - binwidth. This supercedes the `bins`. + binwidth. This supersedes the `bins`. origin : float, default=None When `method="histodot"`{.py}, origin of the first bin. width : float, default=0.9 @@ -63,7 +63,7 @@ class stat_bindot(stat): When `method="histodot"`{.py}, `True`{.py} means include right edge of the bins and if `False`{.py} the left edge is included. breaks : FloatArray, default=None - Bin boundaries for `method="histodot"`{.py}. This supercedes the + Bin boundaries for `method="histodot"`{.py}. This supersedes the `binwidth` and `bins`. See Also diff --git a/plotnine/stats/stat_density.py b/plotnine/stats/stat_density.py index 6a83c4556..54b615963 100644 --- a/plotnine/stats/stat_density.py +++ b/plotnine/stats/stat_density.py @@ -16,7 +16,7 @@ from plotnine.typing import FloatArrayLike -# NOTE: Parameter discriptions are in +# NOTE: Parameter descriptions are in # statsmodels/nonparametric/kde.py @document class stat_density(stat): @@ -268,7 +268,7 @@ def nrd0(x: FloatArrayLike) -> float: n = len(x) if n < 1: raise ValueError( - "Need at leat 2 data points to compute the nrd0 bandwidth." + "Need at least 2 data points to compute the nrd0 bandwidth." ) std: float = np.std(x, ddof=1) # pyright: ignore diff --git a/plotnine/stats/stat_ecdf.py b/plotnine/stats/stat_ecdf.py index 9461b7ca9..9d523b770 100644 --- a/plotnine/stats/stat_ecdf.py +++ b/plotnine/stats/stat_ecdf.py @@ -9,7 +9,7 @@ @document class stat_ecdf(stat): """ - Emperical Cumulative Density Function + Empirical Cumulative Density Function {usage} diff --git a/plotnine/stats/stat_ellipse.py b/plotnine/stats/stat_ellipse.py index f4238295f..53633b958 100644 --- a/plotnine/stats/stat_ellipse.py +++ b/plotnine/stats/stat_ellipse.py @@ -82,7 +82,7 @@ def compute_group(cls, data, scales, **params): else: raise ValueError(f"Unknown value for type={type_}") - # numpy's cholesky function does not gaurantee upper/lower + # numpy's cholesky function does not guarantee upper/lower # triangular factorization. chol_decomp = linalg.cholesky(cov, lower=False) diff --git a/plotnine/stats/stat_smooth.py b/plotnine/stats/stat_smooth.py index 5a895035f..ba00737d2 100644 --- a/plotnine/stats/stat_smooth.py +++ b/plotnine/stats/stat_smooth.py @@ -63,7 +63,7 @@ def my_smoother(data, xseq, **params): # degrees of freedom we can compute the confidence # intervals using the t-distribution. # - # For an alternative, implement confidence interals by + # For an alternative, implement confidence intervals by # the bootstrap method if params["se"]: from plotnine.utils.smoothers import tdist_ci @@ -157,7 +157,7 @@ def my_smoother(data, xseq, **params): def setup_data(self, data): """ - Overide to modify data before compute_layer is called + Override to modify data before compute_layer is called """ data = data[np.isfinite(data["x"]) & np.isfinite(data["y"])] return data @@ -200,7 +200,7 @@ def setup_params(self, data): "You can only use a formula with `method` is " f"one of {allowed}" ) - params["enviroment"] = self.environment + params["environment"] = self.environment return params diff --git a/plotnine/stats/stat_summary_bin.py b/plotnine/stats/stat_summary_bin.py index fdc413e44..991bccecd 100644 --- a/plotnine/stats/stat_summary_bin.py +++ b/plotnine/stats/stat_summary_bin.py @@ -28,7 +28,7 @@ class stat_summary_bin(stat): bins : int | tuple, default=30 Number of bins. Overridden by binwidth. breaks : array_like | tuple[array_like, array_like], default=None - Bin boundaries. This supercedes the `binwidth`, `bins` + Bin boundaries. This supersedes the `binwidth`, `bins` and `boundary` arguments. boundary : float | tuple, default=None A boundary between two bins. As with center, things are @@ -57,7 +57,7 @@ class stat_summary_bin(stat): Notes ----- - The *binwidth*, *bins*, *breaks* and *bounary* arguments can be a + The *binwidth*, *bins*, *breaks* and *boundary* arguments can be a tuples with two values `(xaxis-value, yaxis-value)` of the required type. diff --git a/plotnine/themes/theme_gray.py b/plotnine/themes/theme_gray.py index 87720a52e..e1e907535 100644 --- a/plotnine/themes/theme_gray.py +++ b/plotnine/themes/theme_gray.py @@ -23,7 +23,7 @@ def __init__(self, base_size=11, base_family=None): base_family = base_family or get_option("base_family") quarter_line = base_size / 4 fifth_line = base_size / 5 - eigth_line = base_size / 8 + eighth_line = base_size / 8 m = get_option("base_margin") super().__init__( @@ -53,7 +53,7 @@ def __init__(self, base_size=11, base_family=None): axis_ticks_direction="out", axis_ticks_length=0, axis_ticks_length_major=quarter_line, - axis_ticks_length_minor=eigth_line, + axis_ticks_length_minor=eighth_line, axis_ticks_minor=element_blank(), axis_ticks_pad=2, axis_title_x=element_text( diff --git a/plotnine/themes/themeable.py b/plotnine/themes/themeable.py index f15cc7398..92cf8d52b 100644 --- a/plotnine/themes/themeable.py +++ b/plotnine/themes/themeable.py @@ -342,7 +342,7 @@ def getp(self, key: str | tuple[str, str], default: Any = None) -> Any: Themeables store theming attribute values in the [](`~plotnine.themes.themeables.Themeable.properties`) [](`dict`). The goal of this method is to look a value from - that dictionary, and fallback along the inheritance heirarchy + that dictionary, and fallback along the inheritance hierarchy of themeables. Parameters @@ -384,7 +384,7 @@ def property(self, name: str, key: str = "value") -> Any: Themeables store theming attribute values in the [](`~plotnine.theme.themeables.Themeable.properties`) [](`dict`). The goal of this method is to look a value from - that dictionary, and fallback along the inheritance heirarchy + that dictionary, and fallback along the inheritance hierarchy of themeables. Parameters @@ -445,7 +445,7 @@ class MixinSequenceOfValues(themeable): theme(axis_text_x=element_text(color=("red", "green", "blue"))) The number of values in the list must match the number of objects - targetted by the themeable.. + targeted by the themeable.. """ def set( @@ -2418,7 +2418,7 @@ class subplots_adjust(themeable): def apply_figure(self, figure: Figure, targets: ThemeTargets): warn( "You no longer need to use subplots_adjust to make space for " - "the legend or text around the panels. This paramater will be " + "the legend or text around the panels. This parameter will be " "removed in a future version. You can still use 'plot_margin' " "'panel_spacing' for your other spacing needs.", FutureWarning, diff --git a/tests/test_coords.py b/tests/test_coords.py index 18daf867d..c23156f08 100644 --- a/tests/test_coords.py +++ b/tests/test_coords.py @@ -44,7 +44,7 @@ def test_coord_trans(): def test_coord_trans_reverse(): - # coord trans can reverse continous and discrete data + # coord trans can reverse continuous and discrete data p = ( ggplot(data, aes("factor(x)")) + geom_bar(aes(fill="factor(z)"), show_legend=False) diff --git a/tests/test_ggsave.py b/tests/test_ggsave.py index b860a35f4..d627a8dbb 100644 --- a/tests/test_ggsave.py +++ b/tests/test_ggsave.py @@ -134,7 +134,7 @@ def test_large_height(self): def test_bad_units(self): with pytest.raises(Exception): - p.save(width=1, heigth=1, units="xxx") + p.save(width=1, height=1, units="xxx") # This should be the last function in the file since it can catch diff --git a/tests/test_stat_summary.py b/tests/test_stat_summary.py index 88a098cc3..bb8c6c05e 100644 --- a/tests/test_stat_summary.py +++ b/tests/test_stat_summary.py @@ -73,7 +73,7 @@ def test_summary_functions(): assert p == "summary_functions" -def test_stat_summary_raises_on_invalid_paremeters(): +def test_stat_summary_raises_on_invalid_parameters(): with pytest.raises(TypeError): geom_point(stat_summary(funy=np.mean)) with pytest.raises(TypeError): diff --git a/tests/test_theme.py b/tests/test_theme.py index c49af0998..3234d82cf 100644 --- a/tests/test_theme.py +++ b/tests/test_theme.py @@ -72,7 +72,7 @@ def test_add_empty_theme_element(): blank = element_blank() -def test_add_element_heirarchy(): +def test_add_element_hierarchy(): # parent themeable modifies child themeable theme1 = theme_gray() + theme(axis_line_x=l1) # child theme2 = theme1 + theme(axis_line=l2) # parent