注册 登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

随机过程

http://superware.blog.163.com

 
 
 

日志

 
 

Another interface to maxima  

2012-05-20 13:33:19|  分类: Gnuplot |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
The Gnuplot interface Draw by Mario Rodriguez Riotorto[1] provides an additional set of Maxima graphic routines, which differ from the standard routines with regard to their parameters, in particular the structure of the options.

The application of these routines, all having the stem "draw" in their function names, is slightly more complicated than of the standard routines. However, they offer much more flexibility for configuration and addapting the graphics to particular requirements. Moreover, output format and output target can be assigned after the graphics has been drawn into the Gnuplot output window.

example1:
  gr3d (title = "Controlling color range",
        enhanced3d     = true,
        color          = green,
        cbrange = [-3,10],
        explicit(x^2+y^2, x,-2,2,y,-2,2)) $

example2:
  gr3d (title = "Playing with tics in colorbox",
        enhanced3d     = true,
        color          = green,
        cbtics = {["High",10],["Medium",05],["Low",0]},
        cbrange = [0, 10],
        explicit(x^2+y^2, x,-2,2,y,-2,2)) $

example3:
  gr3d (title = "Logarithmic scale to colors",
        enhanced3d = true,
        color      = green,
        logcb = true,
        logz  = true,
        palette = [-15,24,-9],
        explicit(exp(x^2-y^2), x,-2,2,y,-2,2)) $

draw(example1, example2, example3) $


1、Philosophy

Scenes : A graphic consists of particular scenes, which are ouput by the basic plot command draw in a rectangle array, each scene containing a single diagram.

A scene, a compilation (汇集) of several graphc objects and additional options, is created with the commands gr2d or gr3d command.

Most graphic comtain only one single diagram. In that case the plot commands draw2d and draw3d compile the graphic objects to scene and draw the graphic for that scene in one single step. Thus the commands

    draw2d (...)  and draw3d (...)
are equal to
    draw (gr2d (...)) and draw (gr3d (...))

The parameter list constains any number of graphic objects and options. Options referring to a particular graphic object must precede that object. The position of global parameters is arbitrary.

Options are declared as equations with its name on the left hand side and its value on the right hand side. The value can also be a list.

A complex graphics containing many objects, the parameter list can get long and somewhat confusing. In that case it is goold style, either

a ). to structure the input by appropriate line breaks and indentations, or
b ). not to decalare the graphic objects directly in the parameter list of the plot commands, but assign variable names to them in separate commands and use those variable names in the parameter list of the plot commands.

2 ). 2D Graphic Objects

explicit (f(x),x,x1,x2)

Function f(x) within the range of x1 and x2


parametric (x(t),y(t),t,t1,t2)

Parametric curve x(t),y(t) with the parameter

t ranging from t1 to t2


implicit (equation,x,x1,x2,y,y1,y2)

Implicit curve, declared by the equation equation, with
the variables x and y within the ranges x1. . . x2 and
y1. . . y2


polar (r(φ ),φ ,φ 1,φ 2)

Function in polar coordinates; radius r with respect to
the angle φ in degree ranging from φ 1 to φ 2
Points; xvals and yvals are lists containing the x- and
 

points (xvals,yvals)

y-values respectively

Points; each ponint pi is a list with its coordinates:

[px,py].

points (p1,p2,...)
Polygon with declaration of its vertexes in lists xvals
and yvals.

polygon (xvals,yvals)

Polygon; each vertex pi is a list containing its
polygon(p1,p2,...) coordinates: [px,py].


rectangle (p1,p2)

Rectangle with the opposite vertexes p1 and p2 in the

form [px,py]


ellipse (x0,y0,a,b,w1,w2)

Ellipse (oder circle) with the center [x0,y0], the

half-axes a and b, as well as starting angle w1 and final
angle w2

label (["text",x,y],...)

Label text at the position [x,y]; alignment and

orientation can be set using options.


vector ([x,y],[dx,dy])

Vector with the origin [x,y] and the coordinates [dx,dy]

image (m,x,y,nx,ny)

Image object with the matrix m containing nx×nx

pixels and the coordinates [x,y] of the lower left corner


For example:

eq_a : explicit (2 * sin(x), x, -%pi, %pi);

eq_b : parametric (2 * sin(phi), 2*cos(phi), phi, 0, 2*%pi);

eq_c : implicit (x^2 - y^2 = 1, x, -4, 4, y, -4, 4);

eq_d : polar (0.8 * sin(13*t) + 1, t, 0, 2*%pi);


draw2d (
nticks = 200,
color = red,
eq_a,

color = blue,
eq_b,

color = green,
eq_c,

color = orange,
eq_d

);

输出为:
Another interface to maxima - superware - 随机过程

2 )、draw 函数的写法:
与 plot 函数相比,draw 函数可以很方便画出更加复杂的图形,且语法的一致性比 plot 要好,关于 plot 语法的一致性问题,在这里有比较详细的探讨。

draw2d (

global opts, ; 全局选项

opts_func_a, ; func_a 的局域选项

func_a, ; func_a 定义

opts_func_b, ; func_b 的局域选项

func_b, ; func_b

opts_func_c, ; func_c 的局域选项

func_c ; func_c

);


 
[1] Mario Rodriguez Riotorto: A Maxima-Gnuplot Interface.
     http://www.telefonica.net/web2/biomates/maxima/gpdraw.
  评论这张
 
阅读(62)| 评论(0)
推荐

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018