Sponsored Content
Top Forums Shell Programming and Scripting Performing loop in gnuplot - splot command Post 302773807 by begin_shell on Thursday 28th of February 2013 05:22:43 PM
Old 02-28-2013
Performing loop in gnuplot - splot command

Hi,

I have been struggling for quite past few days to make or generate graphs using a loop in the GNUPLOT.

I am trying to generate a contour plot using "splot" command in gnuplot. I am able to do for a single file successfully. But i am unable to make it work for more number of files using a loop in GNUPLOT.

Kindly post your comments, which would be helpful for me.

Following is the code for generating a single contour splot in GNUPLOT.

Here the file name "950_stress" consists of three numeric columns. One column denotes the x-axis coordinates, second column denotes y-axis coordinates and third column has the stress values.

Code:
splot '950_stress' with lines
set xlabel "x-coordinate"
set ylable "y-coordinate"
set zlabel "stress-distribution"
set title "950_stress"
set dgrid3d
set contour
set cntrparam bspline
set pm3d
set hidden3d
set terminal png
set output '950.png'
replot


I just wanted to do it for data files named from 950_stress to 1950_stress (ie) almost 1000 files.

Put your expert way to do this using LOOP for GNUPLOT splot command. It is to be noted that the title of the graphs and the name of the output of the graph should change accordingly with respect to datafile numbering.

Code:
set title "950_stress"
set output '950.png'

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Performing a non-recursive find in Unix

I need to perform a non-recursive find in Unix. Sounds simple, but it doesn't actually work. The command ALWAYS searches through the subdirectories. Any ideas? I am on DEC Unix :-( (3 Replies)
Discussion started by: christallott
3 Replies

2. Programming

performing a task at regular intervals

hi! i m tryin to write a program that will perform a specific tasks after fixed interval of time.say every 1 min. i jus donno how to go abt it.. which functions to use and so on... i wud like to add that i am dont want to use crontab over here. ny lead is appreciated. thanx. (2 Replies)
Discussion started by: mridula
2 Replies

3. UNIX for Dummies Questions & Answers

performing queries on file data

Can anyone help.. I have a .dat file which contains 5 columns of data. I need to select one row containing just 3 of the columns. I'm not sure how to select a single row? I then need perform arithmetic on on two out of the three columns and display the output in a new column. For example.. ... (1 Reply)
Discussion started by: computersaysno
1 Replies

4. Shell Programming and Scripting

Performing lookup quickly

Hello, Have been trying to develop a script that reads a string from an input file then looks up that string in a reference file to get a number, then inset that number back into the original file at a certain point (_____): Input File: HARRY JON _____ AA M N PETER PIE ... (8 Replies)
Discussion started by: dendright
8 Replies

5. UNIX for Advanced & Expert Users

slow performing system

Friends Greetings. I have a RedHat 5.7 64bit virtual server on VMware ESXi 4.1. This server and other Redhat Servers are running very slow. I did some stats collection on ESXi and looks like Linux is holding the disk IO. I am not sure what is causing this behavior. On Linux I checked the CPU... (4 Replies)
Discussion started by: sdewal
4 Replies

6. Shell Programming and Scripting

Gnuplot command

My data input looks like this: -16.25 -38.75 9.69094 -16.25 -36.25 10.0594 -16.25 -33.75 10.3884 -16.25 -31.25 10.6653 -16.25 -28.75 10.7947 -16.25 -26.25 10.8838 -16.25 -23.75 10.8463 -16.25 -21.25 10.8131 -16.25 -18.75 10.7509 -16.25 -16.25 10.6581 -16.25 -13.75 10.6859 -16.25... (0 Replies)
Discussion started by: programmerc
0 Replies

7. Programming

Performing a while for two files

Hi, This is for Perl. I have a while loop, and would like to process two files, the formats are given below : access access.<previousday>-* How can perform a while loop on both logs, while creating the logic for access.<previousday>-* to get format like "access.20130615-124139" when... (11 Replies)
Discussion started by: susankoperna1
11 Replies

8. Shell Programming and Scripting

Performing aggregation in File

Hi, I need help in UNIX shell script to handle the following: I have file called File1.txt which contains data something like below: LibraryName|BookName|Flag-Indicator|COUNT LIB1|BOOK1|A|12 LIB1|BOOK1|A|2 LIB2|BOOK2|I|1 LIB2|BOOK1|I|4 LIB1|BOOK2|A|12 LIB1|BOOK1|I|22... (3 Replies)
Discussion started by: vfrg
3 Replies

9. Solaris

Solaris not booting with new BE after performing Liveupgrade.

After getting the new BE created and activating the new BE with luactivate command, OS is still booting with OLD BE. Steps followed below.. bash-3.2# bash-3.2# lustatus Boot Environment Is Active Active Can Copy Name Complete Now On Reboot... (3 Replies)
Discussion started by: Kumar07
3 Replies

10. UNIX for Beginners Questions & Answers

Awk: Performing "for" loop within text block with two files

I am hoping to pull multiple strings from one file and use them to search within a block of text within another file. File 1PS001,001 HLK PS002,004 MWQ PS004,002 RXM PS004,006 DBX PS004,006 SBR PS005,007 ML PS005,009 DBR PS005,011 MR PS005,012 SBR PS006,003 RXM PS006,003 >SJ PS006,010... (11 Replies)
Discussion started by: jvoot
11 Replies
GNUPLOT(1)						      General Commands Manual							GNUPLOT(1)

NAME
gnuplot - an interactive plotting program SYNOPSIS
gnuplot [X11 options] [options] [file ...] DESCRIPTION
Gnuplot is a command-driven interactive plotting program. If file names are given on the command line, gnuplot loads each file with the load command, in the order specified, and exits after the last file is processed. If no files are given, gnuplot prompts for interactive commands. Here are some of its features: Plots any number of functions, built up of C operators, C math library functions, and some things C doesn't have like **, sgn(), etc. User-defined constants and functions. All computations performed in the complex domain. Just the real part is plotted by default, but functions like imag() and abs() and arg() are available to override this. Many presentation styles for plotting user data from files, including surface-fitting, error bars, boxplots, histograms, heat maps, and simple manipulation of image data. There is an on-line demo collection at http://gnuplot.info/demo Nonlinear least-squares fitting. 2D and 3D plots with mouse-controlled zoom and rotation. Shell escapes and command line substitution. Load and save capability. Support for a huge variety of output devices and file formats. OPTIONS
-p, --persist lets plot windows survive after main gnuplot program exits. -e "command list" executes the requested commands before loading the next input file. -h, --help print summary of usage -V show current version X11 OPTIONS Gnuplot provides the x11 terminal type for use with X servers. This terminal type is set automatically at startup if the GNUTERM environ- ment variable is set to x11, or if the -display command line option is used. For terminal type x11, gnuplot accepts the standard X Toolkit options and resources such as geometry, font, and background. See the X(1) man page for a description of common options. For additional X options specific to gnuplot, type help x11 on the gnuplot command line. ENVIRONMENT
A number of shell environment variables are understood by gnuplot. None of these are required. GNUTERM The name of the terminal type to be used by default. This can be overridden by the gnuplotrc or .gnuplot start-up files and, of course, by later explicit "set terminal" commands. GNUHELP The pathname of the HELP file (gnuplot.gih). HOME The name of a directory to search for a .gnuplot file. PAGER An output filter for help messages. SHELL The program used for the "shell" command. FIT_SCRIPT Specifies a gnuplot command to be executed when a fit is interrupted---see "help fit". FIT_LOG The name of the logfile maintained by fit. GNUPLOT_LIB Additional search directories for data and command files. The variable may contain a single directory name, or a list of directories separated by ':'. The contents of GNUPLOT_LIB are appended to the "loadpath" variable, but not saved with the "save" and "save set" commands. GDFONTPATH Several gnuplot terminal drivers access TrueType fonts via the gd library. This variable gives the font search path for these driv- ers. GNUPLOT_DEFAULT_GDFONT The default font for the terminal drivers that access TrueType fonts via the gd library. GNUPLOT_FONTPATH The font search path used by the postscript terminal. The format is the same as for GNUPLOT_LIB. The contents of GNUPLOT_FONTPATH are appended to the "fontpath" variable, but not saved with the "save" and "save set" commands. GNUPLOT_PS_DIR Used by the postscript driver to locate external prologue files. Depending on the build process, gnuplot contains either a builtin copy of those files or simply a default hardcoded path. Use this variable to test the postscript terminal with custom prologue files. See "help postscript prologue". FILES
gnuplotrc When gnuplot is run, it first looks for a system-wide initialization file named gnuplotrc. The standard location of this file expected by the program is reported by the "show loadpath" command. .gnuplot After loading the system-wide initialization file, if any, Gnuplot looks for a private initialization file in the HOME directory. It may contain any legal gnuplot commands, but typically they are limited to setting the preferred terminal and line types and defining frequently-used functions or variables. fit.log The default name of the logfile output by the "fit" command. AUTHORS
Original authors: Thomas Williams and Colin Kelley. Starting with gnuplot version 3.8, the project source is cooperatively maintained on SourceForge by a large number of contributors. BUGS
Please report bugs using the project bug tracker on SourceForge. SEE ALSO
See the printed manual or the on-line help for details on specific commands. Project web site at http://gnuplot.info 4th Berkeley Distribution 7 September 2012 GNUPLOT(1)
All times are GMT -4. The time now is 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy