Items tagged with plots

So here's a problem.  We have two of the same commands that operate differently in and outside the plots package. 

changecoords([x, y, z], [x, y, z], spherical, [r, theta, phi])
                        [r*sin(phi)*cos(theta), r*sin(phi)*sin(theta), r*cos(phi)]
with(plots):
changecoords([x, y, z], [x, y, z], spherical, [r, theta, phi])
Error, (in plots/changecoords) changecoords does not accept plot options or other additional arguments

How can we get around that problem?

Dear All

I have a trignometric function and I plotted it in 2D. It is visible from the graph that the function has Maxima and Minima. My question is, can I located all values
 

0.12981e-1+0.80285e-1*cos(.9519256799*x)+0.41370e-1*cos(1.903851360*x)+0.35690e-1*cos(2.855777040*x)+0.147e-3*cos(3.807702720*x)

0.12981e-1+0.80285e-1*cos(.9519256799*x)+0.41370e-1*cos(1.903851360*x)+0.35690e-1*cos(2.855777040*x)+0.147e-3*cos(3.807702720*x)

(1)

plot(diff(0.12981e-1+0.80285e-1*cos(.9519256799*x)+0.41370e-1*cos(1.903851360*x)+0.35690e-1*cos(2.855777040*x)+0.147e-3*cos(3.807702720*x), x), x = -6.2 .. 6.2)

 

``


 

Download Max_Min_from_Graph.mw

of "x" corresponding to these Max. and Min. ?

Hello!

I am working in a simulation, which requires me to create a checkerboard of values which I paint afterwards according to its value. The idea is to create a sequence of images (which I could export for every iteration and create into a gif/timelapse afterwards). The problem I am encountering is that when I try to plot it, I only obtain a difuse coloring scheme, without having a specific color for every pixel.

if you search for the color command in plots (http://www.maplesoft.com/support/help/Maple/view.aspx?path=plot/color) one of the examples is more or less the result I want, but I would like to have it without the gridlines and being able to control the color according to the value of the matrix in said position.

 

My current attempt, and the one closest to the solution is:

 

R:=Matrix(1..N,1..N, datatype=integer); for x from 1 to N do for y from 1 to N do R[x,y]:=P[x,y,2]*18+P[x,y,3]: od: od:R;
#P is the matrix where I do the calculations and R is the matrix I want to plot after every step of the calculation.

surfdata(Matrix(R), 1..N, 1..N, style=surface,
         dimension=2, labels=["x", "y"],
         gridsize=[100,100],
         colorscheme=["zgradient",
                      ["Indigo","Blue","Cyan","Green","Yellow","Orange","Red"]]);
#the surfdata I resqued from another proyect I had. I know it is not thought for this tipe of grafs, but it was the closest I could come by.

 

I do not know if it is a better idea to use an Array or a Matrix to plot this. While the P array isn''t touched, I do not mind modifying in any way the R matrix

Thank you,

Enrique
 

Hello!

I have a question about densityplot.

I want to get this colormap:

As I understand, I should use plots:-densityplot(...) comand and "HSV" colorscheme, where H = [240..0], S=1, V=1.

But if i use zcoloring with this options, I will get wrong result.

My code:

restart;

a := 0; b := 1; #first and final point

plots:-densityplot(z, dummy = 0 .. 1, z = a .. b, grid = [2, 10], size = [90, 100], colorscheme = ["zcoloring", [proc (z) options operator, arrow; -240*(z-a)/(b-a)+240 end proc, proc (z) options operator, arrow; 1 end proc, proc (z) options operator, arrow; 1 end proc], colorspace = "HSV"], style = surface, axes = frame, labels = ["", ""], axis[1] = [tickmarks = []], title = "Test", titlefont = ["Calibri", "Bold", 16], axesfont = ["Arial", 14], size = [100, 500]); #densityplot with zcoloring option.

 

My result (zero must be equal to "Blue"):

I can't find mistake....

with(plots):with(plottools):
p1:=plot( x^3,x=-1..1,thickness=20,color=red):
p2:=plot(-x^3,x=-1..1,thickness=20,color=blue):
p3:=display(rectangle([0.5, 1],[0.75,-1],color=green)):
p4:=display(rectangle([-1,-0.1],[1,0.1],color=yellow)):

display(p1,p2,p3,p4); # order = 4312

 

#  display(p3,p4,p1,p2); # order = 4312 (the same)

It seems that the rectangles are plotted first, in reversed order, and then the curves, in direct order.
Has someone an explanation?

Simple issue. I think it is a bug, but if not, it tends to cause logic problems with new users of Maple.

with(plots):
z := A*x*y:
A:=1.0:
plot3d(z, x=0..1, y=0..1); # works as expected
contourplot(z, x=0..1, y=0..1); # works
fieldplot(z, x=0..1, y=0..1); 
    --> Error, (in plots/fieldplo) invaled 1st argument (the function) 1.0*x*y

Is there something special about what the fieldplot expects for the function? I don't see it in the help. Or is this a bug?  

Yes, there is a work around, define all constants first

A:=1.0:   z := A*x*y: fieldplot(z, x=0..1, y=0..1); 

But I fail to understand why my example should fail. (Note, I have seen this situation for every version, so it is not new.)

 

 

In plots made with 'complexplot3d', Maple uses by default a color wheel for the argument of complex numbers in which positive numbers are painted cyan and negative numbers are red. Is there a way to change this to the other common convention (i.e. cyan negative and red positive numbers)?

 

Any help would be really appreciated, as it's not convenient to have graphs made with different conventions in the same document and I wouldn't want to remake all the ones I already have.

Hello, when you run an error occurs:

Error, (in plots:-display) unknown plot object: circle
Error, (in plots:-display) expecting plot structure but received: P[0]
Error, (in plots:-display) expecting plot structure but received: PP

I'm not good in Maple. Please help me understand.

Programm: https://dropmefiles.com/Qnkzn

with(plots);

implicitplot3d((x+y+z)^2=0, x=-100..100,y=-100..100,z=-100..100)

can be plot, and only show me an empty box.

and i get the same empty box when i reduce the interval.

for example :

implicitplot3d((x+y+z)^2=0, x=-5..5,y=-5..5,z=-5..5)

and

implicitplot3d((x+y+z)^2=0, x=-0.1..0.1,y=-0.1..0.1,z=-0.1..0.1)

please help me.

thanks for reading this question, and i hope i get an answer.

Hello,

does anyone know a way to combine two plots in one where one is created with ScatterPlot3D (Package:Statistics) and the other one with plot3D (Package:plots)?

 

Normally you would write something like this:

but that only works if the plots are from the same package...

I am having trouble to display a 3d and a 2d plots in a same figure. I tried with the display command but no luck.

f1:=exp(x*y);

plot3d(f1,x=0..1,y=0..1);

p1:=%:

f2:=exp(x);

plot(f2,x=0..1);

p2:=%:

To combine both I used display

display(p1,p2);

I ends up with a structure error

The second question is how to plot f(x,y,z)=exp(x+y+z)?

Thanks

A quick question, Can I add legends to 3D plots? 

 

I have:

r:=t-><4cos2t+4sint,5cos3t+4cost,(sin3t+2sint)^2>

with(plots):

 

then I tried:

spacecurve(r(t), t = 0 .. 2*Pi, thickness = 2, color = black, axes = normal, labels = [x, y, z], numpoints = 150)

But I keep getting the error: Warning, unable to evalute the function to numeric values in the region. 

But I thought <4cos2t+4sint, 5cos3t+4cost, (sin3t+2sint)^2> was defined on the region t=0 to 2Pi??? 

I'm using Maple 2015 if that helps. 

Hi all,

I've got a parametric curve of the form f(x),h(x) x=0..1, and want to make an animation of this curve when changing an exogenous variable h0.

My attempt was to do it like this:

plots[animate](plot, [f(x), h(x), x = 0 .. 1], h0 = 0 .. 1)

but it doesn't work.

Does anyone know if/how this can be done?

Thanks,

Paul

1 2 3 4 5 6 7 Last Page 1 of 10