MathGroup Archive 2003

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

Search the Archive

Re: Plot&2backgroundcolors


Needs["Graphics`Colors`"];

orig=1.234;

Plot[Sin[x], {x,0,Pi},
    PlotStyle->{Blue,
        AbsoluteDashing[{}]},
    Frame->True, 
    Prolog->{Text[orig, {orig,-0.2}],
        Antique,Rectangle[{0, 0}, {orig, 1}],
        LightBeige,Rectangle[{orig, 0}, {Pi, 1}],
        Red, AbsoluteDashing[{5,5}],
        Line[{{orig,0}, {orig,1} }]},
    PlotRange->All];

However, if you also want to change the style of the plot in mid stream

Needs["Graphics`Graphics`"];

DisplayTogether[
    Plot[Sin[x], {x,0,orig},
      PlotStyle->{Green,
          AbsoluteDashing[{}]}],
    Plot[Sin[x], {x,orig,Pi},
      PlotStyle->{Blue,
          AbsoluteDashing[{}]}], 
    Prolog->{Text[orig, {orig,-0.2}],
        Antique,Rectangle[{0, 0}, {orig, 1}],
        LightBeige,Rectangle[{orig, 0}, {Pi, 1}],
        Red, AbsoluteDashing[{5,5}],
        Line[{{orig,0}, {orig,1} }]},
    PlotRange->All,
    Frame->True];


Bob Hanlon

In article <bo7nq2$ads$1 at smc.vnet.net>, Roberto Brambilla <rlbrambilla at cesi.it>
wrote:

<< I have to plot a function, let it be Sin[x] in (0-pg), then I have a 
peculiar abscissa, ex. x=1.234.
I'd like to overlap to a normal grid and frame a vertical line at this 
abscissa in same different style
(as dash or color or thickness, etc.) . How can I do it?
How can I have also this value explicit as a tick on the plot?
Then all this would be even better if I could have two background colors 
(or gray levels),
before and after the selected abscissa.


  • Prev by Date: Re: now, while loops construct errors
  • Next by Date: Re: Function-type arguments in function definition
  • Previous by thread: Re: Plot&2backgroundcolors
  • Next by thread: RE: Plot&2backgroundcolors