Gnuplot/palette: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Nie podano opisu zmian
Nie podano opisu zmian
Linia 43:
** ważona suma liniowych składników RGB<ref>[[:w:en:Luma_(video)|Luma_(video) w ang wikipedii]]</ref> <math>Y = 0.2126 R + 0.7152 G + 0.0722 B</math>
 
<sourcesyntaxhighlight lang=c>
//from function test_palette_subcommand from command.c
ntsc = 0.299 * rgb.r + 0.587 * rgb.g + 0.114 * rgb.b;
</syntaxhighlight>
</source>
 
Kod :
 
<sourcesyntaxhighlight lang=c>
// command.c
/*
Linia 156:
is_3d_plot = save_is_3d_plot;
}
</syntaxhighlight>
</source>
 
=Set=
Linia 165:
przywraca standardowe ustawienia :
 
<sourcesyntaxhighlight lang=c>
// color.c
void
Linia 188:
}
 
</syntaxhighlight>
</source>
 
==color/gray==
Linia 222:
Zobacz też color modes:
 
<sourcesyntaxhighlight lang=c>
//color.h
/*
Linia 236:
SMPAL_COLOR_MODE_CUBEHELIX = 'c'
} palette_color_mode;
</syntaxhighlight>
</source>
 
==file==
Linia 271:
 
 
<sourcesyntaxhighlight lang = gnuplot>
# http://soliton.vm.bytemark.co.uk/pub/cpt-city/arendal/arctic.gpf
set palette file "arctic.gpf"
Linia 277:
set output "arctic.png"
test palette
</syntaxhighlight>
</source>
 
 
Linia 302:
* kończymy literą e
 
<sourcesyntaxhighlight lang=gnuplot>
# Equidistant rainbow (blue-green-yellow-red) palette
set palette model RGB file "-"
Linia 310:
1 0 0
e
</syntaxhighlight>
</source>
 
<sourcesyntaxhighlight lang=gnuplot>
# cpt-city/ma/gray/grayscale01a 0 … 100, continuous, RGB, 3 segments
set palette file "-"
Linia 320:
1.00000 0.66667 0.66667 0.66667
e
</syntaxhighlight>
</source>
 
==cubehelix==
Linia 336:
W kodzie:
 
<sourcesyntaxhighlight lang=c>
// color.h: t_sm_palette typedef struct (Declaration of smooth palette, i.e. palette for smooth colours)
Linia 344:
double cubehelix_saturation; /* color saturation */
 
</syntaxhighlight>
</source>
 
The cubehelix palette can be modified by gamma. E.g.
Linia 373:
lub:
 
<sourcesyntaxhighlight lang=gnuplot>
gamma = 2.2
color(gray) = gray**(1./gamma)
set palette model RGB functions color(gray), color(gray), color(gray) # A gamma-corrected black and white palette
</syntaxhighlight>
</source>
 
 
Linia 390:
 
Zobacz w kodzie:
<sourcesyntaxhighlight lang=c>
// color.h
/* gamma for gray scale and cubehelix palettes only */
double gamma;
</syntaxhighlight>
</source>
 
==model==
Linia 411:
 
Składnia:
<sourcesyntaxhighlight lang=gnuplot>
set palette functions <R>,<G>,<B>
</syntaxhighlight>
</source>
 
może być łączone:<ref>[http://gnuplot.sourceforge.net/docs_4.2/node218.html gnuplot 4.2 docs: Palette/Functions]</ref>
Linia 420:
set palette model XYZ functions gray**0.35, gray**0.5, gray**0.8 # black to gold
 
<sourcesyntaxhighlight lang=gnuplot>
gamma = 2.2
color(gray) = gray**(1./gamma)
set palette model RGB functions color(gray), color(gray), color(gray) # A gamma-corrected black and white palette
</syntaxhighlight>
</source>
 
 
Linia 434:
Składnia:
 
<sourcesyntaxhighlight lang=bas>
set palette rgbformulae <r>,<g>,<b>
</syntaxhighlight>
</source>
 
skrócona postać :
Linia 605:
Przykłady:
<sourcesyntaxhighlight lang=gnuplot>
set palette defined (0 "dark-green", 1 "green", 1 "yellow", 4 "red")
test palette
</syntaxhighlight>
</source>
Otrzymujemy nieciągły gradient.
 
Za pomocą 2 kolorów otrzymujemy ciągły gradient ( liniowy) pomiędzy bielą ( 1 1 1) a czernią ( 0 0 0 )
 
<sourcesyntaxhighlight lang=gnuplot>
set palette model RGB
set output "gray.png"
set palette defined (0 1 1 1, 1 0 0 0) # <r> <g> <b>
test palette
</syntaxhighlight>
</source>
Inna równowazna składnie polecena set palette:
 
<sourcesyntaxhighlight lang=gnuplot>
set palette defined ( 0 "white", 1 "black") # ’<color-name>’
set palette defined ( 0 "#ffffff", 1 "#000000") # ’#rrggbb’
</syntaxhighlight>
</source>
[[Plik:Gnuplot linear gray gradient.png|mały|prawo|Gnuplot linear gray gradient]]
 
 
<sourcesyntaxhighlight lang=gnuplot>
# Approximate the default palette used by MATLAB:
set pal defined (1 '#00008f', 8 '#0000ff', 24 '#00ffff', 40 '#ffff00', 56 '#ff0000', 64 '#800000')
</syntaxhighlight>
</source>
[[Plik:Matlab gradient.png|mały|prawo|Matlab gradient]]
 
Linia 645:
Przykład pliku tekstowego pal:
 
<sourcesyntaxhighlight lang=gnuplot>
# jet.pal with 4 columns
set palette defined (0 0.0 0.0 0.5, \
Linia 656:
7 1.0 0.0 0.0, \
8 0.5 0.0 0.0 )
</syntaxhighlight>
</source>
 
<sourcesyntaxhighlight lang=gnuplot>
# ColorBrewer Accent
# https://github.com/Gnuplotting/gnuplot-palettes/blob/master/accent.pal
Linia 677:
6 '#BF5B17',\
7 '#666666' )
</syntaxhighlight>
</source>
 
Zbiory palet:
Linia 696:
Inny przykład
 
<sourcesyntaxhighlight lang=gnuplot>
# http://www.gnuplotting.org/defining-a-palette-with-discrete-colors/
set palette maxcolors 3
Linia 702:
1 '#90ff70',\
2 '#ee0000')
</syntaxhighlight>
</source>
 
==nops_allcF | ps_allcF ==
Linia 711:
Sprawdzamy w jakich plikach użyto słowa palette:
 
<sourcesyntaxhighlight lang=bash>
grep -R --include *.c -l "palette"
src/command.c
Linia 736:
src/show.c
term/sixel.c
</syntaxhighlight>
</source>
 
a w jakich sm_palette:
 
<sourcesyntaxhighlight lang=bash>
grep -R --include *.c -l "sm_palette"
src/command.c
Linia 752:
src/getcolor.c
src/show.c
</syntaxhighlight>
</source>
 
=Zobacz również=