Dr. Paulina Chin

1206 Reputation

10 Badges

16 years, 8 days
Senior Architect
Waterloo, Ontario, Canada

MaplePrimes Activity

These are answers submitted by pchin

As far as I know, plots:-arrow has never supported multiple colours. In earlier versions of Maple, the colours were simply ignored, but because of recent changes in the plot library, a rather cryptic error message is now issued. Each arrow is actually made up of several components and the colour list is mapped onto them incorrectly. 

It is reasonable to expect the command to take lists of colours, and so I've added a report of this issue to our bugs database. As others have pointed out, the workaround to use in the meantime is to create each arrow individually with a single plots:-arrow call and a single colour and then to combine the arrows with plots:-display.

Much of what acer wrote is correct. Since Maple 2015, we've made updates to various plot commands to improve the error-checking and to use floating-point rtables for storing plot data whenever possible. There are still omissions in the documentation and inconsistencies in the commands' behaviours which need to be addressed. 

First, it is a bug that plottools:-rotate accepts a non-real number for the angle argument. In the code, execution of F[1](t) should generate an appropriate error message. The fact that it didn't in early versions of Maple 2015 is unintended. It is also true that the help page needs an update. Similar commands like plottools:-scale and plottools:-translate do say that parameters must be real numbers.

Second, acer's example with plottools:-line is also a bug. This should result in an error, as the plottools:-polygon example does.

Finally, an easy fix to avoid premature evaluation is to change 

animate(display,[F[n](t)], t=0..-Pi/2,paraminfo=false)


animate(display@F[n],[t], t=0..-Pi/2,paraminfo=false)

and similarly for G.

The displayprecision interface variable controls the number of decimal places, not the number of significant digits, and this is consistent with the description on the interface help page. It has always been this way in the cmaple and standard-typesetting worksheet interfaces. It was originally implemented incorrectly in the extended-typesetting interface but this did not come to light until extended typesetting became the default typesetting level in Maple 2017. At that point, the behaviour was fixed to match the help-page description and the other interfaces.

Changing the meaning of displayprecision is probably not a good idea at this point. We can certainly consider adding a different interface variable. However, there does exist a simple if tedious workaround, which is to apply evalf[n] to the result after it has been computed with the desired value of Digits but before displaying.

The axis option can be used when the same suboptions apply to all axes. Otherwise, you have to specifiy axis[1] and axis[2] separately:

plot(axis[1]=[tickmarks=spacing(1)], axis[2]=[tickmarks=spacing(2)]);

plot(axis[1]=[gridlines=spacing(1)], axis[2]=[gridlines=spacing(2)]);


The top-level tickmarks and gridlines options, while convenient to use, only offer limited functionality, so you have to use the axis and axis[n] options to get all the features. 

The name 'all' can be passed to Typesetting:-Unsuppress only, and it means to remove all the Typesetting:-Suppress requests previously issued. Using Typesetting:-Suppress(x(t)), as you've noted, is the only way to do this operation.

Thanks for reporting this issue. There is indeed an inconsistency, and it appears that it's not intentional. I've recorded this in our bugs database, and unless further investigation shows there's a good reason for the difference, we'll be fixing the behaviour of extended typesetting to match that of standard typesetting and command-line Maple.

The reason the following command does not work as expected is because the plots:-densityplot scales and shifts the plot data so that it fits into the range 0..1 before the colorscheme option is applied. 

densityplot(sin(x*y), x = -5 .. 5, y = -5 .. 5, colorscheme = ["zgradient", ["blue", "green", "yellow", "red"], zrange = -5 .. 5], style = surface)

If you remove the zrange suboption from the colorscheme option, you'll get the expected result. You can still use the zrange option but you would have to provide values relative to the range 0..1. 

We'll update the plots:-densityplot documentation so that it's clear that colorscheme works on the scaled data.


You can also use the new dataplot command, introduced in Maple 2015: 

dataplot(0..2*Pi, -1..1, A);

Note the difference in the order of arguments. For this situation, it produces a result similar to that of plots:-surfdata, but it also allows you to replace the ranges with Vectors or lists of values to get a plot over an unevenly spaced grid.

Replying to this question:

I use command plot(sin(x)/(tan(x)+x),x=-1..1,discont=[showremovable]); and command plot((x^2-1)/(x-1),x,discont=[showremovable]). but in first case x=0 is not a hollow point and in second case x=1 is a hollow point. why in the first case appears automatic simplification and in the second case doesn't appear automatic simplification?

The problem stems from a limitation of the plotting code. It tries initially to compute discontinuities with the discont command. If the answer contains RootOfs or variable names, then it attempts to compute the discontinuities with the fdiscont command instead. Unfortunately, the showremovable option does not work when the fdiscont command is used, as explained on the plot/discont help page. 

I'll submit a report to our bugs database, suggesting that we improve the documentation and perhaps issue a warning or userinfo message in this situation.


Yes, your observation is correct. The Calling Sequence section of the help page shows templates for Maple commands that are not always executable. You have to go to the Examples section to see fully formed commands. In the Diff help page, the ellipses are preventing the parser from recognizing the 2-D input as a call to diff.

Try the command plots:-surfdata(A). I'd also recommend creating the Matrix with datatype=float[8] for best performance if you have a very large Matrix.

Unfortunately, this is a bug introduced in Maple 16. We will make it a high priority to get this one fixed quickly.  In the meantime, a workaround is to create single plots and combine with the plots:-display command.

Paulina Chin


How about this?

plot3d([6, y, z], y=2..5, z=0..(1/4)*2^2+(1/5)*(y-3)^2+10, axes=boxed,style=surface);


You can also do it this way:

plot3d(4*x^2-y^2, x=-1..1, y=-sqrt(1-x^2)..sqrt(1-x^2));

Actually, I think Robert's cylindrical-coordinates solution is a better one for this particular example; however, I wanted to show that you can use expressions in terms of x in the y range argument.





Have you tried the ExportMatrix command? In Maple 15, we updated the command to work with sparse matrices. It will take a Maple sparse matrix and produce a binary file which can then be read into MATLAB, again in sparse format.


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