PatrickT

Dr. Patrick T

2108 Reputation

18 Badges

16 years, 301 days

MaplePrimes Activity


These are replies submitted by PatrickT

@acer 

thanks acer, I posted here because you were discussing copy-pasting dll and moving them around and having Maple read the appropriate one at the appropriate time, which I thought perhaps would be one approach to get cmaple to use alternative drivers. Do feel free to branch off my question into a new thread, if that would be cleaner.

Sort of a little bit related : Do you know if it would be possible, in a small number of steps, to instruct command-line maple to use the standard gui plot drivers?

@acer 

Oh and I'm also primarily interested in high-quality plots, performance being secondary.

I do have the compiler installed and working. I have installed the Microsoft Visual C++ 2010 Redistributable Package, because I needed it for something else. I also have older versions (do I need the older versions as well?). I haven't configured it yet, because I am actually using the 32bit version (on a 64bit machine, because a couple of versions ago I had some installation problem). Will I see a performance improvement with the properly configured 64bit version?

May I ask a few questions related to exporting high-quality plots.

1. Can your procedure be used/adapted for other kinds of plots? I'm thinking about combining several 2D plots obtained with commands other than plot, such as plottools:-point and plots:-odeplot.

Or perhaps I should instead bypass plots:-odeplot altogether and instead use the data from dsolve together with plot?

2. Is there a simple way to transform a 3D plot into a 2D plot for subsequent printing via your method? For instance, using the viewpoint option. I have in mind creating a 3D plot, selecting 4 viewpoints, transforming to 2D plot and exporting the resulting 4 2D plots in high-quality.

thanks acer.

@Alejandro Jakubi 

> if your expectation was batch mode + Standard drivers, the answer seems no.

I understand! Yes, that was my expectation, I misunderstood what you were saying.

I agree that it would be useful to call the Standard plot drivers from the command line. Very disappointing that it cannot be done.

@Alejandro Jakubi 

> if your expectation was batch mode + Standard drivers, the answer seems no.

I understand! Yes, that was my expectation, I misunderstood what you were saying.

I agree that it would be useful to call the Standard plot drivers from the command line. Very disappointing that it cannot be done.

@acer 

thanks for a very stimulating post. I'm a couple of months late, but let me nevertheless report my experience with your code. It's worked great except for Zeta, where it got nowhere after nearly an hour. The output I got was similar to the one you report, beautiful plots, but the performance on my machine not as good, I think:

my specs:
i-7 CPU, Q720 @1.60GHz, 4GB RAM, WIN7Prox64 SP1, Maple 15 Standard GUI,

my stats (worksheet closed and re-opened before each run):

F:=z->`if`(z=0,Pi,exp(1/z)):
st,bu:=time(),kernelopts(bytesalloc):
  Q:=ArgPlot(F,-0.25,0.25,600,600):
time()-st,kernelopts(bytesalloc)-bu;

                        11.887, 97041044

F:=unapply(convert(convert(taylor(1/(1-z),z=0,100),polynom),horner,z),z):
st,bu:=time(),kernelopts(bytesalloc):
  Q:=ArgPlot(F,-1.5,1.5,600,600):
time()-st,kernelopts(bytesalloc)-bu;

                       31.388, 100382768
st,bu:=time(),kernelopts(bytesalloc):
Q:=ArgPlot(Zeta,-40.0,2.0,300,300):
time()-st,kernelopts(bytesalloc)-bu;

Warning,  computation interrupted
                      1435.474, 125281888
F:=z->Beta(z,1.1-1.7*I): Digits:=7:
st,bu:=time(),kernelopts(bytesalloc):
Q:=ArgPlot(F,-10.0,10.0,300,300):
time()-st,kernelopts(bytesalloc)-bu;
                       503.649, 54057300
 
# Adding axes:

F:=z->`if`(z=0,Pi,exp(1/z)):
st,str,ba,bu:=time(),time[real](),kernelopts(bytesalloc),kernelopts(bytesused):
  Q:=ArgPlot(F,-0.25,0.25,vsize,hsize):
time()-st,time[real]()-str,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;

                2.995, 3.073, 35645056, 43740452

newQ:=ImageTools:-Mask(Q,correctedT):
ImageTools:-Write(cat(currentdir(),kernelopts(dirsep),"arg_expinv_new.jpg"),newQ,quality=95):
time()-st,time[real]()-str,kernelopts(bytesalloc)-ba,kernelopts(bytesused)-bu;

                 0.187, 8.518, 2358864, 7682788


@pagan 

thanks for the link pagan, I'm reading it now, very interesting.

yes, I did notice the memory issues in exporting the picture of the bird above and also in exporting animated gifs.

As you know I'm always on the lookout for tricks to improve plot quality and versatility.

thanks.

 

P.S. I revived this thread after being taken to it by Markyan's reply to this recent question,

http://www.mapleprimes.com/questions/126946-Can-I-Make-A-Jpeg-File-Into-The-Background

@pagan 

thanks for the link pagan, I'm reading it now, very interesting.

yes, I did notice the memory issues in exporting the picture of the bird above and also in exporting animated gifs.

As you know I'm always on the lookout for tricks to improve plot quality and versatility.

thanks.

 

P.S. I revived this thread after being taken to it by Markyan's reply to this recent question,

http://www.mapleprimes.com/questions/126946-Can-I-Make-A-Jpeg-File-Into-The-Background

@Alejandro Jakubi 

I have tested several commanders, restricting myself to freeware: I found Freecommander very good, but I'm still using Xplorer2 lite, as my needs are satisfied with it. Apparently Freecommander is quite versatile, it can be used with TeraCopy for istance. I discovered Q-dir, which has a 4-panel and generally n-panel n<5 feature, it's absolutely great. This is becoming my explorer of choice. I discovered Double Commander, which you may like, it integrates a command-line interface, and has powerful features to run programs, a bit like medit, it is said to be fast and I certainly have not found it slow so far. Just thought I'd mention these.

@Alejandro Jakubi 

I have tested several commanders, restricting myself to freeware: I found Freecommander very good, but I'm still using Xplorer2 lite, as my needs are satisfied with it. Apparently Freecommander is quite versatile, it can be used with TeraCopy for istance. I discovered Q-dir, which has a 4-panel and generally n-panel n<5 feature, it's absolutely great. This is becoming my explorer of choice. I discovered Double Commander, which you may like, it integrates a command-line interface, and has powerful features to run programs, a bit like medit, it is said to be fast and I certainly have not found it slow so far. Just thought I'd mention these.

@Alejandro Jakubi 

I thought it would be worth the trouble of getting Maple 14 back, since you have said that command-line calls work with Maple 14. I was able to get the "old" disk (not that old!). I was also able to get my old XP windows drive to power up and to install Maple 14 on it. This is a completely different machine and a different version of Maple. However, I have not been able to get the commands to "work".

This is strange. Perhaps there has been a misunderstanding about what I'm expecting the commands to do.

Refer to the test.mpl file above. It creates a plot and exports it. I expect that plot to be created in the current directory. This works with cmaple.exe, but not with maplew.exe. Should I expect maplew.exe to do that?

I want to export the plots with the standard gui instead of the classic gui because the plots look so much better with standard, that's my only reason for insisting on getting maplew.exe to execute and create plots.

Are you saying that, on your machine, you get a postscript plot created? (with/without cygwin, with/without Win7 or XP, with/without Maple 14/15) ???

I have now tried with Maple 14/15, Win7/XP, cmd/cygwin.

I have also tried from within the C:\Program Files\Maple 15\ and C:\Program Files\Maple 15\bin.win directories as well as my "workspace" C:\maple.

I also successfully used XP mode on my Windows 7 machine and tested the commands there too!

I suggest we leave this discussion aside, it would be best for my sanity. In the meantime, I work in the mouse-intensive, old-fashion way. But I want to thank you both very, very much for extending a hand at a difficult time. Your help is very much appreciated.

@Alejandro Jakubi 

I thought it would be worth the trouble of getting Maple 14 back, since you have said that command-line calls work with Maple 14. I was able to get the "old" disk (not that old!). I was also able to get my old XP windows drive to power up and to install Maple 14 on it. This is a completely different machine and a different version of Maple. However, I have not been able to get the commands to "work".

This is strange. Perhaps there has been a misunderstanding about what I'm expecting the commands to do.

Refer to the test.mpl file above. It creates a plot and exports it. I expect that plot to be created in the current directory. This works with cmaple.exe, but not with maplew.exe. Should I expect maplew.exe to do that?

I want to export the plots with the standard gui instead of the classic gui because the plots look so much better with standard, that's my only reason for insisting on getting maplew.exe to execute and create plots.

Are you saying that, on your machine, you get a postscript plot created? (with/without cygwin, with/without Win7 or XP, with/without Maple 14/15) ???

I have now tried with Maple 14/15, Win7/XP, cmd/cygwin.

I have also tried from within the C:\Program Files\Maple 15\ and C:\Program Files\Maple 15\bin.win directories as well as my "workspace" C:\maple.

I also successfully used XP mode on my Windows 7 machine and tested the commands there too!

I suggest we leave this discussion aside, it would be best for my sanity. In the meantime, I work in the mouse-intensive, old-fashion way. But I want to thank you both very, very much for extending a hand at a difficult time. Your help is very much appreciated.

great stuff pagan, thanks.

I got it to work (see my code below) with Windows7x64, Maple15.01

I had to use this assignment instead, m,n,o:=op(map2(op,2,[rtable_dims(immy)])): to avoid an "ambiguous assignment" error.

See below for a potential application (joke).

Funnily enough, I can get to display a plottools:-circle but not a plottools:-disk. You can check for yourselves, if you're interested, with the code below.

### 3D Plot

a,b:=-10,10:
P1 := plottools:-sphere( [1,1.5,1], 1, 'color' = red, 'thickness' = 10, 'style' = patchnogrid): #plots:-display(%);
immy := ImageTools:-Read(cat(currentdir(),kernelopts(dirsep),images,kernelopts(dirsep),"birdy.jpg")):
m,n,o:=op(map2(op,2,[rtable_dims(immy)])):
P2a := ImageTools:-Preview(immy):
P2b := plottools:-translate( P2a, -floor(m/2), -floor(n/2), 1 ):
P2 := plottools:-scale( P2b, (b-a)/m, (b-a)/n, 1 ):
plots:-display( [P2,P1], 'orientation' = [0.0,0.1], 'axes' = none );

My original plan was to have a heart-shape instead of a circle/sphere, but as I couldn't work out how to draw a heart in less than 5 minutes, I settled with the sphere (I do have more pressing things to do).

### 2D plot

Z := op(2,op(4,op(1,P2a))):
Zc := Array(1..265*265,1..3,(i,j)->Z[265-max(1,iquo(i,265))+1,265-irem(i,265),j],datatype=float[8]):
M := Matrix(265*265,2,datatype=float[8]):
V := Vector(265,i->265-i+1,datatype=float[8]):
Vc := Vector(265,datatype=float[8]):

for i from 1 to 265 do
  ArrayTools:-Fill(265,i,Vc,0,1);
  M[(i-1)*265+1..(i-1)*265+265,2]:=Vc:
  M[(i-1)*265+1..(i-1)*265+265,1]:=V:
end do:

P3a := plots:-pointplot( convert(M,listlist), 'color' = [seq(COLOR(RGB,seq(Zc[i][k],k=1..3)),i=1..265^2)] ):
P3b := plottools:-translate( P3a, -floor(m/2), -floor(n/2) ):
P3 := plottools:-scale( P3b, (b-a)/m, (b-a)/n ):
P2a:='P2a': P2b:='P2b': P3a:='P3a': P3b:='P3b': #freeing up memory
# P4 := plottools:-disk( [0,-2], 3, 'color' = red):  plots:-display(%);
P4 := plottools:-circle( [0,-2], 3, 'color' = red):  plots:-display(%);
plots:-display( [P3,P4] ); #, 'axes' = none );



great stuff pagan, thanks.

I got it to work (see my code below) with Windows7x64, Maple15.01

I had to use this assignment instead, m,n,o:=op(map2(op,2,[rtable_dims(immy)])): to avoid an "ambiguous assignment" error.

See below for a potential application (joke).

Funnily enough, I can get to display a plottools:-circle but not a plottools:-disk. You can check for yourselves, if you're interested, with the code below.

### 3D Plot

a,b:=-10,10:
P1 := plottools:-sphere( [1,1.5,1], 1, 'color' = red, 'thickness' = 10, 'style' = patchnogrid): #plots:-display(%);
immy := ImageTools:-Read(cat(currentdir(),kernelopts(dirsep),images,kernelopts(dirsep),"birdy.jpg")):
m,n,o:=op(map2(op,2,[rtable_dims(immy)])):
P2a := ImageTools:-Preview(immy):
P2b := plottools:-translate( P2a, -floor(m/2), -floor(n/2), 1 ):
P2 := plottools:-scale( P2b, (b-a)/m, (b-a)/n, 1 ):
plots:-display( [P2,P1], 'orientation' = [0.0,0.1], 'axes' = none );

My original plan was to have a heart-shape instead of a circle/sphere, but as I couldn't work out how to draw a heart in less than 5 minutes, I settled with the sphere (I do have more pressing things to do).

### 2D plot

Z := op(2,op(4,op(1,P2a))):
Zc := Array(1..265*265,1..3,(i,j)->Z[265-max(1,iquo(i,265))+1,265-irem(i,265),j],datatype=float[8]):
M := Matrix(265*265,2,datatype=float[8]):
V := Vector(265,i->265-i+1,datatype=float[8]):
Vc := Vector(265,datatype=float[8]):

for i from 1 to 265 do
  ArrayTools:-Fill(265,i,Vc,0,1);
  M[(i-1)*265+1..(i-1)*265+265,2]:=Vc:
  M[(i-1)*265+1..(i-1)*265+265,1]:=V:
end do:

P3a := plots:-pointplot( convert(M,listlist), 'color' = [seq(COLOR(RGB,seq(Zc[i][k],k=1..3)),i=1..265^2)] ):
P3b := plottools:-translate( P3a, -floor(m/2), -floor(n/2) ):
P3 := plottools:-scale( P3b, (b-a)/m, (b-a)/n ):
P2a:='P2a': P2b:='P2b': P3a:='P3a': P3b:='P3b': #freeing up memory
# P4 := plottools:-disk( [0,-2], 3, 'color' = red):  plots:-display(%);
P4 := plottools:-circle( [0,-2], 3, 'color' = red):  plots:-display(%);
plots:-display( [P3,P4] ); #, 'axes' = none );



@zoli123 

I don't recall seeing anything about this, but I'm sure Joe would know how to go about resolving your problem, if you give him a chance.

As it is, your question is too abstract, too vague.

Why don't you copy-paste a minimal example, using 1-D "text only" equations. Or if that's too difficult, then upload your worksheet. Or are you working on hypersensitive stuff and are bound by a pledge of secrecy?

First 29 30 31 32 33 34 35 Last Page 31 of 93