Skip to content

Commit

Permalink
Fix typos (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
kianmeng authored Jan 21, 2025
1 parent 6289b61 commit ebe04df
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![Downloads](https://pepy.tech/badge/plotille/month)](https://pepy.tech/project/plotille)
[![PyPi license](https://img.shields.io/pypi/l/plotille.svg)](https://pypi.python.org/pypi/plotille)

Plots, scatter plots, histograms and heatmaps in the terminal using braille dots, and foreground and background colors - with no dependancies. Make complex figures using the Figure class or make fast and simple plots using graphing function - similar to a very small sibling to matplotlib. Or use the canvas to plot dots, lines and images yourself.
Plots, scatter plots, histograms and heatmaps in the terminal using braille dots, and foreground and background colors - with no dependencies. Make complex figures using the Figure class or make fast and simple plots using graphing function - similar to a very small sibling to matplotlib. Or use the canvas to plot dots, lines and images yourself.

Install:

Expand Down Expand Up @@ -41,7 +41,7 @@ In [3]: X = np.sort(np.random.normal(size=1000))

### Figure

To construct plots the recomended way is to use a `Figure`:
To construct plots the recommended way is to use a `Figure`:

```python
In [12]: plotille.Figure?
Expand Down Expand Up @@ -155,10 +155,10 @@ Parameters:
X: List[float] X values.
Y: List[float] Y values. X and Y must have the same number of entries.
width: int The number of characters for the width (columns) of the canvas.
hight: int The number of characters for the hight (rows) of the canvas.
height: int The number of characters for the height (rows) of the canvas.
X_label: str Label for X-axis.
Y_label: str Label for Y-axis. max 8 characters.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
interp: Optional[str] Specify interpolation; values None, 'linear'
x_min, x_max: float Limits for the displayed X values.
y_min, y_max: float Limits for the displayed Y values.
Expand Down Expand Up @@ -210,10 +210,10 @@ Parameters:
X: List[float] X values.
Y: List[float] Y values. X and Y must have the same number of entries.
width: int The number of characters for the width (columns) of the canvas.
hight: int The number of characters for the hight (rows) of the canvas.
height: int The number of characters for the height (rows) of the canvas.
X_label: str Label for X-axis.
Y_label: str Label for Y-axis. max 8 characters.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
x_min, x_max: float Limits for the displayed X values.
y_min, y_max: float Limits for the displayed Y values.
lc: multiple Give the line color.
Expand Down Expand Up @@ -259,7 +259,7 @@ Parameters:
bins: int The number of bins to put X entries in (rows).
width: int The number of characters for the width (columns).
log_scale: bool Scale the histogram with `log` function.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
lc: multiple Give the line color.
bg: multiple Give the background color.
color_mode: str Specify color input mode; 'names' (default), 'byte' or 'rgb'
Expand Down Expand Up @@ -304,7 +304,7 @@ Parameters:
Hence, `len(bins) == len(counts) + 1`.
width: int The number of characters for the width (columns).
log_scale: bool Scale the histogram with `log` function.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
lc: multiple Give the line color.
bg: multiple Give the background color.
color_mode: str Specify color input mode; 'names' (default), 'byte' or 'rgb'
Expand Down Expand Up @@ -359,7 +359,7 @@ Parameters:
height: int The number of characters for the height (rows).
X_label: str Label for X-axis.
Y_label: str Label for Y-axis. max 8 characters.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
x_min, x_max: float Limits for the displayed X values.
y_min, y_max: float Limits for the displayed Y values.
lc: multiple Give the line color.
Expand Down Expand Up @@ -411,7 +411,7 @@ Initiate a Canvas object
Parameters:
width: int The number of characters for the width (columns) of the canvas.
hight: int The number of characters for the hight (rows) of the canvas.
height: int The number of characters for the height (rows) of the canvas.
xmin, ymin: float Lower left corner of reference system.
xmax, ymax: float Upper right corner of reference system.
background: multiple Background color of the canvas.
Expand Down Expand Up @@ -559,7 +559,7 @@ Docstring:
Transform canvas into `print`-able string
Parameters:
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
Returns:
unicode: The canvas as a string.
Expand Down
6 changes: 3 additions & 3 deletions examples/color_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@ def main():
print(color('and a background.', bg='red'))
print(color('Or both.', fg='black', bg='cyan'))

print(color('Asside from 4-bit / name colors', fg='green', mode='names'))
print(color('Aside from 4-bit / name colors', fg='green', mode='names'))
print(color('you can also set 8-bit colors / 256-color lookup tables', fg=126, bg=87, mode='byte'))
print(color('or go with full 24-bit rgb colors', fg=(50, 50, 50), bg=(166, 237, 240), mode='rgb'))

no_color = os.environ.get('NO_COLOR')
os.environ['NO_COLOR'] = '1'
print(color('The Environmnet variable `NO_COLOR` will always strip colors.', fg='red'))
print(color('The Environment variable `NO_COLOR` will always strip colors.', fg='red'))
if no_color:
os.environ['NO_COLOR'] = no_color
else:
os.environ.pop('NO_COLOR')

force_color = os.environ.get('FORCE_COLOR')
os.environ['FORCE_COLOR'] = '1'
print(color('The Environmnet variable `FORCE_COLOR` allows to toggle colors,', fg='blue'))
print(color('The Environment variable `FORCE_COLOR` allows to toggle colors,', fg='blue'))
os.environ['FORCE_COLOR'] = '0'
print(color('setting it to 0, none or false, strips color codes', fg='magenta'))
os.environ['FORCE_COLOR'] = '1'
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_ticks_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# Custom X and Y ticks
#
# You can customize the displayed tick valus on the corresponding axis
# You can customize the displayed tick values on the corresponding axis
# by providing callback functions for each.


Expand Down
2 changes: 1 addition & 1 deletion examples/wetterdienst_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def main():
fig.plot([1970, 2021], [start, end], label='{} - regression'.format(station))

print('\033[2J') # clear screen
print(' ' * 50 + 'Temperatur of two stations in Germany at 1. Januar')
print(' ' * 50 + 'Temperature of two stations in Germany at 1. January')
print(fig.show(legend=True))


Expand Down
4 changes: 2 additions & 2 deletions plotille/_canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, width, height, xmin=0, ymin=0, xmax=1, ymax=1, background=Non
Parameters:
width: int The number of characters for the width (columns) of the canvas.
hight: int The number of characters for the hight (rows) of the canvas.
height: int The number of characters for the height (rows) of the canvas.
xmin, ymin: float Lower left corner of reference system.
xmax, ymax: float Upper right corner of reference system.
background: multiple Background color of the canvas.
Expand Down Expand Up @@ -366,7 +366,7 @@ def plot(self, linesep=os.linesep):
"""Transform canvas into `print`-able string
Parameters:
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
Returns:
unicode: The canvas as a string.
Expand Down
2 changes: 1 addition & 1 deletion plotille/_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def color(text, fg=None, bg=None, mode='names', no_color=False, full_reset=True)
`ValueErrors`.
If you do not want a foreground or background color, leave the corresponding
paramter `None`. If both are `None`, you get `text` directly.
parameter `None`. If both are `None`, you get `text` directly.
When you stick to mode `names` and only use the none `bright_` versions,
the color control characters conform to ISO 6429 and the ANSI Escape sequences
Expand Down
2 changes: 1 addition & 1 deletion plotille/_dots.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Dots(object):
Dot ordering: \u2800 '⠀' - \u28FF '⣿'' Coding according to ISO/TR 11548-1
Hence, each dot on or off is 8bit, i.e. 256 posibilities. With dot number
Hence, each dot on or off is 8bit, i.e. 256 possibilities. With dot number
one being the lsb and 8 is msb:
idx: 8 7 6 5 4 3 2 1
Expand Down
2 changes: 1 addition & 1 deletion plotille/_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ def scatter(self, X, Y, lc=None, label=None, marker=None):
def histogram(self, X, bins=160, lc=None):
"""Compute and plot the histogram over X.
Paramaters:
Parameters:
X: List[float] X values.
bins: int The number of bins to put X entries in (columns).
lc: multiple The line color.
Expand Down
20 changes: 10 additions & 10 deletions plotille/_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def hist_aggregated(counts, bins, width=80, log_scale=False, linesep=os.linesep,
Hence, `len(bins) == len(counts) + 1`.
width: int The number of characters for the width (columns).
log_scale: bool Scale the histogram with `log` function.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
lc: multiple Give the line color.
bg: multiple Give the background color.
color_mode: str Specify color input mode; 'names' (default), 'byte' or 'rgb'
Expand All @@ -69,12 +69,12 @@ def _scale(a):
canvas = [' bucket | {} {}'.format('_' * width, 'Total Counts')]
lasts = ['', '⠂', '⠆', '⠇', '⡇', '⡗', '⡷', '⡿']
for i in range(bins_count):
hight = int(width * 8 * _scale(h[i]) / h_max)
height = int(width * 8 * _scale(h[i]) / h_max)
canvas += ['[{}, {}) | {} {}'.format(
ipf.fmt(b[i], delta=delta, chars=8, left=True),
ipf.fmt(b[i + 1], delta=delta, chars=8, left=False),
color('⣿' * (hight // 8) + lasts[hight % 8], fg=lc, bg=bg, mode=color_mode)
+ color('\u2800' * (width - (hight // 8) + int(hight % 8 == 0)), bg=bg, mode=color_mode),
color('⣿' * (height // 8) + lasts[height % 8], fg=lc, bg=bg, mode=color_mode)
+ color('\u2800' * (width - (height // 8) + int(height % 8 == 0)), bg=bg, mode=color_mode),
h[i])]
canvas += ['‾' * (2 * 8 + 2 + 3 + width + 12)]
return linesep.join(canvas)
Expand All @@ -92,7 +92,7 @@ def hist(X, bins=40, width=80, log_scale=False, linesep=os.linesep,
bins: int The number of bins to put X entries in (rows).
width: int The number of characters for the width (columns).
log_scale: bool Scale the histogram with `log` function.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
lc: multiple Give the line color.
bg: multiple Give the background color.
color_mode: str Specify color input mode; 'names' (default), 'byte' or 'rgb'
Expand Down Expand Up @@ -121,7 +121,7 @@ def histogram(X, bins=160, width=80, height=40, X_label='X', Y_label='Counts', l
height: int The number of characters for the height (rows).
X_label: str Label for X-axis.
Y_label: str Label for Y-axis. max 8 characters.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
x_min, x_max: float Limits for the displayed X values.
y_min, y_max: float Limits for the displayed Y values.
lc: multiple Give the line color.
Expand Down Expand Up @@ -170,10 +170,10 @@ def scatter(X, Y, width=80, height=40, X_label='X', Y_label='Y', linesep=os.line
X: List[float] X values.
Y: List[float] Y values. X and Y must have the same number of entries.
width: int The number of characters for the width (columns) of the canvas.
hight: int The number of characters for the hight (rows) of the canvas.
height: int The number of characters for the height (rows) of the canvas.
X_label: str Label for X-axis.
Y_label: str Label for Y-axis. max 8 characters.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
x_min, x_max: float Limits for the displayed X values.
y_min, y_max: float Limits for the displayed Y values.
lc: multiple Give the line color.
Expand All @@ -200,10 +200,10 @@ def plot(X, Y, width=80, height=40, X_label='X', Y_label='Y', linesep=os.linesep
X: List[float] X values.
Y: List[float] Y values. X and Y must have the same number of entries.
width: int The number of characters for the width (columns) of the canvas.
hight: int The number of characters for the hight (rows) of the canvas.
height: int The number of characters for the height (rows) of the canvas.
X_label: str Label for X-axis.
Y_label: str Label for Y-axis. max 8 characters.
linesep: str The requested line seperator. default: os.linesep
linesep: str The requested line separator. default: os.linesep
interp: Optional[str] Specify interpolation; values None, 'linear'
x_min, x_max: float Limits for the displayed X values.
y_min, y_max: float Limits for the displayed Y values.
Expand Down

0 comments on commit ebe04df

Please sign in to comment.