Skip to main content

Adjustable binning of scatter plot data

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scatterbin-0.0.2.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scatterbin-0.0.2-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file scatterbin-0.0.2.tar.gz.

File metadata

  • Download URL: scatterbin-0.0.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.9.15 Darwin/24.6.0

File hashes

Hashes for scatterbin-0.0.2.tar.gz
Algorithm Hash digest
SHA256 318af604aa582ed5c4e0438bdb4533002e9269943685da610262dbf6973ec566
MD5 f2f7e481184fe1d3acf9feb48af8e1c9
BLAKE2b-256 1cfec8093494147fe04417a673c32675866a72673fe9027745b9a064c809612b

See more details on using hashes here.

File details

Details for the file scatterbin-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: scatterbin-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.4 CPython/3.9.15 Darwin/24.6.0

File hashes

Hashes for scatterbin-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9be68aad19f11b676cbf1d3e337ec15477fc9f2f3ca2c06d378fd27a9664387b
MD5 6cd2ef93557a864f510440e86755e8be
BLAKE2b-256 5492ef7bdb21182a6d8ea08ba825b847dc32aadc99affdf192bcfc047e663574

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page