I am currently attending high school, grade 11, and have purchased Maplesoft to asisst me with my math home work. I'm well aware that the aplications of Maplesoft far exceed my needs currently, but I hope to continue its use further through to unversity.
My issue is to figure out how to change the markings / ticks along the x axis of a graph so that I can plot a function i.e. sin(x) and know where π/2 ,π, 3π/2, and 2π are located.
This will help as I learn the process of the transformations of a function.
Any ideas?
Thanks.David
Comments
Graph markings or ticks
The code below is from a previous posting that
I answered. You can cut and paste it into your
worksheet, and then play with it to see what the
different commands will do. ?plot, ?textplot,
and ?display will give you more info as to why
the code below does what you asked.
> restart:
> with(plots):
> P1 :=plot (sin(x), x=-3*Pi/2..3*Pi/2,
tickmarks=[0,0], title=`Plot of sin(x)`):
> P2 :=textplot([[Pi,-0.05,`p`], [Pi/2,-0.05,`p/2`], [-Pi/2,-0.05,`-p/2`],[-Pi,-0.05,`-p`]], align={BELOW,CENTER}, font=[SYMBOL,10]):
> P3:=textplot([[-0.1,1.0,`1.0`], [-0.1,0.5,`0.5`],
[-0.1,-0.5,`-0.5`],[-0.1,-1.0,`-1.0`]], align={CENTER,LEFT}):
> P4:=pointplot ([[-Pi,0], [-Pi/2,0], [Pi/2,0],
[Pi,0],[0,1.0],[0,0.5],[0,-0.5],[0,-1.0]]):
> display({P1,P2,P3,P4});
Regards,
Georgios Kokovidis
Dräger Medical
Tickmarks
You could also try this:
plot( sin(x), x=0..2*Pi, axesfont= [SYMBOL],tickmarks=[ [0="0", evalf(Pi/2)="p/2",
evalf(Pi)="p", evalf(3*Pi/2)="3/2 p",evalf(2*Pi)="2 p"], default],title = "Plot of sin(x)" );
See ?plot,options for tickmarks, axesfont, font, title and much more.
Hope this helps
J. Tarr
Trig Plot Function
Here is a function that will do the plotting for you, all you have to do is pass the expression that you want plotted and the range, just like you do for plot. Copy and paste this code into your worksheet and you will be able to use the function anywere in your worksheet. Click here to download the worksheet to try it on your computer
When viewing the Worksheet below, the
symbols appear as "p". When you download the worksheet it will look better
> trigPlot := proc( thePlot, range )
local start, finish, offset, spacing, truestart, ticks,tick, tickName, pos;
spacing := Pi/2;
start := op(1, op(2,range) );
finish := op(2, op(2,range ) );
ticks := [];
pos := start;
while( evalf(pos) <= evalf(finish) ) do
tickName := convert( pos, string );
tickName := StringTools[Substitute]( tickName, "Pi", "p" );
ticks := [op(ticks), evalf(pos)=tickName];
pos := pos + spacing;
end do:
plot( thePlot, range, axesfont= [SYMBOL],tickmarks = [ticks,default] );
end proc:
Here are some examples of its usage
> trigPlot(cos(x), x=-Pi..Pi);
> trigPlot(sin(x),x=-2*Pi..Pi/2);
> trigPlot(sin(x)^2, x=0..2*Pi);
>
This post was generated using the MaplePrimes File Manager
Download the original worksheet | View worksheet on MapleNet
Delete the sign of axes x
Hello!
I have a problem with graphs. I do not like to have x as sign of axes x. How can I remove it?
This post was generated using the MaplePrimes File Manager
View 3088_30 ivnisi WH with SAP graph+formulas.mw on MapleNet or Download 3088_30 ivnisi WH with SAP graph+formulas.mw
View file details
Plot labels
Please see ?plot,options and look for labels. If you don't want a label on the y axis , you could achieve what you want by altering your plot command to:
plot(f(x), x = -20 .. 20, labels = (["", ""]));
Hope this helps.
J. Tarr
New Maplesoft owner
Everybody is glad to help a new Maplesoft owner.
__________
Alec Mihailovs
http://mihailovs.com/Alec/