Sponsored Content
Special Forums UNIX and Linux Applications GnuPlot - 2d-graph --> depending from size, different color Post 302688349 by IMPe on Saturday 18th of August 2012 08:43:26 PM
Old 08-18-2012
GnuPlot - 2d-graph --> depending from size, different color

Hi,

i would like to change color depending from the valuerange.
a gnuplot-script will generate a multiplot and in one graph,
the ranges should have different colors, e.g.
100 ... 133 --> red
200 ... 233 --> blue
300 ... 333 --> orange
400 ... 433 --> green

Code:
#Partikeldata - Partikel INDEX  - [ 4 ]
set size 1,0.17
set origin 0,0.32
set format x ""
#set key left Left bot font "Helvetica,8" 
set noxlabel 
#set log y
#set mytics 10
#set grid mytics linestyle 0 linewidth .8
set yrange [50:450]
set ytics (100,133,200,233,300,333,400,433)
#set format y "10^{%L}"
#set grid x
set key left Left bot font "Helvetica,8" 
set noxlabel 
set label 1 "Partikel-INDEX" at graph 1.0, graph 0.5 rotate by 90 center offset 1,0 font "Helvetica,8"
set cbrange [100:433]
set palette defined (0 "blue",17 "#00ffff",33 "white",50 "yellow",\
    66 "red",100 "#990000",101 "grey")
plot "${Home}/scripte/index.txt" using 1:(\$2) t '   PD < 0,532 µm' w p pt 6 ps 0.2 lc rgbcolor "#999999"

Image

I tried to solve it with the blue colored "set range / set palette" but it didnt work - all the generated dots are red. Can somebody help me?
Thanks in advance!
IMPe

Last edited by IMPe; 08-18-2012 at 10:38 PM..
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

gnuplot flat line graph

Hi, I'm not able to find a solution because I cant find the exact keyword for this. I wanna make a graph like ive shown in the attachment. Could someone please share ideas on how to do this. Thanks! (3 Replies)
Discussion started by: jamie_123
3 Replies

2. Programming

Draw Bar Graph for GNUPLOT

For example, I have a file called data.txt. And the content is: Iker_Casillas 181 Raphael_Varane 182 Sergio_Ramos 182May I know how to write a script for gnuplot, so I can have a bar graph as the column 1 will be the x and column 2 will be the y? And I hope that the x value can be seen clearly.... (0 Replies)
Discussion started by: Tzeronone
0 Replies

3. Shell Programming and Scripting

Problem creating graph with gnuplot with time on x-axis

Let me start by saying I'm new to gnuplot and not very good at unix at all.. Anyway, I'm each minute measuring temperature and humidity and saves the last 60 readings along with time in a textfile, values_minute. The contents of the file is formatted like this: time temperature humidity ... (8 Replies)
Discussion started by: hakro807
8 Replies

4. Shell Programming and Scripting

Removing duplicates depending on file size

Hi all, I am working with a huge amount of files in a Linux environment and I was trying to filter my data. Here's what my data looks like Name............................Size OLUSDN.gf.gif-1.JPEG.......5 kb LKJFDA01.gf.gif-1.JPEG.....3 kb LKJFDA01.gf.gif-2.JPEG.....1 kb... (7 Replies)
Discussion started by: Error404
7 Replies
IMAGECOLOREXACTALPHA(3) 						 1						   IMAGECOLOREXACTALPHA(3)

imagecolorexactalpha - Get the index of the specified color + alpha

SYNOPSIS
int imagecolorexactalpha (resource $image, int $red, int $green, int $blue, int $alpha) DESCRIPTION
Returns the index of the specified color+alpha in the palette of the image. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $red -Value of red component. o $green -Value of green component. o $blue -Value of blue component. o $alpha - A value between 0 and 127. 0 indicates completely opaque while 127 indicates completely transparent. The colors parameters are integers between 0 and 255 or hexadecimals between 0x00 and 0xFF. RETURN VALUES
Returns the index of the specified color+alpha in the palette of the image, or -1 if the color does not exist in the image's palette. EXAMPLES
Example #1 Get colors from the GD logo <?php // Setup an image $im = imagecreatefrompng('./gdlogo.png'); $colors = Array(); $colors[] = imagecolorexactalpha($im, 255, 0, 0, 0); $colors[] = imagecolorexactalpha($im, 0, 0, 0, 127); $colors[] = imagecolorexactalpha($im, 255, 255, 255, 55); $colors[] = imagecolorexactalpha($im, 100, 255, 52, 20); print_r($colors); // Free from memory imagedestroy($im); ?> The above example will output something similar to: Array ( [0] => 16711680 [1] => 2130706432 [2] => 939524095 [3] => 342163252 ) NOTES
Note This function requires GD 2.0.1 or later (2.0.28 or later is recommended). SEE ALSO
imagecolorclosestalpha(3). PHP Documentation Group IMAGECOLOREXACTALPHA(3)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy