kris2099

180 Reputation

2 Badges

18 years, 362 days

MaplePrimes Activity


These are answers submitted by kris2099

Hi Pauline. 

Thanks for the reply.

To Acer, Georgios, Alec, Jakubi, Doug, Werner and Robert : A big THANK YOU for all the great help. 

Pauline, I have summarised the problem as per below, instead of asking your colleagues to go through the threads:

I have used "Classic Worksheet Maple 12" to compile the code below:

> restart;
> with(plots):
> p1:=plot(sin(x),x=-2*Pi..2*Pi,tickmarks=[0,0],color=black):
> p2 := textplot([[Pi,-0.05,`p`], [Pi/2,-0.05,`p/2`],[-Pi/2,-0.05,`-p/2`], [-Pi,-0.05,`-p`],[0.2,-0.05,`0`],[-3*Pi/2,-0.05,`-3p/2`],[-2*Pi,-0.05,`-2p`],[3*Pi/2,-0.05,`3p/2`],[2*Pi,-0.05,`2p`]], align=below, font=[SYMBOL,10]):
> p3 := textplot([[-0.1,1.0,`1`], [-0.1,-1.0,`-1`],[-0.1,0.5,`y`],[2*Pi+1.5,-0.05,`x`]], align=left):
> p4:= pointplot([[-Pi,0], [-Pi/2,0], [Pi/2,0],[Pi,0],[0,1.0],[0,-1.0],[-3*Pi/2,0],[-2*Pi,0],[3*Pi/2,0],[2*Pi,0]], symbol=CROSS):
> display({p1,p2,p3,p4});

Once the plot is displayed on the screen, I right-clicked on the plot, choose "Export As" -> "Encapsulated Postscript (EPS)" and then type in a name to save it.

Using Ghostview 4.9 to open this saved (eps) file, the resultant was that the graph is rotated anticlockwise by 90 degrees.  The negative 3Pi/2 and negative 2Pi that are on the x axis becomes "plus or minus 3Pi/2" and "plus or minus 2Pi".

I have also tried to open this saved (eps) file using Adobe Illustrator CS3.  The graph is still rotated anticlockwise by 90 degrees.  The negative 3Pi/2 and negative 2Pi that are on the x axis becomes "box 3Pi/2" and "box 2Pi".  The box means that an empty small square box is given instead of a negative sign.

One possible solution as suggested by Acer is to put a space in between the negative sign and 3p/2 in the textplot line p2 which would "cure" it.   And to cure the rotation by 90 degrees problem, Acer suggested to insert an additional code:
> plotsetup(ps,plotoutput=`sine.eps`,plotoptions=`portrait,noborder`);
which will write the output to a file without showing the actual graph on the Maple worksheet.

Another completely new problem is for the code found below.  Is there any other simpler way of doing this in the Classic Worksheet Maple 12?  The code below is long and tedious.

> restart;
> with(plots):
> p1:=plot(2*cos(1/2*x-Pi/6),x=Pi/3..13*Pi/3,tickmarks=[0,0],color=black,thickness=2):
> p2:=plot(2*cos(1/2*x),x=0..4*Pi,tickmarks=[0,0],color=black,linestyle=dashdot):
> p3:=textplot([[Pi-0.1,-0.05,`p`],[Pi/3+0.08,-0.05,`p/3`],[0.18,-0.05,`0`],[13*Pi/3-0.15,-0.05,`13p/3`],[4*Pi-0.1,-0.05,`4p`],[4*Pi/3+0.15,-0.05,`4p/3`],[7*Pi/3-0.1,-0.05,`7p/3`],[10*Pi/3+0.35,-0.05,`10p/3`],[2*Pi,-0.05,`2p`],[3*Pi,-0.05,`3p`]],align=below, font=[SYMBOL,10]):
> p4:=textplot([[-0.1,2.0,`2`],[-0.1,-2.0,`-2`],[-0.1,1.0,`y`],[13*Pi/3+1.5,-0.05,`x`]],align=left):
> p5:=pointplot([[Pi/3,0],[4*Pi/3,0],[7*Pi/3,0],[10*Pi/3,0],[13*Pi/3,0],[2*Pi,0],[3*Pi,0],[4*Pi,0],[0,2],[0,-2]],symbol=CROSS):
> p6:=textplot([[4*Pi/3+0.6,1,`y=2cos(x/2-`],[Pi-0.5,-1,`y=2cos(x/2)`]]):
> p7:=textplot([4*Pi/3+1.4,1,"p"],font=[SYMBOL,12]):
> p8:=textplot([4*Pi/3+1.6,1,` /6)`]):
> display({p1,p2,p3,p4,p5,p6,p7,p8});
 

Have a great weekend! :)

Chris

Hi Acer. 

I used

plotsetup(ps,plotoutput=`foo.eps`,plotoptions=`portrait,noborder`);

as suggested by you.

Unfortunately, the removal of the space in `-3 Pi/2` and `-2 Pi` (using Maple 12 Classic Worksheet) still results in a plus/minus sign when viewed in Ghostview 4.9.  Using Adobe Illustrator CS3, it becomes a small empty little box instead of a negative sign.

Hi Acer.  Thanks for the suggestion.

A space after the negative sign and before 3Pi/2 helps!

Also, the additional code which immediately transform the output to a eps file is great!  *thumbs up*

I embed the eps file into LaTeX and then convert the DVI file to PDF and use Adobe Acrobat 9 to view the result.

What kind of software would you use if I were to plot the graphs found in The concluding saga to: "How to plot" with success! and EPS and LaTeX (III) with the required tickmarks and text minus the hassles?  :)

Hi Georgios.  Thanks for the help.

Now, I'll have to wait for Paulina's reply or someone else's reply in regards to the EPS and LaTeX problem I have. 

Hi Alec.  I just tried it with the standard worksheet.  The graph was not rotated -- it was upright as it should be!  The "plus and minus" signs disappeared in the x axis including the minus signs in the negative x axis!  D'OH! 

Now, seriously, if Maple 12 was written properly, why would you get 2 different outputs from the Classic Worksheet and the Standard Worksheet?!

Anyone else besides Alec around???  :)

Urmm......Alec, could you please shed some light in the "points" system as previously mentioned?

 

Hi Alec. I don't need the whole worksheet to be converted.  Just the plots.  Yes, I have done this before in previous versions of Maple and had no problems with it. 

Why don't you try it yourself with the new Classic Worksheet Maple 12? 

Here's the code for a SIMPLE sine graph:

> restart;
> with(plots):
> p1:=plot(sin(x),x=-2*Pi..2*Pi,tickmarks=[0,0],color=black):
> p2 := textplot([[Pi,-0.05,`p`], [Pi/2,-0.05,`p/2`],[-Pi/2,-0.05,`-p/2`], [-Pi,-0.05,`-p`],[0.2,-0.05,`0`],[-3*Pi/2,-0.05,`-3p/2`],[-2*Pi,-0.05,`-2p`],[3*Pi/2,-0.05,`3p/2`],[2*Pi,-0.05,`2p`]], align=below, font=[SYMBOL,10]):
> p3 := textplot([[-0.1,1.0,`1`], [-0.1,-1.0,`-1`],[-0.1,0.5,`y`],[2*Pi+1.5,-0.05,`x`]],align=left):
> p4:= pointplot([[-Pi,0], [-Pi/2,0], [Pi/2,0],[Pi,0],[0,1.0],[0,-1.0],[-3*Pi/2,0],[-2*Pi,0],[3*Pi/2,0],[2*Pi,0]], symbol=CROSS):
> display({p1,p2,p3,p4});
 

Once the graph is plotted, right click on it, then choose "Export As" and then "Encapsulated Postscript (EPS)".  Then try opening this file with extension eps or try putting it into your normal LaTeX code (I used \begin{figure},etc).  You will see what I mean in the negative x axis.

All are welcomed to try this code and see if it happens to you?!    Paulina --- if you could please try this, it would be greatly appreciated.

BTW, what is this "point system"?  Everytime I post a new post, I get 1 point.  What does these points enable you to do? 

Chris

Hi Alec.  I had to use it -- no choice.  I tried exporting the Maple plot to an EPS file and then integrating it into LaTeX.  And I got the problem (see "The concluding saga to: "How to plot" with success! ")   I thought my command in LaTeX was wrong, so I opened the EPS file by itself and it gave the same dreadful plot (which was wrong).

So copying the Maple plot and pasting it into Adobe Illustrator CS3 and then saving it as a EPS file was the only quick fix that I came up with......unless Paulina could come up with something better?????

 

Hi Paulina.  Thanks for the advice.

I have made the appropriate changes (getting rid of the extra space) and now it works on the Standard worksheet as well as the Classic Worksheet.

However, my point number 2 still stands -- regarding the EPS file and LaTeX problem.   The problem should not be happening -- with the changes to the "plus/minus" signs and the rotation.

To get around it, I had to copy the graph from Maple and paste it into Adobe Illustrator CS3 and then save it as a EPS file.  This is a pain but it is a temporary fix.

Chris

Dear all,

Thanks for all the input/output, especially Georgios Kokovidis!   3 cheers to you!  :)

The thread was extremely helpful.  I am now able to insert "Pi" into my Maple 12 Classic Worksheet now. 

Here is the code to share around (if you are interested):

> restart;
> with(plots):
> p1:=plot(2*cos(1/2*x-Pi/6),x=Pi/3..13*Pi/3,tickmarks=[0,0],color=black,thickness=2):
> p2:=plot(2*cos(1/2*x),x=0..4*Pi,tickmarks=[0,0],color=black,linestyle=dashdot):
> p3:=textplot([[Pi-0.1,-0.05,`p`],[Pi/3+0.08,-0.05,`p/3`],[0.18,-0.05,`0`],[13*Pi/3-0.15,-0.05,`13p/3`],[4*Pi-0.1,-0.05,`4p`],[4*Pi/3+0.15,-0.05,`4p/3`],[7*Pi/3-0.1,-0.05,`7p/3`],[10*Pi/3+0.35,-0.05,`10p/3`],[2*Pi,-0.05,`2p`],[3*Pi,-0.05,`3p`]],align=below, font=[SYMBOL,10]):
> p4:=textplot([[-0.1,2.0,`2`],[-0.1,-2.0,`-2`],[-0.1,1.0,`y`],[13*Pi/3+1.5,-0.05,`x`]],align=left):
> p5:=pointplot ([[Pi/3,0],[4*Pi/3,0],[7*Pi/3,0],[10*Pi/3,0],[13*Pi/3,0],[2*Pi,0],[3*Pi,0],[4*Pi,0],[0,2],[0,-2]],symbol=CROSS):
> p6:=textplot([[4*Pi/3+0.6,1,`y=2cos(x/2-`],[Pi-0.5,-1,`y=2cos(x/2)`]]):
> p7:=textplot([4*Pi/3+2.0,1,"p"],font=[SYMBOL,12]):
> p8:=textplot([4*Pi/3+2.4,1,` /6)`]):
> display({p1,p2,p3,p4,p5,p6,p7,p8});

I have shrink the picture a tad as well. 

Unfortunately, this code will not work on the normal Maple worksheet (non classic).   It keeps complaining about an error with p5 (which is the pointplot). 
"Error, (in plots:-display) expecting plot structures but received: {plots:-pointplot*([[(1/3)*Pi, 0], [(4/3)*Pi, 0], [(7/3)*Pi, 0], [(10/3)*Pi, 0], [(13/3)*Pi, 0], [2*Pi, 0], [3*Pi, 0], [4*Pi, 0], [0, 2], [0, -2]], symbol = CROSS)}"

From this, I have learned:

(1) "Classic Worksheet Maple 12" is not compatible with "Maple 12".  That shouldn't be the case!   If it works in Classic Worksheet, it should also work in the normal worksheet.
(2) When the plot is done, I right clicked on the plot, go to "Export As" , choose "Encapsulated Postscript (EPS)" and save it as a eps file.  Problems then arises when trying to embed this eps file into LaTeX with the usual begin{figure}, etc.  Problem 1: The plot is rotated anti clockwise by 90 degrees.  Problem 2: Whenever there is a minus sign in front of some Pi symbols, Maple converts it  to "plus or minus" signs -- the \pm sign if you use LaTeX.   See my second post. 

Hopefully, developers of Maple will do some changes to tackle these problems for the new release.  We don't want Maple to be like another "you know who" suite where problems just rolled over.

Hi all. 

It is still not giving what I want.

I am using the Classic Worksheet Maple 12 and here's my code:

> restart;
> with(plots):
> p1:=plot(2*cos(1/2*x-Pi/6),x=Pi/3..13*Pi/3,tickmarks=[0,0],color=black,thickness=2):
> p2:=plot(2*cos(1/2*x),x=0..4*Pi,tickmarks=[0,0],color=black,linestyle=dashdot):
> p3:=textplot([[Pi-0.1,-0.05,`p`],[Pi/3+0.08,-0.05,`p/3`],[0.18,-0.05,`0`],[13*Pi/3-0.15,-0.05,`13p/3`],[4*Pi-0.1,-0.05,`4p`],[4*Pi/3+0.15,-0.05,`4p/3`],[7*Pi/3-0.1,-0.05,`7p/3`],[10*Pi/3+0.35,-0.05,`10p/3`],[2*Pi,-0.05,`2p`],[3*Pi,-0.05,`3p`]],align=below, font=[SYMBOL,10]):
> p4:=textplot([[-0.1,2.0,`2`],[-0.1,-2.0,`-2`],[-0.1,1.0,`y`],[13*Pi/3+1.5,-0.05,`x`]],align=left):
> p5:=pointplot ([[Pi/3,0],[4*Pi/3,0],[7*Pi/3,0],[10*Pi/3,0],[13*Pi/3,0],[2*Pi,0],[3*Pi,0],[4*Pi,0],[0,2],[0,-2]],symbol=CROSS):
> p6:=textplot([[4*Pi/3+1,1,`y=2cos(x/2-Pi/6)`],[Pi-0.5,-1,`y=2cos (x/2)`]]):
> display({p1,p2,p3,p4,p5,p6});

The graph plotted beautifully.   The plot is to show y=2cos(x/2-Pi/6) is merely a shift of y=2cos(x/2) with period 4Pi, displacement Pi/3, limits -2 and 2 and the graph starting at Pi/3 and ending at 13Pi/3.  The only downfall was that Pi was not outputted as a symbolic form in the plot.  It just gave y=2cos(x/2-Pi/6) instead of giving the symbol Pi where appropriate. 

Maple should design the software such that the commands that works in Maple 12 should also work in the Classic Worksheet as well. 

Page 1 of 1