MathGroup Archive 2011

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

Search the Archive

Re: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123133] Re: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position
  • From: "David Park" <djmpark at comcast.net>
  • Date: Thu, 24 Nov 2011 06:56:44 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <27299681.71314.1322049394785.JavaMail.root@m06>

Bill,

There is an easy and natural way to do this with the Presentations
application. It has the routines XTickLine and YTickLine for drawing our own
tick scales, (and also TickLine3D for raising these to Graphics3D objects).
XTickLine has the form:

XTickLine[{xmin,xmax,yloc},{rangemin,rangemax},
          {labelstart,labelend,increment},subdivisions] 

with a similar form for YTickLine. We can then specify your graphic as
follows:

<< Presentations` 

First specify the normal axes.

xaxis = XTickLine[{-30, 30, 0}, {-30, 30}, {-30, 30, 10}, 5] /. 
   Text[0, __] -> Sequence[];

yaxis = YTickLine[{-30, 30, 0}, {-30, 30}, {-30, 30, 10}, 5] /. 
   Text[0, __] -> Sequence[];

where we eliminated the 0 tick value to prevent clutter around the origin.
We then just draw one thing after another. We don't have to use Prolog,
Epilog, Show,  graphics level jumping or Inset. 

Draw2D[
 {ContourDraw[
   17*x^2 - 48*x*y + 31*y^2 + 49 == 0, {x, -30, 30}, {y, -30, 30}],
  xaxis, yaxis,
  {Red, xaxis, yaxis} // RotateOp[36.8699 \[Degree], {0, 0}]},
 ImageSize -> 300] 

RotateOp is just a convenient postfix form of Rotate. Rotate by default
rotates about the center of the graphics primitives, but a second parameter
allows you to specify the rotation center.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  


From: Bill [mailto:WDWNORWALK at aol.com] 


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,AxesSty
le->{Directive[{Red,Thin}],Directive[{Black,Thin}]},AxesLabel->{"'x","'y"},A
spectRatio->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}]},AxesLa
bel->{"X","Y"},Background->LightGray,ImageSize->500,Prolog->Inset[Rotate[Gra
phics[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




  • Prev by Date: Re: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position
  • Next by Date: Re: special character size
  • Previous by thread: Re: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position
  • Next by thread: Re: Aligning 2 Sets of Axes at {0,0}; Rotated & Standard Position