[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: controlling plot appearance (was "line graph problems")

Ben Tupper (btupper@bigelow.org) writes:

> It would be relatively easy to create an plotting object for direct
> graphics (I'm not volunteering for this until I get more than just red
> colors on my display!)  New graphics keywords could be added, like your
> YTITLE_SHIFT keyword example.  Once you figure out what to do with the
> YTITLE given its SHIFT, you make it a method within the object to handle
> that property.  You could introduce other keywords like XSUBTITLE and
> YSUBTITLE.  Similar objects could be created for any kind of direct
> graphics routine (I have started a direct graphics contour object a
> number of times... someday I shall finish it... what? it's 2001
> already?) 
> Here's what it might look like:
> MyPlotObj = obj_new('DG_Plot', X, Y, YTITLESHIFT = [-0.1, 0],
> MyPlotObj->Plot
> 	;ah shoot, forgot to set these
> MyPlotObj->SetProperty, Background = 3, isotropic = 1
> MyPlot->Plot
> 	;make a printout
> devicename = !D.name
> Set_plot, 'printer'
> MyPlotObj->Plot
> Device, /Close
> Set_plot, devicename
> Obj_destroy, MyPlotObj
> If it were that simple then would you still say, 'if I can't create a
> plot in one or two lines of code then forget it'? I think that is a
> really important question, (at least I find myself asking this over and
> over before starting a new project.)

Oh, I think it could be made a LOT easier than that! 

As Martin and I have alluded to, we have been trying
to develop a program that gives the user a bit more
control over how a plot looks on the display. I guess 
it might be time to reveal it and get user feedback. 
This is truly version 1.0 of the software. Even we 
have some ideas for things it still needs. :-)

And it is not nearly as sophisticated as rotating
axis labels or shifting labels by some small amount.
But I can envision it becoming something like that.
That is to say, I know how to do those kinds of things,
and I believe I could implement it in the object
oriented approach we have used here. But, alas, we
are offering the software for free, so you pretty 
much have to take what you get and rely on the kindness
of strangers for updates. :-)

I'll put the program up on my web page for a limited
time, if people want to try it out. The Max-Plank 
Institute of Meteorology has provided a small amount
of funding to bring this software to you. I hope you
extend your gratitude to those folks should you ever 
run into them.

The program is here:


The program uses a number of files from both the Coyote
Library and Martin's Max-Plank library. I've included
everything you need in the zip file. To try it out, I
recommend you unzip the files in a local directory,
then either CD into that directory from within IDL 
(highly recommended) or add the directory to your path 
(this could be a problem if you don't have the latest 
Coyote or Max Plank files in directories ahead of this 
one on the path). To run the program, just type MPI_PLOT. 
Or, you can use your own data. This is basically a wrapper 
routine for the PLOT command, although the output will 
appear in its own display window.

All complaints, feature requests, etc. should be directed
to Martin. :-)

I particularly like the little gizmo for positioning
the plot in the window. Users of PSConfig will be
familiar with the concept. Let's just say I *knew* that
code would be useful for something someday!

I should mention that MPI_PLOT is really just an example
plot to show off the underlying functionality that we
have been working on. The real guts of the stuff we have
been doing is to have an interactive way to set plot and
axis keywords. What we imagine is that people will use
the more fundamental programs to build their own graphics
display routines, like MPI_PLOT. But all of this will
be documented in an upcoming World Premier Release that
will happen later this year.



David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155