PHPackages                             macocci7/php-lorenz-curve - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. macocci7/php-lorenz-curve

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

macocci7/php-lorenz-curve
=========================

A PHP Library to plot a Lorenz Curve.

0.0.7(5mo ago)110[2 issues](https://github.com/macocci7/PHP-LorenzCurve/issues)MITPHPPHP &gt;=8.1

Since Aug 1Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/macocci7/PHP-LorenzCurve)[ Packagist](https://packagist.org/packages/macocci7/php-lorenz-curve)[ RSS](/packages/macocci7-php-lorenz-curve/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (8)Used By (0)

PHP Lorenz Curve
================

[](#php-lorenz-curve)

A PHP Library to draw a Lorenz Curve.

1. Features
-----------

[](#1-features)

`PHP-LorenzCurve` draws a Lorenz Curve and also calculates the Gini's coefficient.

[![](examples/img/BasicUsage.png)](examples/img/BasicUsage.png)

Of course, you can also obtain only parsed data such as coordinates for each point and the Gini's coefficient without generating an image.

2. Contents
-----------

[](#2-contents)

- [1. Features](#1-features)
- 2. Contents
- [3. Requirements](#3-requirements)
- [4. Installation](#4-installation)
- [5. Usage](#5-usage)
    - [5.1. Basic Usage](#51-basic-usage)
    - [5.2. Adjusting the Appearance](#52-adjusting-the-appearance)
        - [5.2.1. Drawing Grid Lines](#521-drawing-grid-lines)
        - [5.2.2. Drawing an Upward Convex Curve](#522-drawing-an-upward-convex-curve)
        - [5.2.3. Setting the Image Size](#523-setting-the-image-size)
        - [5.2.4. Setting the Attributes of Plotarea](#524-setting-the-attributes-of-plotarea)
        - [5.2.5. Setting Caption and Labels](#525-setting-caption-and-labels)
        - [5.2.6. Setting Attributes with Array](#526-setting-attributes-with-array)
        - [5.2.7. Setting Attributes with Neon File](#527-setting-attributes-with-neon-file)
        - [5.2.8. Customisable Attributes](#528-customisable-attributes)
    - [5.3. Gini's Coefficient](#53-ginis-coefficient)
    - [5.4. Getting Parsed Data](#54-getting-parsed-data)
- [6. Examples](#6-examples)
- [7. LICENSE](#7-license)

3. Requirements
---------------

[](#3-requirements)

- PHP 8.1 or later
- Imagick PHP Extension

    Check with commands:

    ```
    (php -m; php -i) | grep imagick
    ```
- Composer

4. Installation
---------------

[](#4-installation)

```
composer require macocci7-lorenz-curve
```

5. Usage
--------

[](#5-usage)

### 5.1. Basic Usage

[](#51-basic-usage)

To draw a Lorenz Curve, create an instance of `LorenzCurve` class at first.

```
