-
Notifications
You must be signed in to change notification settings - Fork 47
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
Use data blocks to in-line data in the script #31
Comments
@epagone - thank you for your comments! ogpf uses data generated by Fortran! I am not sure what is the benefit of data block in the case of ogpf! but I would welcome to give some example and explain the purpose a little more! Thank you |
Thanks for looking into my issue.
This makes even a better case for using data blocks (expanded description follows).
If you look at the linked Stacked Overflow question in my first message both your requests are addressed. The main advantage is to avoid repeating the same entire dataset in the script for each plot command that is using it. Currently, set terminal gif
set output 'plot1.gif'
plot '-' using 1:2
1 10
2 20
3 32
4 40
5 50
e and if you want to plot the same dataset with different plot specs you need to repeat the in-line data each time for each With data blocks (in the example called $data << EOD
1 1
2 4
3 9
4 16
EOD
plot "$data" \
with linespoints \
title "my data" I hope that it is now clearer. The only drawback (as mentioned in my first message) is that this approach will fail with very old versions of gnuplot (i.e. older than about 7 years), but I guess that it is a reasonable request. |
@epagone thank you! If you can make a PR I welcome to look into it and merge! We need to freeze the current version and start ne release to let people with old gnuplot can still use the library! |
Thank you. Unfortunately, I do not see an opportunity in the next months, but I will try to have a look at this when things clear up a bit more. |
Since version 5 (released almost 7 years ago) gnuplot offers data blocks, a more flexible way to in-line data for repeated plotting. It might be worth using this new functionality.
The text was updated successfully, but these errors were encountered: