PatrickT

Dr. Patrick T

2163 Reputation

18 Badges

16 years, 230 days

MaplePrimes Activity


These are replies submitted by PatrickT

Another strange issue. The following two plots were produced with some slightly tedious code from one of my research projects, so I'm not going to copy it unless requested.

The first plot is exported as png. The second plot is exported as ps. The strange thing is the green color covers the red color in postscript, not in png: these are two different plots, there must be an error?

Not a thorough study, but further random points I have noticed as I plough away trying to beat a deadline:


1. Problems with the 'font' 'axesfont' 'labelfont' options:

From the Help files, we get the following explanation:


axesfont=l
Font for the labels on the tick marks of the axes, specified in the same manner as font. This option overrides values specified for font.

captionfont=1
This option defines the font for a plot caption, specified in the same manner as font. This option overrides values specified for font.

labelfont=l
Font for the labels on the axes of the plot, specified in the same manner as font. This option overrides values specified for font.


font=l
This option defines the font for the plot title, caption, axis tickmark labels, and axis labels if no values have been specified for the axesfont, captionfont, labelfont, or titlefont options. The value l is a list of the form [family, style, size]. The value of family can be one of Times, Courier, Helvetica, or Symbol. It can also be any font name supported by your system, for example, Tahoma and Lucida in Windows. The first letter of the family name must be capitalized.
The value of style can be omitted or one of roman, bold, italic, bolditalic, oblique, or boldoblique.
The Symbol family does not accept a style option. The final value, size, is the point size to be used.

However, some casual testing reveals the following:

  • 'font'  fails to control labelfont
  • 'labelfont' succeeds in controlling labelfont
  • 'axesfont' fails to control axesfont

See my test plots below.

2. When exporting in larger size, the labels are not scaled up, this is for both 'labelfont' and 'axesfont'. A workaround is to scale them up manually. See my test plots below.


3. Cropping is often too tight, both programmatically and contextmenu, both png/ps

In many cases, some labels are cropped out of the figure. In some cases, the caption is cropped out altogether.


4. Third label dropped, both png/ps

This problem is by now well known, but it's very problematic in real life.

 

5. (EDIT) Axis lines sometimes drawn in wrong color, for ps exports only.

 

Test Plots: taken from Maple Help files, with added titles, captions, colors, etc..

testPlot1 :=
  plot3d([1,x,y]
    , x = 0 .. 2*Pi
    , y = 0 .. 2*Pi
    , 'coords' = toroidal(10)
    , 'scaling' = constrained
    , 'style' = contour
    , 'labels' = [ `x`, `y`, `z` ]
    , 'tickmarks' = [ 5, 5, 5 ]
    , 'axes' = box
    , 'orientation' = [70,70]
    , 'axis' = [ 'color' = magenta, 'thickness' = 1 ]
    , 'title' = "testPlot1 title"
    , 'caption' = "testPlot1 caption"
  ) :

testPlot1;

addcoords(z_cylindrical,[z,r,theta],[r*cos(theta),r*sin(theta),z]);
testPlot2 :=
  plot3d(r*cos(theta)
    , r = 0 .. 10
    , theta = 0 .. 2*Pi
    , 'coords' = z_cylindrical
    , 'color' = red
    , 'lightmodel' = light1
    , 'labels' = [ `x`, `y`, `z` ]
    , 'tickmarks' = [ 5, 5, 5 ]
    , 'orientation' = [-130,70]
    , 'axes' = boxed
    , 'axis' = [ 'color' = blue, 'thickness' = 2 ]
    , 'title' = "testPlot2 title"
    , 'caption' = "testPlot2 caption"
  ) :

testPlot2;

The following procedure makes a plot in the current directory. The plot should have different fonts in the title, caption, labels, etc.

MakePlot := proc(p::evaln, {[x,ext,extension]:=ps})
  local name, dir, opts:
  name := cat(convert(p,string),".",convert(x,string)):
  dir := cat(currentdir(),kernelopts(dirsep)):
  opts := `color,portrait,noborder,transparent`:
  plotsetup('x', 'plotoutput'=cat(dir,name), 'plotoptions'=opts):
  print( plots:-display(
    eval(p), 'font' = [TIMES, ROMAN, 12]
           , 'axesfont' = [HELVETICA, ROMAN, 20]
           , 'labelfont' = [SYMBOL, BOLD, 12]
           , 'captionfont' = [TIMES, BOLD, 6]
           , 'titlefont' = [TIMES, BOLD, 20]
  ) ) ;
plotsetup(default):
end proc:

MakePlot(testPlot1, 'extension' = png);
MakePlot(testPlot2, 'extension' = png);

MakePlot(testPlot1, 'extension' = ps);
MakePlot(testPlot2, 'extension' = ps);

The following procedure makes a large plot in the current directory:

MakeLargePlot := proc(p::evaln, {[x,ext,extension]:=ps})
  local name, dir, opts:
  name := cat(convert(p,string),".",convert(x,string)):
  dir := cat(currentdir(),kernelopts(dirsep)):
  opts := `color,portrait,noborder,transparent,height=1024,width=1024`: # export large png: use large height/width
  plotsetup('x', 'plotoutput'=cat(dir,name), 'plotoptions'=opts):
  print( plots:-display(
    eval(p), 'font' = [TIMES, ROMAN, 24] # fails to control labelfont
           , 'labelfont' = [TIMES, ROMAN, 24] # succeeds in controlling labelfont
           , 'axesfont' = [HELVETICA, ITALIC, 10] # fails to control axesfont
  ) ) ;
plotsetup(default):
end proc:

 

MakeLargePlot(testPlot1, 'extension' = png);
MakeLargePlot(testPlot2, 'extension' = png);

MakeLargePlot(testPlot1, 'extension' = ps);
MakeLargePlot(testPlot2, 'extension' = ps);


Let me copy only 3 of the plots, for illustration.

The first two plots are "LARGE" plots exported in png format. The pretty plot has the label size manually adjusted.

The third plot is a default-size plot exported in ps format. The red blots as labels occur (presumably) because the ps-export driver couldn't deal with the "symbol" font.

 

If I'm not mistaken, I think the following line will override the default display option:

interface(typesetting=extended):

i.e. executing the line above at the top of the worksheep, in Standard (but not in Classic) overrides this setting:

Tools -> Options -> Display -> Typesetting Level -> Maple Standard

I could be wrong, but it looks that way.

If I'm not mistaken, I think the following line will override the default display option:

interface(typesetting=extended):

i.e. executing the line above at the top of the worksheep, in Standard (but not in Classic) overrides this setting:

Tools -> Options -> Display -> Typesetting Level -> Maple Standard

I could be wrong, but it looks that way.

@Preben Alsholm 

That's a very good point. The Pi/pi notation is a minefield really. I've learned not to use pi as a variable to avoid the potential confusion, so I hadn't noticed they print the same. I can see it now. There is indeed a difference between e and exp(1), but I'd say it's rather subtle!

A few days ago I noticed that the plot/tickmarks options take the 'piticks' keyword. Should it not have been 'Piticks' (with a capital P) instead?

The mistaken use of pi for Pi is one of the top frequently asked questions (and maybe number one). And the e^()/exp() confusion is up there two (maybe number two most faq?). If I remember correctly, the original Maple was using a capital E for the exponential.

I've always felt that there should be a default warning thrown up by Maple whenever it finds pi instead of Pi or whenever it finds e^() or E^() instead of exp(). Naturally, advanced users could silence the warning.

@Preben Alsholm 

That's a very good point. The Pi/pi notation is a minefield really. I've learned not to use pi as a variable to avoid the potential confusion, so I hadn't noticed they print the same. I can see it now. There is indeed a difference between e and exp(1), but I'd say it's rather subtle!

A few days ago I noticed that the plot/tickmarks options take the 'piticks' keyword. Should it not have been 'Piticks' (with a capital P) instead?

The mistaken use of pi for Pi is one of the top frequently asked questions (and maybe number one). And the e^()/exp() confusion is up there two (maybe number two most faq?). If I remember correctly, the original Maple was using a capital E for the exponential.

I've always felt that there should be a default warning thrown up by Maple whenever it finds pi instead of Pi or whenever it finds e^() or E^() instead of exp(). Naturally, advanced users could silence the warning.

are you in document or worksheet mode? in worksheet mode, the input is red by default, while the output is blue, are you trying to delete the blue part? because that won't work. what are the lines of code preceding this, if you don't want the list [G,H,L,P,T,U] to appear, you may need to act on the earlier part of the code.

Thanks Preben, interesting exploration...

1.^b;
whattype(%);
                                b
                              1.
                               ^
-1.^b;
whattype(%);
                                 b
                              -1.
                               *

Thanks Preben, interesting exploration...

1.^b;
whattype(%);
                                b
                              1.
                               ^
-1.^b;
whattype(%);
                                 b
                              -1.
                               *

I want to take this opportunity to thank the Maplesoft team for their great work on the 3D plot postscript export facility: Maple 16 has introduced a thoroughly rewritten plot exporter that brings to 3D plots the level of quality that was until now only available for 2D plots. The 3D plots I've been able to export with Maple 16 look very, very good.

Unfortunately, there are some bugs in the 16.00 and 16.01 release. However, I am confident that the problems will be soon resolved, since the Maplesoft team has shown that they view plots in general, and the postscript exporter in particular, as one of their priorities.

Some of the problems with creating plots and exporting plots that remain to be fixed in Maple 16 are discussed here:

http://www.mapleprimes.com/posts/134832-Postscript-3D-Plot-Export-SCR--Maple
http://www.mapleprimes.com/posts/134845-Inappropriate-Printing-Of-Images-And
http://www.mapleprimes.com/posts/133666-Domain-Problems-In-Plot-For-Maple-16
http://www.mapleprimes.com/posts/133651-PS-Driver-In-Maple-16-For-Windows

Problems with Maple 15, 14, and earlier were partly summarized here (with links to other discussions):

http://www.mapleprimes.com/posts/125952-Export-Plot-Driver-In-Standard

The "interrupt the current operation" button in the "context bar", the button in the shape of a red hand, is my most used button, and the only reason I keep the "context bar" on display. I would find it more convenient if the red hand were located in a better place outside of the context bar. A good place might be immediately to the right of "Help" or the left of "File"  or maybe to the left of the top-right corner "Minimize" tab. Does anyone second this idea at all?

Here are some suggestions:

To be specific, I have in mind this sort of plot:

plot3d(sin(x+y), x=-5..5, y=-5..5, viewpoint=["circleleft", frames=20]);

Programmatically: I'd like to have the options 'continuous' = true and 'play' = true. And perhaps some of the other options that currently can only be reached via the context menu, such as the frame per second.

Mouse-tically: First, I'd like to be able to reach the 'play' and 'continuous' options easily. Ideally, as soon as the mouse clicks on the plot, as soon as the "resizing" box becomes highlighted I'd love to see a "play" button that would toggle to "stop" when pressed.

Currently, accessing the option with the mouse is a two-step mouse action, right-click to get the menu, then scroll down to "animation" and then get another menu and scroll down again to "play."  So to get the animation to play continuously involves a lot of wrist movement. So tedious that my current practice is to export the animation as gif and only then to look at the animated gif.

My own personal preference is for the default to be 'continuous'=true: Is that a good idea?

Another thing that I'd like about the "context bar" is to see both the "play" buttons AND the "orientation" angles. Currently, if you have the 'viewpoint' option, you don't get to see the orientation angles again. I think it's useful to have both.

I thought I might be able to use the 'axis' and 'tickmarks' options to make the process of exporting the 3D plots to postscript more successful, but on the contrary, there seems to be some interference.

Consider the following options:

    , 'style' = line
    , 'thickness' = 2
    , 'axes' = normal
    , 'labels' = [ `u`, `r`, `q` ]
    , 'tickmarks' = [ 4, 4, 4 ]
    , 'axis'=['color'=black, 'thickness'=2, 'location'=origin ]
    , 'view' = [ -0.03 .. 0.001, 0.066 .. 0.075, 0.068 .. 0.075 ]

The only difference with the previous examples is the addition of the 'axis' option, where I was hoping that thickening and coloring the axis might help. (another difference is I extended the view so more trajectories are visible):

 The first plot is exported as png, the second is exported as postscript:

As for controlling the tickmarks, it looks good in png but I experienced a crash when trying to export as postcript:

The code above is changed to:

#    , 'tickmarks' = [ 4, 4, 4 ]
    , 'tickmarks' = [spacing(0.01,0),spacing(0.0015,0.067),spacing(0.0015,0.067)] # hand-made tickmarks

The plot with hand-made tickmarks is arguably more legible because the labels don't overlap near the origin:

The labels are on the inside instead of on the outside, where they would arguably sit better, but I don't think that can be controlled manually.

Do you also experience a crash when attempting to export with the spacing option in tickmarks?

Below is the test odeplot produced with acer's code, but exported with the pointy-clicky method. Sadly, the third label (z) is dropped when exporting using the programmatic plotsetup method outlined above (this is a problem I remember reporting a few releases ago, so it hasn't been fixed with Maple 16). The animated plot with the label exported with context-menu clicks:

 

 

 

One frame exported by the procedure Animate2 above, with the third label (z) missing:

The problem will remain even in Maple 17. Now that your problem has been cleaned up, I suggest you do this:

define numerical values of the parameters (all the non-tau symbols), set them equal to something like values you expect them to have, and if you're not sure set them equal to one. Then see if fsolve can solve it. Also worth investigating is whether you can eliminate some equations by eliminating some of the tau variables, if you can reduce the system from 5 to 3 or even to 2, then you can plot it and see visually whether there are any solutions.

First 13 14 15 16 17 18 19 Last Page 15 of 93