Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rotating gnuplot graphic´s output in 90 degrees

1,676 views
Skip to first unread message

vald...@gmail.com

unread,
Jun 4, 2008, 7:53:14 AM6/4/08
to

Hi:

Please, can you tell me how rotate in 90 degrees this gnuplot
graphics ?
I want a horizontal histogram, but I´m only getting a vertical
histogram:

reset
set boxwidth 0.66 absolute
set style fill solid 1.00 noborder
set style line 1 lw 0 lc rgb "#000080"
set style line 2 lw 0 lc rgb "#33339A"
set style line 3 lw 0 lc rgb "#C0C0C0"
set style line 4 lw 0 lc rgb "#FF9A00"
set style line 5 lw 0 lc rgb "#FF0000"
set style increment user
set key off
set style histogram rowstacked
set style data histograms
set xtics border in scale 1,0.5 nomirror rotate by 90
unset ytics
unset border
set yrange [0:100]
# just formating until here
set terminal emf size 300,700
set output 'stackedbar.emf'
plot 'stackedbar2.dat' using 3:xticlabels(2), '' using 4, '' using 5,
\
'' using 6, '' using 7 ,\
'' using 1:($3/2):3 with labels rotate by 90 textcolor rgb "white",
\
'' using 1:($3+$4/2):4 with labels rotate by 90 textcolor rgb
"white",\
'' using 1:($3+$4+$5/2):5 with labels rotate by 90 ,\
'' using 1:($3+$4+$5+$6/2):6 with labels rotate by 90 ,\
'' using 1:($3+$4+$5+$6+$7/2):7 with labels rotate by 90
set output

Tim Hoffmann

unread,
Jun 4, 2008, 6:42:22 PM6/4/08
to vald...@gmail.com
vald...@gmail.com wrote:
>
> Hi:
>
> Please, can you tell me how rotate in 90 degrees this gnuplot
> graphics ?
> I want a horizontal histogram, but I´m only getting a vertical
> histogram:

Right. Since gnuplot doesn't support horizontal histograms, the example
is just a hack to get something looking horizontal (from the right
perspective).
You will have to rotate the graphics with the external graphics tool of
your choice.

vald...@gmail.com

unread,
Jun 4, 2008, 7:21:02 PM6/4/08
to
On 4 jun, 19:42, Tim Hoffmann <tim.hoffm...@uni-bonn.de> wrote:

Is there any gnuplot command to create horizontal rectangles ?

Ethan Merritt

unread,
Jun 4, 2008, 7:30:01 PM6/4/08
to
In article <4bbe6f4f-8c61-43c1...@t12g2000prg.googlegroups.com>,

<vald...@gmail.com> wrote:
>
>Is there any gnuplot command to create horizontal rectangles ?

???
How can you tell a horizontal rectangle from a vertical rectangle?


There is a strong convention in scientific presentation that the
independent variable is plotted on the horizontal axis (usually X),
and dependent variables are plotted against the vertical axis (Y).

Of course there are specific cases that call for some other layout,
but it is rare to see horizontal histograms.

--
Ethan A Merritt

Dan

unread,
Jun 5, 2008, 1:25:12 PM6/5/08
to
On Jun 4, 6:30 pm, merr...@u.washington.edu (Ethan Merritt) wrote:
> In article <4bbe6f4f-8c61-43c1-8577-a3e9ec4ba...@t12g2000prg.googlegroups.com>,

>
> <valdem...@gmail.com> wrote:
>
> >Is there any gnuplot command to create horizontal rectangles ?
>
> ???
> How can you tell a horizontal rectangle from a vertical rectangle?
>
> There is a strong convention in scientific presentation that the
> independent variable is plotted on the horizontal axis (usually X),
> and dependent variables are plotted against the vertical axis (Y).
>
> Of course there are specific cases that call for some other layout,
> but it is rare to see horizontal histograms.

Who has never seen this example:
http://www.censusscope.org/us/chart_age.html

This sort of thing is not at all rare in newspapers and
magazines, or indeed any publication where page
layout conventions trump scientific conventions.


Dan

mer...@chauvet.bmsc.washington.edu

unread,
Jun 5, 2008, 3:02:04 PM6/5/08
to
In article <c5dbd041-1700-4f30...@m3g2000hsc.googlegroups.com>,

Dan <luec...@uark.edu> wrote:
>On Jun 4, 6:30 pm, merr...@u.washington.edu (Ethan Merritt) wrote:
>> In article <4bbe6f4f-8c61-43c1-8577-a3e9ec4ba...@t12g2000prg.googlegroups.com>,
>>
>> <valdem...@gmail.com> wrote:
>>
>> >Is there any gnuplot command to create horizontal rectangles ?
>>
>> ???
>> How can you tell a horizontal rectangle from a vertical rectangle?
>>
>> There is a strong convention in scientific presentation that the
>> independent variable is plotted on the horizontal axis (usually X),
>> and dependent variables are plotted against the vertical axis (Y).
>>
>> Of course there are specific cases that call for some other layout,
>> but it is rare to see horizontal histograms.
>
>Who has never seen this example:
> http://www.censusscope.org/us/chart_age.html

FWIW, here's the gnuplot equivalent, cut-and-pasting the
data from that URL.
http://skuld.bmsc.washington.edu/people/merritt/gnuplot/census.html

I know of that style as a "back-to-back" histogram.
There was recently discussion on the developers mailing list
about the possibility of implementing a more general form of
this sometimes called a "violin plot", e.g.
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=43

Drawing such a set of curves in gnuplot would not be hard,
but working out a standard way of getting the relevant data
into the program would be non-trivial.

>This sort of thing is not at all rare in newspapers and
>magazines, or indeed any publication where page
>layout conventions trump scientific conventions.

Surely you are not appealing to newspaper/magazine standards
as a touchstone for the presentation of scientific data!


--
Ethan A Merritt

Dan

unread,
Jun 6, 2008, 11:03:17 AM6/6/08
to
On Jun 5, 2:02 pm, merr...@chauvet.bmsc.washington.edu wrote:
> In article <c5dbd041-1700-4f30-a172-ce42bd5ad...@m3g2000hsc.googlegroups.com>,

>
>
>
> Dan <lueck...@uark.edu> wrote:
> >On Jun 4, 6:30 pm, merr...@u.washington.edu (Ethan Merritt) wrote:
[...]

>
> >> Of course there are specific cases that call for some other layout,
> >> but it is rare to see horizontal histograms.

Note the phrase "rare to see"

>
> >This sort of thing is not at all rare in newspapers and
> >magazines, or indeed any publication where page
> >layout conventions trump scientific conventions.

Note the phrase "not at all rare".

>
> Surely you are not appealing to newspaper/magazine standards
> as a touchstone for the presentation of scientific data!

Clearly, the point I made was that they are not "rare to see",
considering all the things even we "scientists" might see.

I also *thought* it was clear that what I said was something
of a put-down ("layout... trumps... science..."? I hardly think
so.)

So, removing my tongue from my cheek: No, I don't think
that newspapers and magazines standards should guide our
presentation of scientific data.

I do, however think there are cases where a vertical axis
for the independent variable can be the best choice for
scientific presentation. And even scientists may have to
write for magazines and newspapers on occasion. In those
cases, fitting the graph to the layout could conceivably
make the entire presentation better.


Dan

0 new messages