Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

set multiple delimiter with gnuplot

I'm doing some simulations in OpenFOAM, using probes to get a time series of the velocity in a point. The output file has the following delimiter setup.

enter image description here

if it is possible, what would be the command to set the delimiter ?? when using gnuplot

set datafile separator '???'

Bonus info if I remove all ( and ) and use the default command the plot "plots"

plot "U" using 1:2
like image 589
Malthe Eisum Avatar asked Dec 15 '25 00:12

Malthe Eisum


2 Answers

You can use

plot "U" using 1:2 "%lf (%lf %lf %lf)"

This format specifies your data format in the plot command. See help using for more details on this and the using examples for more complex examples.

If you don't want to type this each time, and you have a copy of gnuplot compiled with support for string macros, you also can do

dformat = "\"%lf (%lf %lf %lf)\""
plot "U" using 1:2 @dformat

which will expand the format specifier into the command. See help macros for more on this.

like image 56
Matthew Avatar answered Dec 16 '25 22:12

Matthew


I would suggest to use sed :

plot "< sed 's|[()]||g' U" u 1:2
like image 40
bibi Avatar answered Dec 16 '25 22:12

bibi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!