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

How to plot both pattern and fill color on a histogram

2,823 views
Skip to first unread message

Vick

unread,
Jul 10, 2008, 11:01:13 AM7/10/08
to

Is there a way to plot pattern with a fill color in a histogram?

For example if I would like a bar with color lt rgb "#0000EE" and fs
pattern 1; can it be done simultaneously in GNUplot? Please let me
know.

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

unread,
Jul 10, 2008, 12:17:05 PM7/10/08
to
In article <75b4a5db-3b19-4068...@z72g2000hsb.googlegroups.com>,

You can give an explicit fill style and color for each column of data:

set style data histogram
plot 'foo' using 2 lc rgb 'gold' fillstyle solid 1.0 noborder, \
'' using 4 lc rgb 'purple' fillstyle pattern 1

There is a minor bug in version 4.2 that makes the command sensitive to
the order of the plot options; you must specify the color first and
the fillstyle second.
--
Ethan A Merritt

Vick

unread,
Jul 11, 2008, 10:47:07 AM7/11/08
to
On Jul 10, 12:17 pm, merr...@chauvet.bmsc.washington.edu wrote:
> In article <75b4a5db-3b19-4068-8945-320d0e050...@z72g2000hsb.googlegroups.com>,

>
> Vick  <vparth...@gmail.com> wrote:
>
> >Is there a way to plot pattern with a fill color in a histogram?
>
> >For example if I would like a bar with color lt rgb "#0000EE" and fs
> >pattern 1; can it be done simultaneously in GNUplot?  Please let me
> >know.
>
> You can give an explicit fill style and color for each column of data:
>
>     set style data histogram
>     plot 'foo' using 2 lc rgb 'gold' fillstyle solid 1.0 noborder, \
>             '' using 4 lc rgb 'purple' fillstyle pattern 1
>
> There is a minor bug in version 4.2 that makes the command sensitive to
> the order of the plot options;  you must specify the color first and
> the fillstyle second.
> --
> Ethan A Merritt

Do you know by chance if using color and fs pattern 1 works in the old
version. I tried to do it and it doesn't work in my system. Do you
know why?

Thank You.

Ethan Merritt

unread,
Jul 11, 2008, 11:19:27 AM7/11/08
to
In article <a6301dbf-963a-422f...@y21g2000hsf.googlegroups.com>,
Vick <vpar...@gmail.com> wrote:
>On Jul 10, 12:17=A0pm, merr...@chauvet.bmsc.washington.edu wrote:
>> In article <75b4a5db-3b19-4068-8945-320d0e050...@z72g2000hsb.googlegroups=
>.com>,

>>
>> Vick =A0<vparth...@gmail.com> wrote:
>>
>> >Is there a way to plot pattern with a fill color in a histogram?
>>
>> >For example if I would like a bar with color lt rgb "#0000EE" and fs
>> >pattern 1; can it be done simultaneously in GNUplot? =A0Please let me

>> >know.
>>
>> You can give an explicit fill style and color for each column of data:
>>
>> =A0 =A0 set style data histogram
>> =A0 =A0 plot 'foo' using 2 lc rgb 'gold' fillstyle solid 1.0 noborder, \
>> =A0 =A0 =A0 =A0 =A0 =A0 '' using 4 lc rgb 'purple' fillstyle pattern 1

>>
>> There is a minor bug in version 4.2 that makes the command sensitive to
>> the order of the plot options; =A0you must specify the color first and

>> the fillstyle second.
>> --
>> Ethan A Merritt
>
>Do you know by chance if using color and fs pattern 1 works in the old
>version. I tried to do it and it doesn't work in my system. Do you
>know why?

What is "the old version"?
And what terminal type are you using?

--
Ethan A Merritt

Vick

unread,
Jul 11, 2008, 1:04:25 PM7/11/08
to
On Jul 11, 11:19 am, merr...@u.washington.edu (Ethan Merritt) wrote:
> In article <a6301dbf-963a-422f-a094-d10f58f2d...@y21g2000hsf.googlegroups.com>,
> Ethan A Merritt- Hide quoted text -
>
> - Show quoted text -

On the terminal type, I'm using--
set term postscript eps enhanced color solid font "Arial,14"

The version is 4.2.2...

When I use the 'plot foo.dat' using 2:xtic(1) lc rgb 'purple' fs
pattern 1' -- all i see is a bar with a purple line with no pattern.

Do you know why that would happen?

Thanks a lot for your help.

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

unread,
Jul 11, 2008, 3:28:38 PM7/11/08
to
In article <030df87d-26e5-4f98...@x41g2000hsb.googlegroups.com>,

Vick <vpar...@gmail.com> wrote:
>>
>> >Do you know by chance if using color and fs pattern 1 works in the old
>> >version. =A0I tried to do it and it doesn't work in my system. =A0Do you

>> >know why?
>>
>> What is "the old version"?
>> And what terminal type are you using?
>>
>> --
>> Ethan A Merritt- Hide quoted text -
>>
>> - Show quoted text -
>
>On the terminal type, I'm using--
>set term postscript eps enhanced color solid font "Arial,14"
>
>The version is 4.2.2...
>
>When I use the 'plot foo.dat' using 2:xtic(1) lc rgb 'purple' fs
>pattern 1' -- all i see is a bar with a purple line with no pattern.
>
>Do you know why that would happen?

Aha. Let me guess.
You didn't actually print this file; you are viewing it in ghostview or gv.
Right?

There is nothing wrong with your gnuplot output, and if you send it to a
printer you will see purple pattern-fill.
The problem is a known bug in ghostscript/ghostview/gv.
It doesn't show pattern-fill unless you disable anti-aliasing.

This has been broken in ghostscript for several years, but no one seems
to care about fixing it.
http://bugs.ghostscript.com/show_bug.cgi?id=688588

--
Ethan A Merritt

0 new messages