Sponsored Content
Top Forums Shell Programming and Scripting gnuplot do not take my variable Post 302643507 by bakunin on Saturday 19th of May 2012 03:53:44 PM
Old 05-19-2012
I could be wrong, but the last line looks problematic:

Quote:
Originally Posted by IMPe
Code:
M=$`date +%m`
D=$`date +%d`
Ma=$`date --date="$Z days ago" +%m`
Da=$`date --date="$Z days ago" +%d`
[...]
set xrange [ "Ma/Da/12":"M/D/12" ]

You create some variables (D, M, Da, Ma) but you never use them. Instead you use fixed strings ("D", "M", ...).

If you want to use a variables content (as opposed to its name) you have to prepend it with "$". To avoid ambiguity you can also enclose the variables name with curly braces ("{}"). So the last line should probably look like this:

Code:
set xrange [ "${Ma}/${Da}/12":"${M}/${D}/12" ]

Further, you should not use the backticks, even if they work. Backticks are an ancient construct and only supported for legacy purposes. Use the "$(...)" instead. That means change:

Code:
M=`date +%m`

to

Code:
M="$(date +%m)"

and accordingly with similar lines.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help with gnuplot

Hi, I am a beginner using UNIX, and was wondering how to use gnuplot from UNIX on my pc. I am connected remotely to my work's UNIX server using Secure Shell Client, and gnuplot won't open a new window when I use the plot command. How do I do this? Moreover, is it possible to save things from the... (0 Replies)
Discussion started by: KTTFB64
0 Replies

2. UNIX and Linux Applications

gnuplot + 3-d grids

When designing a 3-d graph in gnuplot, is it possible to create a 3-d grid that goes through each point on the graph ? (0 Replies)
Discussion started by: JamesGoh
0 Replies

3. UNIX and Linux Applications

GNUplot

Hi, I am trying to make a plot of an ASCII file using GNUplot, but I keep getting error msg: for example plot filename.txt It says that (.txt ) is not identified ... I tried to write it without the .txt part, but I also get the error msg. Any idea why? :confused: (1 Reply)
Discussion started by: cosmologist
1 Replies

4. UNIX for Dummies Questions & Answers

Need help! How to gnuplot a picture??

I would like to ask if I have already plot a graph using gnuplot, the setting(made by others) is in "gnuplot.defaults": gnuplot> load '<ParadisDir>/inputs/gnuplot.defaults' gnuplot> splot 'box.in' with lines, '0t0001' w lines How to transform it to bmp file? (or other types of pictures?) ... (2 Replies)
Discussion started by: kelvin490
2 Replies

5. UNIX and Linux Applications

gnuplot trouble

I am having a bit of trouble plotting a histogram in gnuplot. I am trying to use it to draw bars side by side. The first bar is from column five in my data file. The second bar is actually three bars stacked on top of each other and should be as tall as the first bar. The data is from the 2nd,... (0 Replies)
Discussion started by: kingnothing
0 Replies

6. Shell Programming and Scripting

Pass shell variable to gnuplot

Hi I am plotting a series of CDFs using gnuplot using plot "data" u 1:(1./x.) smooth cumulative I am doing this over many files and I need to tune the x value to the number of lines that meets a particular condition. Is it possible to get the line count from shell using cat file | grep... (7 Replies)
Discussion started by: jamie_123
7 Replies

7. 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

8. Shell Programming and Scripting

Gnuplot question

Hi! Let's say I have these two columns in file.txt 0 1 1 5 2 10 3 15 4 20 5 25 in gnuplot, i would plot usingplot 'file.txt' u 1:2 If I wanted to add a label to the y-axis I would useset label "Ef" at 0.0,7.0 However, I want the label Ef to be on the otherside of the y-axis. Not... (0 Replies)
Discussion started by: sidiq1983
0 Replies

9. Shell Programming and Scripting

Gnuplot 3d binning

Hello I have a text file with tens of thousands of rows The format is x y where both x and y can be anything between -100 and +100. What I would like to do is have a 3d gnuplot where there are 10,000 squared or bins and each bin will count how many rows have a value that would be... (1 Reply)
Discussion started by: garethsays
1 Replies
BNO_PLOT(1)															       BNO_PLOT(1)

NAME
bno_plot - generate interactive 3D plot of IO blocks and sizes SYNOPSIS
bno_plot [ -h | --help ] [ -v | --verbose ] [ -K | --keys-below ] [ <file...> ] DESCRIPTION
bno_plot is a visualization tool for the block layer IO tracing tool called blktrace(8). As noted in its documentation, blktrace is a block layer IO tracing mechanism which provides detailed information about request queue operations up to user space. bno_plot utilizes gnuplot to generate a 3D plot of the block number output from btt. If no <files> are specified, it will utilize all files generated after btt was run with -B blknos (meaning: all files of the form blknos*[rw].dat). The -K option forces bno_plot to put the keys below the graph. If it is not specified, all keys for input files are put in the upper right corner of the graph. If the number of devices exceed 10, then bno_plot will automatically push the keys under the graph. To use this utility, the gnuplot package needs to be installed. To exit the plotter, enter 'quit' or ^D at the 'gnuplot> ' prompt. AUTHORS
bno_plot was written by Alan D. Brunelle. This man page was created from the blktrace documentation by Bas Zoetekouw. REPORTING BUGS
Report bugs to <linux-btrace@vger.kernel.org> COPYRIGHT
Copyright (C) 2008 Hewlett-Packard Development Company, L.P. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. This manual page was created for Debian by Bas Zoetekouw. It was derived from the documentation provided by the authors and it may be used, distributed and modified under the terms of the GNU General Public License, version 2. On Debian systems, the text of the GNU General Public License can be found in /usr/share/common-licenses/GPL-2. SEE ALSO
btt (1), gnuplot (1), blktrace (8), blkparse (1), verify_blkparse (1), blkrawverify (1) blktrace git-20080213182518 February 22, 2007 BNO_PLOT(1)
All times are GMT -4. The time now is 09:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy