Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6675
| From | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position |
| Date | 2011-11-24 11:56 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jalbea$sau$1@smc.vnet.net> (permalink) |
| References | <201111231208.HAA15016@smc.vnet.net> |
You could try something like this:
a = 17; b = -48; c = 31;
alpha = (ArcTan[b/(a - c)])/2;
axes = Graphics[Point[{0, 0}], PlotRange -> {{-12, 12}, {-12, 12}},
Axes -> True,
AxesStyle -> {Directive[{Red, Thin}], Directive[{Black, Thin}]},
AxesLabel -> {"'x", "'y"}, AspectRatio -> 1, ImageSize -> 500];
ContourPlot[
17*x^2 - 48*x*y + 31*y^2 + 49 == 0, {x, -12, 12}, {y, -12, 12},
AspectRatio -> 1, Axes -> True,
AxesStyle -> {Directive[{Red, Thin}], Directive[{Black, Thin}]},
AxesLabel -> {"X", "Y"}, Background -> LightGray, ImageSize -> 500,
Prolog -> Inset[axes, {Axis, Axis}, {Axis, Axis}, Automatic,
RotationMatrix[-alpha]]]
Heike.
On 23 Nov 2011, at 13:08, Bill wrote:
> Subj: Aligning Two Sets of Axes at {0,0}; Rotated and Standard Position in one plot.
>
>
> Hi:
>
> I have the following Mathematica 8.0.4 code that gives me a satisfactory plot:
>
> a=17;b=-48;c=31;
> (ArcTan[b/(a-c)])/2;
> N[(%)*(180/Pi)];
> Print["Majoraxis: Angle in Decimal Degrees= ",%]
> =
axes=Graphics[Point[{0,0}],PlotRange->{{-12,12},{-12,12}},Axes->True,AxesStyle->{Directive[{Red,Thin}],Directive[{Black,Thin}]},AxesLabel->{"'x","'y"},AspectRatio->1,ImageSize->500];
> ContourPlot[17*x^2-48*x*y+31*y^2+49==0,{x,-12,12},{y,-12,12},AspectRatio->1,Axes->True,AxesStyle->{Directive[{Red,Thin}],Directive[{Black,Thin}]},AxesLabel->{"X","Y"},Background->LightGray,ImageSize->500,Prolog->Inset[Rotate[Graphics[axes],36.8699Degree],{.1,.7}]]
>
> However, my objective here is to combine the two plots with the two sets of axes centered automatically.
> As my code is now, I have to use a trial-and-error visual inspection method, and manually input the location of the rotated axes to match the main plot axes' center at standard position.
>
> Ref: See {.1,.7} in ...Inset[Rotate[Graphics[axes],36.8699Degree],{.1,.7}]]
> (In another example using another equation that I ploted, the alignment values were different yet. So for some reason, these numbers don't seem to be constants from one plot to another.)
>
> I have tried AxesOrigin->{0,0} in the plots, but this doesn't seem to matter. Any help will be appreciated.
>
>
> Tia,
>
> Bill
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position Heike Gramberg <heike.gramberg@gmail.com> - 2011-11-24 11:56 +0000
csiph-web