Plotting multiple graphs depending on column value with gnuplot

Aaginor

I have the following data, which I wan't to plot using GNUPLOT:

#TIME #VALUE #SOURCE
1 100 A
1 88 B
2 115 A
2 100 B
3 130 A
3 210 B

I want to have two lines drawn, depending on the value of column #SOURCE. One line for A and one line for B. Is this possible with GNUPLOT and if yes how?

Is it possible to also draw a summation of column #VALUE depending over column #TIME? Means, that for all equal entries in #TIME, the values in #VALUE will be summed up.

Thanks in advance, Frank

ilent2

One way to do it would be to use grep to locate lines ending with A or B and plot the result. You can do this in a single plot line with a for loop if you know the characters lines will end in:

plot for [s in 'A B'] sprintf("<(grep -v '%s$' data.dat)", s) u 1:2 w l

This plots the data you provided (saved in data.dat) as two different lines.

You could also change the for part to [s in 'word1 word2 word3'] or any other string you like. If you don't know the character/word lines will be ending with you would probably need to pass the file twice first to determine the string for the for loop and a second time to do the plotting.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Plotting multiple graphs in a single window by using matlab

分類Dev

delete or update depending column value

分類Dev

gnuplot.py - plotting time vs distance graph - multiple lines

分類Dev

Check content of multiple columns of one row and add new column with value depending on contents

分類Dev

Plotting with Gnuplot in Tk

分類Dev

Plotting strings to table with gnuplot

分類Dev

Selectively populating a pandas column depending if the value in a different column falls into a list

分類Dev

Creating new column in dataframe, with ascending values, depending on value in other column

分類Dev

Gnuplot: how to mimic sketch graphs

分類Dev

Replace values in multiple untitled columns to 0, 1, 2 depending on column

分類Dev

Slick 3.0.0 - multiple inserts depending on each other with return value

分類Dev

Multiple graphs with r

分類Dev

GNUplot batch plotting producing empty plot files

分類Dev

Plotting COVID-19 data in Gnuplot

分類Dev

Plotting a column with millions of rows

分類Dev

Plotting multiple lines in Tableau

分類Dev

Plotting multiple lines in Tableau

分類Dev

Plotting two graphs, one below the other, in shiny panel

分類Dev

Using pmap in ggplot2 to automate plotting graphs of different datasets

分類Dev

Creation of timeseries depending on value of vector of df1 with timeseries of column of xts2 in R

分類Dev

How to separate the rows depending of the column's value witin two tables in CodeIgniter?

分類Dev

Multiple graphs on the same plot in seaborn

分類Dev

Find if a column value exists in multiple dataframes

分類Dev

Google Sheets setting value of multiple cells in a column

分類Dev

How to print multiple value column in PHP

分類Dev

How to set a default value with MySQL "CASE WHEN" depending the result of multiple rows

分類Dev

Plotting multiple polylines on Google Maps

分類Dev

Return multiple rows grouped by a column and named by other column value

分類Dev

Condition check, single/multiple value for multiple columns with comma separated column

Related 関連記事

  1. 1

    Plotting multiple graphs in a single window by using matlab

  2. 2

    delete or update depending column value

  3. 3

    gnuplot.py - plotting time vs distance graph - multiple lines

  4. 4

    Check content of multiple columns of one row and add new column with value depending on contents

  5. 5

    Plotting with Gnuplot in Tk

  6. 6

    Plotting strings to table with gnuplot

  7. 7

    Selectively populating a pandas column depending if the value in a different column falls into a list

  8. 8

    Creating new column in dataframe, with ascending values, depending on value in other column

  9. 9

    Gnuplot: how to mimic sketch graphs

  10. 10

    Replace values in multiple untitled columns to 0, 1, 2 depending on column

  11. 11

    Slick 3.0.0 - multiple inserts depending on each other with return value

  12. 12

    Multiple graphs with r

  13. 13

    GNUplot batch plotting producing empty plot files

  14. 14

    Plotting COVID-19 data in Gnuplot

  15. 15

    Plotting a column with millions of rows

  16. 16

    Plotting multiple lines in Tableau

  17. 17

    Plotting multiple lines in Tableau

  18. 18

    Plotting two graphs, one below the other, in shiny panel

  19. 19

    Using pmap in ggplot2 to automate plotting graphs of different datasets

  20. 20

    Creation of timeseries depending on value of vector of df1 with timeseries of column of xts2 in R

  21. 21

    How to separate the rows depending of the column's value witin two tables in CodeIgniter?

  22. 22

    Multiple graphs on the same plot in seaborn

  23. 23

    Find if a column value exists in multiple dataframes

  24. 24

    Google Sheets setting value of multiple cells in a column

  25. 25

    How to print multiple value column in PHP

  26. 26

    How to set a default value with MySQL "CASE WHEN" depending the result of multiple rows

  27. 27

    Plotting multiple polylines on Google Maps

  28. 28

    Return multiple rows grouped by a column and named by other column value

  29. 29

    Condition check, single/multiple value for multiple columns with comma separated column

ホットタグ

アーカイブ