pchin

Dr. Paulina Chin

1416 Reputation

12 Badges

19 years, 72 days
Maplesoft
Senior Architect
Waterloo, Ontario, Canada

MaplePrimes Activity


These are answers submitted by pchin

The wiggles are caused by different sample points in each frame. The "wiggles" will appear in both Standard and Classic. A workaround is to increase the number of sample points using the 'numpoints' option. You are right, Christopher, that the sample points shouldn't shift. I've added a report to our bugs database so that we can review and improve the algorithm for this command.

Paulina Chin
Maplesoft

Thanks for your comments, Mario. I'm glad you are finding document mode useful. Please continue to report problems to us, and we'll try our best to address them for future releases. We do follow the discussions on MaplePrimes and are working on solutions for many of the 2-d input issues that users have reported here.

By the way, my comments were not addressed at your remarks in particular. I just wanted to remind our users that each input mode has its advantages and drawbacks, and that it's most beneficial to choose the mode that makes sense for the way you use Maple. I frequently switch back and forth between the two modes, depending on the task at hand.

Paulina

 

Mario, the example you show is a known bug in 2-d math. Because it is somewhat difficult to fix, we've not gotten around to it yet, but it is indeed in our bugs database. In the meantime, there are workarounds you can use. The first is to use a regular procedure instead of an operator: proc(x) if ... end if end proc. The second is to use the operator `if`: x->`if`(...).

It is true there are still some problems with 2-d math and the document mode interface, but we continue to work on these issues and offer fixes and new features in every release to make the interace easier to use. Personally, I wouldn't discourage any user from either input mode or interface. 1-d input, 2-d input, document mode and worksheet mode are all useful. It really depends on what you're trying to accomplish. If you are creating a complex program with large modules and procedures, I'd definitely recommend sticking to 1-d input. If you care about the look of the math input and output (plots with math in the title, for example), then features like palettes can be very useful to you.

Paulina Chin
Maplesoft

Jonas, you can also try the Student[VectorCalculus][PlotVector] command. There are a couple of examples on the help page that are similar to yours. However, you will still need the textplot command to create the labels.

Paulina Chin Maplesoft

The suggestion from jakubi should work. Basically, you need to either prevent evaluation of n[i] or turn it into an atomic identifier. The latter is much easier to do with 2-d math.

In any case, I would suggest you try the Standard Worksheet interface instead of the Classic Worksheet interface, unless there is a reason that prevents you from using it. If you find the transition from Classic to Standard difficult, you can always stick to Worksheet mode instead of Document mode and 1-d input instead of 2-d input initially. (These settings can be changed in the Options dialog box from the Tools menu.) There are reasons why some users prefer to stay with the older Classic Interface (the main one being a lack of memory on their machines). However, if the look of the math output is important to you, this is much easier to control and customize using the new features in the Standard Interface.

Paulina

Hello Casper,

I'm not sure I understand your question fully. However, if you are asking how to display a name with a subscript, there are various ways to accomplish this.

If you are using 2-d math input, the easiest way is to open the Layout palette and insert the symbol that looks like an A with an asterisk as subscript, and then replace the A and asterisk with p and i, for example. In 2-d math, there is a distinction between a subscripted name and an indexed name A[i], that also displays in a similar way.

If you are using 1-d math input, you can simply use p[i], without the double quotation marks around it. The double quotation marks create a string that displays as plain text. If p[i] evaluates to a certain value, but you want p[i] to be displayed as p with subscript i, then you'll need to put single "uneval" quotation marks around it: 'p[i]'. This should then print as p with subscript i.

Paulina Chin
Maplesoft

I took a look at the issue Robert had brought up. Acer is correct in that this is not a Standard vs. Classic problem, but it is instead an extended vs. standard typesetting issue. With extended typesetting mode, proc(x) x*x end proc becomes proc(x) x^2 end proc. I see that Robert has already submitted this report to our bugs database, and we'll be sure to investigate.

Paulina Chin
Maplesoft

Using print, as Alec suggests, should work. Another solution is to save all the plots in an Array and then plot them all together at the end in a table-like format. See the plot/arrayplot help page for details.

Paulina Chin
Maplesoft

The colours in the BoxPlot example are the default ones, but you can specify the colours using the 'color' option. One feature that not many users know about is that many of the Statistics visualization commands allow a range of colours. For example, you can use colour="NavyBlue".."LightBlue" to get a nice variety of blues.

Paulina Chin
Maplesoft

Normally, you can change a default option value by calling plots[display] with the new option. For example,
p1 := plot(sin);
plots[display](p1, thickness=3);

Unfortunately, 'color' is an exception, because the structure representing color=red is added to the plot structure by default. It is generally the rule that options added through plots[display] do not override options already specified in the plot structures.

We usually prefer that users do not try to manipulate the plot data structures unless absolutely necessary. That's because the internal structures may change from release to release, and code that uses internal structures or undocumented commands is not guaranteed to work in a future release. We do try to maintain backward compatibility for all documented commands.

In this case, there is no real alternative to removing the COLOR structure in the plot code. However, you can try the following bit of code instead, as this doesn't require you to build your own COLOR structure. The removecolor procedure simply removes all the COLOR structures in the procedure p. Then, the plots[display] command is used to add a new color option.

removecolor := proc(p) subs(seq(i=NULL, i in indets(p, specfunc(anything, {'COLOR', 'COLOUR'}))), p) end proc;
plots[display](removecolor(p1), color="NavyBlue");

Of course, Doug's or alec's solution, where you specify the colors as the plots are being created, is the best approach.

Paulina Chin
Maplesoft

Here's an alternate approach: draw the points, draw a green line segment for the special section, and then draw the x-axis underneath to look like your bar.

p1 := plots[pointplot]([seq([i,0], i=1..6)], symbol=solidcircle, symbolsize=20, color=red):
p2 := plottools[line]([3,0], [4,0], color=green, thickness=3):
plots[display](p2, p1, axis[1]=[tickmarks=[seq(i, i=1..6)], axis[2]=[gridlines=[[0], color=blue, thickness=3], location=none]);

Note that the location=none suboption is in Maple 13 but not earlier versions. If you omit it, the y-axis is displayed.

Paulina Chin
Maplesoft

As far as I know, plots[textplot] has never accepted the value 'center' as a value for the 'align' option. If you omit the 'align' option completely, then the text will be centered over the given point.

Paulina Chin
Maplesoft

The plots[matrixplot] command, with the heights=histogram option, should provide the functionality you need. There are various examples on the help page to show you how the options work.

Paulina Chin
Maplesoft

Patrick writes: "I want to plot two thick lines to be used to overwrite plot axes (a workaround for the inability to customize the axes)."

A workaround that doesn't require figuring out the y-axis range is to use custom gridlines. For example, try the following:

> plot(cos(x), x=xmin..xmax, axis=[gridlines=[[0], thickness=4], tickmarks=8], axes=normal);

This produces thick gridlines at x=0 and y=0 only. You have to add a tickmarks suboption because otherwise, Maple assumes that you want tickmarks at the same locations as gridlines by default.

Paulina Chin
Maplesoft

If you have Maple 13, you can use the new elementwise operator:
> Result := M +~ N;

Otherwise, there are a number of ways to do this, such as:
> map(`+`, M, N);
or
> LinearAlgebra:-Map(`+`, M, N);
if you want to change M in-place.

Paulina Chin
Maplesoft

2 3 4 5 6 7 8 Page 4 of 10