Graphics_with_Maxima.pdf

(1111 KB) Pobierz
GraphicswithMAXIMA
(Version5.23andabove)
WilhelmHaager
HTLSt.Pölten,DepartmentElectricalEngineering
wilhelm.haager@htlstp.ac.at
November26,2011
961039970.010.png
Contents
ii
Contents
1Basics
1
2Gnuplot 3
2.1GnuplotCommands....................................... 3
2.2GnuplotTerminals........................................ 4
2.3Initialization............................................ 5
3GraphicInterfacePlot 6
3.1PlotCommands.......................................... 6
3.2Options............................................... 10
4GraphicInterfaceDraw 14
4.1PlotCommands.......................................... 14
4.22d-GraphicObjects........................................ 15
4.33d-graphicobjects........................................ 19
4.4GeneralOptions......................................... 22
4.5OptionsforLabelsandVectors................................ 26
4.6Optionsfor2d-Graphics..................................... 27
4.7Optionsfor3d-Graphics..................................... 29
Bibliography
32
961039970.011.png 961039970.012.png
1Basics
1
1Basics
Maximausestheprogram Gnuplot fordepictinggraphics[2],whichiscalledautomatically,
whenthegraphicisproduced.Twovariousmethodsfordisplayingthegraphicsarepossible:
1.Whencallingthestandardplottingroutines plot2d , plot3d , draw2d , draw3d ,etc.,aGnu-
plotoutputwindowcontainingthegraphicispoppingup.ContinuingworkingwithMax-
imaisnotpossibleuntilthatwindowisclosedagain.TheGnuplotoutputwindowand
À ...GraphicinwxMaximaworkingwindow
Á ...GraphicinGnuplotoutputwindow
 ...Gnuplotconsole
WilhelmHaager:GraphicswithMAXIMA
961039970.013.png 961039970.001.png
1Basics
2
consequentlythegraphictoocanberesizedusingthemouse.Measurementscanbeper-
formedin2d-plotswiththemouse,3d-plotscanberotatedinanyarbitrarydirection.
Right-clickingthewindowtitleopensacontextmenu,whichenablesprintingthegraphic
andopeningtheGnuplotconsole.Usingthatconsolewindow,Gnuplotcanbeusedasa
separateprogram,evenindependentlyofMaxima.
2.Whenpreceedingtheletters“ wx ”tothenamesoftheplottingroutines( wxplot2d ,
wxplot3d , wxdraw2d , wxdraw3d ,...),PNG-graphicsareproducedinscreenresolutionand
placeddirectlyintothewxMaximaworkingwindow.Asthegraphicsremainvisibleduring
theentireMaximasession,thatmethodisbeneficialforinteractivework.Rightclicking
thegraphicenablescopyingintotheclipboardorsavingasafile.Nevertheless,duetoits
lowresolution,furtheruseofagraphicproducedinthatwayisnotreasonable.
TwovariousGnuplotinterfacesareavailable,theMaximastandardfunctionswiththestem
“plot”inthefunctionnames,aswellastheroutinesoftheadditionalpackage Draw [3]withthe
stem“draw”inthefunctionnames.
Theroutinesofthepackage Draw areadmittedlyslightlymorecomplicatedconcerningtheir
usage,buttheyaremoreflexiblethanthestandardroutinesandoffermuchmorepossibilities
toadaptthegraphicswiththeaidofoptionstoparticularrequirements.Furthermoreitis
possible,tosetoutputformat(eps,png,jpg,etc.)andoutputtarget(i.e.thefilename)inthe
gnuplotconsole after thegraphichasbeenproduced,whichisappearentlynotpossiblewhen
usingthestandardroutinesoftheGnuplotinterface Plot .
WilhelmHaager:GraphicswithMAXIMA
961039970.002.png 961039970.003.png
2Gnuplot
3
2Gnuplot
Gnuplotisacomand-lineorientedplotprogram.WhencalledbyMaxima,theinputofcom-
mandsintotheGnuplotconsolewindowisnotnecessaryingeneral,butcanbehelpful,espe-
ciallywhenusingtheGnuplotinterface Draw .Forthatreasonthebasicprinciplesandthe(few)
mostinportantcommandsofGnuplotareexplainedbelow.
2.1GnuplotCommands
plot f(x)opts Plottingthefunction f(x) withtheoptions opts ;
fundamentalcommandforproducinggraphics,but
thereisnoneedforitwithinMaxima.
replot Plottingagraphicanew,occasionallywithchanged
settings
setterminal termopts Settingtheoutputformat,ifnecessary,withadditional
options opts .
setoutput" filename " Settingtheoutputtarget(filenamewiththe
appropriateextension)
setsize xscale , yscale Scalingthediagramwithrespecttothesizeofthe
entiregrafic
setsizeratio n Setstheaspectratioheight/widthofthediagram
show item Showstheactualvalueof item .
cd" directory " Changestheworkingdirectoryfortheoutputfile
pwd Showstheworkingdirectory
load" filename " LoadsabatchofGnuplotcommandsfromthefile
filename .
set/unsetkey Turnsthelege!ison/off
set/unsethidden3d Turnsthevisibilityofhiddenlinesin3d-plotson/off
set/unsetgrid Turnsthecoordinategridon/off
setcntrparam spez Controlscontourlinesinacontour-plot
setview rotxrotzscalescaley Setstheviewpointof3d-plots
quit ExitingGnuplot;notusedwithinMaxima.
ImportantGnuplotCommands
GnuplotcommandsareinputintotheGnuplotconsolelinebyline;onelinecancontainsev-
eralcommands,separatedbysemicolons.Commandsandparametersareseparatedbyspaces,
particularcoordinatesbycolons.Coordinate ranges havetheform [ x 1 : x 2 ] .
WilhelmHaager:GraphicswithMAXIMA
961039970.004.png 961039970.005.png 961039970.006.png 961039970.007.png 961039970.008.png 961039970.009.png
Zgłoś jeśli naruszono regulamin