Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Re: RE: Dashing with alternating colors?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80462] Re: [mg80425] Re: [mg80394] RE: [mg80367] Dashing with alternating colors?
  • From: Brett Champion <brettc at wolfram.com>
  • Date: Thu, 23 Aug 2007 01:02:53 -0400 (EDT)
  • References: <200708200736.DAA18662@smc.vnet.net> <17985897.1187692506598.JavaMail.root@m35> <200708220843.EAA08661@smc.vnet.net>

On Aug 22, 2007, at 3:43 AM , DrMajorBob wrote:

> Or perhaps...
>
> Plot[Sin[x], {x, 0, 2 Pi},
>   PlotStyle -> Directive[Opacity[0.5], Dashed, Thick],
>   ColorFunction -> Hue]
>

Unfortunately this doesn't dash well at the top or bottom, because of  
the adaptive refinement.  Since Line doesn't currently support  
VertexColors, Plot with a ColorFunction generates a bunch of line  
segments, each with a specific color.   Then the dashing is applied  
to each of those segments individually, instead of to the plot as a  
whole.

Brett Champion
Wolfram Research


> On Tue, 21 Aug 2007 04:02:39 -0500, David Annetts
> <davidannetts at aapt.net.au> wrote:
>
>> Hi,
>>
>>> Any simple PlotStyle to plot a curve with segments in
>>> alternating colors?
>>> [I can think of plotting the curve twice, in alternating
>>> colors, dashed both times, and somehow offsetting the dashes
>>> (how to do that
>>> accurately?) -- or plotting it solid once, then overlaying it
>>> dashed in the other color.  But a neater way?]
>>
>> There is
>>
>> 	ListLinePlot[Table[Sin[x], {x, 0, 2 Pi, 0.1}], Joined -> True,
>> 	 PlotStyle -> Directive[Opacity[0.5], Thick], Mesh -> 10,
>> 	 MeshFunctions -> {#1 &}, MeshShading -> {Red, Blue}]
>>
>>> From the online help.
>>
>>
>
>
>
> -- 
> DrMajorBob at bigfoot.com



  • Prev by Date: RE: FWHM, InterpolationFunction & Solve
  • Next by Date: Manipulate a VectorFieldPlot3D
  • Previous by thread: Re: RE: Dashing with alternating colors?
  • Next by thread: Best practise for defining shortened display versions of custom functions