Items tagged with plottools plottools Tagged Items Feed

I want to apologize if this being neither necessarily a minimal working example for one question nor just one question is uncomfortable. The "MWE" was created on and is designed for Linux machines including ImageMagick. The problem itself should be obvious to all users though, as the subfolder and creation of the gif are just conveniences. I have three sections concerning the different problems occuring in my attempts.

(which I was told is not doable in maple ... hence the gif)

link

The goal was to create an animation that zooms in on a function. As maple just wouldn't allow scaling of axis in animations I decided to export single frames and then convert those with ImageMagick. Maple offers ssystem(„...“) which allows for command line usage.

The problem (may as well be a bug) occurs when I try to export images in a for loop with exportplot(...). If the path as well as previously exported images exist, it won't output an error but still not export the desired images. Exporting frames separately works just fine, as well as doing the very same operation in a separate for loop.

(see the first red comment and export section)

After using the workaround in a second for loop. I couldn't figure out how to import the images and then create an animation from them. The main obstacle is the fact that the imported pictures are put into plot-functions.

(see the second red comment)

 

restart;

with(plottools):

f1 := s -> sin(2*s):

max_frame := 10: # = number of steps

for k from 0 to max_frame do
    pic[k] := plot(f1(x), x=-Pi*(1-k/max_frame)..Pi*(1-k/max_frame),
                    filled=true, #color = ["Orange"],
                    color = ColorTools:-Color([0,
                                              floor(128*k/max_frame),
                                              floor(255*k/max_frame)
                                              ]),
                    view=[-Pi*(1-k/max_frame)..Pi*(1-k/max_frame), -1..1]
                    ):
end do:

path := FileTools:-TemporaryDirectory();
path_list := ssystem("pwd");
path := path_list[2];
ssystem("mkdir ./pics"); # creates a subfolder
path := FileTools:-JoinPath([path, "pics"]); # need to change path to subfolder

plotsetup(window, plotoptions="width=480, height=600");
for k from 0 to max_frame do
    file[k] := FileTools:-JoinPath([path,
                                     MapleTA:-Builtin:-strcat("frame_",
                                                              convert(k, string),
                                                              ".jpg")
                                    ]);
    # exportplot(file[k], pic[k]); # does not work
end do:

exportplot(file[0], pic[0]); # works

# =====================================================================================
# export
# =====================================================================================
for k from 0 to max_frame do
  exportplot(file[k], pic[k]);
od; # also works

# =====================================================================================
# import
# =====================================================================================
for k from 0 to max_frame do
    reimported_pic[k] := importplot(file[k]); # this might take a while (depending on the amount of frames)
end do: # import works but [Length of output exceeds limit of 1000000]

whattype(reimported_pic[0]); #seems to create a plot function
show := convert(reimported_pic,list):
#Error, while processing result #There is no help page available for this error

show[1]; # works

# =====================================================================================
# create an animated gif at least
# =====================================================================================
delay_time := ceil(evalf(100/max_frame));
command_for_gif := MapleTA:-Builtin:-strcat("convert -delay ",
                                            convert(delay_time, string),
                                            " -loop 0 ", # -reverse ",
                                            FileTools:-JoinPath([path, "frame_*.jpg "]),
                                            FileTools:-JoinPath([path, "animation.gif"])
                                            );
ssystem(command_for_gif);

 

 

Download bug_report_maybe.mw

 

I would be grateful for any suggestions. Moreover I have run accross

?DocumentTools:-Components:-VideoPlayer

which I could not figure out how to use by the help pages (I tried to create an avi and import that). If someone has informations on that, please share!

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

polygon_2_color.mw

Imitation coloring both sides of the polygon in 3d.  We  build a new polygon in parallel with our polygon on a very short distance t. (We need any three points on the polygon plane, do not lie on a straight line.) This place in the program is highlighted in blue.

Paint the polygons are in different colors.

In Maple 15 it seems that plottools:-transform only accepts this form of conditional statement:  

`if`(conditional expression, true expression, false expression).

Is there any way to have plottools:-transform process more than one condition? Do later versions of Maple permit this?


How to produce such a plot with Maple?
enter image description here

The difficulty is that the geom3d package does not include a command for a cylinder whereas
the plottools package has the cylinder command, but does not have a tool to determine whether
two random cylinders intersect.

Hello all!

I did

with(plottools):

display(pieslice([0,0],5,Pi/4..7Pi/4,color=yellow))

but I don't know how to do "Animating Pacman". Can you help me? I read it on Mapleprimes but I don't really understand. Can you explain it to me? Thank you so much! Sorry, My English is not very good

 

Shading is not valid as an option in the command defining a plottools object e.g. a parallelepiped, and yet shading can be selected in the actual display of the object. Is there a way to code for shading when creating the object?

Hi all, 

I'm trying to implement the smithChart on Maple, but this error "Error, (in unknown) invalid transform: output is not 2 or 3 element" keeps popping up for some reason. I have no idea how to fix it. Can anyone help me with this? Here is the smithChart:




smithChart.mw

 

smithChart := proc(r)
  local i, a, b, c;
   a := PLOT(seq(plottools[arc]([-i*r/4, 0], i*r/4, 0..Pi),
                 i = 1..4),

  plottools[arc]([0, r/2], r/2,
            Pi-arcsin(3/5)..3*Pi/2),
  plottools[arc]([0,r], r, Pi..Pi+arcsin(15/17)),
  plottools[arc]([0, 2*r], 2*r,
            Pi+arcsin(3/5)..Pi+arcsin(63/65)),
  plottools[arc]([0,4*r], 4*r,
            Pi+arcsin(15/17)..Pi+arcsin(63/65)));

  b := plottools[transform]((x, y) -> [x-y])(a);
  c := plottools[line]([0,0], [-2*r, 0]):
  plots[display](a, b, c, axes = none, scaling = constrained, args[2..nargs]);
  end proc:

smithChart(1);
Error, (in unknown) invalid transform: output is not 2 or 3 elements

I'm importing a STL geometry with plottools[importplot].

The result is a PLOT3D data structure. Applying "op" to the structure reveals that it is formed by POLYGONS structures.

How can I import the same STL geometry, and, instead of getting a POLYGONS structure, getting a POINTS structure?

I think it should be direct for Maple, because in the plot view configs one can select the style to be surface, contour and even point.

If the conversion has to be by hand, does someone know a not too painful method? For me it's being painful, as I'm trying a solution all the day.

Is there a document with all elementairy plottools commands to find?

i must construct a numberline and lines to e4xplain with a arrow and text under it.

Hi all,

I ploted the cylinder like this:

with(plottools);
with(plots);
display(cylinder([1, 1, 1], 1, 3), orientation = [45, 70], scaling = constrained, grid = [2, 2, 2]);

 

Is it possible to export nodal points of the plot?

Thank a lot.

Hi

I'm using Maple 17 on Windows 8 (64-bit).

I have noticed that when I use the 'spacecurve' command and try to display it with the 'display' command, nothing shows up. I made sure that I used 'with(plots)' and 'with(plottools)', still nothing. However 'plot3d' works fine. I think it has something to do with the version of Java I'm using but I don't know what. Any help is welcome, thx

Specifications of my laptop:

Graphics: NVIDIA Geforce GT 740m

Processor: Intel(R) Core(TM) i7-3630QM (2.40GHz)

Ram: 6,00 GB

OS: Windows 8.1

Hi,

plot([[F(0,0.8)(y),y,y=0..3],[F(0.1,0.8)(y),y,y=0..3],[F(0.2,0.8)(y),y,y=0..3]],numpoints=25,color=[red,green,blue],view=[-0.3..0.5,0..2.5]);

p1:=%:

data:=plottools:-getdata~([p1]):

dm1:=op([1,-1],data);

              dm1 := Vector(4, {(1) = ` 36 x 2 `*Matrix,

                        (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

dm2:=op([2,-1],data);

           dm2 := Vector(4, {(1) = ` 32 x 2 `*Matrix,

                    (2) = `Data Type: `*float[8], (3) = `Storage: `*rectangular, (4) = `Order: `*Fortran_order})

dm3:=op([3,-1],data);

                       dm3 := Vector(4, {(1) = ` 28 x 2 `*Matrix, (2) = `Data Type: `*float[8], (3) = `Storage:                                         `*rectangular, (4) = `Order: `*Fortran_order})

How to combine these three matrices into a single one with four columns (y, F(0,0.8)(y), F(0.1,0.8)(y), F(0.2,0.8)(y) )?

 

Thanks

 

Is it possible to change the order of which polygons are plot? I searched a lot on the internet but I don't find a useful answer. It seems to be logical that they are plot in the order they are given to the command "display", but it don't seem to work.

I try to plot different polygons, like you can see in the images below:

The red planes should form a pyramid but the black ground plane is front of it, so it should be plotted before the four red planed (polygons) are plotted.

In the code, the black plane (pp6) comes before the red planes (pp7->pp10) as input of the display command. If I change the order, nothing changes in the plot.

Is it possible to tell Maple that some polygons should be on the foreground and some on the background?

 Here is a link to the file if necessary: translatie_stn.mw

Thanks in advance!

hello. how can I translate a graph in the x axis 3 times and then again in the y axis 2 times?

1 2 Page 1 of 2