Skip to main content

scatterbin

Adjustable binning of scatter plot data

pip install scatterbin


Requires import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
from scipy import stats
import sys


import scatterbin
scatterbin.plot(data)

where data is an array 2D array of the x and y data.

See src/scatterbin/demos.ipynb for examples

Parameters

data : obj

    The data in the form of a 2D array

two_panel : bool   (default : False)

    The default is to plot the binned data in the scatter plot. If set to
    True this will plot these in a panel below.

width : float  (default : 7)

    The width of the plot. 

height : float   (default : 5)

    The height of the plot. 

height_ratios : [float, float]    (default : [1,0.5])

    When two_panel = True, the height ratios of the two panels.
   
fs : float   (default : 12)

    The font size used in the plot.

aw : float    (default : 2)

    Axis widths

aw : float    (default : 7)

    Axis padding

point_sym : MarkerStyle  (default : 'o')

    The scatter plot marker

point_s : float   (default : 20)

    Point size in scatter plots

point_ec : str    (default :'r')

    The edge colour of the points

point_cc : str    (default :'r')

    The face colour of the points

point_top : bool   (default : False) 

    If True plots the scatter plots over the binned data
    in the single panel plot.

alpha : float  (default : 1)

    The transparency of the points

lrot : float   (default : 0)

    Axis label rotation angle

 min_space : int  (default : 5)

    Number of minor ticks per major tick interval

 xlabel_off : bool  (default : True)

    If True this removes the x-axis labels

ylabel_off : bool   (default : True)

    If True this removes the y-axis labels

xlabel : str (default : 'x')

    The x-axis label

ylabel : str (default : 'x')

    The y-axis label

pvalue : bool (default : False)

    If True this will show the p-value of the distribution
    according to Kendall's tau

leg_scale: float (default : 0.8)

     The scaling of the legend text in relation to fs

leg_loc : str    (default: 'upper left')

     The location of the legend

nbins : int  (default : 5)

     The number of bins for the binning

equal_span : str (default : 'x')

     The type of binning
     equal_span = 'x'  : each bin spans the same x-range
     equal_span = 'n'  : quantile binning - each bin
                         contains an equal number of
                         points and the x-error bars
                         show the standard deviation
     equal_span = 'nx' : shows the mean of the quantile
                         binning, but the x-error bars show
                         the range of the binning

inc_strays : bool (default : False)

     The quantile binning will have some stray points
     left over if the number of points is not divisible
     by the number of bins. Setting this to True includes
     these stray points in the last bin

SE : bool  (default : False)

     If True the error bars show the standard error rather
     than the default standard deviation

blw : float (default : 2)

     The line width of the error bars

bcol : str (default : 'k')

     The colour of the error bars

capsize : float (default : 5)

     The cap size of the error bars

hc : bool  (default : False)

  hc = True saves a hard copy

plot_form : str (default : 'png')

  The format of the hard copy

plot_name : str (default : 'scatterbin')

  The name of the hard copy

Metadata

Release files for scatterbin 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scatterbin 0.0.2
File Size Uploaded
scatterbin-0.0.2.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scatterbin 0.0.2
File Interpreter ABI Platform
scatterbin-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / scatterbin-0.0.2.tar.gz

Download URL scatterbin-0.0.2.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
318af604aa582ed5c4e0438bdb4533002e9269943685da610262dbf6973ec566
BLAKE2b-256 checksum
How to use checksums
1cfec8093494147fe04417a673c32675866a72673fe9027745b9a064c809612b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.9.15 Darwin/24.6.0

Release files / scatterbin-0.0.2-py3-none-any.whl

Download URL scatterbin-0.0.2-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9be68aad19f11b676cbf1d3e337ec15477fc9f2f3ca2c06d378fd27a9664387b
BLAKE2b-256 checksum
How to use checksums
5492ef7bdb21182a6d8ea08ba825b847dc32aadc99affdf192bcfc047e663574
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.4 CPython/3.9.15 Darwin/24.6.0

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page