Is there any ways to define f, g, h first before plotting f(g(x,y),h(x,y)) =
0?
Where, for example, f(x,y) = x^2 + y^3 - xy, g(x,y) = 2x + 3*y, h(x,y) = x^3
- y.
I need codes like these:
.
.
(Definitions of f, g, h)
.
.
xrange -2 2
yrange -2 2
new test 256 256
list v 0
fill test 'f(g(x,y),h(x,y))'
box
axis
cont v test
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just use 'x>0' for step(x). In yours case it will be 'f(x,y)>0'. Note, that
priority of '>' operator is one of lowest. So, use '(x>0)' inside other
expressions.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Don't understand the question completely. There are several ways to make
figure transparent manually:
You can use plots designed for it (like SurfA(), Surf3A(), Cloud(), TileS() and so on).
You can cut off a region of plot (see SetCut(), SetCutBox(), CutOff())
You can NAN as value of a data cell. Points with NAN will not be plotted.
I think you mean last case?! You can just divide by zero in formula to produce
NAN -- for example, try "sin(2pix)/(x^2+y^2>0.1)" or
"sin(2pix)/(x^2+y^2>0.1)/(x^2+y^2<0.5)"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your kind support!
Drawing solid contours using ContD() is a good way. I will try to make use of
it.
My original codes are:
setsize 1280 1280
plotfactor 1.0
xrange -1.5 1.5
yrange -4.0 -1.0
zrange -2000 2000
new fun 2560 2560
fill fun '???' # ??? is the formulas for fun(x,y).
light off
surf fun 'rc|'
And this is the (resized) output image:
Use GIMP to select the unwanted red-colored regions and fill them with cyan.
The problem is that the result image is not clean!
Below are the codes that I used to make images transparent:
setsize 1280 1280
plotfactor 1.0
xrange -1.5 1.5
yrange -4.0 -1.0
zrange 0.1 1.0
new fun 2560 2560
fill fun '??? < 0.0' # ??? is the formulas for fun(x,y).
light off
surf fun 'wr|'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Is there any ways to define f, g, h first before plotting f(g(x,y),h(x,y)) =
0?
Where, for example, f(x,y) = x^2 + y^3 - xy, g(x,y) = 2x + 3*y, h(x,y) = x^3
- y.
I need codes like these:
.
.
(Definitions of f, g, h)
.
.
xrange -2 2
yrange -2 2
new test 256 256
list v 0
fill test 'f(g(x,y),h(x,y))'
box
axis
cont v test
Thanks in advance.
You can use "define" command:
Hi abalakin,
It works fine. Thanks a lot!
I've got another question. Sorry for the hassle!
How to define step(x,y) = f(x,y)>0 ? 1:0 in MGL?
Just use 'x>0' for step(x). In yours case it will be 'f(x,y)>0'. Note, that
priority of '>' operator is one of lowest. So, use '(x>0)' inside other
expressions.
Hi abalakin,
Thank you and that's very kind of you!
Now I can make a clean transparent image with the use of '>' or '<' operators.
Don't understand the question completely. There are several ways to make
figure transparent manually:
I think you mean last case?! You can just divide by zero in formula to produce
NAN -- for example, try "sin(2pix)/(x^2+y^2>0.1)" or
"sin(2pix)/(x^2+y^2>0.1)/(x^2+y^2<0.5)"
There is also one more way -- draw solid contours using ContF() or ContD().
Try for example
Hi abalakin,
Thank you for your kind support!
Drawing solid contours using ContD() is a good way. I will try to make use of
it.
My original codes are:
And this is the (resized) output image:
Use GIMP to select the unwanted red-colored regions and fill them with cyan.
The problem is that the result image is not clean!
It spent me some time to clean up the image.
Below are the codes that I used to make images transparent:
With contours you can seve the image into SVG/EPS and edit it as vector figure
(for example, in Inksape).