Question: How do I add a title to a plot quickly

I frequently title my plots to identify what is being plotted. Very often that means specifying a parameter. For example, I might want the title to read;  Exponential when the power is c.

In the above I want to replace c with a real number. For example, my command might read

> for c from 1 to 10 do
p||c := plot( x^c, x= -1..1, title= the power is c )
end do:

I can then display the sequence of plots nicely labelled.

That does not work.

 

I cannot find adequate  info about what follows title =  in the help pages or the manual so I end up creating a worksheet and experimenting for quite a while until I find something that works.
(The Help page says: “The value t can be an arbitrary expression.” That’s it. One can go to the typesetting page to get more info about captions which is probably relevant but it begins to feel like learning about sex by looking up words in the dictionary.


BTW, I have been using Maple for 18+ years so I should have a cheat sheet somewhere to remind me of the correct syntax but I am suggesting that Maple would be much more user friendly if this info was in the help pages.

It would be very nice to have a fuller explanation with more examples.

Here is what works:


c:=3;  # special case

 

plot(x^c, x=-1..1,title=`power is `|| c);  Why back quotes?

or

cc:=convert(c,string);
plot(x^c,x=-1..1,title=[`power is `||cc]);   why barckets?

or not as nice
plot(x^c,x=-1..1,title=power.is.cc);  why dots?

or if you get rid of the is
plot(x^c,x=-1..1,title=[power = c]);  why noy use is?

 

not as nice
plot(x^c,x=-1..1,title=[power = cc]);  ugly quote marks

 

Here is a list of failures in this very simple case:

 

c:=3;

 

plot(x^c,x=-1..1,title="power is c");

 

plot(x^c,x=-1..1,title=power is c);

 

 

cc:="c";plot(x^c,x=-1..1,title="power is cc");
or

plot(x^c,x=-1..1,title=power is cc);


plot(x^c,x=-1..1,title=power.is.cc);

 

cc:=convert(c,string);plot(x^c,x=-1..1,title="power is cc");

 

cc:=convert(c,string);plot(x^c,x=-1..1,title="power is cc");

 

plot(x^c,x=-1..1,title='power is cc');

 

plot(x^c,x=-1..1,title=[power, is, cc]);

 

plot(x^c,x=-1..1,title='power = cc');

 

plot(x^c,x=-1..1,title=power = cc); but plot(x^2,x=-1..1,title=[power = cc]);is acceptable

another couple of failures:

plot(x^c,x=-1..1,title=[`power is c`]);

 

plot(x^c,x=-1..1,title=[`power is cc`]);

 

 

Please Wait...