DJ Clayworth

213 Reputation

6 Badges

17 years, 98 days

MaplePrimes Activity


These are replies submitted by DJ Clayworth

Hi everyone

Paulina asked me to respond to points raised in this thread. Since many points have been rasied, this may take a little time. Please bear with me.

Firstly I should point out that the Classic interface, while still supported by Maplesoft, is not being improved to the same degree as the Standard interface. The reason for that is that if we made every improvement to both interfaces it would take us twice as long, and our customers would get only half the number of improvements they would otherwise. Specifically in Maple 11 Standard there was a major upgrade to 2D plotting, including many new features, especially better control of tickmarks and the ability to write math directly into plots. If you are still using Classic and haven't tried plotting in Standard Maple recently I strongly recommend it.

Secondly most of the complexity (and poor quality) of the above example is because the user is trying to draw his own tickmarks by placing crosses and text at the appropriate places. Despite what was said above, this is not the usual way of using Maple. It is almost always unnecessary, and almost always produces worse results than doing the same thing in Maple's own tickmark control in the Standard interface. Here is an example which does exactly what is wanted. I'm also using the typesetting feature to lay out the functions better.

a1 := plot(2*cos((1/2)*x-(1/6)*Pi), x = (1/3)*Pi .. 13*Pi*(1/3), color = black, thickness = 2);

a2 := plot(2*cos((1/2)*x), x = 0 .. 4*Pi, color = black, linestyle = dashdot);

a6 := textplot([[4*Pi*(1/3)+.6, 1, typeset(y=2*cos((1/2)*x-(1/6)*Pi))], [Pi-.5, -1, typeset(y=2*cos((1/2)*x))]]);

display(a1, a2, a6, tickmarks = [spacing((1/3)*Pi), 3]);

If you really need the irregular spacing of tickmarks then that can be done with custom tickmark placement:

display(a1,a2,a6,tickmarks=[[Pi/3 = Pi/3,Pi=Pi], 3]);

You might consider using legends rather than text labels to identify the curves.  e.g.:

b1 := plot(2*cos((1/2)*x-(1/6)*Pi), x = (1/3)*Pi .. 13*Pi*(1/3), color = black, thickness = 2,legend=typeset(y=2*cos((1/2)*x-(1/6)*Pi)));

a2 := plot(2*cos((1/2)*x), x = 0 .. 4*Pi, color = black, linestyle = dashdot,typeset(2*cos((1/2)*x)));

display(b1,b2,tickmarks = [spacing((1/3)*Pi), 3]);

On to some other points.

In Classic the decision was taken to rotate the plot 90 degrees by default because it was thought that most people wanted their plots in landscape. In retrospect this may not have been the best decision, but changing it would affect the export of every Classic user in the world, and probably cause users more trouble that it saved. As pointed out above, you can use options to specify a portrait orientation, and you should be able to rotate postscript files on import to LaTeX.

It is strongly recommended that you do not use the SYMBOL font  any more. Since Maple 11 plots can handle any symbols, alphabets and typeset math as though they were regular text, which makes the SYMBOL font unnecessary (this was part of the improvements to the Standard interface). You can enter sympols directly into the plot commands using Pi as I did above, or using the "Greek" palette.

Export of symbols to postscript is sometimes tricky as it can depend on the fonts you have set up. Standard Maple handles them pretty well. In some older versions somes specified a default setup in which your postscript browser might substitute a non-standard symbol for the one we expected. I would imagine this is what is causing the substitution of +/- for the unary minus symbol.  I would urge you to try this in the Standard interface and see if it still happens.

If you really don't want to set options for the postscript output then the rotation can be undone with a simple edit of the postscript file. Search the file for a line that says "%%IncludeResource: font Helvetica". After it there should be a line "n.n n.n translate" and then "90 rotate" (n.n is some real-valued number). Either remove these lines or comment them out by placing two % symbols at the front. Your plot should now be in landscape formation.

I hope that was helpful. Can I re-emphasise that everything you want can be done in the Standard interface. The commands you are posting above can be copied exactly to Standard (saving the extra space); if you like you can save the Classic worksheet and open it in Standard.  Also you can specify the tickmarks using a single command instead of six, which should save some time, to say nothing of not having to position the text labels exactly.

David Clayworth Maplesoft GUI Developer

Hi everyone

Paulina asked me to respond to points raised in this thread. Since many points have been rasied, this may take a little time. Please bear with me.

Firstly I should point out that the Classic interface, while still supported by Maplesoft, is not being improved to the same degree as the Standard interface. The reason for that is that if we made every improvement to both interfaces it would take us twice as long, and our customers would get only half the number of improvements they would otherwise. Specifically in Maple 11 Standard there was a major upgrade to 2D plotting, including many new features, especially better control of tickmarks and the ability to write math directly into plots. If you are still using Classic and haven't tried plotting in Standard Maple recently I strongly recommend it.

Secondly most of the complexity (and poor quality) of the above example is because the user is trying to draw his own tickmarks by placing crosses and text at the appropriate places. Despite what was said above, this is not the usual way of using Maple. It is almost always unnecessary, and almost always produces worse results than doing the same thing in Maple's own tickmark control in the Standard interface. Here is an example which does exactly what is wanted. I'm also using the typesetting feature to lay out the functions better.

a1 := plot(2*cos((1/2)*x-(1/6)*Pi), x = (1/3)*Pi .. 13*Pi*(1/3), color = black, thickness = 2);

a2 := plot(2*cos((1/2)*x), x = 0 .. 4*Pi, color = black, linestyle = dashdot);

a6 := textplot([[4*Pi*(1/3)+.6, 1, typeset(y=2*cos((1/2)*x-(1/6)*Pi))], [Pi-.5, -1, typeset(y=2*cos((1/2)*x))]]);

display(a1, a2, a6, tickmarks = [spacing((1/3)*Pi), 3]);

If you really need the irregular spacing of tickmarks then that can be done with custom tickmark placement:

display(a1,a2,a6,tickmarks=[[Pi/3 = Pi/3,Pi=Pi], 3]);

You might consider using legends rather than text labels to identify the curves.  e.g.:

b1 := plot(2*cos((1/2)*x-(1/6)*Pi), x = (1/3)*Pi .. 13*Pi*(1/3), color = black, thickness = 2,legend=typeset(y=2*cos((1/2)*x-(1/6)*Pi)));

a2 := plot(2*cos((1/2)*x), x = 0 .. 4*Pi, color = black, linestyle = dashdot,typeset(2*cos((1/2)*x)));

display(b1,b2,tickmarks = [spacing((1/3)*Pi), 3]);

On to some other points.

In Classic the decision was taken to rotate the plot 90 degrees by default because it was thought that most people wanted their plots in landscape. In retrospect this may not have been the best decision, but changing it would affect the export of every Classic user in the world, and probably cause users more trouble that it saved. As pointed out above, you can use options to specify a portrait orientation, and you should be able to rotate postscript files on import to LaTeX.

It is strongly recommended that you do not use the SYMBOL font  any more. Since Maple 11 plots can handle any symbols, alphabets and typeset math as though they were regular text, which makes the SYMBOL font unnecessary (this was part of the improvements to the Standard interface). You can enter sympols directly into the plot commands using Pi as I did above, or using the "Greek" palette.

Export of symbols to postscript is sometimes tricky as it can depend on the fonts you have set up. Standard Maple handles them pretty well. In some older versions somes specified a default setup in which your postscript browser might substitute a non-standard symbol for the one we expected. I would imagine this is what is causing the substitution of +/- for the unary minus symbol.  I would urge you to try this in the Standard interface and see if it still happens.

If you really don't want to set options for the postscript output then the rotation can be undone with a simple edit of the postscript file. Search the file for a line that says "%%IncludeResource: font Helvetica". After it there should be a line "n.n n.n translate" and then "90 rotate" (n.n is some real-valued number). Either remove these lines or comment them out by placing two % symbols at the front. Your plot should now be in landscape formation.

I hope that was helpful. Can I re-emphasise that everything you want can be done in the Standard interface. The commands you are posting above can be copied exactly to Standard (saving the extra space); if you like you can save the Classic worksheet and open it in Standard.  Also you can specify the tickmarks using a single command instead of six, which should save some time, to say nothing of not having to position the text labels exactly.

David Clayworth Maplesoft GUI Developer

Hi Colin

If you are doing the export with commands, I recommend trying the GUI export mechanisms, which can be invoked from either the Plot menu or the context menu. However I checked out your plot and it does seem that the exports all have trouble with implicitplot. This is definitely not the expected behaviour, and we'll be looking at it.

This may not help you in the long run, but here is a file containing the function you used above, exported in POV DXF and X3D formats (X3D is a modern replacement for VRML). Please let me know if they work.

Download 572_implicitexport.tar
View file details

David Clayworth Maplesoft GUI Developer

The switch to this way of writing plot text to postscript gives us a huge increase in the power and flexibility of plot labels, essentially allowing the ability to write 2D math in plots.

David Clayworth Maplesoft GUI Developer

There have been two postscript export codes in Maple for a long time now. One resides in the kernel and is generally accessed by setting plotdevice=ps and similar. The other is in the GUI and is generally used when you use menus to export a plot in the worksheet. The one in the kernel is generally outdated and not recommended.

In Maple 11 the GUI-based driver was upgraded substantially to support the many new features that were added to 2D plotting. At the same time, to improve consistency, the kernel was modified so that when plotdevice=ps was set the GUI-based code was used rather than the older kernel code, which could not handle the new features. If the GUI-based code was not available then the older code was used, possibly causing some features not to be exported.

As I understand it the usual use of psfrag is to replace simple text labels in Maple plots with mathematical expressions. One of the improvments to 2D plots in Maple 11 was to allow mathematical expressions to be added to plots. For those of you with Maple 11 can I suggest adding the expressions you want as labels within Maple? Maybe you don't need psfrag at all.

David Clayworth Maplesoft GUI Developer

This would be an ideal issue to talk to Maplesoft Technical Support about.

David Clayworth Maplesoft GUI Developer

The 2D plotting was rewritten in Maple 11, and that included a new tickmark generation algorithm. The 3D plotting has not however been changed. If it were to be changed it is likely it would use the same algorithm as 2D plots

David Clayworth Maplesoft GUI Developer

This doesn't seem to happen with me on Maple 12 or Maple 11. I suggest contacting Maple technical support, letting them know both the version of Maple you are working with and the platform you are on.

David Clayworth Maplesoft GUI Developer

Could you post an example here?

David Clayworth Maplesoft GUI Developer

Could you post an example here?

David Clayworth Maplesoft GUI Developer

Hi Thomas

I wonder if you would mind telling us some more about what the problem with loglogplot is?

David Clayworth Maplesoft GUI Developer

If I've understood you correctly the legend has an entry for the curve in, but no label when you enter the "magic string" above.

This is probably because the curve is being created in two pieces, one of which has the legend suppressed but the other doesn't, but without knowing what you are doing it's hard to know for sure. Maybe check whether there is another command creating a curve that hasn't had the magic string added to it. I don't think there's anything else useful I can suggest

David Clayworth Maplesoft GUI Developer

If I've understood you correctly the legend has an entry for the curve in, but no label when you enter the "magic string" above.

This is probably because the curve is being created in two pieces, one of which has the legend suppressed but the other doesn't, but without knowing what you are doing it's hard to know for sure. Maybe check whether there is another command creating a curve that hasn't had the magic string added to it. I don't think there's anything else useful I can suggest

David Clayworth Maplesoft GUI Developer

That feature was added in Maple 11, I'm afraid. And thanks for the title, but I'm a software developer not a professor.

David Clayworth Maplesoft GUI Developer

That feature was added in Maple 11, I'm afraid. And thanks for the title, but I'm a software developer not a professor.

David Clayworth Maplesoft GUI Developer

2 3 4 5 6 7 8 Page 4 of 8