CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Special Topics > Visualization & Post-Processing

what software you use for obtaining graphs by data?

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 8, 2013, 07:44
Default
  #21
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Quote:
Why would you need to fix that? Gnuplot doesnt care about the "look" of the datafile as long as there are datafile separators between each column.
The only issue with this datafile are the brackets. But we already had that.
but it doesn't plot the data files I've attache them by this error:
Code:
gnuplot> plot 'h1.dat' u 1:4 ti 'h1-Temperature' w l linestyle 1,"h2.dat" u 1:4 ti 'h2-Temperature' w l linestyle 2,"h3.dat" u 1:4 ti "h3-Temperature" with lp linestyle 3
                                                                                                                                                                          ^
         "T.plt", line 29: all points y value undefined!
I've attached the gnuplot code used.
Attached Files
File Type: gz h1.dat.tar.gz (74.2 KB, 0 views)
File Type: gz h2.dat.tar.gz (73.2 KB, 0 views)
File Type: gz h3.dat.tar.gz (74.3 KB, 1 views)
File Type: gz T.plt.tar.gz (547 Bytes, 1 views)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 8, 2013, 07:51
Default
  #22
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
But that works for another case with attached files.
Quote:
I did that plotting the same data twice, once as a line and a second time with points using the every option.
The drawback is that you cant have the same representation of the linestyle in the key automatically as far as I know. Some editing of the figure will be required.
do you mean that its not possible to plot with linepoints style so that line be continuous and points plot every 5 points as you mentioned? then I have to use only points style for that?
Attached Files
File Type: gz h1.dat.tar.gz (85.8 KB, 1 views)
File Type: gz h2.dat.tar.gz (84.9 KB, 0 views)
File Type: gz h3.dat.tar.gz (85.8 KB, 0 views)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 8, 2013, 08:09
Default
  #23
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
this error shown when I added "every" option,what may be the cause?
Code:
gnuplot> load "Ux.plt"

gnuplot> plot 'h1.dat' u 1:7 ti 'h1-x_Velocity' w l linestyle 1,"h2.dat" u 1:7 ti 'h2-x_Velocity' w l linestyle 2,"h3.dat" u 1:7 ti "h3-x_Velocity" every 5 with p linestyle 3
                                                                                                                                                    ^
         "Ux.plt", line 29: ';' expected

gnuplot> gnuplot> load "Ux.plt"

gnuplot> plot 'h1.dat' u 1:7 ti 'h1-x_Velocity' w l linestyle 1,"h2.dat" u 1:7 ti 'h2-x_Velocity' w l linestyle 2,"h3.dat" u 1:7 ti "h3-x_Velocity" every 5 with p linestyle 3
                                                                                                                                                    ^
         "Ux.plt", line 29: ';' expected

gnuplot> gnuplot> load "Ux.plt"

gnuplot> plot 'h1.dat' u 1:7 ti 'h1-x_Velocity' w l linestyle 1,"h2.dat" u 1:7 ti 'h2-x_Velocity' w l linestyle 2,"h3.dat" u 1:7 ti "h3-x_Velocity" every 5 with p linestyle 3
                                                                                                                                                    ^
         "Ux.plt", line 29: ';' expected
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 8, 2013, 09:53
Default
  #24
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Quote:
Originally Posted by immortality View Post
but it doesn't plot the data files I've attache them by this error:
Code:
gnuplot> plot 'h1.dat' u 1:4 ti 'h1-Temperature' w l linestyle 1,"h2.dat" u 1:4 ti 'h2-Temperature' w l linestyle 2,"h3.dat" u 1:4 ti "h3-Temperature" with lp linestyle 3
                                                                                                                                                                          ^
         "T.plt", line 29: all points y value undefined!
I've attached the gnuplot code used.
Seriously, why dont you erase the brackets in the datafiles?

Quote:
Originally Posted by immortality View Post
But that works for another case with attached files.
...because in these datafiles, there are no brackets...

do you mean that its not possible to plot with linepoints style so that line be continuous and points plot every 5 points as you mentioned? then I have to use only points style for that?
I mean that you cant have the correct representation of that line style in the key automatically, because the line with dots will actually consist of two plots.
With the method I described, the line within the plot will be continuous and contain all data points, while there will only be few points to enhance visibility.

Quote:
Originally Posted by immortality View Post
this error shown when I added "every" option,what may be the cause?
Code:
gnuplot> load "Ux.plt"

gnuplot> plot 'h1.dat' u 1:7 ti 'h1-x_Velocity' w l linestyle 1,"h2.dat" u 1:7 ti 'h2-x_Velocity' w l linestyle 2,"h3.dat" u 1:7 ti "h3-x_Velocity" every 5 with p linestyle 3
                                                                                                                                                    ^
         "Ux.plt", line 29: ';' expected

gnuplot> gnuplot> load "Ux.plt"

gnuplot> plot 'h1.dat' u 1:7 ti 'h1-x_Velocity' w l linestyle 1,"h2.dat" u 1:7 ti 'h2-x_Velocity' w l linestyle 2,"h3.dat" u 1:7 ti "h3-x_Velocity" every 5 with p linestyle 3
                                                                                                                                                    ^
         "Ux.plt", line 29: ';' expected

gnuplot> gnuplot> load "Ux.plt"

gnuplot> plot 'h1.dat' u 1:7 ti 'h1-x_Velocity' w l linestyle 1,"h2.dat" u 1:7 ti 'h2-x_Velocity' w l linestyle 2,"h3.dat" u 1:7 ti "h3-x_Velocity" every 5 with p linestyle 3
                                                                                                                                                    ^
         "Ux.plt", line 29: ';' expected
I dont think it is a good idea to have the every option at the end of the plot prompt.
Not 100% sure about the correct sequence, so try one of the following
Code:
plot 'h1.dat' u 1:7 w l linestyle 1 t 'h1-x_Velocity',"h2.dat" u 1:7 w l linestyle 2 t 'h2-x_Velocity',"h3.dat" every 5 u 1:7 with p linestyle 3 t "h3-x_Velocity"
plot 'h1.dat' u 1:7 w l linestyle 1 t 'h1-x_Velocity',"h2.dat" u 1:7 w l linestyle 2 t 'h2-x_Velocity',"h3.dat" u 1:7 every 5 with p linestyle 3 t "h3-x_Velocity"
flotus1 is offline   Reply With Quote

Old   September 8, 2013, 10:29
Default
  #25
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Quote:
Seriously, why dont you erase the brackets in the datafiles?
I don't think it be because of parentheses,because it was plotting other columns without parentheses in previous data files,however I deleted parentheses but the error has remained,although its appearance has changed.
Code:
gnuplot> plot "p.plt"
              ^
         Bad data on line 1
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 8, 2013, 10:39
Default
  #26
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

I don't have much time to spare today, so I can't play with gnuplot myself . Nonetheless, here are the instructions for installing the gnuplot documentation and example on Ubuntu:
  1. Install the documents and examples:
    Code:
    sudo apt-get install gnuplot-doc
  2. Open the main HTML page on Firefox:
    Code:
    firefox /usr/share/doc/gnuplot-doc/html/index.html
    This is the main page for the documentation for gnuplot.
  3. You can find the examples at the folder:
    Code:
    /usr/share/doc/gnuplot-doc/examples/
Good luck! Best regards,
Bruno
immortality likes this.
__________________
wyldckat is offline   Reply With Quote

Old   September 8, 2013, 11:48
Default
  #27
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
Hi
that resolved,the ranges wasn't appropriate,
but I didn't grasp how to set linestyles to have lines and points concurrently and points be less.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 8, 2013, 12:55
Default
  #28
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
it resolved,thanks,
the attached is the result with this command:
Code:
plot 'h1.dat' u 1:3 ti 'h1-pressure' w l linestyle 1,"h2.dat" u 1:3 ti 'h2-pressure' w l linestyle 2,"h3.dat" u 1:3 every 20 with lp linestyle 3 t "h3-pressure"
Attached Files
File Type: gz pressures.pngcairo.tar.gz (45.9 KB, 1 views)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 06:46
Default
  #29
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
an issue is that the output page that graph is plotted on that has fixed size.
my data's are very high in numbers in x-axis side.I want my graph be wider without need to make it smaller in y-direction by size commands.I want to have a more wider page in fact rather than a smaller graph in the same page output.
is there any way to change dimensions of output page?
it seems it has compacted in x-direction now.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 09:25
Default
  #30
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
another issue is that is it possible to do some calculations on columns before plotting by gnuplot,like multiplying one column to another column and divide by a constant?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 11:26
Default
  #31
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Quote:
Originally Posted by immortality View Post
an issue is that the output page that graph is plotted on that has fixed size.
my data's are very high in numbers in x-axis side.I want my graph be wider without need to make it smaller in y-direction by size commands.I want to have a more wider page in fact rather than a smaller graph in the same page output.
is there any way to change dimensions of output page?
it seems it has compacted in x-direction now.
You can directly specify the size of the png-file.
Code:
set terminal pngcairo size 1200, 600
will result in a a figure of 1200*600 pixels.

Quote:
Originally Posted by immortality View Post
another issue is that is it possible to do some calculations on columns before plotting by gnuplot,like multiplying one column to another column and divide by a constant?
This works almost the same way as in M$ Excel.
Code:
plot 'h1.dat' u 1:($2*5.0)
will plot plot the second column multiplied by 5 over the first column. The $ character denotes the column number.
immortality likes this.
flotus1 is offline   Reply With Quote

Old   September 9, 2013, 12:22
Default
  #32
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
thanks Alex,
how I should act if I want to for example subtract two columns in two data files from each other?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 12:51
Default
  #33
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
I have no idea, and apparently, there is no way to do this in gnuplot directly.
But google seems to know another way to do this if you search for "gnuplot compare two files" and hit the first result.
You can be sure that EVERY question you might have concerning gnuplot has already been answered somewhere on the web.
flotus1 is offline   Reply With Quote

Old   September 9, 2013, 13:27
Default
  #34
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
in this link:
http://objectmix.com/graphics/139945...le-figure.html
it says to use: plot '< join fileA.dat fileB.dat' using 1:N+1
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 13:50
Default
  #35
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
how can add all numbers in a column in gnuplot and the number of figures(for obtaining an average of them)?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 14:08
Default
  #36
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
this page seems to have some information about averaging in gnuplot but is banned here
can anyone help to read the page or know about averaging in gnuplot?
http://gnuplot-tricks.blogspot.com/
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 15:37
Default
  #37
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,427
Rep Power: 49
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
http://www.phyast.pitt.edu/~zov1/gnu...tatistics.html

Quote:
Recently, a patch has been added to gnuplot, with the help of which one make plots with some statistical properties quite easily. Now, the problem with that patch is that, if you do not want to, or cannot take the trouble of compiling gnuplot for yourself, it is no use. However, for most things contained in the patch, there is a work-around that should work in gnuplot 4.2. I will discuss those now.
Determining the minimum, maximum, and the mean
The first thing we will do is to plot the mean, minimum and maximum of a data set. This can easily done in the following way.

Code:
reset
# Produce some dummy data
set sample 200
set table 'stats2.dat'
plot [0:10] 0.5+rand(0)
unset table

set yrange [0:2]
unset key

# Retrieve statistical properties
plot 'stats2.dat' u 1:2
min_y = GPVAL_DATA_Y_MIN
max_y = GPVAL_DATA_Y_MAX

f(x) = mean_y
fit f(x) 'stats2.dat' u 1:2 via mean_y

# Plotting the minimum and maximum ranges with a shaded background
set label 1 gprintf("Minimum = %g", min_y) at 2, min_y-0.2
set label 2 gprintf("Maximum = %g", max_y) at 2, max_y+0.2
set label 3 gprintf("Mean = %g", mean_y) at 2, max_y+0.35
plot min_y with filledcurves y1=mean_y lt 1 lc rgb "#bbbbdd", \
max_y with filledcurves y1=mean_y lt 1 lc rgb "#bbddbb", \
'stats2.dat' u 1:2 w p pt 7 lt 1 ps 1
At the beginning of our script, we just produce some dummy data, and call a dummy plot. This plot does nothing but fills in the values of the minimum and maximum of the data set. Then we fit a constant function. You can convince yourself that this returns the average of the data set.

In the plotting section, we produce three labels, that tell us something about the data set, and plot the data range with shaded region. Easy enough, and in just a couple of lines, we created this figure
Attached Images
File Type: jpg gnuplot_statistics.jpg (42.6 KB, 6 views)
flotus1 is offline   Reply With Quote

Old   September 9, 2013, 18:17
Default
  #38
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
thanks Alex,then how I have to use averaging?
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 9, 2013, 18:24
Default
  #39
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
I found this also,but isn't clear what have to do exactly.
http://www.manpagez.com/info/gnuplot...nuplot_419.php
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   September 11, 2013, 18:06
Default
  #40
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27
immortality is on a distinguished road
how can draw two sided arrows for specifying a part of plot parallel to x-direction?(arrow be in x-axis to distinguish a part of plot over a period of time)
for example in the figure attached I want to distinct 0.0347 till 0.0355 by an arrow.
(is there a way to send this type of figures as image?)
Attached Files
File Type: gz MaxU.pngcairo.tar.gz (36.4 KB, 1 views)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exporting data (cell values, ascii) and obtaining more data than cells! TfG FLUENT 3 April 3, 2015 01:18
CAD integrated CFD Software kostikr Main CFD Forum 3 February 4, 2010 15:38
IFStream read float point data problem liu OpenFOAM Running, Solving & CFD 0 October 24, 2008 13:14
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27
Seeking for flow field (vector plot) visualization software. Hua Main CFD Forum 7 January 25, 1999 12:33


All times are GMT -4. The time now is 01:34.