Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #13637

Issues with Rendering of Graphics[]

From tim_brock20@hotmail.com
Newsgroups comp.soft-sys.math.mathematica
Subject Issues with Rendering of Graphics[]
Date 2013-02-28 04:42 +0000
Message-ID <kgmn7q$8gn$1@smc.vnet.net> (permalink)
Organization Time-Warner Telecom

Show all headers | View raw


Hi

I've been trying to design a bar chart from scratch using primitives. I've come across a bit of an odd issue when I try to add horizontal lines across vertical bars as an alternative to grid lines.

The list rectangles looks like the following:
{Rectangle[{0.1, 0}, {0.9, 35}], Rectangle[{1.1, 0}, {1.9, 89}],
 Rectangle[{2.1, 0}, {2.9, 9}], Rectangle[{3.1, 0}, {3.9, 57}],
 Rectangle[{4.1, 0}, {4.9, 88}], Rectangle[{5.1, 0}, {5.9, 51}],
 Rectangle[{6.1, 0}, {6.9, 52}], Rectangle[{7.1, 0}, {7.9, 62}],
 Rectangle[{8.1, 0}, {8.9, 78}], Rectangle[{9.1, 0}, {9.9, 50}]}

The list markers20 looks like the following:
{{Line[{{0.1, 20}, {0.9, 20}}]}, {Line[{{1.1, 20}, {1.9, 20}}],
  Line[{{1.1, 40}, {1.9, 40}}], Line[{{1.1, 60}, {1.9, 60}}],
  Line[{{1.1, 80}, {1.9, 80}}]}, {}, {Line[{{3.1, 20}, {3.9, 20}}],
  Line[{{3.1, 40}, {3.9, 40}}]}, {Line[{{4.1, 20}, {4.9, 20}}],
  Line[{{4.1, 40}, {4.9, 40}}], Line[{{4.1, 60}, {4.9, 60}}],
  Line[{{4.1, 80}, {4.9, 80}}]}, {Line[{{5.1, 20}, {5.9, 20}}],
  Line[{{5.1, 40}, {5.9, 40}}]}, {Line[{{6.1, 20}, {6.9, 20}}],
  Line[{{6.1, 40}, {6.9, 40}}]}, {Line[{{7.1, 20}, {7.9, 20}}],
  Line[{{7.1, 40}, {7.9, 40}}],
  Line[{{7.1, 60}, {7.9, 60}}]}, {Line[{{8.1, 20}, {8.9, 20}}],
  Line[{{8.1, 40}, {8.9, 40}}],
  Line[{{8.1, 60}, {8.9, 60}}]}, {Line[{{9.1, 20}, {9.9, 20}}],
  Line[{{9.1, 40}, {9.9, 40}}]}}

And I use the following command to draw:

 Graphics[
 {
  RGBColor[136/255, 189/255, 204/255],
  rectangles,
  GrayLevel[0.25],
  CapForm["Butt"],
  markers20
  },
 PlotRange -> {{-1, 11}, {-10, 100}}, AspectRatio -> 1,
 ImageSize -> 600
 ]

The problem I'm having is that the horizontal markers which should stretch exactly from the left of a bar to the right of a bar are rendered as starting slightly inside of the bar on the left-hand side and go slightly outside on the right-hand side. I've tried changing the CapForm for the lines but that doesn't fix the problem.
Oddly, if I wrap the above inside of Image[] the problem goes away but in eneral I don't want to do this.
I'm using Mathematica 9.0.1.

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Issues with Rendering of Graphics[] tim_brock20@hotmail.com - 2013-02-28 04:42 +0000
  Re: Issues with Rendering of Graphics[] Alan <alan.isaac@gmail.com> - 2013-03-06 03:13 +0000
    Re: Issues with Rendering of Graphics[] tim_brock20@hotmail.com - 2013-03-06 11:04 +0000
  Re: Issues with Rendering of Graphics[] Alexey Popkov <lehin.p@gmail.com> - 2013-03-08 03:47 +0000
  Re: Issues with Rendering of Graphics[] tim_brock20@hotmail.com - 2013-03-12 04:33 +0000
    Re: Issues with Rendering of Graphics[] David Bailey <dave@removedbailey.co.uk> - 2013-03-13 08:18 +0000
      Re: Issues with Rendering of Graphics[] tim_b <tim_brock20@hotmail.com> - 2013-03-14 11:12 +0000
        Re: Issues with Rendering of Graphics[] David Bailey <dave@removedbailey.co.uk> - 2013-03-15 05:46 +0000
    Re: Issues with Rendering of Graphics[] tim_brock20@hotmail.com - 2013-03-16 07:13 +0000
      Re: Issues with Rendering of Graphics[] debguy <johnandsara2@cox.net> - 2013-04-01 04:56 +0000
    Re: Issues with Rendering of Graphics[] tim_b <tim_brock20@hotmail.com> - 2013-04-03 08:07 +0000

csiph-web