nm

8552 Reputation

19 Badges

12 years, 353 days

MaplePrimes Activity


These are replies submitted by nm

@Kitonum 

thanks. I tried many variations, except this one :) I did not think of it, since remove takes argument itself. 

But in remove~(has, A, 0);  how does knows it is the second argument, which is A here hat needs to be element wise expanded and passed to remove? Why did it not look at say the third argument which is zero in this case, which is not a list ofcourse and did nothing? it seems ~  is smart and found the right thing on its RHS to expand, which is A in this case.  This is why I did not think this will work and did not try it. I  thought what is on RHS of ~  can only be list, and not the full arguments to the function.

 

@minhhieuh2003 

I want the expression to be a fraction, not a power of -1?

Yes, I want that also. But Maple's Latex conversion is not the best. This is well known issue for many many years. Apparently Maplesoft does not think Latex is important in the real world. Even this forum itself does not accept Latex as input.  

https://www.mapleprimes.com/posts/209333-Improving-Latex-Output-Of-Maple-For-Expressions

Notice that _LatexSmallFractionConstant:=1;  has no effect on this. Sometimes this has an effect and sometimes not. It is not really a documented thing any way.

Only way to fix this is at the source. The source is at Maplesoft headquarters. So only someone inside Maplesoft can fix these issues. We hope they will do this in the next 10-20 years time frame.

 

But it returns only one value: -1.000.

But why would you expect it to return more than one value? You are not collecting all the results generated inside the loop any where. The result returned is the last one as expected.

@Christopher2222 

I do not even know where the LibraryTools code is in first place, and I do not think I will be able to figure how change it myself to do what I want.

I do not even know how to copy what LibraryTools:-Browse()  shows on the screen to some text file to save me having to type all this myself.

 

@Pascal4QM 

Thanks for the hint, But this does not exactly do what I want. I do not want to look at call graphs. Just want to have a large view of the organizational structure of the the packages and subpackages to help one get an idea of what is there. Similar to help's table of content in a way but in a way to only look at packages/subpackages layout more easily than can be done using help.

isn't the syntax for plotting multiple functions plot( [sin(x),sin(x)],  x=0..420);  so is the bug that Maple accepted the syntax plot( [sin(x),sin(x),  x=0..420]); without giving a syntax error? 

I am trying to understand what plot( [sin(x),sin(x),  x=0..420]); is supposed to mean in the first place as the syntax itself looks wrong to me. 

@Christopher2222 

Thanks, lightmodel=none is good hint. Will use it from now on for 3D. Without it, the frame is indeed affected by view angle, when it should not be. 

@Carl Love 

THanks for the hint that one can color the tick labels separately from the axes themselves. But when I use

axis     = [tickmarks= [3, subticks= 4, color= black], thickness= 0,color= COLOR(HSV, 0, 0, .85)],

now the axes labels themselves (x,y,z) become hard to read. But the numbers on the ticks are clear. Here is what I mean


 

restart;
f :=-x^4-2*y^4+14*x^2*y^2/5:
axis_color        :=  COLOR(HSV, 0, 0, .85);
tick_labels_color :=  black;

plot3d(f, x=-5..5,y=-5..5,
   axes     = boxed,
   axesfont = [Helvetica, Bold, 8], #good choice
   axis     = [tickmarks= [3, subticks= 4, color= tick_labels_color ], thickness= 0, color = axis_color],
   labeldirections = [horizontal, horizontal, horizontal],        
   labels     = ['x', 'y', 'z'],   
   lightmodel=none,
   scaling  = unconstrained, view=[-5.2..5.2,-5.2..5.2,-1300..40]);

So I removed the axis_color and now it is more clear, but the frame became black again.

It looks like "labels" are affected by axis_color so when axis_color is say gray or COLOR(HSV, 0, 0, .85), the labels text color become gray and hard to read but the numbers on the ticks are still good and not affected by this change.

@acer 

Although eps works, I use lualatex and not pdflatex, which will end up converting eps to pdf on the fly, since native lualatex only reads pdf images.

So for this latex

\documentclass[12pt]{book}
\usepackage{graphicx}
\begin{document}

test

\includegraphics[width=.5\textwidth]{t.eps}

\end{document}

where t.eps was the file generated from Maple using

plotsetup(default):
plotsetup(postscript, plotoutput="t.eps", plotoptions=`color,portrait,height=300`);
plots[display](Array([p1,p2]));   #must be; to show up in file
plotsetup(default):

then compiling using lualatex foo.tex  it does the conversion on the fly

[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2020/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty

generating a file called t-eps-converted-to.pdf  in same folder, which then uses.  This is the final PDF of the above latex

But I also need all images in pdf becuase I use other tools that convert the PDF images to SVG (pdf2svg), since I need an SVG version for HTML (better quality than png, since SVG is vector graphics). I also use a PDF crop tool which automtically crops any empty spaces around images in PDF files and that works on PDF files only.

Bascially starting with PDF image file instead of eps is so much easier for me. pdflatex these days take PDF as image files as well.

The world runs on PDF these days. It is a universal format. eps and .ps are dead formats for all practical purposes. More reason for Maplesoft to add support for PDF's.

@acer 

"were interested in exporting the whole worksheet" sorry if I was not clear. I never actually export whole Maple document to anything. The output is not that useful. 

But I might want to export a specific plot or object to pdf to add it to latex.

I don't think that you're going to get great success (easily, or perhaps at all) by trying to deal with exporting arrays of plots by themselves.

Actually I just found out, when I export the Array of plots, it works and automatically removed all the spaces on its own. I assumed first is that what I am looking at in the screen is what will show up in pdf. 

restart;
p1:=plot(sin(x), x=-Pi..Pi, size=[300,300]):
p2:=plot(cos(x), x=-Pi..Pi, size=[300,300]):
plots[display](Array([p1,p2])); 

But now when I did this

 

plotsetup(default):
plotsetup(postscript, plotoutput="t.ps", plotoptions=`color,portrait,height=300`);
plots[display](Array([p1,p2]));   #must be; to show up in file
plotsetup(default):

And converted the generated t.ps file to t.pdf using adobe, the PDF output do not have the wasted space. But it is not very good looking. May be it needs more adjustments. Strange that what shows on the screen (in the worksheet) does not match what goes to the PDF file.  For example  on the screen the tick labels show as symbolic Pi/4, Pi/2, etc.. but in the PDF these got converted to actual numerical values.

This will make it very hard for normal person who is not expert in Maple to use Maple to generate plots and images to use for professional reports and papers which most use Latex and PDF, if the quality is like this as it seems it needs more tweeking. (fonts, etc...) but at least the wasted space is not there which is progress.

 

@acer 

Thanks. This did generate better result:

restart;

p1:=plot(sin(x), x=-Pi..Pi, size=[300,300]):
p2:=plot(cos(x), x=-Pi..Pi, size=[300,300]):
p:=DocumentTools:-Tabulate([p1,p2],width=50);

When I tried to export the above to PDF using the GUI first (by right-clicking) on both,, I could not select the whole output above at same time. I could only select either the left or the right plot, then do, using the menu export->PDF. So this does not work.

Next, I tried plottsetup as the export() command does not support PDF file option. (Very strange that to this day, one can not export a plot to pdf using the export command. How many more years it will take for Maplesoft to add direct support to exporting plots to pdf? It is the year 2020 after all. This is not 1990.)

Export("myPlot.pdf",p);
Error, (in Export) file type not recognized
 

So I tried 

plotsetup(default):
plotsetup(postscript, plotoutput=`t.eps`, plotoptions=`color,portrait,height=300`);
DocumentTools:-Tabulate([p1,p2],width=50):
plotsetup(default):

However, this genrated no file. I could not find `t.eps` anywhere. Also tried `t.ps` I think it did not work, since DocumentTools:-Tabulate  is not a plot command ofcourse. So this does not work. So I went back to the export command, and tried another format, such as JPEG and GIF, but these also did not work for Tabulate.

Export("myPlot.gif",p);

Error, (in Export) invalid input: format GIF not supported for this input

So I give up. Not able to figure how to export the output of DocumentTools:-Tabulate([p1,p2],width=50): to a file. May be there is a way. I do not know.

@Kitonum 

I tried it. I do not see any difference between it and the default color. But thanks for the suggestion.

restart;
#https://www.mapleprimes.com/questions/228539-Set-Size-Of-3D-Plot
setsize:=proc(P,sz::[posint,posint])
  op(0,P)(remove(type,[op(P)],'specfunc(ROOT)')[],
          ROOT(BOUNDS_X(0),BOUNDS_Y(0),
               BOUNDS_WIDTH(sz[1]),BOUNDS_HEIGHT(sz[2])));
end proc:

f:=-x^4-2*y^4+14*x^2*y^2/5:
p1:=plot3d(f, x=-5..5,y=-5..5,
   axes     = boxed,
   axesfont = [Times,default,10],
   axis  = [tickmarks=[3,subticks=5],thickness=0],
   labeldirections = [horizontal, horizontal, horizontal],        
   labels   = ['x', 'y', 'z'],
   title    = "default color",
   scaling  = unconstrained, view=[-5.2..5.2,-5.2..5.2,-1300..40]):
p1:=setsize(p1, [300,300]):
p2:=plot3d(f, x=-5..5,y=-5..5,
   axes     = boxed,
   axesfont = [Times,default,10],
   axis     = [tickmarks=[3,subticks=5],thickness=0,color="DarkSlateGray"],
   title    = "DarkSlateGray",
   labeldirections = [horizontal, horizontal, horizontal],        
   labels   = ['x', 'y', 'z'],
   scaling  = unconstrained, view=[-5.2..5.2,-5.2..5.2,-1300..40]):
p2:=setsize(p2, [300,300]):
p3:=plot3d(f, x=-5..5,y=-5..5,
   axes     = boxed,
   axesfont = [Times,default,10],
   axis  = [tickmarks=[3,subticks=5],thickness=0,color="gray"],
   title    = "gray color",
   labeldirections = [horizontal, horizontal, horizontal],        
   labels   = ['x', 'y', 'z'],
   scaling  = unconstrained, view=[-5.2..5.2,-5.2..5.2,-1300..40]):
p3:=setsize(p3, [300,300]):
plots[display](Array([p1,p2,p3]));

 

 

@Kitonum 

Thanks. When I used gray for the color of the frame, it made the actual ticks labels hard to read. Is there a way to make the frame itself light gray or gray or less thick of line, but not affect the actual ticks and the numbers on the tick? i.e. control the frame settings seperate from ticks and ticks labels?

restart;
f:=-x^4-2*y^4+14*x^2*y^2/5:
plot3d(f, x=-5..5,y=-5..5,
   axes     = boxed,
   axesfont = [Times,default,10],
   axis  = [tickmarks=[3,subticks=5],thickness=0,color=gray],
   labeldirections = [horizontal, horizontal, horizontal],        
   labels   = ['x', 'y', 'z'],
   scaling  = unconstrained, view=[-5.2..5.2,-5.2..5.2,-1300..40]);

 

 

@acer 

I see. This means someone got so upset with me to have to take away their vote for me for 3 different posts in such short time.

This has to have taken some work to do, as they would have to search for these in thre past and it is not easy to find where one have voted for someone else.

I am sorry I must have made someone so upset. I thought I was being helpful by posting some issues I found testing Maple, which took me 2 days to find them.

I will make sure from now on not to post about any problem I find in Maple any more. I really do not want to upset any one. This was the last post from me here.

 

I am also looking for the code for this book. Advanced Mathematical Methods with Maple, D. Richards

The link http://mcs.open.ac.uk/dr9  no longer works.

I gogoled and not able to find copy.

Any one has copy they can share? or place to download them from? The book itself I have a PDF copy of, but the book do not contain Maple code.

First 36 37 38 39 40 41 42 Last Page 38 of 71