Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How smooth graphs?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61419] Re: [mg61385] How smooth graphs?
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Tue, 18 Oct 2005 02:45:29 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200510170629.CAA16338@smc.vnet.net> <4353C88B.1000001@wolfram.com>
  • Reply-to: murray at math.umass.edu
  • Sender: owner-wri-mathgroup at wolfram.com

The antialiasing treatment you suggest does make the curve appear 
smoother, even with no user option for PlotPoints or PlotDivision.

Unfortunately, it also eliminates the deliberately thickened size of the 
curve.  And it wipes out the axes labels and tick labels!  I suppose 
some aa treatment of just the curve itself would at least take care of 
the latter.

The aa function is REALLY slow -- too slow to even consider using it for 
a totally live generation of the animation (although the author of the 
code I presented may be satisfied with generating the graphics ahead of 
time).

I'll pass your suggestions along.  Thanks.

Jeff Bryant wrote:
>   The effect you are seeing is aliasing.  This has nothing to do with 
> the PlotPoints, it is is a rendering effect.  Basically, you need to 
> apply a "smoothing filter" to the pixels, or anti-alias the graphic, so 
> you don't get the stairstep effect.  Mathematica does not automatically 
> antialias graphics, but you can write top level code to do it for you. 
> You can see some example code here:
> 
> http://members.wri.com/jeffb/visualization/aa.shtml
> 
> If you decide to apply this technique, I strongly recommend that you 
> drastically reduce the PlotPoints setting since I'm pretty sure they 
> don't need to be very high. ....
> 
  > -Jeff
> 
> Murray Eisenberg wrote:
> 
>> A colleague, L.J. Moffitt, asked me how the graphs produced by the 
>> following code might be smoothed so as to avoid the jaggedness, 
>> especially the "staircasing".
>>
>> (This is going to be projected, and at a typical projection resolution 
>> of 1024 x 768, it looks even worse.)
>>
>> I tried all sorts of ploys, like drastically increasing PlotPoints and 
>> PlotDivision; lowering the Thickness in PlotStyle; and even breaking 
>> up the domain into two subintervals, one where the graph is more level 
>> and the other where the graph is rising rapidly.  Nothing seemed to help.
>>
>>   p[x_, L_] := (50.*L)/((1000. - 1.*x)*(-9.025*^8 + L + 1000.*x^2))
>>
>>   <<Graphics`Animation`
>>
>>   Animate[
>>     Plot[p[x,L],{x, 0, 950},
>>        PlotStyle->{AbsoluteThickness[3]},
>>        PlotRange->{.1,.7},
>>        AxesLabel->{"Inspection Rate","Robustness"},
>>        PlotPoints->10000, PlotDivision->50,
>>        AxesStyle->{RGBColor[0,0,1],Thickness[0.02]},
>>        ImageSize->600,
>>        Background->RGBColor[.1,.2,.7]],
>>    {L,1000000000., 1000000000.+700000000., 10000000}]
>>
>> Any suggestions that I might pass along to him?
>>
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Re: big integer for Range
  • Next by Date: Re: formatting table with integers and floats in a column
  • Previous by thread: How smooth graphs?
  • Next by thread: Re: Re: How smooth graphs?