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

How to embed y-values above the plot points? #47

Closed
pvonmoradi opened this issue Aug 27, 2022 · 3 comments
Closed

How to embed y-values above the plot points? #47

pvonmoradi opened this issue Aug 27, 2022 · 3 comments

Comments

@pvonmoradi
Copy link

1- Is it possible to also show y-values on the graph itself similar to this?
image

2- Is it possible to only print the last data point somewhere on the graph?

Thanks for your awesome tool.

@dkogan
Copy link
Owner

dkogan commented Aug 27, 2022

Hi. Each plot component should be passed-in and interepreted as a separate dataset. For instance, let's say you have a data file:

1 1
2 4
3 9
4 16
5 25

To plot these as only xy data with lines and points:

< /tmp/dat feedgnuplot --domain --lines --points

To plot these as labels only:

< /tmp/dat awk '{print $1,$2,$2}' | feedgnuplot --domain --with labels --tuplesizeall 3

To plot just the last point as a cicle:

wc -l /tmp/dat | awk '{print $1}' | read N; < /tmp/dat awk 'NR=='$N' {print $1,$2}' | feedgnuplot --domain --with 'points pt 7 ps 2'

To do all this at the same time:

wc -l /tmp/dat | awk '{print $1}' | read N; < /tmp/dat awk '{print $1,"lp",$2} {print $1,"text",$2+1,$2} NR=='$N' {print $1,"last",$2}' | feedgnuplot --dataid --domain --style lp 'with linespoints' --style text 'with labels' --style last 'with points pt 7 ps 2' --tuplesize text 3

@pvonmoradi
Copy link
Author

Thanks!

(had to substitute N with literal 5 possibly due to some quoting issues)

@dkogan
Copy link
Owner

dkogan commented Aug 28, 2022

Sure. Or tail -n1 or something. I'm going to close this issue. Re-open if something isn't clear.

@dkogan dkogan closed this as completed Aug 28, 2022
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