Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

output figures display at terminal #6

Closed
crazyhottommy opened this issue Nov 22, 2016 · 6 comments
Closed

output figures display at terminal #6

crazyhottommy opened this issue Nov 22, 2016 · 6 comments

Comments

@crazyhottommy
Copy link

crazyhottommy commented Nov 22, 2016

Hi shenwei,

Thanks for this nice tool. I really like the plot functions.

It will be more useful if it can be piped to display from imagemagic to display on terminal rather saving the figures. see some examples http://crazyhottommy.blogspot.com/2014/11/csvkit-to-manipulate-csv-at-command.html. Most of the time, I just want to glance the distribution of the data. If I want serious figures, I will import to R and plot with ggplot2.

Best,
Tommy

@crazyhottommy crazyhottommy changed the title give output figure names and display at terminal output figures display at terminal Nov 22, 2016
@shenwei356
Copy link
Owner

Hi Tommy,

Output image file could be set by global flag -o/--out-file of csvtk .

Help message of csvtk plot:

plot common figures

Notes:

  1. File format is determined by the out file (-o/--out-file) suffix.
     Supported formats: eps, jpg|jpeg, pdf, png, svg, and tif|tiff

Usage:
  csvtk plot [command]

Available Commands:
  box         plot boxplot
  hist        plot histogram
  line        line plot and scatter plot

Flags:
      --axis-width float     axis width (default 1.5)
  -f, --data-field string    column index or column name of data (default "1")
  -g, --group-field string   column index or column name of group
      --height float         Figure height (default 4.5)
      --label-size int       label font size (default 14)
      --tick-width float     axis tick width (default 1.5)
      --title string         Figure title
      --title-size int       title font size (default 16)
      --width float          Figure width (default 6)
      --x-max string         maximum value of X axis
      --x-min string         minimum value of X axis
      --xlab string          x label text
      --y-max string         maximum value of Y axis
      --y-min string         minimum value of Y axis
      --ylab string          y label text

@crazyhottommy
Copy link
Author

crazyhottommy commented Nov 23, 2016

I want to do something like:

csvtk -t plot hist grouped_data.tsv.gz -f2 -o - | display
display: no decode delegate for this image format `' @ error/constitute.c/ReadImage/501.

see https://www.imagemagick.org/script/command-line-processing.php

@shenwei356
Copy link
Owner

shenwei356 commented Nov 23, 2016

It's implemented, and I'll release a new version until I fix a bug of other subcommand.

@crazyhottommy
Copy link
Author

crazyhottommy commented Nov 23, 2016

great and thanks!

Now it looks like after

csvtk -t plot hist grouped_data.tsv.gz -f2 -o - 

A histogram.png file will still be generated rather than output to the STDOUT.

@shenwei356
Copy link
Owner

shenwei356 commented Nov 23, 2016

Implemented in new version v0.4.2

csvtk -t plot hist grouped_data.tsv.gz -f2 | display

@crazyhottommy
Copy link
Author

nicely worked for me! great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants