|
From: Emanuel B. <emb...@st...> - 2016-02-01 02:18:41
|
I have a project going on here:
http://user.it.uu.se/~embe8573/everest-plot/
If we focus on this plot:
http://user.it.uu.se/~embe8573/everest-plot/early.png
I'd like to change two things:
1) How can I give the bars more different colors?
Especially if printed on a black-and-white
printer, the bars get too similar. Instead one
can be black, and the other white (with
a border).
2) How can I add small digits above each bar,
saying the number which the bar illustrates?
E.g.,
3
2 |
| | 1
| | |
---------
Here is the .gpi file:
# This file: http://user.it.uu.se/~embe8573/everest-plot/everest.gpi
set terminal png size 800,600 font "cm-super"
datastring = sprintf("%s", data)
set xtics 1 font ",8" rotate by 90
if (datastring eq "early.dat") {
set ytics 1
set key left top height 1
set title font ",14" "Mount Everest: Framgångsrika bestigningar, dödsfall"
set xtics offset 0.2,graph -0.0475
}
else {
set ytics 20
unset key
set xtics offset 0.2,graph -0.045
}
set ytics font ",6"
set grid
set style data histogram
set style fill solid
plot for [COL=2:3] datastring using COL:xticlabels(1) title column
--
underground experts united
http://user.it.uu.se/~embe8573
|
|
From: Ethan A M. <eam...@gm...> - 2016-02-01 04:31:47
|
On Monday, 01 February 2016 03:18:24 AM Emanuel Berg wrote: > I have a project going on here: > > http://user.it.uu.se/~embe8573/everest-plot/ > > If we focus on this plot: > > http://user.it.uu.se/~embe8573/everest-plot/early.png > > I'd like to change two things: > > 1) How can I give the bars more different colors? > Especially if printed on a black-and-white > printer, the bars get too similar. Instead one > can be black, and the other white (with > a border). There are many ways you could specify color. Here is one: set linetype 1 linecolor rgb "white" set linetype 2 linecolor rgb "black" To get a border: set style fill solid 1.0 border > 2) How can I add small digits above each bar, > saying the number which the bar illustrates? > E.g., > > 3 > 2 | > | | 1 > | | | > --------- See 5th plot of this demo http://gnuplot.sourceforge.net/demo_svg_5.0/datastrings.html[1] > > Here is the .gpi file: > > # This file: http://user.it.uu.se/~embe8573/everest-plot/everest.gpi > > set terminal png size 800,600 font "cm-super" > > datastring = sprintf("%s", data) > > set xtics 1 font ",8" rotate by 90 > > if (datastring eq "early.dat") { > set ytics 1 > set key left top height 1 > set title font ",14" "Mount Everest: Framgångsrika bestigningar, dödsfall" > set xtics offset 0.2,graph -0.0475 > } > else { > set ytics 20 > unset key > set xtics offset 0.2,graph -0.045 > } > set ytics font ",6" > > set grid > > set style data histogram > set style fill solid > > plot for [COL=2:3] datastring using COL:xticlabels(1) title column > > -- -------- [1] http://gnuplot.sourceforge.net/demo_svg_5.0/datastrings.html |
|
From: Emanuel B. <emb...@st...> - 2016-02-02 01:39:07
|
Ethan A Merritt <eam...@gm...> writes: > See 5th plot of this demo > > http://gnuplot.sourceforge.net/demo_svg_5.0/datastrings.html Thank you! The code now looks like this: http://user.it.uu.se/~embe8573/everest-plot/everest.gpi Diagrams 1-2: http://user.it.uu.se/~embe8573/everest-plot/early.png http://user.it.uu.se/~embe8573/everest-plot/late.dat Questions: 1. How can I have the bars *wider* ... 2. ... so the entire label will always be visible above the bar, centered around the bar's mid? 3. How can I don't have to do this: set yrange [0.01:33] # hack not to show 0 as labels, # also to have labels within border # obviously ugly to have this hard coded 4. How can I set the colors of the labels to the colors of the bars? -- underground experts united http://user.it.uu.se/~embe8573 |
|
From: Emanuel B. <emb...@st...> - 2016-02-05 04:16:23
|
"Mauricio Galo (Dep. de Cartografia)"
<ga...@fc...> writes:
> You can also use patterns with black and white bars.
> In the link above there are some simple examples:
> with pattern
Thank you, but I'm happy with:
set linetype 1 linecolor rgb "gray"
set linetype 2 linecolor rgb "black"
> different width [...]
>
> http://www2.fct.unesp.br/docentes/carto/galo/web/gnuplot/gnu_exemplos5.htm
If you mean either of
set boxwidth 1.0 relative
set boxwidth 1.5
then neither will do - they make the bars expand
"inward" and overlap long before they get wide enough!
So the four issues I have remain:
1. How can I have the bars *wider* ...
2. ... so the entire label will always be visible
above the bar, centered around the bar's mid?
3. How can I don't have to do this:
set yrange [0.01:33] # hack not to show 0 as labels,
# also to have labels within border
# obviously ugly to have this hard coded
4. How can I set the colors of the labels to the
colors of the bars?
--
underground experts united
http://user.it.uu.se/~embe8573
|