Re: Axis layout of xyz in 3D plotting

Tee Nor <[email protected]> Mon, 23 Aug 2021 11:41:49 -0400
Newsgroups gmane.comp.gnu.octave.general
Message-ID <CAPV-67ftTgCWCNYGYpDyV_=vTGCOkq-Q-R0Huwq91djFZJsdhA@mail.gmail.com>
Hello again Markus,
 No problems,
Please note the ijk unit vectors are not displayed. This is a special
reminder just for me (quick hack job).
Here are the two plotting  example.oct script shown in the last figures.
I'm still building Debian 10.9.0  Octave 6.3.0 ... Debian 10 is at 4.4.1-5.
I built Octave 5.2.0 on Debian 7.7.0, works just fine, been using it ever
since for advanced development.
Using Debian 7.11.0 with Octave 3.6.2 native version with distribution,
as this is my baseline development platform. As stated before, I am please
with
Octave, my usage has been engineering graphical plotting/documentation of
ngspice,
mathematical and electromagnetics and served me very well for instructional
purposes.
I thank you again for your time and interest.

Regards, T

On Mon, Aug 23, 2021 at 10:41 AM Markus Mützel <[email protected]>
wrote:

>
> Sorry, I probably was ambiguous:
> Please, show some self-contained code with which Octave produces a plot
> with left-handed coordinate system for you.
>
> Markus
>
> *Gesendet:* Montag, 23. August 2021 um 16:35 Uhr
> *Von:* "Tee Nor" <[email protected]>
> *An:* "Markus Mützel" <[email protected]>
> *Cc:* [email protected]
> *Betreff:* Re: Axis layout of xyz in 3D plotting
> Hello agian Markus,
> I am pleased you have taken interest.
> I have included an example of "undergraduate cross product textbook
> confusion".
> First you will see the mathematical  (used in theatrical Electromagnetics)
> illustration
> common to cross product vector analysis.
> Second is illustrations of simple changing the axis label to seemling
> correct this issue,
> By the way, this is not earth shattering news, I discovered this in
> Mathworks during the 90's.
> Please Be Careful not to be fooled by my trickery of Octave, it's for
> illustration only,
> There is nothing incorrect with Octave's workings. More of a wish list.
>
> Please note this is a simple single vector from 0,0,0 to 1,2,1 in all
> cases.
> In figure 4, this looks as seen Fig 188 (b). Here the orientation is
> view(145,-218) as
> also the plot code (t,x,y,z) for the vector. However, if rotated back
> around, so that
> it looks like Fig 188 (a), x axis and y axis move where y is left and x is
> right of the plot.
> Thus, Figure 5, I simple changed the xlabel and ylabel statements, and all
> is well,
> except x data is y data, and y data is x data. Completely incorrect, as
> shown.
> So no matter where this plot is viewed from, it is still a Left handed
> coordinate system.
>
> This is a very small detail, however, It's used during exam's to "weed out
> bell curve" types.
> I looked into changing this, and will take much time to introduce a switch
> to change
> between left and right coordinate systems.
>
> Please indicate any more missing information, I take a lot for granted in
> electromagnetics.
>
> Regards, T
>
>
> On Mon, Aug 23, 2021 at 8:09 AM Markus Mützel <[email protected]>
> wrote:
>
>> Please, keep the mailing list in CC.
>>
>> Octave's plotting system uses a right-handed coordinate system.
>> If you'd like to switch to a left handed coordinate system, reverse one
>> of the axes.
>>
>> Can you give an example where Octave uses a left-handed coordinate system
>> when plotting for you?
>>
>> Markus
>>
>>
>> *Gesendet:* Montag, 23. August 2021 um 13:27 Uhr
>> *Von:* "Tee Nor" <[email protected]>
>> *An:* "Markus Mützel" <[email protected]>
>> *Betreff:* Re: Axis layout of xyz in 3D plotting
>> Hello Markus,
>>   Thank you very much for the help. I installed Octave 6.3.0 on Vista,
>> Apparently, On Debian 10.9.0 I'll have to re-build Octave 6.3.0 as
>> Debian 10 Octave version is 4.4.1.  This issue has not changed between
>> versions.
>> Please examine the included attachment:
>> MathWorks (MathLab) and Octave are using the "Left-hand" coordinate
>> system,
>> so it is not currently possible to change to the "Right handed" system.
>> In either case, the plots are correct as seen per the xyz numbers.
>> As indicated by the preferred statement, while developing textbooks etc,
>> the solution was to just leave out the axis information, avoiding
>> confusion.
>> In my last note, the location (1,1,1) of ijk in both (a) and (b) are the
>> same,
>> just flip (b) over, except x and y are swapped. Also, gui_mode() is now
>> considered an error in MS world. I do not plan to use MS.
>> Suggest adding a setup switch between right and left hand option.
>> Regards, T
>>
>>
>> On Sat, Aug 21, 2021 at 4:09 PM Markus Mützel <[email protected]>
>> wrote:
>>
>>> Am 21. August 2021 um 08:52 Uhr schrieb "Tee Nor":
>>> > Has anyone noticed,
>>> > Most math and physics textbooks have the positive axis arrowheads
>>> direction layout as follows:
>>> >      x axis arrow pointing down and to the left,
>>> >      y axis arrow pointing to the right,
>>> >      z axis arrow pointing to the top.
>>> > Using GNU Octave version 3.6.2,
>>> > Please show how to make my positive axis look this way.
>>> > My view always looks like x and y are swapped.
>>> > Regards, T
>>>
>>> Octave 3.6.2 is ancient and I don't have access to it to test in that
>>> version.
>>> In version 6.3.0, the following command seems to rotate the axes in the
>>> way you describe:
>>>   view ([100, 30]);
>>>
>>> HTH,
>>> Markus
>>>
>>>
>>
>>


----------
We are transitioning to a web based forum
for community help discussions at
https://octave.discourse.group/c/help
example.txt (text/plain, 1.9 KB)
################################################################################

#		Create 3D figure 4
figure(4,"name","Figure 188 Left handed plot correct view ")
set (gca, "PlotBoxAspectRatioMode", "manual","PlotBoxAspectRatio", [1 1 1]);

grid on
hold all
box off
gui_mode("3d");

#		Title
title("/home/user/Documents/Manuals/Mathematics/calculus-multivariable.pdf pdf pg 333 pg 333")
title("(b) Left handed concordance system: t = 0.0:0.1:1.0; x = t; y = t*2; z = t; ");


#		Indicate vector Origin
text (0,0,0,"+ (0 0 0)","color","black");

#		Axis labels
xlabel ("X - axis")
ylabel ("Y - axis")
zlabel ("Z - axis")

#		Calculations:
t = 0.0:0.1:1.0;
x = t;
y = t*2;
z = t;
#		Plot 3D
plot3(x,y,z,"color",[0 0 1],"linestyle","-","marker",".","markersize",10)
#		Indicate vector end
text (1,2,1,"+ (1 2 1)","color","red");
#view(50, 225)
view(145,-218)




################################################################################

#		Create 3D figure 5
figure(5,"name","Figure 188 Faked out Right handed vector incorrect ")
set (gca, "PlotBoxAspectRatioMode", "manual","PlotBoxAspectRatio", [1 1 1]);

grid on
hold all
box off
gui_mode("3d");

#		Title
title("/home/user/Documents/Manuals/Mathematics/calculus-multivariable.pdf pdf pg 333 pg 333")
title("(b) Right handed Faked out xlabel (Y - axis) ylabel (X - axis): t = 0.0:0.1:1.0; x = t; y = t*2; z = t; ");


#		Indicate vector Origin
text (0,0,0,"+ (0 0 0)","color","black");

#		Axis labels
xlabel ("Y - axis")
ylabel ("X - axis")
zlabel ("Z - axis")

#		Calculations:
t = 0.0:0.1:1.0;
x = t;
y = t*2;
z = t;
#		Plot 3D
plot3(x,y,z,"color",[0 0 1],"linestyle","-","marker",".","markersize",10)
#		Indicate vector end
text (1,2,1,"+ (1 2 1)","color","red");
text (1,2,0,"* (1,2,0)   xlabel (Y - axis) ylabel (X - axis)","color","blue")

#view([1,1,1.5])
view(145,43)