mcastorina / graph-cli

Flexible command line tool to create graphs from CSV data
783 stars 29 forks source link

Negative --yrange doesn't work #50

Closed MarekKnapek closed 3 years ago

MarekKnapek commented 3 years ago

I would like to adjust yrange. When I try your sine example, I can do it for a positive numbers such as from 0.5 to 1.0 but when I try with negative numbers, such as from -0.5 to 1.0, your program fails. I'm on Windows 10 x64, using Python 3.9.4.

>graph --version
graph-cli v0.1.13

>graph sine.csv --yrange 0.5:1.0 -o sine.png

>graph sine.csv --yrange -0.5:1.0 -o sine.png
usage: graph [-h] [--xcol COL] [--ycol COL] [--legend LEGEND] [--color COLOR] [--style STYLE] [--fill]
             [--marker MARKER] [--width WIDTH] [--offset OFFSET] [--markersize MARKERSIZE] [--output FILE]
             [--time-format-input FORMAT] [--time-format-output FORMAT] [--resample FREQ] [--sort] [--bar] [--barh]
             [--hist] [--hist-perc] [--bins BINS] [--bin-size BIN_SIZE] [--xlabel LABEL] [--xscale SCALE]
             [--xrange RANGE] [--ylabel LABEL] [--yscale SCALE] [--yrange RANGE] [--figsize SIZE] [--title TITLE]
             [--fontsize FONTSIZE] [--tick-fontsize TICK_FONTSIZE] [--label-fontsize LABEL_FONTSIZE]
             [--xtick-fontsize XTICK_FONTSIZE] [--xtick-angle XTICK_ANGLE] [--xtick-align XTICK_ALIGN]
             [--xlabel-fontsize XLABEL_FONTSIZE] [--ytick-fontsize YTICK_FONTSIZE] [--ytick-angle YTICK_ANGLE]
             [--ytick-align YTICK_ALIGN] [--ylabel-fontsize YLABEL_FONTSIZE] [--no-grid] [--grid GRID]
             [--grid-color GRID_COLOR] [--grid-alpha GRID_ALPHA] [--grid-width GRID_WIDTH] [--text TEXT]
             [--annotate ANNOTATE] [--exponent-range RANGE] [--no-tight] [--chain] [--version]
             CSV
graph: error: argument --yrange: expected one argument
mcastorina commented 3 years ago

Please try using the equal sign syntax. --yrange=-0.5:1.0

MarekKnapek commented 3 years ago

Works great. Definitely should be mentioned in manual and in examples.

mcastorina commented 3 years ago

cbe0284c361f66156f5bbec327ee9fec01ca4a8e adds a note in the help message, and there's also a note in OPTIONS.md