├── .gitattributes ├── .github ├── DISCUSSION_TEMPLATE │ └── 2024-plotnine-contest.yml ├── utils │ ├── _repo.py │ └── please.py └── workflows │ ├── documentation.yml │ ├── release.yml │ ├── testing.yml │ └── weekly.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .readthedocs.yaml ├── CITATION.bib ├── LICENSE ├── Makefile ├── README.md ├── code-of-conduct.md ├── codecov.yml ├── doc ├── .gitignore ├── Makefile ├── _config.py ├── _quarto.yml ├── _quartodoc.yml ├── _renderer.py ├── changelog.qmd ├── images │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── logo-512.png │ ├── logo.png │ ├── readme-image-1.png │ ├── readme-image-2.png │ ├── readme-image-3.png │ ├── readme-image-4.png │ ├── readme-image-5.png │ ├── readme-image-5alt.png │ └── readme_images.py └── plotnine.scss ├── licences └── SEABORN_LICENSE ├── plotnine ├── __init__.py ├── _mpl │ ├── __init__.py │ ├── gridspec.py │ ├── layout_manager │ │ ├── __init__.py │ │ ├── _engine.py │ │ ├── _layout_items.py │ │ ├── _layout_tree.py │ │ └── _spaces.py │ ├── offsetbox.py │ ├── patches.py │ ├── text.py │ ├── ticker.py │ ├── transforms.py │ └── utils.py ├── _utils │ ├── __init__.py │ ├── context.py │ ├── dev.py │ ├── ipython.py │ ├── quarto.py │ ├── registry.py │ └── yippie.py ├── animation.py ├── coords │ ├── __init__.py │ ├── coord.py │ ├── coord_cartesian.py │ ├── coord_fixed.py │ ├── coord_flip.py │ └── coord_trans.py ├── data │ ├── __init__.py │ ├── anscombe-quartet.csv │ ├── diamonds.csv │ ├── economics.csv │ ├── economics_long.csv │ ├── faithful.csv │ ├── faithfuld.csv │ ├── huron.csv │ ├── luv_colours.csv │ ├── meat.csv │ ├── midwest.csv │ ├── mpg.csv │ ├── msleep.csv │ ├── mtcars.csv │ ├── pageviews.csv │ ├── penguins.csv │ ├── presidential.csv │ ├── seals.csv │ └── txhousing.csv ├── doctools.py ├── exceptions.py ├── facets │ ├── __init__.py │ ├── facet.py │ ├── facet_grid.py │ ├── facet_null.py │ ├── facet_wrap.py │ ├── labelling.py │ ├── layout.py │ └── strips.py ├── geoms │ ├── __init__.py │ ├── annotate.py │ ├── annotation_logticks.py │ ├── annotation_stripes.py │ ├── geom.py │ ├── geom_abline.py │ ├── geom_area.py │ ├── geom_bar.py │ ├── geom_bin_2d.py │ ├── geom_blank.py │ ├── geom_boxplot.py │ ├── geom_col.py │ ├── geom_count.py │ ├── geom_crossbar.py │ ├── geom_density.py │ ├── geom_density_2d.py │ ├── geom_dotplot.py │ ├── geom_errorbar.py │ ├── geom_errorbarh.py │ ├── geom_freqpoly.py │ ├── geom_histogram.py │ ├── geom_hline.py │ ├── geom_jitter.py │ ├── geom_label.py │ ├── geom_line.py │ ├── geom_linerange.py │ ├── geom_map.py │ ├── geom_path.py │ ├── geom_point.py │ ├── geom_pointdensity.py │ ├── geom_pointrange.py │ ├── geom_polygon.py │ ├── geom_qq.py │ ├── geom_qq_line.py │ ├── geom_quantile.py │ ├── geom_raster.py │ ├── geom_rect.py │ ├── geom_ribbon.py │ ├── geom_rug.py │ ├── geom_segment.py │ ├── geom_sina.py │ ├── geom_smooth.py │ ├── geom_spoke.py │ ├── geom_step.py │ ├── geom_text.py │ ├── geom_tile.py │ ├── geom_violin.py │ └── geom_vline.py ├── ggplot.py ├── guides │ ├── __init__.py │ ├── guide.py │ ├── guide_axis.py │ ├── guide_colorbar.py │ ├── guide_legend.py │ └── guides.py ├── helpers.py ├── iapi.py ├── labels.py ├── layer.py ├── mapping │ ├── __init__.py │ ├── _env.py │ ├── _eval_environment.py │ ├── aes.py │ └── evaluation.py ├── options.py ├── plot_composition │ ├── __init__.py │ ├── _compose.py │ ├── _plotspec.py │ └── _spacer.py ├── positions │ ├── __init__.py │ ├── position.py │ ├── position_dodge.py │ ├── position_dodge2.py │ ├── position_fill.py │ ├── position_identity.py │ ├── position_jitter.py │ ├── position_jitterdodge.py │ ├── position_nudge.py │ └── position_stack.py ├── py.typed ├── qplot.py ├── scales │ ├── __init__.py │ ├── _expand.py │ ├── _runtime_typing.py │ ├── limits.py │ ├── range.py │ ├── scale.py │ ├── scale_alpha.py │ ├── scale_color.py │ ├── scale_continuous.py │ ├── scale_datetime.py │ ├── scale_discrete.py │ ├── scale_identity.py │ ├── scale_linetype.py │ ├── scale_manual.py │ ├── scale_shape.py │ ├── scale_size.py │ ├── scale_stroke.py │ ├── scale_xy.py │ └── scales.py ├── stats │ ├── __init__.py │ ├── binning.py │ ├── density.py │ ├── distributions.py │ ├── smoothers.py │ ├── stat.py │ ├── stat_bin.py │ ├── stat_bin_2d.py │ ├── stat_bindot.py │ ├── stat_boxplot.py │ ├── stat_count.py │ ├── stat_density.py │ ├── stat_density_2d.py │ ├── stat_ecdf.py │ ├── stat_ellipse.py │ ├── stat_function.py │ ├── stat_hull.py │ ├── stat_identity.py │ ├── stat_pointdensity.py │ ├── stat_qq.py │ ├── stat_qq_line.py │ ├── stat_quantile.py │ ├── stat_sina.py │ ├── stat_smooth.py │ ├── stat_sum.py │ ├── stat_summary.py │ ├── stat_summary_bin.py │ ├── stat_unique.py │ └── stat_ydensity.py ├── themes │ ├── __init__.py │ ├── elements │ │ ├── __init__.py │ │ ├── element_base.py │ │ ├── element_blank.py │ │ ├── element_line.py │ │ ├── element_rect.py │ │ ├── element_text.py │ │ └── margin.py │ ├── seaborn_rcmod.py │ ├── targets.py │ ├── theme.py │ ├── theme_538.py │ ├── theme_bw.py │ ├── theme_classic.py │ ├── theme_dark.py │ ├── theme_gray.py │ ├── theme_light.py │ ├── theme_linedraw.py │ ├── theme_matplotlib.py │ ├── theme_minimal.py │ ├── theme_seaborn.py │ ├── theme_tufte.py │ ├── theme_void.py │ ├── theme_xkcd.py │ └── themeable.py ├── typing.py └── watermark.py ├── pyproject.toml ├── requirements └── doc.txt ├── tests ├── baseline_images │ ├── test_aes │ │ ├── geom_crossbar.png │ │ ├── reorder.png │ │ ├── reorder_index.png │ │ ├── stat_bin_2d.png │ │ ├── stat_ecdf.png │ │ └── test_stat_function.png │ ├── test_annotate │ │ └── multiple_annotation_geoms.png │ ├── test_annotation_logticks │ │ ├── annotation_logticks.png │ │ ├── annotation_logticks_base_5.png │ │ ├── annotation_logticks_base_8.png │ │ ├── annotation_logticks_coord_flip.png │ │ ├── annotation_logticks_coord_flip_discrete.png │ │ ├── annotation_logticks_coord_flip_discrete_bottom.png │ │ └── annotation_logticks_faceting.png │ ├── test_annotation_stripes │ │ ├── annotation_stripes.png │ │ ├── annotation_stripes_continuous_scale.png │ │ ├── annotation_stripes_coord_flip.png │ │ ├── annotation_stripes_faceting.png │ │ ├── annotation_stripes_fill_direction_extend.png │ │ ├── annotation_stripes_fill_range.png │ │ ├── annotation_stripes_fill_range_cycle.png │ │ └── annotation_stripes_single_stripe.png │ ├── test_coords │ │ ├── coord_fixed.png │ │ ├── coord_flip.png │ │ ├── coord_trans.png │ │ ├── coord_trans_backtransform.png │ │ ├── coord_trans_reverse.png │ │ └── datetime_scale_limits.png │ ├── test_facet_labelling │ │ ├── aslabeller_dict_0tag.png │ │ ├── aslabeller_func_hashtagit.png │ │ ├── label_both.png │ │ ├── label_context.png │ │ ├── label_context_wrap2vars.png │ │ ├── label_value.png │ │ ├── labeller_cols_both_grid.png │ │ ├── labeller_cols_both_wrap.png │ │ ├── labeller_towords.png │ │ └── uneven_num_of_lines.png │ ├── test_facets │ │ ├── array_mapping_and_evaluation.png │ │ ├── dir_v_ncol.png │ │ ├── facet_grid_drop_false.png │ │ ├── facet_grid_expression.png │ │ ├── facet_grid_formula_only_cols.png │ │ ├── facet_grid_formula_only_rows.png │ │ ├── facet_grid_margins.png │ │ ├── facet_grid_one_by_one_var.png │ │ ├── facet_grid_scales_free_x.png │ │ ├── facet_grid_scales_free_y.png │ │ ├── facet_grid_space_free.png │ │ ├── facet_grid_space_ratios.png │ │ ├── facet_wrap_direction_v.png │ │ ├── facet_wrap_expression.png │ │ ├── facet_wrap_label_both.png │ │ ├── facet_wrap_not_as_table.png │ │ ├── facet_wrap_not_as_table_direction_v.png │ │ ├── facet_wrap_one_var.png │ │ ├── facet_wrap_two_vars.png │ │ ├── manual_mapping_with_lists.png │ │ ├── non_mapped_facetting.png │ │ └── variable_and_annotate.png │ ├── test_geom_abline │ │ ├── aes_inheritance.png │ │ └── aesthetics.png │ ├── test_geom_bar_col_histogram │ │ ├── bar-count.png │ │ ├── col.png │ │ ├── col_just.png │ │ ├── histogram-count.png │ │ ├── histogram_weights.png │ │ ├── stat-count-float.png │ │ └── stat-count-int.png │ ├── test_geom_bin_2d │ │ ├── drop_false.png │ │ └── drop_true.png │ ├── test_geom_blank │ │ └── blank.png │ ├── test_geom_boxplot │ │ ├── aesthetics+coord_flip.png │ │ ├── aesthetics.png │ │ ├── no_outliers.png │ │ ├── params.png │ │ ├── position_nudge.png │ │ └── weight.png │ ├── test_geom_count │ │ ├── continuous_x_y.png │ │ ├── discrete_x.png │ │ └── discrete_y.png │ ├── test_geom_crossbar │ │ └── aesthetics.png │ ├── test_geom_density │ │ ├── bounds.png │ │ ├── few_datapoints.png │ │ ├── gaussian-trimmed.png │ │ ├── gaussian.png │ │ ├── gaussian_weighted.png │ │ └── triangular.png │ ├── test_geom_density_2d │ │ ├── contours.png │ │ ├── points.png │ │ └── polygon.png │ ├── test_geom_dotplot │ │ ├── binaxis_y.png │ │ ├── dotdensity.png │ │ ├── group_basic.png │ │ ├── group_stackgroups.png │ │ ├── group_stackgroups_binaxis_y.png │ │ ├── histodot.png │ │ ├── stackdir_center.png │ │ ├── stackdir_centerwhole.png │ │ ├── stackdir_down.png │ │ └── stackratio.png │ ├── test_geom_errorbar_errorbarh │ │ ├── errorbar_aesthetics.png │ │ └── errorbarh_aesthetics.png │ ├── test_geom_freqpoly │ │ └── midpoint.png │ ├── test_geom_hline │ │ └── aesthetics.png │ ├── test_geom_linerange_pointrange │ │ ├── linerange_aesthetics.png │ │ └── pointrange_aesthetics.png │ ├── test_geom_map │ │ ├── facet_wrap.png │ │ ├── geometries.png │ │ ├── multipoint.png │ │ └── multipolygon.png │ ├── test_geom_path_line_step │ │ ├── aesthetics.png │ │ ├── arrow.png │ │ ├── arrow_facets.png │ │ ├── missing_values.png │ │ ├── no_missing_values.png │ │ ├── path_line_step.png │ │ ├── step.png │ │ └── step_mid.png │ ├── test_geom_point │ │ ├── aesthetics.png │ │ ├── color_only_mapping.png │ │ ├── custom_shapes.png │ │ ├── legend_transparency.png │ │ ├── no_fill.png │ │ └── no_mapping.png │ ├── test_geom_pointdensity │ │ ├── contours.png │ │ └── points.png │ ├── test_geom_polygon │ │ ├── aesthetics.png │ │ └── no_fill.png │ ├── test_geom_qq_qq_line │ │ ├── normal.png │ │ └── normal_with_line.png │ ├── test_geom_quantile │ │ └── lines.png │ ├── test_geom_raster │ │ ├── gap_no_interpolation.png │ │ ├── gap_with_interpolation.png │ │ ├── rectangle.png │ │ └── square.png │ ├── test_geom_rect_tile │ │ ├── coord-trans-groups.png │ │ ├── coord-trans.png │ │ ├── infinite-rects.png │ │ ├── rect-aesthetics.png │ │ ├── rect-nofill.png │ │ └── tile-aesthetics.png │ ├── test_geom_ribbon_area │ │ ├── area_aesthetics.png │ │ ├── ribbon_aesthetics.png │ │ ├── ribbon_coord_flip.png │ │ ├── ribbon_facetting.png │ │ ├── ribbon_outline_type.png │ │ ├── ribbon_outline_type_coord_flip.png │ │ └── ribbon_where.png │ ├── test_geom_rug │ │ ├── aesthetics.png │ │ └── coord_flip.png │ ├── test_geom_segment │ │ ├── aesthetics.png │ │ └── arrow.png │ ├── test_geom_sina │ │ ├── method_counts.png │ │ ├── scale_area+coord_flip.png │ │ ├── scale_area.png │ │ ├── scale_count.png │ │ └── style.png │ ├── test_geom_smooth │ │ ├── continuous_x.png │ │ ├── continuous_x_fullrange.png │ │ ├── coord_trans_se_false.png │ │ ├── discrete_x.png │ │ ├── discrete_x_fullrange.png │ │ ├── glm_formula.png │ │ ├── gls_formula.png │ │ ├── init_and_fit_kwargs.png │ │ ├── legend_fill_ratio.png │ │ ├── linear_smooth.png │ │ ├── linear_smooth_no_ci.png │ │ ├── lm_formula.png │ │ ├── lm_formula_weights.png │ │ ├── non_linear_smooth.png │ │ ├── non_linear_smooth_no_ci.png │ │ ├── rlm_formula.png │ │ └── sorts_by_x.png │ ├── test_geom_spoke │ │ ├── aesthetics.png │ │ └── test_unmapped_angle.png │ ├── test_geom_text_label │ │ ├── adjust_label.png │ │ ├── adjust_text.png │ │ ├── adjust_text_default_color.png │ │ ├── format_missing_values.png │ │ ├── label_aesthetics.png │ │ └── text_aesthetics.png │ ├── test_geom_violin │ │ ├── aesthetics+coord_flip.png │ │ ├── aesthetics.png │ │ ├── no_trim.png │ │ ├── overlap.png │ │ ├── quantiles_width_dodge.png │ │ ├── scale.png │ │ ├── scales_free.png │ │ ├── style.png │ │ └── style_alternating.png │ ├── test_geom_vline │ │ └── aesthetics.png │ ├── test_ggplot_internals │ │ ├── after_scale_mapping.png │ │ └── to_pandas.png │ ├── test_guide_internals │ │ └── guide_legend_after_scale.png │ ├── test_layers │ │ └── inserting_layers.png │ ├── test_layout │ │ ├── axis_text_justification.png │ │ ├── axis_title_x_justification.png │ │ ├── axis_title_y_justification.png │ │ ├── colorbar_frame.png │ │ ├── default.png │ │ ├── default_tag_location.png │ │ ├── different_colorbar_themes.png │ │ ├── facet_grid.png │ │ ├── facet_wrap.png │ │ ├── facet_wrap_scales_free.png │ │ ├── inside_legend_90pct_top_right.png │ │ ├── inside_legend_left.png │ │ ├── inside_legend_top.png │ │ ├── inside_legend_top_right.png │ │ ├── justification_with_blank_title_and_text.png │ │ ├── legend_at_the_bottom.png │ │ ├── legend_at_top.png │ │ ├── legend_on_the_left.png │ │ ├── legends_in_different_positions.png │ │ ├── margin_bottom.png │ │ ├── outside_legend_bottom_left.png │ │ ├── outside_legend_left_top.png │ │ ├── outside_legend_right_bottom.png │ │ ├── outside_legend_top_right.png │ │ ├── panel_bottomleft.png │ │ ├── panel_topleft_margin_in_fig.png │ │ ├── panel_topleft_margin_in_pt.png │ │ ├── panel_topleft_margin_in_pt_ar1.png │ │ ├── panel_xycoords.png │ │ ├── plot_margin_aspect_ratio.png │ │ ├── plot_margin_protruding_axis_text.png │ │ ├── plot_title_justification.png │ │ ├── plot_titles_and_caption_positioning.png │ │ ├── plot_topright.png │ │ ├── plot_topright_margin_in_fig.png │ │ ├── plot_topright_margin_in_pt.png │ │ ├── plot_xycoords.png │ │ └── turn_off_guide.png │ ├── test_plot_composition │ │ ├── basic_horizontal_align_resize.png │ │ ├── basic_vertical_align_resize.png │ │ ├── complex_composition.png │ │ ├── facets.png │ │ ├── horizontal_tag_align.png │ │ ├── nested_horizontal_align_resize.png │ │ ├── nested_vertical_align_resize.png │ │ └── vertical_tag_align.png │ ├── test_position │ │ ├── dodge.png │ │ ├── dodge2.png │ │ ├── dodge2_preserve_single_interval.png │ │ ├── dodge2_varwidth.png │ │ ├── dodge_preserve_single.png │ │ ├── dodge_preserve_single_text.png │ │ ├── dodge_segment.png │ │ ├── fill.png │ │ ├── jitter.png │ │ ├── jitterdodge.png │ │ ├── nudge.png │ │ ├── stack-negative.png │ │ ├── stack-non-linear-scale.png │ │ └── stack.png │ ├── test_qplot │ │ ├── arrays.png │ │ ├── multiple_geoms.png │ │ ├── onlyx.png │ │ ├── onlyy.png │ │ ├── range.png │ │ ├── sample.png │ │ ├── scalars.png │ │ ├── series_labelling.png │ │ ├── string-arrays.png │ │ ├── xlim.png │ │ └── ylim.png │ ├── test_scale_internals │ │ ├── bool_mapping.png │ │ ├── breaks_and_labels_outside_of_limits.png │ │ ├── datetime_scale_expansion.png │ │ ├── datetime_scale_limits.png │ │ ├── discrete_xy_scale_drop_limits.png │ │ ├── expand_limits.png │ │ ├── legend_ordering_added_scales.png │ │ ├── legend_ordering_global_aesthetics_1.png │ │ ├── legend_ordering_global_aesthetics_2.png │ │ ├── legend_ordering_local_aesthetics_1.png │ │ ├── legend_ordering_local_aesthetics_2.png │ │ ├── legend_ordering_mixed_scope_aesthetics.png │ │ ├── missing_data_discrete_position_scale.png │ │ ├── missing_data_discrete_scale.png │ │ ├── missing_manual_dict_aesthetic.png │ │ ├── multiple_aesthetics.png │ │ ├── ordinal_scale.png │ │ ├── test_legend_ordering_with_identity_scale.png │ │ ├── transform_aes_defaults_and_params.png │ │ └── transform_datetime_aes_param.png │ ├── test_scale_labelling │ │ ├── caption_complex.png │ │ ├── caption_simple.png │ │ └── labelling_with_colour.png │ ├── test_scale_linetype │ │ ├── scale_linetype_manual_strings.png │ │ └── scale_linetype_manual_tuples.png │ ├── test_scale_symlog │ │ └── scale_y_symlog.png │ ├── test_stat_ecdf │ │ ├── computed_y_column.png │ │ ├── ecdf.png │ │ └── ecdf_no_pad.png │ ├── test_stat_ellipse │ │ └── ellipse.png │ ├── test_stat_function │ │ ├── args.png │ │ └── limits.png │ ├── test_stat_hull │ │ └── hull.png │ ├── test_stat_summary │ │ ├── fun_args.png │ │ ├── mean_cl_boot.png │ │ ├── mean_cl_normal.png │ │ ├── mean_sdl.png │ │ ├── mean_se.png │ │ ├── median_hilow.png │ │ └── summary_functions.png │ ├── test_stat_summary_bin │ │ ├── continuous_x.png │ │ ├── discrete_x.png │ │ └── setting_binwidth.png │ ├── test_theme │ │ ├── axis_ticks_and_length.png │ │ ├── element_text_with_sequence_values.png │ │ ├── no_ticks.png │ │ ├── override_axis_text.png │ │ ├── theme_538.png │ │ ├── theme_bw.png │ │ ├── theme_classic.png │ │ ├── theme_dark.png │ │ ├── theme_gray.png │ │ ├── theme_light.png │ │ ├── theme_linedraw.png │ │ ├── theme_matplotlib.png │ │ ├── theme_minimal.png │ │ ├── theme_seaborn.png │ │ ├── theme_tufte.png │ │ ├── theme_void.png │ │ ├── theme_xkcd.png │ │ └── theme_xkcd_ci.png │ └── test_watermark │ │ └── watermark.png ├── conftest.py ├── images │ └── plotnine-watermark.png ├── test_aes.py ├── test_animation.py ├── test_annotate.py ├── test_annotation_logticks.py ├── test_annotation_stripes.py ├── test_binning.py ├── test_coords.py ├── test_doctools.py ├── test_facet_labelling.py ├── test_facets.py ├── test_geom.py ├── test_geom_abline.py ├── test_geom_bar_col_histogram.py ├── test_geom_bin_2d.py ├── test_geom_blank.py ├── test_geom_boxplot.py ├── test_geom_count.py ├── test_geom_crossbar.py ├── test_geom_density.py ├── test_geom_density_2d.py ├── test_geom_dotplot.py ├── test_geom_errorbar_errorbarh.py ├── test_geom_freqpoly.py ├── test_geom_hline.py ├── test_geom_linerange_pointrange.py ├── test_geom_map.py ├── test_geom_path_line_step.py ├── test_geom_point.py ├── test_geom_pointdensity.py ├── test_geom_polygon.py ├── test_geom_qq_qq_line.py ├── test_geom_quantile.py ├── test_geom_raster.py ├── test_geom_rect_tile.py ├── test_geom_ribbon_area.py ├── test_geom_rug.py ├── test_geom_segment.py ├── test_geom_sina.py ├── test_geom_smooth.py ├── test_geom_spoke.py ├── test_geom_text_label.py ├── test_geom_violin.py ├── test_geom_vline.py ├── test_ggplot_internals.py ├── test_ggsave.py ├── test_guide_internals.py ├── test_helpers.py ├── test_layers.py ├── test_layout.py ├── test_lint_and_format.py ├── test_plot_composition.py ├── test_position.py ├── test_qplot.py ├── test_save_as_pdf_pages.py ├── test_scale_internals.py ├── test_scale_labelling.py ├── test_scale_linetype.py ├── test_scale_symlog.py ├── test_stat.py ├── test_stat_calculate_methods.py ├── test_stat_ecdf.py ├── test_stat_ellipse.py ├── test_stat_function.py ├── test_stat_hull.py ├── test_stat_summary.py ├── test_stat_summary_bin.py ├── test_theme.py ├── test_utils.py └── test_watermark.py └── tools ├── release-checklist-tpl.md ├── release-checklist.py ├── term.py ├── update_baseline_images.py └── visualize_tests.py /.gitattributes: -------------------------------------------------------------------------------- 1 | plotnine/_version.py export-subst 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | __pypackages__/ 27 | node_modules/ 28 | 29 | # Environments 30 | .direnv 31 | .venv 32 | venv 33 | uv.lock 34 | 35 | # PyInstaller 36 | # Usually these files are written by a python script from a template 37 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 38 | *.manifest 39 | *.spec 40 | 41 | # Installer logs 42 | pip-log.txt 43 | pip-delete-this-directory.txt 44 | 45 | # Unit test / coverage reports 46 | htmlcov/ 47 | .tox/ 48 | .coverage 49 | .coverage.* 50 | .cache 51 | nosetests.xml 52 | coverage.xml 53 | *,cover 54 | .hypothesis/ 55 | .pytest_cache 56 | .ruff_cache 57 | .mypy_cache 58 | 59 | # plotnine testing 60 | tests/result_images/ 61 | notes.txt 62 | examples/.ipynb_checkpoints 63 | 64 | # plotnine developing 65 | .ipynb_checkpoints/ 66 | *.ipynb 67 | 68 | # Translations 69 | *.mo 70 | *.pot 71 | 72 | # Django stuff 73 | *.log 74 | 75 | # PyBuilder 76 | target/ 77 | 78 | # OS generated files 79 | .DS_Store 80 | .DS_Store? 81 | 82 | # AirSpeed Velocity benchmarks are not necessary as yet, 83 | # so it is a private branch and this gives a clean 84 | # git status 85 | benchmarks 86 | 87 | # version file generated by setuptools-scm 88 | plotnine/_version.py 89 | doc/qrenderer.scss 90 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/astral-sh/ruff-pre-commit 3 | rev: v0.11.9 4 | hooks: 5 | # Run the linter. 6 | - id: ruff 7 | args: [--select=I001, --fix] 8 | # Run the formatter. 9 | - id: ruff-format 10 | -------------------------------------------------------------------------------- /.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yaml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Set the version of Python and other tools you might need 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.11" 13 | 14 | # Build documentation in the docs/ directory with Sphinx 15 | sphinx: 16 | configuration: doc/conf.py 17 | 18 | # Optionally declare the Python requirements required to build your docs 19 | python: 20 | install: 21 | - method: pip 22 | path: . 23 | extra_requirements: 24 | - doc 25 | - requirements: requirements/examples.txt 26 | -------------------------------------------------------------------------------- /CITATION.bib: -------------------------------------------------------------------------------- 1 | @misc{plotnine, 2 | author = {The plotnine development team}, 3 | title = {plotnine: A grammar of graphics for Python}, 4 | url = {https://github.com/has2k1/plotnine}, 5 | doi = {https://doi.org/10.5281/zenodo.1325308} 6 | } 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 Hassan Kibirige 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | codecov: 2 | require_ci_to_pass: true 3 | 4 | comment: 5 | behavior: default 6 | branches: 7 | - 'main' 8 | 9 | coverage: 10 | round: 'down' 11 | range: 90..100 12 | status: 13 | project: 14 | default: 15 | target: auto 16 | threshold: 0.5% 17 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | /.quarto/ 2 | _extensions/ 3 | _site/ 4 | site_libs/ 5 | _environment 6 | _variables.yml 7 | 8 | # quartodoc 9 | _inv/ 10 | reference/ 11 | qrenderer.scss 12 | objects.json 13 | objects.txt 14 | objects.inv 15 | gallery/thumbnails 16 | -------------------------------------------------------------------------------- /doc/_config.py: -------------------------------------------------------------------------------- 1 | """ 2 | This script is run by the Makefile before quarto_build 3 | """ 4 | 5 | import re 6 | from importlib.metadata import version as get_version 7 | from pathlib import Path 8 | 9 | DOC_DIR = Path(__file__).parent 10 | EXAMPLES_DIR = DOC_DIR / "reference" / "examples" 11 | TUTORIALS_DIR = DOC_DIR / "tutorials" 12 | 13 | # The variables file holds the version 14 | variables_filepath = DOC_DIR / "_variables.yml" 15 | VARIABLES_TPL = """\ 16 | version: {version} 17 | """ 18 | 19 | 20 | def generate_variables_file(): 21 | """ 22 | Generate _variables.yml file in the quartodoc project directory 23 | """ 24 | # Modifying variables file breaks quarto preview 25 | if variables_filepath.exists(): 26 | return 27 | 28 | version = get_version("plotnine") 29 | 30 | # The scm-version scheme adds .date suffix to the version 31 | # if the repo is dirty. For better look while developing, 32 | # we remove it. 33 | dirty_pattern = re.compile(r"\.d\d{8}$") 34 | if dirty_pattern.search(version): 35 | version = dirty_pattern.sub("", version) 36 | 37 | contents = VARIABLES_TPL.format(version=version) 38 | variables_filepath.write_text(contents) 39 | 40 | 41 | if __name__ == "__main__": 42 | generate_variables_file() 43 | -------------------------------------------------------------------------------- /doc/_quarto.yml: -------------------------------------------------------------------------------- 1 | project: 2 | type: website 3 | resources: 4 | - objects.inv 5 | render: 6 | - "reference/**.qmd" 7 | - "*.qmd" 8 | 9 | website: 10 | title: "plotnine {{< var version >}}" 11 | favicon: "images/favicon.ico" 12 | page-navigation: true 13 | navbar: 14 | left: 15 | - file: reference/index.qmd 16 | text: "Reference" 17 | right: 18 | - icon: github 19 | href: https://github.com/has2k1/plotnine 20 | 21 | format: 22 | html: 23 | toc: true 24 | theme: 25 | - lumen 26 | - qrenderer.scss 27 | - plotnine.scss 28 | 29 | 30 | filters: 31 | - interlinks 32 | 33 | interlinks: 34 | sources: 35 | python: 36 | url: https://docs.python.org/3/ 37 | matplotlib: 38 | url: https://matplotlib.org/stable/ 39 | mizani: 40 | url: https://mizani.readthedocs.io/en/stable/ 41 | numpy: 42 | url: https://numpy.org/doc/stable/ 43 | scipy: 44 | url: https://docs.scipy.org/doc/scipy/ 45 | statsmodels: 46 | url: https://www.statsmodels.org/stable/ 47 | pandas: 48 | url: https://pandas.pydata.org/pandas-docs/stable/ 49 | sklearn: 50 | url: https://scikit-learn.org/stable/ 51 | skmisc: 52 | url: https://has2k1.github.io/scikit-misc/stable/ 53 | adjustText: 54 | url: https://adjusttext.readthedocs.io/en/latest/ 55 | patsy: 56 | url: https://patsy.readthedocs.io/en/stable/ 57 | 58 | issuey: 59 | issue-url: "https://github.com/has2k1/plotnine/issues/%id" 60 | issue-text: "#%id" 61 | issue-title: "Issue: #%id" 62 | pull-request-url: "https://github.com/has2k1/plotnine/pulls/%id" 63 | pull-request-text: "PR%id" 64 | pull-request-title: "Pull Request: #%id" 65 | -------------------------------------------------------------------------------- /doc/images/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/favicon-16x16.png -------------------------------------------------------------------------------- /doc/images/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/favicon-32x32.png -------------------------------------------------------------------------------- /doc/images/logo-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/logo-512.png -------------------------------------------------------------------------------- /doc/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/logo.png -------------------------------------------------------------------------------- /doc/images/readme-image-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/readme-image-1.png -------------------------------------------------------------------------------- /doc/images/readme-image-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/readme-image-2.png -------------------------------------------------------------------------------- /doc/images/readme-image-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/readme-image-3.png -------------------------------------------------------------------------------- /doc/images/readme-image-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/readme-image-4.png -------------------------------------------------------------------------------- /doc/images/readme-image-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/readme-image-5.png -------------------------------------------------------------------------------- /doc/images/readme-image-5alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/doc/images/readme-image-5alt.png -------------------------------------------------------------------------------- /doc/images/readme_images.py: -------------------------------------------------------------------------------- 1 | from plotnine import ( 2 | aes, 3 | facet_wrap, 4 | geom_point, 5 | ggplot, 6 | stat_smooth, 7 | theme, 8 | theme_tufte, 9 | theme_xkcd, 10 | ) 11 | from plotnine.data import mtcars 12 | 13 | p1 = ( 14 | ggplot(mtcars, aes("wt", "mpg")) 15 | + geom_point() 16 | + theme(figure_size=(6, 4), dpi=300) 17 | ) 18 | p1.save("readme-image-1.png") 19 | 20 | p2 = p1 + aes(color="factor(gear)") 21 | p2.save("readme-image-2.png") 22 | 23 | p3 = p2 + stat_smooth(method="lm") 24 | p3.save("readme-image-3.png") 25 | 26 | p4 = p3 + facet_wrap("gear") 27 | p4.save("readme-image-4.png") 28 | 29 | p5 = p4 + theme_xkcd() 30 | p5.save("readme-image-5.png") 31 | 32 | p5alt = p4 + theme_tufte() 33 | p5alt.save("readme-image-5alt.png") 34 | -------------------------------------------------------------------------------- /doc/plotnine.scss: -------------------------------------------------------------------------------- 1 | // Ref: 2 | // - https://getbootstrap.com/docs/5.3/utilities/spacing/ 3 | // - https://github.com/twbs/bootstrap/blob/main/scss/_variables.scss 4 | 5 | /*-- scss:defaults --*/ 6 | $primary: #9E2F68; 7 | 8 | /*-- scss:mixins --*/ 9 | 10 | /*-- scss:rules --*/ 11 | $signature-border-color: tint-color($primary, 25%); 12 | 13 | 14 | .doc-signature.doc-module > div:first-child, 15 | .doc-signature.doc-class > div:first-child { 16 | border-top: 0.25rem solid $signature-border-color; 17 | } 18 | 19 | .doc-signature.doc-function > div:first-child, 20 | .doc-signature.doc-method > div:first-child { 21 | border-left: 0.25rem solid $signature-border-color; 22 | } 23 | 24 | .doc-signature.doc-attribute > p > code::before { 25 | // A half-dot whose breadth is the same as the border width, 26 | // and slide it to the border. 27 | content: ""; 28 | display: inline-block; 29 | width: 0.5rem; 30 | height: 0.5rem; 31 | background-color: $signature-border-color; 32 | border-radius: 50%; 33 | vertical-align: middle; 34 | margin-left: -.75rem; 35 | margin-right: .5rem; 36 | } 37 | 38 | /*-- scss:functions --*/ 39 | 40 | /*-- scss:uses --*/ 41 | 42 | -------------------------------------------------------------------------------- /licences/SEABORN_LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013, Michael L. Waskom 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of the {organization} nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /plotnine/_mpl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/plotnine/_mpl/__init__.py -------------------------------------------------------------------------------- /plotnine/_mpl/layout_manager/__init__.py: -------------------------------------------------------------------------------- 1 | from ._engine import PlotnineCompositionLayoutEngine, PlotnineLayoutEngine 2 | 3 | __all__ = ( 4 | "PlotnineLayoutEngine", 5 | "PlotnineCompositionLayoutEngine", 6 | ) 7 | -------------------------------------------------------------------------------- /plotnine/_mpl/ticker.py: -------------------------------------------------------------------------------- 1 | import locale 2 | 3 | from matplotlib.ticker import FixedFormatter 4 | 5 | 6 | class MyFixedFormatter(FixedFormatter): 7 | """ 8 | Override MPL fixedformatter for better formatting 9 | """ 10 | 11 | def format_data(self, value: float) -> str: 12 | """ 13 | Return a formatted string representation of a number. 14 | """ 15 | s = locale.format_string("%1.10e", (value,)) 16 | return self.fix_minus(s) 17 | -------------------------------------------------------------------------------- /plotnine/_mpl/transforms.py: -------------------------------------------------------------------------------- 1 | from matplotlib.transforms import Bbox 2 | 3 | ZEROS_BBOX = Bbox([[0, 0], [0, 0]]) 4 | -------------------------------------------------------------------------------- /plotnine/_utils/quarto.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | 4 | def is_quarto_environment() -> bool: 5 | """ 6 | Return True if running in quarto 7 | """ 8 | return "QUARTO_FIG_WIDTH" in os.environ 9 | 10 | 11 | def set_options_from_quarto(): 12 | """ 13 | Set options from quarto 14 | """ 15 | from plotnine.options import set_option 16 | 17 | dpi = int(os.environ["QUARTO_FIG_DPI"]) 18 | figure_size = ( 19 | float(os.environ["QUARTO_FIG_WIDTH"]), 20 | float(os.environ["QUARTO_FIG_HEIGHT"]), 21 | ) 22 | # quarto verifies the format 23 | # If is retina, it doubles the original dpi and changes the 24 | # format to png. Since we cannot tell whether fig-format is 25 | # png or retina, we assume retina. 26 | figure_format = os.environ["QUARTO_FIG_FORMAT"] 27 | if figure_format == "png": 28 | figure_format = "retina" 29 | dpi = dpi // 2 30 | 31 | set_option("dpi", dpi) 32 | set_option("figure_size", figure_size) 33 | set_option("figure_format", figure_format) 34 | -------------------------------------------------------------------------------- /plotnine/coords/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Coordinates 3 | """ 4 | 5 | from .coord_cartesian import coord_cartesian 6 | from .coord_fixed import coord_equal, coord_fixed 7 | from .coord_flip import coord_flip 8 | from .coord_trans import coord_trans 9 | 10 | __all__ = ( 11 | "coord_cartesian", 12 | "coord_fixed", 13 | "coord_equal", 14 | "coord_flip", 15 | "coord_trans", 16 | ) 17 | -------------------------------------------------------------------------------- /plotnine/data/anscombe-quartet.csv: -------------------------------------------------------------------------------- 1 | dataset,x,y 2 | I,10,8.04 3 | I,8,6.95 4 | I,13,7.58 5 | I,9,8.81 6 | I,11,8.33 7 | I,14,9.96 8 | I,6,7.24 9 | I,4,4.26 10 | I,12,10.84 11 | I,7,4.82 12 | I,5,5.68 13 | II,10,9.14 14 | II,8,8.14 15 | II,13,8.74 16 | II,9,8.77 17 | II,11,9.26 18 | II,14,8.1 19 | II,6,6.13 20 | II,4,3.1 21 | II,12,9.13 22 | II,7,7.26 23 | II,5,4.74 24 | III,10,7.46 25 | III,8,6.77 26 | III,13,12.74 27 | III,9,7.11 28 | III,11,7.81 29 | III,14,8.84 30 | III,6,6.08 31 | III,4,5.39 32 | III,12,8.15 33 | III,7,6.42 34 | III,5,5.73 35 | IV,8,6.58 36 | IV,8,5.76 37 | IV,8,7.71 38 | IV,8,8.84 39 | IV,8,8.47 40 | IV,8,7.04 41 | IV,8,5.25 42 | IV,19,12.5 43 | IV,8,5.56 44 | IV,8,7.91 45 | IV,8,6.89 46 | -------------------------------------------------------------------------------- /plotnine/data/presidential.csv: -------------------------------------------------------------------------------- 1 | "name","start","end","party" 2 | "Eisenhower",1953-01-20,1961-01-20,"Republican" 3 | "Kennedy",1961-01-20,1963-11-22,"Democratic" 4 | "Johson",1963-11-22,1969-01-20,"Democratic" 5 | "Nixon",1969-01-20,1974-08-09,"Republican" 6 | "Ford",1974-08-09,1977-01-20,"Republican" 7 | "Carter",1977-01-20,1981-01-20,"Democratic" 8 | "Reagan",1981-01-20,1989-01-20,"Republican" 9 | "Bush",1989-01-20,1993-01-20,"Republican" 10 | "Clinton",1993-01-20,2001-01-20,"Democratic" 11 | "Bush",2001-01-20,2009-01-20,"Republican" 12 | "Obama",2009-01-20,2017-01-20,"Democratic" 13 | -------------------------------------------------------------------------------- /plotnine/facets/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Facets 3 | """ 4 | 5 | from .facet_grid import facet_grid 6 | from .facet_null import facet_null 7 | from .facet_wrap import facet_wrap 8 | from .labelling import ( 9 | as_labeller, 10 | label_both, 11 | label_context, 12 | label_value, 13 | labeller, 14 | ) 15 | 16 | __all__ = ( 17 | "facet_grid", 18 | "facet_null", 19 | "facet_wrap", 20 | "label_value", 21 | "label_both", 22 | "label_context", 23 | "labeller", 24 | "as_labeller", 25 | ) 26 | -------------------------------------------------------------------------------- /plotnine/facets/facet_null.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from .facet import facet, layout_null 6 | 7 | if typing.TYPE_CHECKING: 8 | import pandas as pd 9 | 10 | 11 | class facet_null(facet): 12 | """ 13 | A single Panel 14 | 15 | Parameters 16 | ---------- 17 | shrink : bool, default=True 18 | Whether to shrink the scales to the output of the 19 | statistics instead of the raw data. 20 | """ 21 | 22 | def __init__(self, shrink: bool = True): 23 | facet.__init__(self, shrink=shrink) 24 | self.nrow = 1 25 | self.ncol = 1 26 | 27 | def map(self, data: pd.DataFrame, layout: pd.DataFrame) -> pd.DataFrame: 28 | data["PANEL"] = 1 29 | return data 30 | 31 | def compute_layout( 32 | self, 33 | data: list[pd.DataFrame], 34 | ) -> pd.DataFrame: 35 | return layout_null() 36 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_area.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from ..doctools import document 6 | from .geom_ribbon import geom_ribbon 7 | 8 | if typing.TYPE_CHECKING: 9 | import pandas as pd 10 | 11 | 12 | @document 13 | class geom_area(geom_ribbon): 14 | """ 15 | Area plot 16 | 17 | An area plot is a special case of geom_ribbon, 18 | where the minimum of the range is fixed to 0, 19 | and the position adjustment defaults to 'stack'. 20 | 21 | {usage} 22 | 23 | Parameters 24 | ---------- 25 | {common_parameters} 26 | 27 | See Also 28 | -------- 29 | plotnine.geom_ribbon 30 | """ 31 | 32 | REQUIRED_AES = {"x", "y"} 33 | DEFAULT_PARAMS = { 34 | **geom_ribbon.DEFAULT_PARAMS, 35 | "position": "stack", 36 | "outline_type": "upper", 37 | } 38 | 39 | def setup_data(self, data: pd.DataFrame) -> pd.DataFrame: 40 | data["ymin"] = 0 41 | data["ymax"] = data["y"] 42 | return data 43 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_bin_2d.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_rect import geom_rect 3 | 4 | 5 | @document 6 | class geom_bin_2d(geom_rect): 7 | """ 8 | Heatmap of 2d bin counts 9 | 10 | Divides the plane into rectangles, counts the number of 11 | cases in each rectangle, and then (by default) maps the number 12 | of cases to the rectangle's fill. This is a useful alternative 13 | to geom_point in the presence of overplotting. 14 | 15 | {usage} 16 | 17 | Parameters 18 | ---------- 19 | {common_parameters} 20 | """ 21 | 22 | DEFAULT_PARAMS = {"stat": "bin_2d", "position": "identity", "na_rm": False} 23 | 24 | 25 | geom_bin2d = geom_bin_2d 26 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_blank.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from ..doctools import document 6 | from .geom import geom 7 | 8 | if typing.TYPE_CHECKING: 9 | import pandas as pd 10 | from matplotlib.axes import Axes 11 | 12 | from plotnine.coords.coord import coord 13 | from plotnine.iapi import panel_view 14 | 15 | 16 | @document 17 | class geom_blank(geom): 18 | """ 19 | An empty plot 20 | 21 | {usage} 22 | 23 | Parameters 24 | ---------- 25 | {common_parameters} 26 | """ 27 | 28 | DEFAULT_PARAMS = { 29 | "stat": "identity", 30 | "position": "identity", 31 | "na_rm": False, 32 | } 33 | 34 | def draw_panel( 35 | self, 36 | data: pd.DataFrame, 37 | panel_params: panel_view, 38 | coord: coord, 39 | ax: Axes, 40 | ): 41 | pass 42 | 43 | def handle_na(self, data: pd.DataFrame) -> pd.DataFrame: 44 | return data 45 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_col.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_bar import geom_bar 3 | 4 | 5 | @document 6 | class geom_col(geom_bar): 7 | """ 8 | Bar plot with base on the x-axis 9 | 10 | This is an alternate version of [](`~plotnine.geoms.geom_bar`) that maps 11 | the height of bars to an existing variable in your data. If 12 | you want the height of the bar to represent a count of cases, 13 | use [](`~plotnine.geoms.geom_bar`). 14 | 15 | {usage} 16 | 17 | Parameters 18 | ---------- 19 | {common_parameters} 20 | just : float, default=0.5 21 | How to align the column with respect to the axis breaks. The default 22 | `0.5` aligns the center of the column with the break. `0` aligns the 23 | left of the of the column with the break and `1` aligns the right of 24 | the column with the break. 25 | width : float, default=None 26 | Bar width. If `None`{.py}, the width is set to 27 | `90%` of the resolution of the data. 28 | 29 | See Also 30 | -------- 31 | plotnine.geom_bar 32 | """ 33 | 34 | REQUIRED_AES = {"x", "y"} 35 | NON_MISSING_AES = {"xmin", "xmax", "ymin", "ymax"} 36 | DEFAULT_PARAMS = { 37 | "stat": "identity", 38 | "position": "stack", 39 | "na_rm": False, 40 | "just": 0.5, 41 | "width": None, 42 | } 43 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_count.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_point import geom_point 3 | 4 | 5 | @document 6 | class geom_count(geom_point): 7 | """ 8 | Plot overlapping points 9 | 10 | This is a variant [](`~plotnine.geoms.geom_point`) that counts the number 11 | of observations at each location, then maps the count to point 12 | area. It useful when you have discrete data and overplotting. 13 | 14 | {usage} 15 | 16 | Parameters 17 | ---------- 18 | {common_parameters} 19 | """ 20 | 21 | DEFAULT_PARAMS = {"stat": "sum", "position": "identity", "na_rm": False} 22 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_density.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_area import geom_area 3 | 4 | 5 | @document 6 | class geom_density(geom_area): 7 | """ 8 | Smooth density estimate 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | 16 | See Also 17 | -------- 18 | plotnine.geom_ribbon 19 | """ 20 | 21 | DEFAULT_AES = { 22 | **geom_area.DEFAULT_AES, 23 | "color": "black", 24 | "fill": None, 25 | "weight": 1, 26 | } 27 | 28 | DEFAULT_PARAMS = { 29 | **geom_area.DEFAULT_PARAMS, 30 | "stat": "density", 31 | "position": "identity", 32 | } 33 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_density_2d.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_path import geom_path 3 | 4 | 5 | @document 6 | class geom_density_2d(geom_path): 7 | """ 8 | 2D density estimate 9 | 10 | This is a 2d version of [](`~plotnine.geoms.geom_density`). 11 | 12 | {usage} 13 | 14 | Parameters 15 | ---------- 16 | {common_parameters} 17 | """ 18 | 19 | DEFAULT_PARAMS = { 20 | "stat": "density_2d", 21 | "position": "identity", 22 | "na_rm": False, 23 | } 24 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_freqpoly.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_path import geom_path 3 | 4 | _params = geom_path.DEFAULT_PARAMS.copy() 5 | _params["stat"] = "bin" 6 | 7 | 8 | @document 9 | class geom_freqpoly(geom_path): 10 | """ 11 | Frequency polygon 12 | 13 | {usage} 14 | 15 | See [](`~plotnine.geoms.geom_path`) for documentation 16 | of the parameters. 17 | """ 18 | 19 | DEFAULT_PARAMS = _params 20 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_histogram.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_bar import geom_bar 3 | 4 | 5 | @document 6 | class geom_histogram(geom_bar): 7 | """ 8 | Histogram 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | 16 | See Also 17 | -------- 18 | plotnine.geom_bar 19 | """ 20 | 21 | DEFAULT_PARAMS = {"stat": "bin", "position": "stack", "na_rm": False} 22 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_line.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from ..doctools import document 6 | from .geom_path import geom_path 7 | 8 | if typing.TYPE_CHECKING: 9 | import pandas as pd 10 | 11 | 12 | @document 13 | class geom_line(geom_path): 14 | """ 15 | Connected points 16 | 17 | {usage} 18 | 19 | Parameters 20 | ---------- 21 | {common_parameters} 22 | 23 | See Also 24 | -------- 25 | plotnine.geom_path : For documentation of other parameters. 26 | """ 27 | 28 | def setup_data(self, data: pd.DataFrame) -> pd.DataFrame: 29 | return data.sort_values(["PANEL", "group", "x"]) 30 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_linerange.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from ..doctools import document 6 | from .geom import geom 7 | from .geom_path import geom_path 8 | from .geom_segment import geom_segment 9 | 10 | if typing.TYPE_CHECKING: 11 | from typing import Any 12 | 13 | import pandas as pd 14 | from matplotlib.axes import Axes 15 | 16 | from plotnine.coords.coord import coord 17 | from plotnine.iapi import panel_view 18 | 19 | 20 | @document 21 | class geom_linerange(geom): 22 | """ 23 | Vertical interval represented by lines 24 | 25 | {usage} 26 | 27 | Parameters 28 | ---------- 29 | {common_parameters} 30 | """ 31 | 32 | DEFAULT_AES = { 33 | "alpha": 1, 34 | "color": "black", 35 | "linetype": "solid", 36 | "size": 0.5, 37 | } 38 | REQUIRED_AES = {"x", "ymin", "ymax"} 39 | DEFAULT_PARAMS = { 40 | "stat": "identity", 41 | "position": "identity", 42 | "na_rm": False, 43 | } 44 | draw_legend = staticmethod(geom_path.draw_legend) 45 | 46 | @staticmethod 47 | def draw_group( 48 | data: pd.DataFrame, 49 | panel_params: panel_view, 50 | coord: coord, 51 | ax: Axes, 52 | params: dict[str, Any], 53 | ): 54 | data.eval( 55 | """ 56 | xend = x 57 | y = ymin 58 | yend = ymax 59 | """, 60 | inplace=True, 61 | ) 62 | geom_segment.draw_group(data, panel_params, coord, ax, params) 63 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_pointdensity.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_point import geom_point 3 | 4 | 5 | @document 6 | class geom_pointdensity(geom_point): 7 | """ 8 | Scatterplot with density estimation at each point 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | """ 16 | 17 | DEFAULT_PARAMS = { 18 | "stat": "pointdensity", 19 | "position": "identity", 20 | "na_rm": False, 21 | } 22 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_qq.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_point import geom_point 3 | 4 | 5 | @document 6 | class geom_qq(geom_point): 7 | """ 8 | Quantile-Quantile plot 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | """ 16 | 17 | DEFAULT_PARAMS = {"stat": "qq", "position": "identity", "na_rm": False} 18 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_qq_line.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_path import geom_path 3 | 4 | 5 | @document 6 | class geom_qq_line(geom_path): 7 | """ 8 | Quantile-Quantile Line plot 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | """ 16 | 17 | DEFAULT_PARAMS = { 18 | "stat": "qq_line", 19 | "position": "identity", 20 | "na_rm": False, 21 | } 22 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_quantile.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_path import geom_path 3 | 4 | 5 | @document 6 | class geom_quantile(geom_path): 7 | """ 8 | Quantile lines from a quantile regression 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | lineend : Literal["butt", "round", "projecting"], default="butt" 16 | Line end style. This option is applied for solid linetypes. 17 | linejoin : Literal["round", "miter", "bevel"], default="round" 18 | Line join style. This option is applied for solid linetypes. 19 | """ 20 | 21 | DEFAULT_AES = { 22 | "alpha": 1, 23 | "color": "#3366FF", 24 | "linetype": "solid", 25 | "size": 0.5, 26 | } 27 | DEFAULT_PARAMS = { 28 | "stat": "quantile", 29 | "position": "identity", 30 | "na_rm": False, 31 | "lineend": "butt", 32 | "linejoin": "round", 33 | } 34 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_sina.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .geom_point import geom_point 3 | 4 | 5 | @document 6 | class geom_sina(geom_point): 7 | """ 8 | Draw a sina plot 9 | 10 | A sina plot is a data visualization chart suitable for plotting 11 | any single variable in a multiclass dataset. It is an enhanced 12 | jitter strip chart, where the width of the jitter is controlled 13 | by the density distribution of the data within each class. 14 | 15 | {usage} 16 | 17 | Parameters 18 | ---------- 19 | {common_parameters} 20 | 21 | See Also 22 | -------- 23 | plotnine.stat_sina 24 | 25 | References 26 | ---------- 27 | Sidiropoulos, N., S. H. Sohi, T. L. Pedersen, B. T. Porse, O. Winther, 28 | N. Rapin, and F. O. Bagger. 2018. 29 | "SinaPlot: An Enhanced Chart for Simple and Truthful Representation of 30 | Single Observations over Multiple Classes." 31 | J. Comp. Graph. Stat 27: 673–76. 32 | """ 33 | 34 | DEFAULT_PARAMS = {"stat": "sina", "position": "dodge", "na_rm": False} 35 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_spoke.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | import numpy as np 6 | 7 | from ..doctools import document 8 | from .geom_segment import geom_segment 9 | 10 | if typing.TYPE_CHECKING: 11 | import pandas as pd 12 | 13 | 14 | @document 15 | class geom_spoke(geom_segment): 16 | """ 17 | Line segment parameterised by location, direction and distance 18 | 19 | {usage} 20 | 21 | Parameters 22 | ---------- 23 | {common_parameters} 24 | 25 | See Also 26 | -------- 27 | plotnine.geom_segment : For documentation of extra 28 | parameters. 29 | """ 30 | 31 | REQUIRED_AES = {"x", "y", "angle", "radius"} 32 | 33 | def setup_data(self, data: pd.DataFrame) -> pd.DataFrame: 34 | try: 35 | radius = data["radius"] 36 | except KeyError: 37 | radius = self.aes_params["radius"] 38 | try: 39 | angle = data["angle"] 40 | except KeyError: 41 | angle = self.aes_params["angle"] 42 | 43 | data["xend"] = data["x"] + np.cos(angle) * radius 44 | data["yend"] = data["y"] + np.sin(angle) * radius 45 | return data 46 | -------------------------------------------------------------------------------- /plotnine/geoms/geom_tile.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from .._utils import resolution 6 | from ..doctools import document 7 | from .geom_rect import geom_rect 8 | 9 | if typing.TYPE_CHECKING: 10 | import pandas as pd 11 | 12 | 13 | @document 14 | class geom_tile(geom_rect): 15 | """ 16 | Rectangles specified using a center points 17 | 18 | {usage} 19 | 20 | Parameters 21 | ---------- 22 | {common_parameters} 23 | 24 | See Also 25 | -------- 26 | plotnine.geom_rect 27 | """ 28 | 29 | DEFAULT_AES = { 30 | "alpha": 1, 31 | "color": None, 32 | "fill": "#333333", 33 | "linetype": "solid", 34 | "size": 0.1, 35 | "width": None, 36 | "height": None, 37 | } 38 | REQUIRED_AES = {"x", "y"} 39 | DEFAULT_PARAMS = { 40 | "stat": "identity", 41 | "position": "identity", 42 | "na_rm": False, 43 | } 44 | 45 | def setup_data(self, data: pd.DataFrame) -> pd.DataFrame: 46 | try: 47 | width = data.pop("width") 48 | except KeyError: 49 | width = self.aes_params.get( 50 | "width", 51 | resolution(data["x"], False), 52 | ) 53 | 54 | try: 55 | height = data.pop("height") 56 | except KeyError: 57 | height = self.aes_params.get( 58 | "height", 59 | resolution(data["y"], False), 60 | ) 61 | 62 | data["xmin"] = data["x"] - width / 2 63 | data["xmax"] = data["x"] + width / 2 64 | data["ymin"] = data["y"] - height / 2 65 | data["ymax"] = data["y"] + height / 2 66 | return data 67 | -------------------------------------------------------------------------------- /plotnine/guides/__init__.py: -------------------------------------------------------------------------------- 1 | from .guide_colorbar import guide_colorbar, guide_colourbar 2 | from .guide_legend import guide_legend 3 | from .guides import guides 4 | 5 | __all__ = ("guide_colorbar", "guide_colourbar", "guide_legend", "guides") 6 | -------------------------------------------------------------------------------- /plotnine/guides/guide_axis.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from dataclasses import dataclass, field 4 | 5 | from .guide import guide 6 | 7 | 8 | @dataclass 9 | class guide_axis(guide): 10 | """ 11 | Axis 12 | """ 13 | 14 | # Non-Parameter Attributes 15 | available_aes: set[str] = field( 16 | init=False, default_factory=lambda: {"x", "y"} 17 | ) 18 | -------------------------------------------------------------------------------- /plotnine/helpers.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from copy import deepcopy 4 | from typing import TYPE_CHECKING 5 | 6 | if TYPE_CHECKING: 7 | from typing import Sequence 8 | 9 | from plotnine import ggplot 10 | 11 | __all__ = ("get_aesthetic_limits",) 12 | 13 | 14 | def get_aesthetic_limits( 15 | plot: ggplot, 16 | ae: str, 17 | ) -> ( 18 | tuple[float, float] 19 | | Sequence[str] 20 | | list[tuple[float]] 21 | | list[Sequence[str]] 22 | ): 23 | """ 24 | Get the limits of an aesthetic 25 | 26 | These are the limits before they are expanded. 27 | 28 | Parameters 29 | ---------- 30 | plot : 31 | ggplot object 32 | 33 | ae : 34 | Name of aesthetic 35 | 36 | Returns 37 | ------- 38 | out : 39 | The limits of the aesthetic. If the plot is facetted, (has many 40 | panels), it is a sequence of limits, one for each panel. 41 | """ 42 | plot = deepcopy(plot) 43 | plot._build() 44 | limits = [ 45 | getattr(panel, ae).limits 46 | for panel in plot._build_objs.layout.panel_params 47 | ] 48 | 49 | return limits[0] if len(limits) == 1 else limits 50 | -------------------------------------------------------------------------------- /plotnine/mapping/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Aesthetic Mappings 3 | """ 4 | 5 | from ._env import Environment # noqa: F401 6 | from .aes import aes 7 | from .evaluation import after_scale, after_stat, stage 8 | 9 | __all__ = ("aes", "after_stat", "after_scale", "stage") 10 | -------------------------------------------------------------------------------- /plotnine/plot_composition/__init__.py: -------------------------------------------------------------------------------- 1 | from ._compose import ADD, DIV, OR, Compose 2 | from ._spacer import spacer 3 | 4 | __all__ = ( 5 | "Compose", 6 | "ADD", 7 | "DIV", 8 | "OR", 9 | "spacer", 10 | ) 11 | -------------------------------------------------------------------------------- /plotnine/plot_composition/_plotspec.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from dataclasses import dataclass 4 | from typing import TYPE_CHECKING 5 | 6 | if TYPE_CHECKING: 7 | from matplotlib.figure import Figure 8 | from matplotlib.gridspec import SubplotSpec 9 | 10 | from plotnine._mpl.gridspec import p9GridSpec 11 | from plotnine.ggplot import ggplot 12 | 13 | 14 | @dataclass 15 | class plotspec: 16 | """ 17 | Plot Specification 18 | """ 19 | 20 | plot: ggplot 21 | """ 22 | Plot 23 | """ 24 | 25 | figure: Figure 26 | """ 27 | Figure in which the draw the plot 28 | """ 29 | 30 | composition_gridspec: p9GridSpec 31 | """ 32 | The gridspec of the innermost composition group that contains the plot 33 | """ 34 | 35 | subplotspec: SubplotSpec 36 | """ 37 | The subplotspec that contains the plot 38 | 39 | This is the subplot within the composition gridspec and it will 40 | contain the plot's gridspec. 41 | """ 42 | 43 | plot_gridspec: p9GridSpec 44 | """ 45 | The gridspec in which the plot is drawn 46 | """ 47 | 48 | def __post_init__(self): 49 | self.plot.figure = self.figure 50 | self.plot._gridspec = self.plot_gridspec 51 | -------------------------------------------------------------------------------- /plotnine/plot_composition/_spacer.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from copy import deepcopy 4 | 5 | from plotnine import element_rect, ggplot, theme, theme_void 6 | 7 | 8 | class spacer(ggplot): 9 | """ 10 | An empty plot 11 | """ 12 | 13 | def __init__(self): 14 | super().__init__() 15 | self.theme = theme_void() 16 | 17 | def __add__(self, rhs) -> spacer: # pyright: ignore[reportIncompatibleMethodOverride] 18 | """ 19 | Add to spacer 20 | 21 | All added objects are no ops except the plot_background, 22 | i.e.: 23 | 24 | theme(plot_background=element_rect(fill="red")) 25 | """ 26 | self = deepcopy(self) 27 | if isinstance(rhs, theme): 28 | fill = rhs.getp(("plot_background", "facecolor")) 29 | self.theme += theme( 30 | plot_background=element_rect(fill=fill), 31 | ) 32 | return self 33 | -------------------------------------------------------------------------------- /plotnine/positions/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Position Adjustments 3 | """ 4 | 5 | from .position_dodge import position_dodge 6 | from .position_dodge2 import position_dodge2 7 | from .position_fill import position_fill 8 | from .position_identity import position_identity 9 | from .position_jitter import position_jitter 10 | from .position_jitterdodge import position_jitterdodge 11 | from .position_nudge import position_nudge 12 | from .position_stack import position_stack 13 | 14 | __all__ = ( 15 | "position_dodge", 16 | "position_dodge2", 17 | "position_fill", 18 | "position_identity", 19 | "position_jitter", 20 | "position_jitterdodge", 21 | "position_nudge", 22 | "position_stack", 23 | ) 24 | -------------------------------------------------------------------------------- /plotnine/positions/position_fill.py: -------------------------------------------------------------------------------- 1 | from .position_stack import position_stack 2 | 3 | 4 | class position_fill(position_stack): 5 | """ 6 | Normalise stacked objects to unit height 7 | """ 8 | 9 | fill = True 10 | -------------------------------------------------------------------------------- /plotnine/positions/position_identity.py: -------------------------------------------------------------------------------- 1 | from .position import position 2 | 3 | 4 | class position_identity(position): 5 | """ 6 | Do not adjust the position 7 | """ 8 | 9 | @classmethod 10 | def compute_layer(cls, data, params, layout): 11 | return data 12 | -------------------------------------------------------------------------------- /plotnine/positions/position_nudge.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from .position import position 6 | 7 | if typing.TYPE_CHECKING: 8 | from plotnine.typing import FloatArray, FloatArrayLike 9 | 10 | 11 | class position_nudge(position): 12 | """ 13 | Nudge points 14 | 15 | Useful to nudge labels away from the points 16 | being labels. 17 | 18 | Parameters 19 | ---------- 20 | x : 21 | Horizontal nudge 22 | y : 23 | Vertical nudge 24 | """ 25 | 26 | def __init__(self, x: float = 0, y: float = 0): 27 | self.params = {"x": x, "y": y} 28 | 29 | @classmethod 30 | def compute_layer(cls, data, params, layout): 31 | trans_x = None # pyright: ignore 32 | trans_y = None # pyright: ignore 33 | 34 | if params["x"]: 35 | 36 | def trans_x(x: FloatArrayLike) -> FloatArray: 37 | return x + params["x"] 38 | 39 | if params["y"]: 40 | 41 | def trans_y(y: FloatArrayLike) -> FloatArray: 42 | return y + params["y"] 43 | 44 | return cls.transform_position(data, trans_x, trans_y) 45 | -------------------------------------------------------------------------------- /plotnine/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/plotnine/py.typed -------------------------------------------------------------------------------- /plotnine/scales/_runtime_typing.py: -------------------------------------------------------------------------------- 1 | """ 2 | This module contains type aliases needed in plotnine.scales.* at runtime. 3 | For example as annotations when declaring dataclasses. They are separated 4 | out so that we can refer to them as plotnine.scales._runtime_typing for 5 | the documentation. 6 | """ 7 | 8 | from typing import Callable, Sequence, Type, TypeAlias, TypeVar 9 | 10 | from mizani.transforms import trans 11 | 12 | from .range import Range 13 | 14 | # fmt: off 15 | 16 | DiscreteBreaksUser: TypeAlias = ( 17 | bool 18 | | None 19 | | Sequence[str] 20 | | Callable[[Sequence[str]], Sequence[str]] 21 | ) 22 | 23 | DiscreteLimitsUser: TypeAlias = ( 24 | None 25 | | Sequence[str] 26 | | Callable[[Sequence[str]], Sequence[str]] 27 | ) 28 | 29 | ContinuousBreaksUser: TypeAlias = ( 30 | bool 31 | | None 32 | | Sequence[float] 33 | | Callable[[tuple[float, float]], Sequence[float]] 34 | ) 35 | 36 | MinorBreaksUser: TypeAlias = ContinuousBreaksUser 37 | 38 | ContinuousLimitsUser: TypeAlias = ( 39 | None 40 | | tuple[float, float] 41 | | Callable[[tuple[float, float]], tuple[float, float]] 42 | ) 43 | 44 | ScaleLabelsUser: TypeAlias = ( 45 | bool 46 | | None 47 | | Sequence[str] 48 | | Callable[[Sequence[float] | Sequence[str]], Sequence[str]] 49 | | dict[str, str] 50 | ) 51 | 52 | TransUser: TypeAlias = trans | str | Type[trans] | None 53 | 54 | RangeT = TypeVar("RangeT", bound=Range) 55 | BreaksUserT = TypeVar("BreaksUserT") 56 | LimitsUserT = TypeVar("LimitsUserT") 57 | GuideTypeT = TypeVar("GuideTypeT") 58 | -------------------------------------------------------------------------------- /plotnine/scales/range.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | import typing 4 | 5 | from mizani.scale import scale_continuous, scale_discrete 6 | 7 | if typing.TYPE_CHECKING: 8 | from typing import Any, Sequence 9 | 10 | from plotnine.typing import AnyArrayLike, FloatArrayLike 11 | 12 | 13 | class Range: 14 | """ 15 | Base class for all ranges 16 | """ 17 | 18 | # Holds the range information after training 19 | range: Any 20 | 21 | def reset(self): 22 | """ 23 | Reset range 24 | """ 25 | del self.range 26 | 27 | def train(self, x: Sequence[Any]): 28 | """ 29 | Train range 30 | """ 31 | raise NotImplementedError("Not Implemented.") 32 | 33 | def is_empty(self) -> bool: 34 | """ 35 | Whether there is range information 36 | """ 37 | return not hasattr(self, "range") 38 | 39 | 40 | class RangeContinuous(Range): 41 | """ 42 | Continuous Range 43 | """ 44 | 45 | range: tuple[float, float] 46 | 47 | def train(self, x: FloatArrayLike): 48 | """ 49 | Train continuous range 50 | """ 51 | rng = None if self.is_empty() else self.range 52 | self.range = scale_continuous.train(x, rng) 53 | 54 | 55 | class RangeDiscrete(Range): 56 | """ 57 | Discrete Range 58 | """ 59 | 60 | range: Sequence[Any] 61 | 62 | def train(self, x: AnyArrayLike, drop: bool = False, na_rm: bool = False): 63 | """ 64 | Train discrete range 65 | """ 66 | rng = None if self.is_empty() else self.range 67 | self.range = scale_discrete.train(x, rng, drop, na_rm=na_rm) 68 | -------------------------------------------------------------------------------- /plotnine/scales/scale_linetype.py: -------------------------------------------------------------------------------- 1 | from dataclasses import dataclass 2 | from warnings import warn 3 | 4 | from .._utils.registry import alias 5 | from ..exceptions import PlotnineError, PlotnineWarning 6 | from .scale_continuous import scale_continuous 7 | from .scale_discrete import scale_discrete 8 | 9 | LINETYPES = ["solid", "dashed", "dashdot", "dotted"] 10 | 11 | 12 | @dataclass 13 | class scale_linetype(scale_discrete): 14 | """ 15 | Scale for line patterns 16 | 17 | Notes 18 | ----- 19 | The available linetypes are 20 | `'solid', 'dashed', 'dashdot', 'dotted'` 21 | If you need more custom linetypes, use 22 | [](`~plotnine.scales.scale_linetype_manual`) 23 | """ 24 | 25 | _aesthetics = ["linetype"] 26 | 27 | def __post_init__(self): 28 | from mizani.palettes import manual_pal 29 | 30 | super().__post_init__() 31 | self.palette = manual_pal(LINETYPES) 32 | 33 | 34 | @dataclass 35 | class scale_linetype_ordinal(scale_linetype): 36 | """ 37 | Scale for line patterns 38 | """ 39 | 40 | _aesthetics = ["linetype"] 41 | 42 | def __post_init__(self): 43 | super().__post_init__() 44 | 45 | warn( 46 | "Using linetype for an ordinal variable is not advised.", 47 | PlotnineWarning, 48 | ) 49 | 50 | 51 | class scale_linetype_continuous(scale_continuous): 52 | """ 53 | Linetype scale 54 | """ 55 | 56 | def __init__(self): 57 | raise PlotnineError( 58 | "A continuous variable can not be mapped to linetype" 59 | ) 60 | 61 | 62 | @alias 63 | class scale_linetype_discrete(scale_linetype): 64 | pass 65 | -------------------------------------------------------------------------------- /plotnine/stats/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Statistics 3 | """ 4 | 5 | from .stat_bin import stat_bin 6 | from .stat_bin_2d import stat_bin2d, stat_bin_2d 7 | from .stat_bindot import stat_bindot 8 | from .stat_boxplot import stat_boxplot 9 | from .stat_count import stat_count 10 | from .stat_density import stat_density 11 | from .stat_density_2d import stat_density_2d 12 | from .stat_ecdf import stat_ecdf 13 | from .stat_ellipse import stat_ellipse 14 | from .stat_function import stat_function 15 | from .stat_hull import stat_hull 16 | from .stat_identity import stat_identity 17 | from .stat_pointdensity import stat_pointdensity 18 | from .stat_qq import stat_qq 19 | from .stat_qq_line import stat_qq_line 20 | from .stat_quantile import stat_quantile 21 | from .stat_sina import stat_sina 22 | from .stat_smooth import stat_smooth 23 | from .stat_sum import stat_sum 24 | from .stat_summary import stat_summary 25 | from .stat_summary_bin import stat_summary_bin 26 | from .stat_unique import stat_unique 27 | from .stat_ydensity import stat_ydensity 28 | 29 | __all__ = ( 30 | "stat_count", 31 | "stat_bin", 32 | "stat_bin_2d", 33 | "stat_bin2d", 34 | "stat_bindot", 35 | "stat_boxplot", 36 | "stat_density", 37 | "stat_ecdf", 38 | "stat_ellipse", 39 | "stat_density_2d", 40 | "stat_function", 41 | "stat_hull", 42 | "stat_identity", 43 | "stat_pointdensity", 44 | "stat_qq", 45 | "stat_qq_line", 46 | "stat_quantile", 47 | "stat_sina", 48 | "stat_smooth", 49 | "stat_sum", 50 | "stat_summary", 51 | "stat_summary_bin", 52 | "stat_unique", 53 | "stat_ydensity", 54 | ) 55 | -------------------------------------------------------------------------------- /plotnine/stats/distributions.py: -------------------------------------------------------------------------------- 1 | import scipy.stats as stats 2 | 3 | from ..exceptions import PlotnineError 4 | 5 | 6 | def _hasattrs(obj, attrs): 7 | return all(hasattr(obj, attr) for attr in attrs) 8 | 9 | 10 | # Continuous univariate 11 | continuous = { 12 | k for k in dir(stats) if _hasattrs(getattr(stats, k), ("pdf", "cdf")) 13 | } 14 | 15 | # Discrete univariate 16 | discrete = {k for k in dir(stats) if hasattr(getattr(stats, k), "pmf")} 17 | 18 | univariate = continuous | discrete 19 | 20 | 21 | def get(name): 22 | """ 23 | Get any scipy.stats distribution of a given name 24 | """ 25 | try: 26 | return getattr(stats, name) 27 | except AttributeError as e: 28 | msg = f"Unknown distribution '{name}'" 29 | raise PlotnineError(msg) from e 30 | 31 | 32 | def get_continuous_distribution(name): 33 | """ 34 | Get continuous scipy.stats distribution of a given name 35 | """ 36 | if name not in continuous: 37 | msg = "Unknown continuous distribution '{}'" 38 | raise ValueError(msg.format(name)) 39 | 40 | return getattr(stats, name) 41 | 42 | 43 | def get_univariate(name): 44 | """ 45 | Get univariate scipy.stats distribution of a given name 46 | """ 47 | if name not in univariate: 48 | msg = "Unknown univariate distribution '{}'" 49 | raise ValueError(msg.format(name)) 50 | 51 | return get(name) 52 | -------------------------------------------------------------------------------- /plotnine/stats/stat_hull.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from ..doctools import document 5 | from .stat import stat 6 | 7 | 8 | @document 9 | class stat_hull(stat): 10 | """ 11 | 2 Dimensional Convex Hull 12 | 13 | {usage} 14 | 15 | Parameters 16 | ---------- 17 | {common_parameters} 18 | qhull_options: str, default=None 19 | Additional options to pass to Qhull. 20 | See `Qhull `__ documentation 21 | for details. 22 | 23 | Raises 24 | ------ 25 | scipy.spatial.QhullError 26 | Raised when Qhull encounters an error condition, 27 | such as geometrical degeneracy when options to resolve are 28 | not enabled. 29 | """ 30 | 31 | _aesthetics_doc = """ 32 | {aesthetics_table} 33 | 34 | **Options for computed aesthetics** 35 | 36 | ```python 37 | "area" # Area of the convex hull 38 | ``` 39 | 40 | """ 41 | REQUIRED_AES = {"x", "y"} 42 | DEFAULT_PARAMS = { 43 | "geom": "path", 44 | "position": "identity", 45 | "na_rm": False, 46 | "qhull_options": None, 47 | } 48 | CREATES = {"area"} 49 | 50 | def compute_group(self, data, scales): 51 | from scipy.spatial import ConvexHull 52 | 53 | hull = ConvexHull( 54 | data[["x", "y"]], qhull_options=self.params["qhull_options"] 55 | ) 56 | idx = np.hstack([hull.vertices, hull.vertices[0]]) 57 | 58 | new_data = pd.DataFrame( 59 | { 60 | "x": data["x"].iloc[idx].to_numpy(), 61 | "y": data["y"].iloc[idx].to_numpy(), 62 | "area": hull.area, 63 | } 64 | ) 65 | return new_data 66 | -------------------------------------------------------------------------------- /plotnine/stats/stat_identity.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .stat import stat 3 | 4 | 5 | @document 6 | class stat_identity(stat): 7 | """ 8 | Identity (do nothing) statistic 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | """ 16 | 17 | DEFAULT_PARAMS = {"geom": "point", "position": "identity", "na_rm": False} 18 | 19 | def compute_panel(self, data, scales): 20 | return data 21 | -------------------------------------------------------------------------------- /plotnine/stats/stat_unique.py: -------------------------------------------------------------------------------- 1 | from ..doctools import document 2 | from .stat import stat 3 | 4 | 5 | @document 6 | class stat_unique(stat): 7 | """ 8 | Remove duplicates 9 | 10 | {usage} 11 | 12 | Parameters 13 | ---------- 14 | {common_parameters} 15 | """ 16 | 17 | DEFAULT_PARAMS = {"geom": "point", "position": "identity", "na_rm": False} 18 | 19 | def compute_panel(self, data, scales): 20 | return data.drop_duplicates() 21 | -------------------------------------------------------------------------------- /plotnine/themes/__init__.py: -------------------------------------------------------------------------------- 1 | from .theme import theme, theme_get, theme_set, theme_update 2 | from .theme_538 import theme_538 3 | from .theme_bw import theme_bw 4 | from .theme_classic import theme_classic 5 | from .theme_dark import theme_dark 6 | from .theme_gray import theme_gray, theme_grey 7 | from .theme_light import theme_light 8 | from .theme_linedraw import theme_linedraw 9 | from .theme_matplotlib import theme_matplotlib 10 | from .theme_minimal import theme_minimal 11 | from .theme_seaborn import theme_seaborn 12 | from .theme_tufte import theme_tufte 13 | from .theme_void import theme_void 14 | from .theme_xkcd import theme_xkcd 15 | 16 | __all__ = ( 17 | "theme", 18 | "theme_538", 19 | "theme_bw", 20 | "theme_classic", 21 | "theme_dark", 22 | "theme_gray", 23 | "theme_grey", 24 | "theme_light", 25 | "theme_linedraw", 26 | "theme_matplotlib", 27 | "theme_minimal", 28 | "theme_seaborn", 29 | "theme_void", 30 | "theme_xkcd", 31 | "theme_tufte", 32 | "theme_get", 33 | "theme_set", 34 | "theme_update", 35 | ) 36 | -------------------------------------------------------------------------------- /plotnine/themes/elements/__init__.py: -------------------------------------------------------------------------------- 1 | from .element_blank import element_blank 2 | from .element_line import element_line 3 | from .element_rect import element_rect 4 | from .element_text import element_text 5 | from .margin import margin, margin_auto 6 | 7 | __all__ = ( 8 | "element_blank", 9 | "element_line", 10 | "element_rect", 11 | "element_text", 12 | "margin", 13 | "margin_auto", 14 | ) 15 | -------------------------------------------------------------------------------- /plotnine/themes/elements/element_base.py: -------------------------------------------------------------------------------- 1 | """ 2 | Theme elements used to decorate the graph. 3 | """ 4 | 5 | from __future__ import annotations 6 | 7 | from typing import TYPE_CHECKING 8 | 9 | if TYPE_CHECKING: 10 | from typing import Any 11 | 12 | from plotnine import theme 13 | 14 | 15 | class element_base: 16 | """ 17 | Base class for all theme elements 18 | """ 19 | 20 | properties: dict[str, Any] # dict of the properties 21 | 22 | def __init__(self): 23 | self.properties = {"visible": True} 24 | 25 | def __repr__(self) -> str: 26 | """ 27 | Element representation 28 | """ 29 | return f"{self.__class__.__name__}({self})" 30 | 31 | def __str__(self) -> str: 32 | """ 33 | Element as string 34 | """ 35 | d = self.properties.copy() 36 | del d["visible"] 37 | return f"{d}" 38 | 39 | def setup(self, theme: theme, themeable_name: str): 40 | """ 41 | Setup the theme_element before drawing 42 | """ 43 | -------------------------------------------------------------------------------- /plotnine/themes/elements/element_blank.py: -------------------------------------------------------------------------------- 1 | from .element_base import element_base 2 | 3 | 4 | class element_blank(element_base): 5 | """ 6 | Theme element: Blank 7 | """ 8 | 9 | def __init__(self): 10 | self.properties = {"visible": False} 11 | -------------------------------------------------------------------------------- /plotnine/themes/theme_538.py: -------------------------------------------------------------------------------- 1 | from .elements import element_blank, element_line, element_rect, element_text 2 | from .theme import theme 3 | from .theme_gray import theme_gray 4 | 5 | 6 | class theme_538(theme_gray): 7 | """ 8 | Theme in the likeness of fivethirtyeight.com plots 9 | 10 | Parameters 11 | ---------- 12 | base_size : int 13 | Base font size. All text sizes are a scaled versions of 14 | the base font size. 15 | base_family : str 16 | Base font family. 17 | """ 18 | 19 | def __init__(self, base_size=11, base_family="DejaVu Sans"): 20 | super().__init__(base_size, base_family) 21 | bgcolor = "#F0F0F0" 22 | self += theme( 23 | axis_ticks=element_blank(), 24 | title=element_text(color="#3C3C3C"), 25 | legend_background=element_rect(fill="none"), 26 | panel_background=element_rect(fill=bgcolor), 27 | panel_border=element_blank(), 28 | panel_grid_major=element_line(color="#D5D5D5"), 29 | panel_grid_minor=element_blank(), 30 | plot_background=element_rect(fill=bgcolor, color=bgcolor, size=1), 31 | strip_background=element_rect(size=0), 32 | ) 33 | -------------------------------------------------------------------------------- /plotnine/themes/theme_bw.py: -------------------------------------------------------------------------------- 1 | from .elements import element_line, element_rect, element_text 2 | from .theme import theme 3 | from .theme_gray import theme_gray 4 | 5 | 6 | class theme_bw(theme_gray): 7 | """ 8 | White background with black gridlines 9 | 10 | Parameters 11 | ---------- 12 | base_size : int 13 | Base font size. All text sizes are a scaled versions of 14 | the base font size. 15 | base_family : str 16 | Base font family. If `None`, use [](`plotnine.options.base_family`). 17 | """ 18 | 19 | def __init__(self, base_size=11, base_family=None): 20 | super().__init__(base_size, base_family) 21 | self += theme( 22 | axis_text=element_text(size=0.8 * base_size), 23 | panel_background=element_rect(fill="white"), 24 | panel_border=element_rect(fill="none", color="#7f7f7f"), 25 | panel_grid_major=element_line(color="#E5E5E5"), 26 | panel_grid_minor=element_line(color="#FAFAFA"), 27 | strip_background=element_rect( 28 | fill="#CCCCCC", color="#7F7F7F", size=1 29 | ), 30 | ) 31 | -------------------------------------------------------------------------------- /plotnine/themes/theme_classic.py: -------------------------------------------------------------------------------- 1 | from .elements import element_blank, element_line, element_rect 2 | from .theme import theme 3 | from .theme_bw import theme_bw 4 | 5 | 6 | class theme_classic(theme_bw): 7 | """ 8 | A classic-looking theme, with x & y axis lines and no gridlines 9 | 10 | Parameters 11 | ---------- 12 | base_size : int 13 | Base font size. All text sizes are a scaled versions of 14 | the base font size. 15 | base_family : str 16 | Base font family. If `None`, use [](`plotnine.options.base_family`). 17 | """ 18 | 19 | def __init__(self, base_size=11, base_family=None): 20 | super().__init__(base_size, base_family) 21 | self += theme( 22 | panel_border=element_blank(), 23 | axis_line=element_line(color="black"), 24 | panel_grid_major=element_blank(), 25 | panel_grid_minor=element_blank(), 26 | strip_background=element_rect(colour="black", fill="none", size=1), 27 | legend_key=element_blank(), 28 | ) 29 | -------------------------------------------------------------------------------- /plotnine/themes/theme_dark.py: -------------------------------------------------------------------------------- 1 | from .elements import element_blank, element_line, element_rect, element_text 2 | from .theme import theme 3 | from .theme_gray import theme_gray 4 | 5 | 6 | class theme_dark(theme_gray): 7 | """ 8 | The dark cousin of [](`~plotnine.themes.theme_light.theme_light`) 9 | 10 | It has similar line sizes but a dark background. Useful to 11 | make thin colored lines pop out. 12 | 13 | Parameters 14 | ---------- 15 | base_size : int 16 | Base font size. All text sizes are a scaled versions of 17 | the base font size. 18 | base_family : str 19 | Base font family. If `None`, use [](`plotnine.options.base_family`). 20 | """ 21 | 22 | def __init__(self, base_size=11, base_family=None): 23 | super().__init__(base_size, base_family) 24 | self += theme( 25 | axis_ticks=element_line(color="#666666", size=0.5), 26 | axis_ticks_minor=element_blank(), 27 | panel_background=element_rect(fill="#7F7F7F", color="none"), 28 | panel_grid_major=element_line(color="#666666", size=0.5), 29 | panel_grid_minor=element_line(color="#737373", size=0.25), 30 | strip_background=element_rect(fill="#333333", color="none"), 31 | strip_text_x=element_text(color="white"), 32 | strip_text_y=element_text(color="white", angle=-90), 33 | ) 34 | -------------------------------------------------------------------------------- /plotnine/themes/theme_light.py: -------------------------------------------------------------------------------- 1 | from .elements import element_blank, element_line, element_rect, element_text 2 | from .theme import theme 3 | from .theme_gray import theme_gray 4 | 5 | 6 | class theme_light(theme_gray): 7 | """ 8 | A theme similar to [](`~plotnine.themes.theme_linedraw.theme_linedraw`) 9 | 10 | Has light grey lines lines and axes to direct more attention 11 | towards the data. 12 | 13 | Parameters 14 | ---------- 15 | base_size : int 16 | Base font size. All text sizes are a scaled versions of 17 | the base font size. 18 | base_family : str 19 | Base font family. If `None`, use [](`plotnine.options.base_family`). 20 | """ 21 | 22 | def __init__(self, base_size=11, base_family=None): 23 | super().__init__(base_size, base_family) 24 | self += theme( 25 | axis_ticks=element_line(color="#B3B3B3", size=0.5), 26 | axis_ticks_minor=element_blank(), 27 | legend_key=element_rect(color="#7F7F7F", size=0.72), 28 | panel_background=element_rect(fill="white"), 29 | panel_border=element_rect(fill="none", color="#B3B3B3", size=1), 30 | panel_grid_major=element_line(color="#D9D9D9", size=0.5), 31 | panel_grid_minor=element_line(color="#EDEDED", size=0.25), 32 | strip_background=element_rect( 33 | fill="#B3B3B3", color="#B3B3B3", size=1 34 | ), 35 | strip_text_x=element_text(color="white"), 36 | strip_text_y=element_text(color="white", angle=-90), 37 | ) 38 | -------------------------------------------------------------------------------- /plotnine/themes/theme_linedraw.py: -------------------------------------------------------------------------------- 1 | from .elements import element_blank, element_line, element_rect, element_text 2 | from .theme import theme 3 | from .theme_bw import theme_bw 4 | 5 | 6 | class theme_linedraw(theme_bw): 7 | """ 8 | A theme with only black lines of various widths on white backgrounds 9 | 10 | Parameters 11 | ---------- 12 | base_size : int 13 | Base font size. All text sizes are a scaled versions of 14 | the base font size. 15 | base_family : str 16 | Base font family. If `None`, use [](`plotnine.options.base_family`). 17 | """ 18 | 19 | def __init__(self, base_size=11, base_family=None): 20 | super().__init__(base_size, base_family) 21 | self += theme( 22 | axis_text=element_text(color="black", size=base_size * 0.8), 23 | axis_ticks=element_line(color="black", size=0.5), 24 | axis_ticks_minor=element_blank(), 25 | legend_key=element_rect(color="black", size=0.72), 26 | panel_background=element_rect(fill="white"), 27 | panel_border=element_rect(fill="none", color="black", size=1), 28 | panel_grid_major=element_line(color="black", size=0.1), 29 | panel_grid_minor=element_line(color="black", size=0.02), 30 | strip_background=element_rect(fill="black", color="black", size=1), 31 | strip_text_x=element_text(color="white"), 32 | strip_text_y=element_text(color="white", angle=-90), 33 | ) 34 | -------------------------------------------------------------------------------- /plotnine/themes/theme_minimal.py: -------------------------------------------------------------------------------- 1 | from .elements import element_blank 2 | from .theme import theme 3 | from .theme_bw import theme_bw 4 | 5 | 6 | class theme_minimal(theme_bw): 7 | """ 8 | A minimalistic theme with no background annotations 9 | 10 | Parameters 11 | ---------- 12 | base_size : int 13 | Base font size. All text sizes are a scaled versions of 14 | the base font size. 15 | base_family : str 16 | Base font family. If `None`, use [](`plotnine.options.base_family`). 17 | """ 18 | 19 | def __init__(self, base_size=11, base_family=None): 20 | super().__init__(base_size, base_family) 21 | self += theme( 22 | axis_ticks=element_blank(), 23 | legend_background=element_blank(), 24 | legend_key=element_blank(), 25 | panel_background=element_blank(), 26 | panel_border=element_blank(), 27 | plot_background=element_blank(), 28 | strip_background=element_blank(), 29 | ) 30 | -------------------------------------------------------------------------------- /requirements/doc.txt: -------------------------------------------------------------------------------- 1 | # These cannot be in pyproject.toml, pypi does not install git packages 2 | # quartodoc @ git+https://github.com/machow/quartodoc#egg=quartodoc 3 | qrenderer @ git+https://github.com/has2k1/qrenderer#egg=qrenderer 4 | -------------------------------------------------------------------------------- /tests/baseline_images/test_aes/geom_crossbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_aes/geom_crossbar.png -------------------------------------------------------------------------------- /tests/baseline_images/test_aes/reorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_aes/reorder.png -------------------------------------------------------------------------------- /tests/baseline_images/test_aes/reorder_index.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_aes/reorder_index.png -------------------------------------------------------------------------------- /tests/baseline_images/test_aes/stat_bin_2d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_aes/stat_bin_2d.png -------------------------------------------------------------------------------- /tests/baseline_images/test_aes/stat_ecdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_aes/stat_ecdf.png -------------------------------------------------------------------------------- /tests/baseline_images/test_aes/test_stat_function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_aes/test_stat_function.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotate/multiple_annotation_geoms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotate/multiple_annotation_geoms.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_logticks/annotation_logticks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_logticks/annotation_logticks.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_logticks/annotation_logticks_base_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_logticks/annotation_logticks_base_5.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_logticks/annotation_logticks_base_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_logticks/annotation_logticks_base_8.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_logticks/annotation_logticks_coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_logticks/annotation_logticks_coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_logticks/annotation_logticks_coord_flip_discrete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_logticks/annotation_logticks_coord_flip_discrete.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_logticks/annotation_logticks_coord_flip_discrete_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_logticks/annotation_logticks_coord_flip_discrete_bottom.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_logticks/annotation_logticks_faceting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_logticks/annotation_logticks_faceting.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes_continuous_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes_continuous_scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes_coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes_coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes_faceting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes_faceting.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes_fill_direction_extend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes_fill_direction_extend.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes_fill_range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes_fill_range.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes_fill_range_cycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes_fill_range_cycle.png -------------------------------------------------------------------------------- /tests/baseline_images/test_annotation_stripes/annotation_stripes_single_stripe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_annotation_stripes/annotation_stripes_single_stripe.png -------------------------------------------------------------------------------- /tests/baseline_images/test_coords/coord_fixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_coords/coord_fixed.png -------------------------------------------------------------------------------- /tests/baseline_images/test_coords/coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_coords/coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_coords/coord_trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_coords/coord_trans.png -------------------------------------------------------------------------------- /tests/baseline_images/test_coords/coord_trans_backtransform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_coords/coord_trans_backtransform.png -------------------------------------------------------------------------------- /tests/baseline_images/test_coords/coord_trans_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_coords/coord_trans_reverse.png -------------------------------------------------------------------------------- /tests/baseline_images/test_coords/datetime_scale_limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_coords/datetime_scale_limits.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/aslabeller_dict_0tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/aslabeller_dict_0tag.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/aslabeller_func_hashtagit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/aslabeller_func_hashtagit.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/label_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/label_both.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/label_context.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/label_context.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/label_context_wrap2vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/label_context_wrap2vars.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/label_value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/label_value.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/labeller_cols_both_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/labeller_cols_both_grid.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/labeller_cols_both_wrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/labeller_cols_both_wrap.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/labeller_towords.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/labeller_towords.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facet_labelling/uneven_num_of_lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facet_labelling/uneven_num_of_lines.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/array_mapping_and_evaluation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/array_mapping_and_evaluation.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/dir_v_ncol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/dir_v_ncol.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_drop_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_drop_false.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_expression.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_formula_only_cols.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_formula_only_cols.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_formula_only_rows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_formula_only_rows.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_margins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_margins.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_one_by_one_var.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_one_by_one_var.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_scales_free_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_scales_free_x.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_scales_free_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_scales_free_y.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_space_free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_space_free.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_grid_space_ratios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_grid_space_ratios.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_wrap_direction_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_wrap_direction_v.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_wrap_expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_wrap_expression.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_wrap_label_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_wrap_label_both.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_wrap_not_as_table.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_wrap_not_as_table.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_wrap_not_as_table_direction_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_wrap_not_as_table_direction_v.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_wrap_one_var.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_wrap_one_var.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/facet_wrap_two_vars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/facet_wrap_two_vars.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/manual_mapping_with_lists.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/manual_mapping_with_lists.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/non_mapped_facetting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/non_mapped_facetting.png -------------------------------------------------------------------------------- /tests/baseline_images/test_facets/variable_and_annotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_facets/variable_and_annotate.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_abline/aes_inheritance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_abline/aes_inheritance.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_abline/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_abline/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bar_col_histogram/bar-count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bar_col_histogram/bar-count.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bar_col_histogram/col.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bar_col_histogram/col.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bar_col_histogram/col_just.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bar_col_histogram/col_just.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bar_col_histogram/histogram-count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bar_col_histogram/histogram-count.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bar_col_histogram/histogram_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bar_col_histogram/histogram_weights.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bar_col_histogram/stat-count-float.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bar_col_histogram/stat-count-float.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bar_col_histogram/stat-count-int.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bar_col_histogram/stat-count-int.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bin_2d/drop_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bin_2d/drop_false.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_bin_2d/drop_true.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_bin_2d/drop_true.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_blank/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_blank/blank.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_boxplot/aesthetics+coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_boxplot/aesthetics+coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_boxplot/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_boxplot/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_boxplot/no_outliers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_boxplot/no_outliers.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_boxplot/params.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_boxplot/params.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_boxplot/position_nudge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_boxplot/position_nudge.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_boxplot/weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_boxplot/weight.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_count/continuous_x_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_count/continuous_x_y.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_count/discrete_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_count/discrete_x.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_count/discrete_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_count/discrete_y.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_crossbar/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_crossbar/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density/bounds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density/bounds.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density/few_datapoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density/few_datapoints.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density/gaussian-trimmed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density/gaussian-trimmed.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density/gaussian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density/gaussian.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density/gaussian_weighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density/gaussian_weighted.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density/triangular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density/triangular.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density_2d/contours.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density_2d/contours.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density_2d/points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density_2d/points.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_density_2d/polygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_density_2d/polygon.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/binaxis_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/binaxis_y.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/dotdensity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/dotdensity.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/group_basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/group_basic.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/group_stackgroups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/group_stackgroups.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/group_stackgroups_binaxis_y.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/group_stackgroups_binaxis_y.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/histodot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/histodot.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/stackdir_center.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/stackdir_center.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/stackdir_centerwhole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/stackdir_centerwhole.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/stackdir_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/stackdir_down.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_dotplot/stackratio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_dotplot/stackratio.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_errorbar_errorbarh/errorbar_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_errorbar_errorbarh/errorbar_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_errorbar_errorbarh/errorbarh_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_errorbar_errorbarh/errorbarh_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_freqpoly/midpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_freqpoly/midpoint.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_hline/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_hline/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_linerange_pointrange/linerange_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_linerange_pointrange/linerange_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_linerange_pointrange/pointrange_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_linerange_pointrange/pointrange_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_map/facet_wrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_map/facet_wrap.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_map/geometries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_map/geometries.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_map/multipoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_map/multipoint.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_map/multipolygon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_map/multipolygon.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/arrow.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/arrow_facets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/arrow_facets.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/missing_values.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/missing_values.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/no_missing_values.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/no_missing_values.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/path_line_step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/path_line_step.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/step.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_path_line_step/step_mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_path_line_step/step_mid.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_point/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_point/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_point/color_only_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_point/color_only_mapping.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_point/custom_shapes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_point/custom_shapes.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_point/legend_transparency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_point/legend_transparency.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_point/no_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_point/no_fill.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_point/no_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_point/no_mapping.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_pointdensity/contours.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_pointdensity/contours.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_pointdensity/points.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_pointdensity/points.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_polygon/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_polygon/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_polygon/no_fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_polygon/no_fill.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_qq_qq_line/normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_qq_qq_line/normal.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_qq_qq_line/normal_with_line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_qq_qq_line/normal_with_line.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_quantile/lines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_quantile/lines.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_raster/gap_no_interpolation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_raster/gap_no_interpolation.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_raster/gap_with_interpolation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_raster/gap_with_interpolation.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_raster/rectangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_raster/rectangle.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_raster/square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_raster/square.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rect_tile/coord-trans-groups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rect_tile/coord-trans-groups.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rect_tile/coord-trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rect_tile/coord-trans.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rect_tile/infinite-rects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rect_tile/infinite-rects.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rect_tile/rect-aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rect_tile/rect-aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rect_tile/rect-nofill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rect_tile/rect-nofill.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rect_tile/tile-aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rect_tile/tile-aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_ribbon_area/area_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_ribbon_area/area_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_ribbon_area/ribbon_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_ribbon_area/ribbon_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_ribbon_area/ribbon_coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_ribbon_area/ribbon_coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_ribbon_area/ribbon_facetting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_ribbon_area/ribbon_facetting.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_ribbon_area/ribbon_outline_type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_ribbon_area/ribbon_outline_type.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_ribbon_area/ribbon_outline_type_coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_ribbon_area/ribbon_outline_type_coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_ribbon_area/ribbon_where.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_ribbon_area/ribbon_where.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rug/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rug/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_rug/coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_rug/coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_segment/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_segment/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_segment/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_segment/arrow.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_sina/method_counts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_sina/method_counts.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_sina/scale_area+coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_sina/scale_area+coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_sina/scale_area.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_sina/scale_area.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_sina/scale_count.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_sina/scale_count.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_sina/style.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_sina/style.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/continuous_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/continuous_x.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/continuous_x_fullrange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/continuous_x_fullrange.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/coord_trans_se_false.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/coord_trans_se_false.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/discrete_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/discrete_x.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/discrete_x_fullrange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/discrete_x_fullrange.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/glm_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/glm_formula.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/gls_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/gls_formula.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/init_and_fit_kwargs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/init_and_fit_kwargs.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/legend_fill_ratio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/legend_fill_ratio.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/linear_smooth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/linear_smooth.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/linear_smooth_no_ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/linear_smooth_no_ci.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/lm_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/lm_formula.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/lm_formula_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/lm_formula_weights.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/non_linear_smooth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/non_linear_smooth.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/non_linear_smooth_no_ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/non_linear_smooth_no_ci.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/rlm_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/rlm_formula.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_smooth/sorts_by_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_smooth/sorts_by_x.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_spoke/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_spoke/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_spoke/test_unmapped_angle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_spoke/test_unmapped_angle.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_text_label/adjust_label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_text_label/adjust_label.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_text_label/adjust_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_text_label/adjust_text.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_text_label/adjust_text_default_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_text_label/adjust_text_default_color.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_text_label/format_missing_values.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_text_label/format_missing_values.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_text_label/label_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_text_label/label_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_text_label/text_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_text_label/text_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/aesthetics+coord_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/aesthetics+coord_flip.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/no_trim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/no_trim.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/overlap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/overlap.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/quantiles_width_dodge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/quantiles_width_dodge.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/scales_free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/scales_free.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/style.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/style.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_violin/style_alternating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_violin/style_alternating.png -------------------------------------------------------------------------------- /tests/baseline_images/test_geom_vline/aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_geom_vline/aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_ggplot_internals/after_scale_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_ggplot_internals/after_scale_mapping.png -------------------------------------------------------------------------------- /tests/baseline_images/test_ggplot_internals/to_pandas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_ggplot_internals/to_pandas.png -------------------------------------------------------------------------------- /tests/baseline_images/test_guide_internals/guide_legend_after_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_guide_internals/guide_legend_after_scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layers/inserting_layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layers/inserting_layers.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/axis_text_justification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/axis_text_justification.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/axis_title_x_justification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/axis_title_x_justification.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/axis_title_y_justification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/axis_title_y_justification.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/colorbar_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/colorbar_frame.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/default.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/default_tag_location.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/default_tag_location.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/different_colorbar_themes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/different_colorbar_themes.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/facet_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/facet_grid.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/facet_wrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/facet_wrap.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/facet_wrap_scales_free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/facet_wrap_scales_free.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/inside_legend_90pct_top_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/inside_legend_90pct_top_right.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/inside_legend_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/inside_legend_left.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/inside_legend_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/inside_legend_top.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/inside_legend_top_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/inside_legend_top_right.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/justification_with_blank_title_and_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/justification_with_blank_title_and_text.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/legend_at_the_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/legend_at_the_bottom.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/legend_at_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/legend_at_top.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/legend_on_the_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/legend_on_the_left.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/legends_in_different_positions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/legends_in_different_positions.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/margin_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/margin_bottom.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/outside_legend_bottom_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/outside_legend_bottom_left.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/outside_legend_left_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/outside_legend_left_top.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/outside_legend_right_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/outside_legend_right_bottom.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/outside_legend_top_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/outside_legend_top_right.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/panel_bottomleft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/panel_bottomleft.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/panel_topleft_margin_in_fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/panel_topleft_margin_in_fig.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/panel_topleft_margin_in_pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/panel_topleft_margin_in_pt.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/panel_topleft_margin_in_pt_ar1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/panel_topleft_margin_in_pt_ar1.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/panel_xycoords.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/panel_xycoords.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_margin_aspect_ratio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_margin_aspect_ratio.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_margin_protruding_axis_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_margin_protruding_axis_text.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_title_justification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_title_justification.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_titles_and_caption_positioning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_titles_and_caption_positioning.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_topright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_topright.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_topright_margin_in_fig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_topright_margin_in_fig.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_topright_margin_in_pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_topright_margin_in_pt.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/plot_xycoords.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/plot_xycoords.png -------------------------------------------------------------------------------- /tests/baseline_images/test_layout/turn_off_guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_layout/turn_off_guide.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/basic_horizontal_align_resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/basic_horizontal_align_resize.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/basic_vertical_align_resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/basic_vertical_align_resize.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/complex_composition.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/complex_composition.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/facets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/facets.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/horizontal_tag_align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/horizontal_tag_align.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/nested_horizontal_align_resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/nested_horizontal_align_resize.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/nested_vertical_align_resize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/nested_vertical_align_resize.png -------------------------------------------------------------------------------- /tests/baseline_images/test_plot_composition/vertical_tag_align.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_plot_composition/vertical_tag_align.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/dodge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/dodge.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/dodge2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/dodge2.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/dodge2_preserve_single_interval.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/dodge2_preserve_single_interval.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/dodge2_varwidth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/dodge2_varwidth.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/dodge_preserve_single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/dodge_preserve_single.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/dodge_preserve_single_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/dodge_preserve_single_text.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/dodge_segment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/dodge_segment.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/fill.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/jitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/jitter.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/jitterdodge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/jitterdodge.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/nudge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/nudge.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/stack-negative.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/stack-negative.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/stack-non-linear-scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/stack-non-linear-scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_position/stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_position/stack.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/arrays.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/arrays.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/multiple_geoms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/multiple_geoms.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/onlyx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/onlyx.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/onlyy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/onlyy.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/range.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/sample.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/scalars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/scalars.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/series_labelling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/series_labelling.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/string-arrays.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/string-arrays.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/xlim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/xlim.png -------------------------------------------------------------------------------- /tests/baseline_images/test_qplot/ylim.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_qplot/ylim.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/bool_mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/bool_mapping.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/breaks_and_labels_outside_of_limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/breaks_and_labels_outside_of_limits.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/datetime_scale_expansion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/datetime_scale_expansion.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/datetime_scale_limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/datetime_scale_limits.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/discrete_xy_scale_drop_limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/discrete_xy_scale_drop_limits.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/expand_limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/expand_limits.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/legend_ordering_added_scales.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/legend_ordering_added_scales.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/legend_ordering_global_aesthetics_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/legend_ordering_global_aesthetics_1.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/legend_ordering_global_aesthetics_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/legend_ordering_global_aesthetics_2.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/legend_ordering_local_aesthetics_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/legend_ordering_local_aesthetics_1.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/legend_ordering_local_aesthetics_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/legend_ordering_local_aesthetics_2.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/legend_ordering_mixed_scope_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/legend_ordering_mixed_scope_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/missing_data_discrete_position_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/missing_data_discrete_position_scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/missing_data_discrete_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/missing_data_discrete_scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/missing_manual_dict_aesthetic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/missing_manual_dict_aesthetic.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/multiple_aesthetics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/multiple_aesthetics.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/ordinal_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/ordinal_scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/test_legend_ordering_with_identity_scale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/test_legend_ordering_with_identity_scale.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/transform_aes_defaults_and_params.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/transform_aes_defaults_and_params.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_internals/transform_datetime_aes_param.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_internals/transform_datetime_aes_param.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_labelling/caption_complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_labelling/caption_complex.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_labelling/caption_simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_labelling/caption_simple.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_labelling/labelling_with_colour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_labelling/labelling_with_colour.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_linetype/scale_linetype_manual_strings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_linetype/scale_linetype_manual_strings.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_linetype/scale_linetype_manual_tuples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_linetype/scale_linetype_manual_tuples.png -------------------------------------------------------------------------------- /tests/baseline_images/test_scale_symlog/scale_y_symlog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_scale_symlog/scale_y_symlog.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_ecdf/computed_y_column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_ecdf/computed_y_column.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_ecdf/ecdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_ecdf/ecdf.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_ecdf/ecdf_no_pad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_ecdf/ecdf_no_pad.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_ellipse/ellipse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_ellipse/ellipse.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_function/args.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_function/args.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_function/limits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_function/limits.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_hull/hull.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_hull/hull.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary/fun_args.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary/fun_args.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary/mean_cl_boot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary/mean_cl_boot.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary/mean_cl_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary/mean_cl_normal.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary/mean_sdl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary/mean_sdl.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary/mean_se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary/mean_se.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary/median_hilow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary/median_hilow.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary/summary_functions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary/summary_functions.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary_bin/continuous_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary_bin/continuous_x.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary_bin/discrete_x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary_bin/discrete_x.png -------------------------------------------------------------------------------- /tests/baseline_images/test_stat_summary_bin/setting_binwidth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_stat_summary_bin/setting_binwidth.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/axis_ticks_and_length.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/axis_ticks_and_length.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/element_text_with_sequence_values.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/element_text_with_sequence_values.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/no_ticks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/no_ticks.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/override_axis_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/override_axis_text.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_538.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_538.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_bw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_bw.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_classic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_classic.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_dark.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_gray.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_light.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_linedraw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_linedraw.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_matplotlib.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_minimal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_minimal.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_seaborn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_seaborn.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_tufte.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_tufte.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_void.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_void.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_xkcd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_xkcd.png -------------------------------------------------------------------------------- /tests/baseline_images/test_theme/theme_xkcd_ci.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_theme/theme_xkcd_ci.png -------------------------------------------------------------------------------- /tests/baseline_images/test_watermark/watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/baseline_images/test_watermark/watermark.png -------------------------------------------------------------------------------- /tests/images/plotnine-watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/has2k1/plotnine/f27edc522dcf44058dac320ffe4803dd2551a11f/tests/images/plotnine-watermark.png -------------------------------------------------------------------------------- /tests/test_annotate.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import pytest 3 | 4 | from plotnine import aes, annotate, geom_point, geom_rect, geom_segment, ggplot 5 | from plotnine.exceptions import PlotnineError 6 | 7 | n = 4 8 | data = pd.DataFrame({"x": range(n), "y": range(n)}) 9 | 10 | 11 | def test_multiple_annotation_geoms(): 12 | p = ( 13 | ggplot(data, aes("x", "y")) 14 | + geom_point() 15 | + annotate("point", 0, 1, color="red", size=5) 16 | + annotate("text", 1, 2, label="Text", color="red", size=15, angle=45) 17 | + annotate( 18 | geom_rect, 19 | xmin=1.8, 20 | xmax=2.2, 21 | ymin=2.8, 22 | ymax=3.2, 23 | size=1, 24 | color="red", 25 | alpha=0.3, 26 | ) 27 | + annotate( 28 | geom_segment, x=2.8, y=3.8, xend=3.2, yend=4.2, color="red", size=1 29 | ) 30 | ) 31 | assert p == "multiple_annotation_geoms" 32 | 33 | 34 | def test_non_geom_raises(): 35 | with pytest.raises(PlotnineError): 36 | annotate("doesnotexist", x=1) 37 | 38 | with pytest.raises(PlotnineError): 39 | annotate(5) 40 | 41 | class NotAGeom: 42 | pass 43 | 44 | with pytest.raises(PlotnineError): 45 | annotate(NotAGeom) 46 | 47 | with pytest.raises(PlotnineError): 48 | annotate(geom_point()) 49 | -------------------------------------------------------------------------------- /tests/test_doctools.py: -------------------------------------------------------------------------------- 1 | from plotnine import position_stack 2 | from plotnine.doctools import document 3 | from plotnine.geoms.geom import geom 4 | from plotnine.stats.stat import stat 5 | 6 | 7 | @document 8 | class geom_abc(geom): 9 | """ 10 | Geom ABC 11 | 12 | {usage} 13 | 14 | Parameters 15 | ---------- 16 | {common_parameters} 17 | """ 18 | 19 | DEFAULT_AES = {"color": None} 20 | DEFAULT_PARAMS = { 21 | "stat": "bin", 22 | "position": position_stack, 23 | "na_rm": False, 24 | } 25 | 26 | 27 | def test_document_geom(): 28 | doc = geom_abc.__doc__ 29 | # assert "~plotnine.stats.stat_bin" in doc 30 | assert 'stat, default="bin"' in doc 31 | assert 'position, default="position_stack"' in doc 32 | 33 | 34 | @document 35 | class stat_abc(stat): 36 | """ 37 | Stat ABC 38 | 39 | {usage} 40 | 41 | Parameters 42 | ---------- 43 | {common_parameters} 44 | """ 45 | 46 | DEFAULT_AES = {"weight": None} 47 | DEFAULT_PARAMS = {"geom": geom_abc, "position": "stack", "na_rm": False} 48 | 49 | 50 | def test_document_stat(): 51 | doc = stat_abc.__doc__ 52 | assert "geom_abc" in doc 53 | # assert "~plotnine.positions.position_stack" in doc 54 | assert 'position, default="stack"' in doc 55 | -------------------------------------------------------------------------------- /tests/test_geom_bin_2d.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import aes, geom_bin_2d, ggplot, scale_x_log10 5 | 6 | from .conftest import layer_data 7 | 8 | n = 20 # Make even for best results 9 | reps = np.hstack( 10 | [np.arange(int(np.ceil(n / 2))), np.arange(int(np.ceil(n // 2)))[::-1]] 11 | ) 12 | diagonal = np.repeat(np.arange(n), reps) 13 | 14 | data = pd.DataFrame( 15 | { 16 | "x": np.hstack([diagonal, diagonal]), 17 | "y": np.hstack([diagonal, diagonal[::-1]]), 18 | } 19 | ) 20 | 21 | 22 | def test_drop_true(): 23 | p = ggplot(data, aes("x", "y")) + geom_bin_2d(binwidth=2, drop=True) 24 | assert p == "drop_true" 25 | 26 | 27 | def test_drop_false(): 28 | p = ggplot(data, aes("x", "y")) + geom_bin_2d(binwidth=2, drop=False) 29 | assert p == "drop_false" 30 | 31 | 32 | def test_scale_transformed_breaks(): 33 | data = pd.DataFrame({"x": [1, 10, 100, 1000], "y": range(4)}) 34 | p = ggplot(data, aes("x", "y")) + geom_bin_2d( 35 | breaks=([5, 50, 500], [0.5, 1.5, 2.5]) 36 | ) 37 | out1 = layer_data(p) 38 | out2 = layer_data(p + scale_x_log10()) 39 | np.testing.assert_allclose(out1.xmax, [50, 500]) 40 | np.testing.assert_allclose(out2.xmax, np.log10([50, 500])) 41 | -------------------------------------------------------------------------------- /tests/test_geom_blank.py: -------------------------------------------------------------------------------- 1 | from plotnine import aes, geom_blank, ggplot 2 | from plotnine.data import mtcars 3 | 4 | 5 | def test_blank(): 6 | gg = ggplot(mtcars, aes(x="wt", y="mpg")) 7 | gg = gg + geom_blank() 8 | assert gg == "blank" 9 | -------------------------------------------------------------------------------- /tests/test_geom_count.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import aes, geom_count, ggplot 4 | 5 | data = pd.DataFrame( 6 | { 7 | "x": list("aaaaaaaaaabbbbbbbbbbcccccccccc"), 8 | "y": [ 9 | 1, 10 | 2, 11 | 3, 12 | 4, 13 | 5, 14 | 6, 15 | 7, 16 | 8, 17 | 9, 18 | 10, 19 | 1, 20 | 1, 21 | 1, 22 | 1, 23 | 1, 24 | 6, 25 | 6, 26 | 8, 27 | 10, 28 | 10, 29 | 1, 30 | 1, 31 | 2, 32 | 4, 33 | 4, 34 | 4, 35 | 4, 36 | 9, 37 | 9, 38 | 9, 39 | ], 40 | } 41 | ) 42 | 43 | 44 | def test_discrete_x(): 45 | p = ggplot(data, aes("x", "y")) + geom_count() 46 | 47 | assert p == "discrete_x" 48 | 49 | 50 | def test_discrete_y(): 51 | p = ggplot(data, aes("y", "x")) + geom_count() 52 | 53 | assert p == "discrete_y" 54 | 55 | 56 | def test_continuous_x_y(): 57 | p = ggplot(data, aes("y", "y")) + geom_count() 58 | 59 | assert p == "continuous_x_y" 60 | -------------------------------------------------------------------------------- /tests/test_geom_crossbar.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import aes, geom_crossbar, ggplot 4 | 5 | n = 4 6 | data = pd.DataFrame( 7 | { 8 | "x": [1] * n, 9 | "ymin": range(1, 2 * n + 1, 2), 10 | "y": [i + 0.1 + i / 10 for i in range(1, 2 * n + 1, 2)], 11 | "ymax": range(2, 2 * n + 2, 2), 12 | "z": range(n), 13 | } 14 | ) 15 | 16 | 17 | def test_aesthetics(): 18 | p = ( 19 | ggplot(data, aes(y="y", ymin="ymin", ymax="ymax")) 20 | + geom_crossbar(aes("x"), size=2) 21 | + geom_crossbar(aes("x+1", alpha="z"), fill="green", width=0.2, size=2) 22 | + geom_crossbar(aes("x+2", linetype="factor(z)"), size=2) 23 | + geom_crossbar(aes("x+3", color="factor(z)"), size=2) 24 | + geom_crossbar(aes("x+4", size="z")) 25 | ) 26 | 27 | assert p == "aesthetics" 28 | -------------------------------------------------------------------------------- /tests/test_geom_density_2d.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import ( 4 | aes, 5 | after_stat, 6 | geom_density_2d, 7 | geom_point, 8 | ggplot, 9 | lims, 10 | scale_size_radius, 11 | stat_density_2d, 12 | ) 13 | 14 | n = 20 15 | adj = n // 4 16 | 17 | data = pd.DataFrame({"x": range(n), "y": range(n)}) 18 | 19 | p0 = ggplot(data, aes("x", "y")) + lims(x=(-adj, n + adj), y=(-adj, n + adj)) 20 | 21 | 22 | def test_contours(): 23 | p = p0 + geom_density_2d(aes(color=after_stat("level"))) 24 | assert p == "contours" 25 | 26 | 27 | def test_points(): 28 | p = ( 29 | p0 30 | + geom_point( 31 | aes(fill=after_stat("density"), size=after_stat("density")), 32 | stat="density_2d", 33 | stroke=0, 34 | n=16, 35 | contour=False, 36 | ) 37 | + scale_size_radius(range=(0, 6)) 38 | ) 39 | 40 | assert p == "points" 41 | 42 | 43 | def test_polygon(): 44 | p = p0 + stat_density_2d(aes(fill=after_stat("level")), geom="polygon") 45 | assert p == "polygon" 46 | -------------------------------------------------------------------------------- /tests/test_geom_errorbar_errorbarh.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import aes, geom_errorbar, geom_errorbarh, ggplot 4 | 5 | n = 4 6 | data = pd.DataFrame( 7 | { 8 | "x": [1] * n, 9 | "ymin": range(1, 2 * n + 1, 2), 10 | "ymax": range(2, 2 * n + 2, 2), 11 | "z": range(n), 12 | } 13 | ) 14 | 15 | 16 | def test_errorbar_aesthetics(): 17 | p = ( 18 | ggplot(data, aes(ymin="ymin", ymax="ymax")) 19 | + geom_errorbar(aes("x"), size=2) 20 | + geom_errorbar(aes("x+1", alpha="z"), width=0.2, size=2) 21 | + geom_errorbar(aes("x+2", linetype="factor(z)"), size=2) 22 | + geom_errorbar(aes("x+3", color="z"), size=2) 23 | + geom_errorbar(aes("x+4", size="z")) 24 | ) 25 | 26 | assert p == "errorbar_aesthetics" 27 | 28 | 29 | def test_errorbarh_aesthetics(): 30 | p = ( 31 | ggplot(data, aes(xmin="ymin", xmax="ymax")) 32 | + geom_errorbarh(aes(y="x"), size=2) 33 | + geom_errorbarh(aes(y="x+1", alpha="z"), height=0.2, size=2) 34 | + geom_errorbarh(aes(y="x+2", linetype="factor(z)"), size=2) 35 | + geom_errorbarh(aes(y="x+3", color="factor(z)"), size=2) 36 | + geom_errorbarh(aes(y="x+4", size="z")) 37 | ) 38 | 39 | assert p == "errorbarh_aesthetics" 40 | -------------------------------------------------------------------------------- /tests/test_geom_freqpoly.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import ( 5 | aes, 6 | geom_freqpoly, 7 | geom_histogram, 8 | geom_point, 9 | ggplot, 10 | ) 11 | 12 | n = 10 # Some even number greater than 2 13 | 14 | # ladder: 0 1 times, 1 2 times, 2 3 times, ... 15 | data = pd.DataFrame( 16 | { 17 | "x": np.repeat(range(n + 1), range(n + 1)), 18 | "z": np.repeat(range(n // 2), range(3, n * 2, 4)), 19 | } 20 | ) 21 | 22 | 23 | def test_midpoint(): 24 | p = ( 25 | ggplot(data, aes("x")) 26 | + geom_histogram(aes(fill="factor(z)"), bins=n, alpha=0.25) 27 | + geom_freqpoly(bins=n, size=4) 28 | + geom_point(stat="bin", bins=n, size=4, stroke=0, color="red") 29 | ) 30 | 31 | assert p == "midpoint" 32 | -------------------------------------------------------------------------------- /tests/test_geom_hline.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import pytest 3 | 4 | from plotnine import aes, geom_hline, geom_point, ggplot 5 | from plotnine.exceptions import PlotnineError, PlotnineWarning 6 | 7 | data = pd.DataFrame( 8 | {"yintercept": [1, 2], "x": [-1, 1], "y": [0.5, 3], "z": range(2)} 9 | ) 10 | 11 | 12 | def test_aesthetics(): 13 | p = ( 14 | ggplot(data) 15 | + geom_point(aes("x", "y")) 16 | + geom_hline(aes(yintercept="yintercept"), size=2) 17 | + geom_hline(aes(yintercept="yintercept+.1", alpha="z"), size=2) 18 | + geom_hline( 19 | aes(yintercept="yintercept+.2", linetype="factor(z)"), size=2 20 | ) 21 | + geom_hline( 22 | aes(yintercept="yintercept+.3", color="factor(z)"), size=2 23 | ) 24 | + geom_hline(aes(yintercept="yintercept+.4", size="z")) 25 | ) 26 | 27 | assert p == "aesthetics" 28 | 29 | 30 | def test_aes_inheritance(): 31 | with pytest.raises(PlotnineError): 32 | p = ( 33 | ggplot(data, aes("x", "y", yintercept="yintercept")) 34 | + geom_point() 35 | + geom_hline(size=2) 36 | ) 37 | p.draw_test() 38 | 39 | 40 | def test_aes_overwrite(): 41 | with pytest.warns(PlotnineWarning): 42 | geom_hline(aes(color="y"), yintercept=2) 43 | -------------------------------------------------------------------------------- /tests/test_geom_linerange_pointrange.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import aes, geom_linerange, geom_pointrange, ggplot 5 | 6 | n = 4 7 | data = pd.DataFrame( 8 | { 9 | "x": range(n), 10 | "y": np.arange(n) + 0.5, 11 | "ymin": range(n), 12 | "ymax": range(1, n + 1), 13 | "z": range(n), 14 | } 15 | ) 16 | 17 | 18 | def test_linerange_aesthetics(): 19 | p = ( 20 | ggplot(data, aes("x")) 21 | + geom_linerange(aes(ymin="ymin", ymax="ymax"), size=2) 22 | + geom_linerange(aes(ymin="ymin+1", ymax="ymax+1", alpha="z"), size=2) 23 | + geom_linerange( 24 | aes(ymin="ymin+2", ymax="ymax+2", linetype="factor(z)"), size=2 25 | ) 26 | + geom_linerange(aes(ymin="ymin+3", ymax="ymax+3", color="z"), size=2) 27 | + geom_linerange(aes(ymin="ymin+4", ymax="ymax+4", size="z")) 28 | ) 29 | assert p == "linerange_aesthetics" 30 | 31 | 32 | def test_pointrange_aesthetics(): 33 | p = ( 34 | ggplot(data, aes("x")) 35 | + geom_pointrange(aes(y="y", ymin="ymin", ymax="ymax"), size=2) 36 | + geom_pointrange( 37 | aes(y="y+1", ymin="ymin+1", ymax="ymax+1", alpha="z"), size=2 38 | ) 39 | + geom_pointrange( 40 | aes(y="y+2", ymin="ymin+2", ymax="ymax+2", linetype="factor(z)"), 41 | size=2, 42 | ) 43 | + geom_pointrange( 44 | aes(y="y+3", ymin="ymin+3", ymax="ymax+3", color="z"), size=2 45 | ) 46 | + geom_pointrange(aes(y="y+4", ymin="ymin+4", ymax="ymax+4", size="z")) 47 | ) 48 | assert p == "pointrange_aesthetics" 49 | -------------------------------------------------------------------------------- /tests/test_geom_pointdensity.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import ( 5 | aes, 6 | after_stat, 7 | geom_point, 8 | geom_pointdensity, 9 | ggplot, 10 | scale_size_radius, 11 | ) 12 | 13 | n = 16 # Some even number > 2 14 | 15 | data = pd.DataFrame({"x": range(n), "y": np.repeat(range(n // 2), 2)}) 16 | 17 | p0 = ggplot(data, aes("x", "y")) 18 | 19 | 20 | def test_pointdensity(): 21 | p = p0 + geom_pointdensity(size=10) 22 | assert p == "contours" 23 | 24 | 25 | def test_points(): 26 | p = ( 27 | p0 28 | + geom_point( 29 | aes(fill=after_stat("density"), size=after_stat("density")), 30 | stat="pointdensity", 31 | ) 32 | + scale_size_radius(range=(10, 20)) 33 | ) 34 | 35 | assert p == "points" 36 | -------------------------------------------------------------------------------- /tests/test_geom_polygon.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import aes, geom_polygon, ggplot 4 | 5 | data = pd.DataFrame( 6 | { 7 | "x": ([1, 2, 3, 2] + [5, 6, 7] + [9, 9, 10, 11, 11, 10]), 8 | "y": ([2, 3, 2, 1] + [1, 3, 1] + [1.5, 2.5, 3, 2.5, 1.5, 1]), 9 | "z": ([1] * 4 + [2] * 3 + [3] * 6), 10 | } 11 | ) 12 | 13 | 14 | def test_aesthetics(): 15 | p = ( 16 | ggplot(data, aes("x", group="factor(z)")) 17 | + geom_polygon(aes(y="y")) 18 | + geom_polygon(aes(y="y+3", alpha="z")) 19 | + geom_polygon( 20 | aes(y="y+6", linetype="factor(z)"), 21 | color="brown", 22 | fill=None, 23 | size=2, 24 | ) 25 | + geom_polygon(aes(y="y+9", color="z"), fill=None, size=2) 26 | + geom_polygon(aes(y="y+12", fill="factor(z)")) 27 | + geom_polygon( 28 | aes(y="y+15", size="z"), color="yellow", show_legend=False 29 | ) 30 | ) 31 | 32 | assert p == "aesthetics" 33 | 34 | 35 | def test_no_fill(): 36 | p = ( 37 | ggplot(data, aes("x", group="factor(z)")) 38 | + geom_polygon(aes(y="y"), fill=None, color="red", size=2) 39 | + geom_polygon(aes(y="y+2"), fill="none", color="green", size=2) 40 | + geom_polygon(aes(y="y+4"), fill="none", color="blue", size=2) 41 | ) 42 | assert p == "no_fill" 43 | -------------------------------------------------------------------------------- /tests/test_geom_qq_qq_line.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import aes, geom_qq, geom_qq_line, ggplot 5 | 6 | random_state = np.random.RandomState(1234567890) 7 | normal_data = pd.DataFrame({"x": random_state.normal(size=100)}) 8 | 9 | 10 | def test_normal(): 11 | p = ggplot(normal_data, aes(sample="x")) + geom_qq() 12 | # Roughly a straight line of points through the origin 13 | assert p == "normal" 14 | 15 | 16 | def test_normal_with_line(): 17 | p = ggplot(normal_data, aes(sample="x")) + geom_qq() + geom_qq_line() 18 | # Roughly a straight line of points through the origin 19 | assert p == "normal_with_line" 20 | -------------------------------------------------------------------------------- /tests/test_geom_quantile.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import aes, geom_point, geom_quantile, ggplot 5 | 6 | n = 200 # Should not be too big, affects the test duration 7 | random_state = np.random.RandomState(1234567890) 8 | # points that diverge like a point flash-light 9 | data = pd.DataFrame( 10 | {"x": np.arange(n), "y": np.arange(n) * (1 + random_state.rand(n))} 11 | ) 12 | 13 | 14 | def test_lines(): 15 | p = ( 16 | ggplot(data, aes(x="x", y="y")) 17 | + geom_point(alpha=0.5) 18 | + geom_quantile(quantiles=[0.001, 0.5, 0.999], formula="y~x", size=2) 19 | ) 20 | 21 | # Two (.001, .999) quantile lines should bound the points 22 | # from below and from above, and the .5 line should go 23 | # through middle (approximately). 24 | assert p == "lines" 25 | -------------------------------------------------------------------------------- /tests/test_geom_raster.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import pytest 4 | 5 | from plotnine import aes, geom_raster, ggplot 6 | from plotnine.exceptions import PlotnineWarning 7 | 8 | 9 | def _random_grid(n, m=None, seed=123): 10 | if m is None: 11 | m = n 12 | prg = np.random.RandomState(seed) 13 | g = prg.uniform(size=n * m) 14 | x, y = np.meshgrid(range(n), range(m)) 15 | return pd.DataFrame({"x": x.ravel(), "y": y.ravel(), "g": g}) 16 | 17 | 18 | def test_square(): 19 | data = _random_grid(5) 20 | p = ggplot(data, aes("x", "y", fill="g")) + geom_raster( 21 | interpolation="bilinear" 22 | ) 23 | assert p == "square" 24 | 25 | 26 | def test_rectangle(): 27 | data = _random_grid(3, 5) 28 | p = ggplot(data, aes("x", "y", fill="g")) + geom_raster( 29 | interpolation="bilinear" 30 | ) 31 | assert p == "rectangle" 32 | 33 | 34 | def test_gap_no_interpolation(): 35 | data = _random_grid(3, 2) 36 | data.loc[4, "y"] = 3 37 | p = ggplot(data, aes("x", "y", fill="g")) + geom_raster() 38 | # Warns about uneven vertical intervals 39 | with pytest.warns(PlotnineWarning): 40 | assert p == "gap_no_interpolation" 41 | 42 | 43 | def test_gap_with_interpolation(): 44 | data = _random_grid(3, 2) 45 | data.loc[4, "y"] = 3 46 | p = ggplot(data, aes("x", "y", fill="g")) + geom_raster( 47 | interpolation="bilinear" 48 | ) 49 | # Warns about uneven vertical intervals 50 | with pytest.warns(PlotnineWarning): 51 | assert p == "gap_with_interpolation" 52 | -------------------------------------------------------------------------------- /tests/test_geom_rug.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import aes, coord_flip, geom_rug, ggplot 5 | 6 | n = 4 7 | seq = np.arange(1, n + 1) 8 | data = pd.DataFrame( 9 | { 10 | "x": seq, 11 | "y": seq, 12 | "z": seq, 13 | } 14 | ) 15 | 16 | 17 | def test_aesthetics(): 18 | p = ( 19 | ggplot(data) 20 | + geom_rug(aes("x", "y"), size=2) 21 | + geom_rug(aes("x+2*n", "y+2*n", alpha="z"), size=2, sides="tr") 22 | + geom_rug( 23 | aes("x+4*n", "y+4*n", linetype="factor(z)"), size=2, sides="t" 24 | ) 25 | + geom_rug(aes("x+6*n", "y+6*n", color="factor(z)"), size=2, sides="b") 26 | + geom_rug(aes("x+8*n", "y+8*n", size="z"), sides="tblr") 27 | ) 28 | 29 | assert p == "aesthetics" 30 | 31 | 32 | def test_coord_flip(): 33 | p = ( 34 | ggplot(data) 35 | + geom_rug(aes("x", "y"), size=2, sides="l") 36 | + coord_flip() 37 | ) 38 | 39 | assert p == "coord_flip" 40 | -------------------------------------------------------------------------------- /tests/test_geom_segment.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import aes, arrow, geom_segment, ggplot 4 | 5 | n = 4 6 | 7 | # stepped horizontal line segments 8 | data = pd.DataFrame( 9 | { 10 | "x": range(1, n + 1), 11 | "xend": range(2, n + 2), 12 | "y": range(n, 0, -1), 13 | "yend": range(n, 0, -1), 14 | "z": range(1, n + 1), 15 | } 16 | ) 17 | 18 | 19 | def test_aesthetics(): 20 | p = ( 21 | ggplot(data, aes("x", "y", xend="xend", yend="yend")) 22 | + geom_segment(size=2) 23 | + 24 | # Positive slope segments 25 | geom_segment(aes(yend="yend+1", color="factor(z)"), size=2) 26 | + geom_segment(aes(yend="yend+2", linetype="factor(z)"), size=2) 27 | + geom_segment(aes(yend="yend+3", size="z"), show_legend=False) 28 | + geom_segment( 29 | aes(yend="yend+4", alpha="z"), size=2, show_legend=False 30 | ) 31 | ) 32 | 33 | assert p == "aesthetics" 34 | 35 | 36 | def test_arrow(): 37 | p = ( 38 | ggplot(data, aes("x", "y", xend="xend", yend="yend")) 39 | + geom_segment(aes("x+2", xend="xend+2"), arrow=arrow(), size=2) 40 | + geom_segment( 41 | aes("x+4", xend="xend+4"), arrow=arrow(ends="first"), size=2 42 | ) 43 | + geom_segment( 44 | aes("x+6", xend="xend+6"), arrow=arrow(ends="both"), size=2 45 | ) 46 | ) 47 | 48 | assert p == "arrow" 49 | -------------------------------------------------------------------------------- /tests/test_geom_spoke.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import aes, geom_spoke, ggplot 5 | 6 | n = 4 7 | data = pd.DataFrame( 8 | { 9 | "x": [1] * n, 10 | "y": range(n), 11 | "angle": np.linspace(0, np.pi / 2, n), 12 | "radius": range(1, n + 1), 13 | "z": range(n), 14 | } 15 | ) 16 | 17 | 18 | def test_aesthetics(): 19 | p = ( 20 | ggplot(data, aes(y="y", angle="angle", radius="radius")) 21 | + geom_spoke(aes("x"), size=2) 22 | + geom_spoke(aes("x+2", alpha="z"), size=2) 23 | + geom_spoke(aes("x+4", linetype="factor(z)"), size=2) 24 | + geom_spoke(aes("x+6", color="factor(z)"), size=2) 25 | + geom_spoke(aes("x+8", size="z")) 26 | ) 27 | 28 | assert p == "aesthetics" 29 | 30 | 31 | def test_unmapped_angle(): 32 | p = ggplot(data, aes(y="y", angle="angle", radius="radius")) + geom_spoke( 33 | aes("x", "y"), angle=0, radius=1 34 | ) 35 | assert p == "test_unmapped_angle" 36 | -------------------------------------------------------------------------------- /tests/test_geom_vline.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import pytest 3 | 4 | from plotnine import aes, geom_point, geom_vline, ggplot 5 | from plotnine.exceptions import PlotnineError, PlotnineWarning 6 | 7 | data = pd.DataFrame( 8 | {"xintercept": [1, 2], "x": [0.5, 3], "y": [-1, 1], "z": range(2)} 9 | ) 10 | 11 | 12 | def test_aesthetics(): 13 | p = ( 14 | ggplot(data) 15 | + geom_point(aes("x", "y")) 16 | + geom_vline(aes(xintercept="xintercept"), size=2) 17 | + geom_vline(aes(xintercept="xintercept+.1", alpha="z"), size=2) 18 | + geom_vline( 19 | aes(xintercept="xintercept+.2", linetype="factor(z)"), size=2 20 | ) 21 | + geom_vline( 22 | aes(xintercept="xintercept+.3", color="factor(z)"), size=2 23 | ) 24 | + geom_vline(aes(xintercept="xintercept+.4", size="z")) 25 | ) 26 | 27 | assert p == "aesthetics" 28 | 29 | 30 | def test_aes_inheritance(): 31 | with pytest.raises(PlotnineError): 32 | p = ( 33 | ggplot(data, aes("x", "y", xintercept="xintercept")) 34 | + geom_point() 35 | + geom_vline(size=2) 36 | ) 37 | p.draw_test() 38 | 39 | 40 | def test_aes_overwrite(): 41 | with pytest.warns(PlotnineWarning): 42 | geom_vline(aes(color="x"), xintercept=2) 43 | -------------------------------------------------------------------------------- /tests/test_guide_internals.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | import pandas as pd 4 | 5 | from plotnine import ( 6 | aes, 7 | after_scale, 8 | geom_bar, 9 | geom_point, 10 | ggplot, 11 | ) 12 | from plotnine.data import mtcars 13 | 14 | 15 | def test_no_after_scale_warning(): 16 | p = ggplot(mtcars, aes("wt", "mpg")) + geom_point() 17 | 18 | with warnings.catch_warnings(): 19 | warnings.simplefilter("error") 20 | p.draw_test() # type: ignore 21 | 22 | 23 | def test_guide_legend_after_scale(): 24 | def alphen(series, a): 25 | ha = f"{round(a * 255):#04X}"[2:] 26 | return [f"{hex_color}{ha}" for hex_color in series] 27 | 28 | data = pd.DataFrame( 29 | {"var1": [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]} 30 | ) 31 | p = ( 32 | ggplot( 33 | data, 34 | aes( 35 | "var1", 36 | color="factor(var1)", 37 | fill=after_scale("alphen(color, .5)"), 38 | ), 39 | ) 40 | + geom_bar() 41 | ) 42 | 43 | assert p == "guide_legend_after_scale" 44 | -------------------------------------------------------------------------------- /tests/test_helpers.py: -------------------------------------------------------------------------------- 1 | from typing import cast 2 | 3 | import numpy.testing as npt 4 | import pandas as pd 5 | 6 | from plotnine import aes, facet_wrap, geom_bar, geom_point, ggplot 7 | from plotnine.helpers import get_aesthetic_limits 8 | 9 | 10 | class TestGetAestheticLimits: 11 | data = pd.DataFrame( 12 | { 13 | "x": [0, 1, 2, 3, 4, 5, 6], 14 | "y": [0, 1, 2, 3, 4, 5, 6], 15 | "g": list("aabbbcc"), 16 | } 17 | ) 18 | 19 | def test_continuous_limits(self): 20 | p = ggplot(self.data, aes("x", "y")) + geom_point() 21 | limits = cast("tuple[float, float]", get_aesthetic_limits(p, "x")) 22 | npt.assert_array_almost_equal(limits, [0, 6]) 23 | 24 | def test_discrete_limits(self): 25 | p = ggplot(self.data, aes("g")) + geom_bar() 26 | limits = cast("list[str]", get_aesthetic_limits(p, "x")) 27 | assert limits == ["a", "b", "c"] 28 | 29 | def test_facet_limits(self): 30 | p = ( 31 | ggplot(self.data, aes("x", "y")) 32 | + geom_point() 33 | + facet_wrap("g", scales="free_x") 34 | ) 35 | limits = cast( 36 | "list[tuple[float, float]]", get_aesthetic_limits(p, "x") 37 | ) 38 | npt.assert_array_almost_equal(limits[0], [0, 1]) 39 | npt.assert_array_almost_equal(limits[1], [2, 4]) 40 | npt.assert_array_almost_equal(limits[2], [5, 6]) 41 | -------------------------------------------------------------------------------- /tests/test_lint_and_format.py: -------------------------------------------------------------------------------- 1 | import os 2 | import subprocess 3 | from pathlib import Path 4 | 5 | import pytest 6 | 7 | # Helps contributors catch linter errors 8 | # when they run make test. 9 | 10 | is_CI = os.environ.get("CI") is not None 11 | 12 | 13 | @pytest.mark.skipif(is_CI, reason="Helps contributors catch linter errors") 14 | def test_lint(): 15 | plotnine_dir = str(Path(__file__).parent.parent.absolute()) 16 | p = subprocess.Popen( 17 | ["ruff", "check", plotnine_dir], 18 | stdout=subprocess.PIPE, 19 | stderr=subprocess.PIPE, 20 | ) 21 | # Ignore the stderr msg as it is mostly noise 22 | # about coverage warnings 23 | stdout, _ = p.communicate() 24 | s = stdout.decode("utf-8") 25 | msg = f"Linting test found the following issues: \n\n{s}" 26 | assert p.returncode == 0, msg 27 | 28 | 29 | @pytest.mark.skipif(is_CI, reason="Helps contributors catch linter errors") 30 | def test_format(): 31 | plotnine_dir = str(Path(__file__).parent.parent.absolute()) 32 | p = subprocess.Popen( 33 | ["ruff", "format", plotnine_dir, "--check"], 34 | stdout=subprocess.PIPE, 35 | stderr=subprocess.PIPE, 36 | ) 37 | # Ignore the stderr msg as it is mostly noise 38 | # about coverage warnings 39 | _, stderr = p.communicate() 40 | s = stderr.decode("utf-8") 41 | msg = f"Formatting test found the following issues: \n\n{s}" 42 | assert p.returncode == 0, msg 43 | -------------------------------------------------------------------------------- /tests/test_scale_labelling.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import ( 4 | aes, 5 | element_text, 6 | facet_grid, 7 | geom_point, 8 | ggplot, 9 | labs, 10 | theme, 11 | ) 12 | from plotnine.data import mtcars 13 | 14 | c1 = "This is a sample caption" 15 | c2 = """\ 16 | Lorem Ipsum is simply dummy text of the printing and typesetting industry. 17 | Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, 18 | when an unknown printer took a galley of type and scrambled it to make 19 | a type specimen book.""" 20 | 21 | 22 | data = pd.DataFrame({"x": [1, 2], "y": [3, 4], "cat": ["a", "b"]}) 23 | 24 | 25 | def test_labelling_with_colour(): 26 | p = ( 27 | ggplot(data, aes("x", "y", color="cat")) 28 | + geom_point() 29 | + labs(colour="Colour Title") 30 | ) 31 | 32 | assert p == "labelling_with_colour" 33 | 34 | 35 | def test_caption_simple(): 36 | p = ggplot(mtcars, aes("wt", "mpg")) + geom_point() + labs(caption=c1) 37 | 38 | assert p == "caption_simple" 39 | 40 | 41 | def test_caption_complex(): 42 | p = ( 43 | ggplot(mtcars, aes("wt", "mpg")) 44 | + geom_point() 45 | + labs(caption=c2) 46 | + facet_grid("am", "vs") 47 | + theme(plot_caption=element_text(ha="left", size=12)) 48 | ) 49 | 50 | assert p == "caption_complex" 51 | -------------------------------------------------------------------------------- /tests/test_scale_linetype.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import aes, geom_line, ggplot, scale_linetype_manual 4 | 5 | 6 | def test_scale_linetype_manual_tuples(): 7 | # linetype_manual accepts tuples as mapping results 8 | # this must be tested specifically. 9 | data = pd.DataFrame( 10 | { 11 | "x": [0, 1, 0, 1, 0, 1], 12 | "y": [0, 1, 0, 2, 0, 3], 13 | "lt": ["A", "A", "B", "B", "C", "C"], 14 | } 15 | ) 16 | 17 | p = ggplot(data) 18 | p += geom_line(aes(x="x", y="y", ymax="y+1", linetype="lt", group="lt")) 19 | p += scale_linetype_manual( 20 | values=( 21 | (2, (5, 3, 1, 3)), 22 | (1, (10, 2)), 23 | (1, (1, 2)), 24 | ) 25 | ) 26 | assert p == "scale_linetype_manual_tuples" 27 | 28 | 29 | def test_scale_linetype_strings_tuples(): 30 | # linetype_manual accepts tuples as mapping results 31 | # this must be tested specifically. 32 | data = pd.DataFrame( 33 | { 34 | "x": [0, 1, 0, 1, 0, 1], 35 | "y": [0, 1, 0, 2, 0, 3], 36 | "lt": ["A", "A", "B", "B", "C", "C"], 37 | } 38 | ) 39 | 40 | p = ggplot(data) 41 | p += geom_line(aes(x="x", y="y", ymax="y+1", linetype="lt", group="lt")) 42 | p += scale_linetype_manual(values=["solid", "dashed", "dotted"]) 43 | assert p == "scale_linetype_manual_strings" 44 | -------------------------------------------------------------------------------- /tests/test_scale_symlog.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import numpy as np 4 | import pandas as pd 5 | import pytest 6 | 7 | from plotnine import aes, annotate, geom_point, ggplot, scale_y_symlog 8 | 9 | is_CI = os.environ.get("CI") is not None 10 | 11 | 12 | @pytest.mark.skipif(is_CI, reason="mizani not yet shipped") 13 | def test_scale_y_symlog(): 14 | n = 3 15 | x = np.arange(-n, n + 1) 16 | data = pd.DataFrame({"x": x, "y": np.sign(x) * (10 ** np.abs(x))}) 17 | 18 | p = ( 19 | ggplot(data, aes("x", "y")) 20 | + geom_point() 21 | # Minor grid lines 22 | + annotate( 23 | "point", 24 | x=0, 25 | y=[-550, -55, -5, 5, 55, 550], 26 | color="red", 27 | shape="_", 28 | size=12, 29 | ) 30 | + scale_y_symlog() 31 | ) 32 | assert p == "scale_y_symlog" 33 | -------------------------------------------------------------------------------- /tests/test_stat_calculate_methods.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import pytest 4 | 5 | from plotnine import aes, ggplot, stat_bin, stat_density, xlim 6 | from plotnine.exceptions import PlotnineError, PlotnineWarning 7 | 8 | 9 | def test_stat_bin(): 10 | x = [1, 2, 3] 11 | y = [1, 2, 3] 12 | data = pd.DataFrame({"x": x, "y": y}) 13 | 14 | # About the default bins 15 | gg = ggplot(aes(x="x"), data) + stat_bin() 16 | 17 | with pytest.warns(PlotnineWarning) as record: 18 | gg.draw_test() 19 | 20 | res = ("bins" in str(item.message).lower() for item in record) 21 | assert any(res) 22 | 23 | # About the ignoring the y aesthetic 24 | gg = ggplot(aes(x="x", y="y"), data) + stat_bin() 25 | with pytest.raises(PlotnineError): 26 | gg.draw_test() 27 | 28 | 29 | def test_changing_xlim_in_stat_density(): 30 | n = 100 31 | _xlim = (5, 10) 32 | data = pd.DataFrame({"x": np.linspace(_xlim[0] - 1, _xlim[1] + 1, n)}) 33 | p = ggplot(data, aes("x")) + stat_density() + xlim(*_xlim) 34 | # No exceptions 35 | with pytest.warns(PlotnineWarning): 36 | # warns about removed points. 37 | p._build() 38 | -------------------------------------------------------------------------------- /tests/test_stat_ecdf.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | 3 | from plotnine import aes, after_stat, ggplot, stat_ecdf 4 | 5 | data = pd.DataFrame({"x": range(10)}) 6 | p = ggplot(data, aes("x")) + stat_ecdf(size=2) 7 | 8 | 9 | def test_ecdf(): 10 | p = ggplot(data, aes("x")) + stat_ecdf(size=2) 11 | 12 | assert p == "ecdf" 13 | 14 | 15 | def test_ecdf_no_pad(): 16 | p = ggplot(data, aes("x")) + stat_ecdf(size=2, pad=False) 17 | 18 | assert p == "ecdf_no_pad" 19 | 20 | 21 | def test_computed_y_column(): 22 | p = ( 23 | ggplot(data, aes("x")) 24 | + stat_ecdf(size=2) 25 | # Should be able to use calculated & create a new column called y 26 | + stat_ecdf(aes(y=after_stat("ecdf-0.2")), size=2, color="blue") 27 | ) 28 | assert p == "computed_y_column" 29 | -------------------------------------------------------------------------------- /tests/test_stat_function.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | import pytest 4 | 5 | from plotnine import aes, arrow, ggplot, stat_function 6 | from plotnine.exceptions import PlotnineError 7 | 8 | n = 10 9 | data = pd.DataFrame({"x": range(1, n + 1)}) 10 | 11 | 12 | def test_limits(): 13 | p = ( 14 | ggplot(data, aes("x")) 15 | + stat_function( 16 | fun=np.cos, size=2, color="blue", arrow=arrow(ends="first") 17 | ) 18 | + stat_function( 19 | fun=np.cos, 20 | xlim=(10, 20), 21 | size=2, 22 | color="red", 23 | arrow=arrow(ends="last"), 24 | ) 25 | ) 26 | assert p == "limits" 27 | 28 | 29 | def test_args(): 30 | def fun(x, f=lambda x: x, mul=1, add=0): 31 | return f(x) * mul + add 32 | 33 | # no args, single arg, tuple of args, dict of args 34 | p = ( 35 | ggplot(data, aes("x")) 36 | + stat_function(fun=fun, size=2, color="blue") 37 | + stat_function(fun=fun, size=2, color="red", args=np.cos) 38 | + stat_function(fun=fun, size=2, color="green", args=(np.cos, 2, 1)) 39 | + stat_function( 40 | fun=fun, 41 | size=2, 42 | color="purple", 43 | args={"f": np.cos, "mul": 3, "add": 2}, 44 | ) 45 | ) 46 | 47 | assert p == "args" 48 | 49 | 50 | def test_exceptions(): 51 | # no mapping, no limits 52 | p = ggplot(data) + stat_function(fun=np.sin) 53 | p.draw_test() 54 | 55 | # fun not callable 56 | with pytest.raises(PlotnineError): 57 | p = ggplot(data, aes("x")) 58 | (p + stat_function(fun=1)).show() 59 | -------------------------------------------------------------------------------- /tests/test_stat_hull.py: -------------------------------------------------------------------------------- 1 | from plotnine import aes, geom_point, ggplot, stat_hull 2 | from plotnine.data import mtcars 3 | 4 | 5 | def test_hull(): 6 | p = ( 7 | ggplot(mtcars) 8 | + aes("wt", "mpg", color="factor(cyl)") 9 | + geom_point() 10 | + stat_hull(size=1) 11 | ) 12 | 13 | assert p == "hull" 14 | -------------------------------------------------------------------------------- /tests/test_stat_summary_bin.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pandas as pd 3 | 4 | from plotnine import aes, ggplot, stat_summary_bin 5 | 6 | data = pd.DataFrame( 7 | { 8 | "xd": list("aaaaabbbbcccccc"), 9 | "xc": range(15), 10 | "y": [1, 2, 3, 4, 5, 1.5, 1.5, 6, 6, 5, 5, 5, 5, 5, 5], 11 | } 12 | ) 13 | 14 | 15 | def test_discrete_x(): 16 | p = ggplot(data, aes("xd", "y")) + stat_summary_bin( 17 | fun_y=np.mean, fun_ymin=np.min, fun_ymax=np.max, geom="bar" 18 | ) 19 | 20 | assert p == "discrete_x" 21 | 22 | 23 | def test_continuous_x(): 24 | p = ggplot(data, aes("xc", "y")) + stat_summary_bin( 25 | fun_y=np.mean, fun_ymin=np.min, fun_ymax=np.max, bins=5, geom="bar" 26 | ) 27 | 28 | assert p == "continuous_x" 29 | 30 | 31 | def test_setting_binwidth(): 32 | p = ggplot(data, aes("xc", "y")) + stat_summary_bin(binwidth=3, geom="bar") 33 | assert p == "setting_binwidth" 34 | -------------------------------------------------------------------------------- /tests/test_watermark.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | import pandas as pd 4 | 5 | from plotnine import aes, geom_point, ggplot, watermark 6 | 7 | wm_file = Path(__file__).parent / "images/plotnine-watermark.png" 8 | 9 | 10 | def test_watermark(): 11 | data = pd.DataFrame({"x": [1, 2, 3], "y": [1, 2, 3]}) 12 | 13 | p = ( 14 | ggplot(data) 15 | + geom_point(aes("x", "y")) 16 | + watermark(wm_file, 150, 160) 17 | + watermark(wm_file, 150, 210, 0.5) 18 | ) 19 | 20 | assert p == "watermark" 21 | -------------------------------------------------------------------------------- /tools/update_baseline_images.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # This updates the baseline images with: 4 | # 5 | # 1. failing test result images 6 | # 2. result images without baseline images 7 | 8 | from pathlib import Path 9 | from typing import Generator 10 | 11 | baseline = Path("tests/baseline_images/") 12 | result = Path("tests/result_images/") 13 | 14 | 15 | def new_test_images() -> Generator[Path, None, None]: 16 | """ 17 | Get all test images that are failing or have no baseline 18 | """ 19 | _exp, _fail = ("-expected.png", "-failed-diff.png") 20 | for d in result.iterdir(): 21 | for png in d.glob("*.png"): 22 | if png.name.endswith(_exp) or png.name.endswith(_fail): 23 | continue 24 | 25 | expected = png.with_name(f"{png.stem}{_exp}") 26 | failed = png.with_name(f"{png.stem}{_fail}") 27 | 28 | if failed.exists() or not expected.exists(): 29 | yield png 30 | 31 | 32 | def baseline_path(new_test_image: Path) -> Path: 33 | """ 34 | Convert a test result image path to a baseline image path 35 | """ 36 | return baseline / "/".join(new_test_image.parts[2:]) 37 | 38 | 39 | def result_to_baseline(): 40 | """ 41 | Copy new or failing tests/result_images to tests/baseline_images 42 | """ 43 | for image in new_test_images(): 44 | new_baseline_image = baseline_path(image) 45 | new_baseline_image.parent.mkdir(parents=True, exist_ok=True) 46 | image.replace(new_baseline_image) 47 | 48 | 49 | if __name__ == "__main__": 50 | result_to_baseline() 51 | --------------------------------------------------------------------------------