namarsha

28 Reputation

2 Badges

16 years, 265 days

MaplePrimes Activity


These are answers submitted by namarsha

Thanks...I've tried your code and I've discovered SetOption works for resizing the plotter as an action command under a button, but if I move those commands inside a function (even if I replot the function) it doesn't resize the plot. 

It's a bit frustrating since code like this: (which grabs an inputted function from a textbox h and does some minor error checking on it, then plots it as formatted text)

plot_text_h := proc ()
  local f;
  f := Maplets:-Tools:-Get('h'::algebraic, corrections);
  Maplets:-Tools:-Set('h'=f);
  textplot ([0,0,f], font=["Dialog",10],axes=none);
end proc: 
 

does work in setting text fields.

An expand button is nice and likely what I am going to have to say we can implement. If I could set height and width it in a procedure however, it could give me the possibilily of examining the inputted function and determining if it needed a higher resolution to plot in it.

Thanks a lot, it gives me a good idea of what is possible.

Basically the idea would be to take an imput function by a user. The Maplet examines the function and if it is really complicated (like say cos(100*Pi*x) the plotter window could be re automatically resized to a larger size for easier viewing. I have functions (which are used for other purposes in the Maplet) which could be used to determine how 'simple' the function is. However, I can't determine if it is possible to resize a plotter object in a Maplet dynamically. As far as I know it is set to the value at runtime and thus can't be changed.

I have tried the Maple command "Maplet-:Elements:-SetOptions" but when I apply it to changing a plotter object  (let's call it P1) with the command   SetOption ('target'='P1','height' ="400") it doesn't change the dimension of the plotter object in the window, regardless of how I call it.

I know I am likely tilting at windmills here. It's more I was asked if one could do this and had no idea. I wondered if anyone out there might know if one could do this or not. It's one of those simple things that doesn't (at least for me) appear to be simple. Thanks again.


 

Thanks Doug, when the site went down a few days ago I kinda figured out what I wanted to do... Been in exams until today, but thanks for your idea...

but since I asked for help, I figure I'd share the code...  This function generates a text-plot from a textbox called 'h' which contains an initial function for the heat equation... say x^4*(1-x)*x  (This is for periodic boundary conditions on 0 <= x <= 1)

plot_text_h := proc ()
  local f;
  f := Maplets:-Tools:-Get('h'::algebraic, corrections);
  Maplets:-Tools:-Set('h'=f);
  textplot ([0,0,f], font=["Dialog",10],axes=none);
end proc: 

I call it by an evaluate ('function_display"='plot_text_h ()'') which runs when the window is opened.

Thanks

Neil

Page 1 of 1