sgreben / jp

dead simple terminal plots from JSON data. single binary, no dependencies. linux, osx, windows.
MIT License
1.32k stars 33 forks source link

Manually set the Y axis scale #24

Open luckman212 opened 4 years ago

luckman212 commented 4 years ago

Love this tool @sgreben !

Is there any way to manually set the min/max values for the Y-axis?

BlackthornYugen commented 4 years ago

Would love this feature. Sometimes I am graphing a horizontal line, and that yields NaN for ymin / ymax since it tries to automagically set these. I am trying to find an easy tool to graph temperatures over time from a few different sensors. Ideally I'd like these to have the same Y axis scale so they are easy to compare.

Here is how I animate a few days of temperature data with jp:

for y in `seq 4500 -20 20` ; do
  for x in {0..2} ; do
    jq -sc ".[-$((1000 + $y)):-${y}] "'| map([.[3],.['"$x"']])' < remote.templog \
      | jp -height 10 -width 100 >> graph.txt
  done
  cat graph.txt
  rm graph.txt
  sleep 0.05
done

temps