sand15

837 Reputation

13 Badges

10 years, 248 days

MaplePrimes Activity


These are replies submitted by sand15

@Andiguys 

Answer is in the help page:

<X, 2*Y>       vector which represents the point where the arrow starts from
< 0, -.9*Y >   vector which represents the displacement to the point where the arrow ends.

So if you want an arrow from, lets say, point <a, b> to point <c, b> where c < a define the arrow this way

plots:-arrow( < a, b >, < c-a, b >, ...)

If you find this definition is confusing use plottools:-arrow instead.

I advice you to carefully read plots/arrow and plottools/arrow help pages to understand how to draw arrows.

@acer 

"The OP seems to have indicated (elsewhere) that he couldn't use Kitonum's contour labelling proc..."
What I know is that the OP has posted a question saying that your code produced an error and I sent him a reply which basically said the same think as in my last reply above.

It was only when I saw that his question had been deleted that I wrote the above reply..
 

@Andiguys 

Watchout, @acer writes in LOOK HERE that his code uses "the new legend mechanism."  (meaning for Maple versions  >= 2020).
For instance the same code generates an error in Maple 2015 (my version) or earlier because option legend must be of the form legend=something.
It is thus likely this same code could not work for some versions in between 2016 and 2019 included

 


In my REPLY to your previous question @acer code is for Maple 2020 (and further versions I guess [I use Maple 2015 right now]).

In his answer @acer clearly speaks of the "new legend mechanism" meaning the syntax

plots:-contourplot(ee, contours = 20, opts, legend),

is not supposed to be supported by some versions anterior to 2020.
For instance Maple 2015 does not accept it and it is likely the same thing for your own version.

I suggest you to wait for @acer , or someone else more qualified than me, for a workaround adaptedto your own Maple version.

@Carl Love 

You write: "And how does this have any significant effect on the length of the plot structure?"

If X contains N elements then histogram(X, discrete=true, ...) contains exactly N CURVES structures.
If X ranges from A to B then histogram(X, bninwidth=W, ...) contains about (B-A)/W CURVES structures.

For instance if X= [1, 1.1, 10] histogram(X, discrete=true, ...) contains 3 CURVES while, a bandwith W=0.1 induces about 100 CURVES.
 

@Carl Love 

I didn't catch this point, sorry

@Carl Love 

Binwidth W:= min(Xs[2..] -~ Xs[..-2]); doesn't always good the correct result, like any other formula I think (not to even speak about the length of the plot structure it may generate).
So I still advice using option discrete=true instead... which of course requires adapting the thickness of the bars.

discrete.mw
 

data = [[1, 2], [11/3, 5], [16/3, 6], [6, 3], [19/3, 5], [28/3, 4]]




Option bindwidth=1/3 misses the bar at location x=1.
 

I agree that command randomize() should always end with a semicolon.

@erik10 

@Carl Love's use of option binwidth=something seems to me far too restrictive and is prone to give wrong results in a lot of situations.
I would advise you to use the option discrete=true instead: discrete.mw

@dharr 

Here is an updated version where I add a 2D ternary plot maybe_smarter_2.mw

Building a smooth representation of this ternary plot cannot be done with Maple built-in procedures.

Here is the result  from a package I developed from internal purposes. As the orientations of the axes of the ternary plot diffeet from those used in the attached worksheet, I simply reflected the figure using plottools:-reflect to ease the comparison with the Multinomial ternary plot [which explains why texts are badly positioned]):

@dharr 

You're the only one who did the things correctly because, indeed, a multinomial distribution with N characters is defined on a (N-1)-simplex.

To get a smart visualization of a 3 characters multinomial distribution I used, years ago, vertical bars of hexagonal cross sections in order tho "fill" the 2-simplex in the sense matrixplot does.
I can't put the hand on what I did bback then but here is the idea (the coloring was initially adapted to the heights of the bars)

restart

with(plots):

prob of m and k successes in N trials with prob p,q per trial

trinomial := proc (m, k, N, p, q) options operator, arrow; factorial(N)*p^m*q^k*(1-p-q)^(N-m-k)/(factorial(m)*factorial(k)*factorial(N-m-k)) end proc;

proc (m, k, N, p, q) options operator, arrow; factorial(N)*p^m*q^k*(1-p-q)^(N-m-k)/(factorial(m)*factorial(k)*factorial(N-m-k)) end proc

(1)

Ternary coords for m = N at (N,0), k=N at (1/2,sqrt(3)/2)*N, third one =N at the origin. - see  https://en.wikipedia.org/wiki/Ternary_plot

tcoords := proc (m, k) options operator, arrow; (2*m+k)/2., sqrt(3)*k/2. end proc;

proc (m, k) options operator, arrow; (2*m+k)/2., sqrt(3)*k/2. end proc

(2)

lbls := proc (N) options operator, arrow; textplot3d({[0, 0, 0, cat("var3 = ", N), align = [below, right]], [(1/2)*N, (1/2)*sqrt(3)*N, 0, cat("var2 = ", N), align = [below, right]], [N, 0, 0, cat("var1 = ", N), align = [below, left]]}) end proc:

N := 20;

20

(3)

with(plottools):


Without focusing on coloring:

ref  := display(
          polygon(
            [seq([cos(2*Pi/6*i)/sqrt(3), sin(2*Pi/6*i)/sqrt(3)], i=1..7)]
            , color=gray
          )
        ):

pins := (N, p, q) -> seq(
                       seq(
                         translate(
                           extrude(ref, 0..trinomial(m, k, N, p, q))
                           , tcoords(m, k), 0
                         )
                         , m=0..N-k
                       )
                       , k=0..N
                     ):

display(
  pins(N, .2, .5)
  , lbls(N)
  , axes = normal
  , labels = ["", "", prob]
  , axis[1, 2] = [color = white]
)

 
 

 

Download maybe_smarter.mw

A coloring example: maybe_smarter_2.mw

By the way I thought there was a built-in TernaryPlot in Maple now?

@TechnicalSupport 

Meanwhile things changed a lot.
At some point I have been capable to enter my password (adress michael.mmcdara@gmail.com, user name mmcdara) but this latter wasn't correct.
So I requested a link to reset my password but a new ptoblem occured which is detailed in this question.
Presently  any attempt to login as mmcdara is unsuccessful: after having entered my password, clicking on the "Sign in" button generates no action (not even a switch to a "Forgot your password?" window.

Incidentally, but of capital importance, mu adress michael.mmcdara@gmail.com, is no longer licit for easons explained in my question.
So I'm contacting you on @dharr's suggestion to find out if you can associate my user name mmcdara with a licit adress I can provide?

I'm really sorry for the inconvenience and I thank you in advance for any reply.

@Andiguys 

(I'm mmcdara but I reply you from my professional account as the former is not avaliable right now)

My suggestion

  1. Export as png just like I did in my previous answer (change the options if you want, note that the extension of MyFile is not mandatory and will be the one of the devide (png) you use in plotsetup).
  2. Run any dpi converter, for instance Clideo.
    (to save the converted image just click on it).

Results:
Archive.zip  (72dpi.png is the file generated by plotsetup, 600dpi.png is its upgrade from Clideo)

Here a screenshot showing the resolutions of these two files:

@dharr 

This is indeed a very promising idea.
I'm going to follow your suggestion,thanks again.


This comment is written using Firefox.

Under Safari it is (at least for me) impossible to login.
Things start with an a priori satisfactory connection:





Now trying to send you a comment results in this pop-up window




And things keep going on this way.
Trying to asx a quastion from Safari results in an endless loop:





Clicking on Sign in reopen windows



The top right region of Mapleprimes indeed shows I'm not logged in after having  Sign in

@Math-dashti 

The file, with the output I asked you to produce, has too large a size.
No problem: just reduce the time range for instance replace

 

rt := 0, 200:
by

 

rt := 0, 1:

 
What I am interested in is the structure of dsol, and it won't change it the time range is reduced
1 2 3 4 5 6 7 Last Page 1 of 26