Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Issues with Rendering of Graphics[]
Replies: 6   Last Post: Mar 15, 2013 1:46 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alexey

Posts: 265
Registered: 6/14/08
Re: Issues with Rendering of Graphics[]
Posted: Mar 7, 2013 10:47 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi!

Try to swith off antialiasing:

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

works for me.

HTH,
Alexey


On Thursday, February 28, 2013 8:42:34 AM UTC+4, tim_b...@hotmail.com wrote:
> 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 general I don't want to do this.
>
> I'm using Mathematica 9.0.1.






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.