farrow-and-ball-0.0.3
توضیحات
Port of the R farrowandball palette implementation.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | farrow-and-ball-0.0.3 |
| نام | farrow-and-ball |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Mark Boss |
| ایمیل نویسنده | hello@markboss.me |
| آدرس صفحه اصلی | https://github.com/vork/farrowandball |
| آدرس اینترنتی | https://pypi.org/project/farrow-and-ball/ |
| مجوز | - |
# Farrow&Ball Matplotlib
[](https://pypi.org/project/farrow-and-ball/)
This is a python port for the matplotlib library of the [R Package](https://github.com/km4htc/farrowandball) for ggplot2.


The style for the charts is provided in the [styles](https://github.com/vork/farrowandball/tree/master/styles) folder
# Installation
A python version >= 3 is required.
```bash
pip install farrow-and-ball
```
# Usage
The usage is quite simple:
```python
from farrow_and_ball import *
import numpy as np
import matplotlib.pyplot as plt
# Define a gray scale image
x = np.arange(0, np.pi, 0.1)
y = np.arange(0, 2 * np.pi, 0.1)
X, Y = np.meshgrid(x, y)
Z = np.cos(X) * np.sin(Y) * 10
# Get the color map
cmap = build_colormap(DivergentPalette.DAY, True)
# Draw image
plt.imshow(Z, origin="lower", cmap=cmap)
plt.show()
```
One can also directly get the color map definition as a list of strings with `farrow_and_ball.get_palette(DivergentPalette.DAY)` or an interpolated one with `farrow_and_ball.get_interpolated_palette(DivergentPalette.DAY, num_classes)`.
# Palettes
The palettes are organized in Enums:
```python
class SpectralPalette(Enum):
DEEPSPEC = "deepspec"
SPEC = "spec"
LIGHTSPEC = "lightspec"
LIGHTERSPEC = "lighterspec"
class DivergentPalette(Enum):
DAY = "day"
DAYLONG = "daylong"
ARMY = "army"
MONO = "mono"
class BaseColorPalette(Enum):
PINKS = "pinks"
PINKS_VAR = "pinks2"
REDS = "reds"
YELLOWS = "yellows"
GREENS = "greens"
GREENS_VAR = "greens2"
BLUES = "blues"
BLUES_VAR = "blues2"
class MiscPalette(Enum):
TONKA = "tonka"
BELLSPOUT = "bellsprout"
DOCKERS = "dockers"
FRUITYPEBBLES = "fruitypebbles"
```
One can also directly enter the name as a string, e.g. `build_colormap("day", True)`.
## Color Maps
### Continuous




### Discrete




نیازمندی
| مقدار | نام |
|---|---|
| - | matplotlib |
| - | enum34 |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3 | Python |
نحوه نصب
نصب پکیج whl farrow-and-ball-0.0.3:
pip install farrow-and-ball-0.0.3.whl
نصب پکیج tar.gz farrow-and-ball-0.0.3:
pip install farrow-and-ball-0.0.3.tar.gz