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
IMAGEARC(3)								 1							       IMAGEARC(3)

imagearc - Draws an arc

SYNOPSIS
bool imagearc (resource $image, int $cx, int $cy, int $width, int $height, int $start, int $end, int $color) DESCRIPTION
imagearc(3) draws an arc of circle centered at the given coordinates. PARAMETERS
o $ image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3). o $cx - x-coordinate of the center. o $cy - y-coordinate of the center. o $width - The arc width. o $height - The arc height. o $start - The arc start angle, in degrees. o $end - The arc end angle, in degrees. 0o is located at the three-o'clock position, and the arc is drawn clockwise. o $color - A color identifier created with imagecolorallocate(3). RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Drawing a circle with imagearc(3) <?php // create a 200*200 image $img = imagecreatetruecolor(200, 200); // allocate some colors $white = imagecolorallocate($img, 255, 255, 255); $red = imagecolorallocate($img, 255, 0, 0); $green = imagecolorallocate($img, 0, 255, 0); $blue = imagecolorallocate($img, 0, 0, 255); // draw the head imagearc($img, 100, 100, 200, 200, 0, 360, $white); // mouth imagearc($img, 100, 100, 150, 150, 25, 155, $red); // left and then the right eye imagearc($img, 60, 75, 50, 50, 0, 360, $green); imagearc($img, 140, 75, 50, 50, 0, 360, $blue); // output image in the browser header("Content-type: image/png"); imagepng($img); // free memory imagedestroy($img); ?> The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : Drawing a circle with imagearc() SEE ALSO
imagefilledarc(3), imageellipse(3), imagefilledellipse(3). PHP Documentation Group IMAGEARC(3)
All times are GMT -4. The time now is 03:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy