Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Advanced plotting

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98949] Re: Advanced plotting
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Wed, 22 Apr 2009 05:14:00 -0400 (EDT)

On 4/21/09 at 5:11 AM, zhengji.li at gmail.com (Li Zhengji) wrote:

>Inspired by Bill Rowe's code, I think we can do it like this.

>The key point here is that the common Y axes is in a separated Inset
>object.

>Plot[-3, {x, -0.5, 10}, PlotRange -> {-1.1, 1.1}, Axes -> None,
>AspectRatio -> Automatic,
>Epilog -> {Inset[
>Plot[-3, {x, 0, 10}, PlotRange -> {-1.1, 1.1},
>Axes -> {False, True}, Frame -> None,
>AspectRatio -> Automatic], {0, 0}, {0, 0}, 10],
>Inset[Plot[Sin[2 x], {x, 0, 4}, PlotRange -> {-1.1, 1.1},
>Axes -> {True, False}, Frame -> None,
>AspectRatio -> Automatic], {0, 0}, {0, 0}, 4],
>Inset[Plot[Cos[2 x], {x, 6, 10}, PlotRange -> {-1.1, 1.1},
>Axes -> {True, False}, Frame -> None,
>AspectRatio -> Automatic], {5.2, 0}, {6, 0}, 4],
>Inset[Style[Rotate["\[TildeTilde]", 90 Degree],
>FontSize -> 20], {4.6, 0}]}]

While I agree Inset can be used to create more complex graphics
and I am glad code I've posted here has been found useful, the
effect of having a common Y axis with a broken X-axis can be
done more simply as follows:

Grid@{{Plot[Sin[2 x], {x, 0, 4}, PlotRange -> {-1.1, 1.1},
     AxesOrigin -> {0, 0}],
    Style[Rotate["\[TildeTilde]", 90 Degree], 20],
    Plot[Cos[2 x], {x, 6, 10}, PlotRange -> {-1.1, 1.1},
     Axes -> {True, False}]}}




  • Prev by Date: Re: Creating a sign chart
  • Next by Date: Re: Help with a possible bug
  • Previous by thread: Re: Re: Advanced plotting
  • Next by thread: Re: Re: Advanced plotting