comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: high quality 'old' direct graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: high quality 'old' direct graphics [message #73710] Thu, 25 November 2010 02:40 Go to next message
sirvival is currently offline  sirvival
Messages: 18
Registered: August 2010
Junior Member
Im still getting used to idl so excuse if I ask something stupid.

Im am using display for my images (http://cosmology.berkeley.edu/group/
cmbanalysis/forecast/idl/display.pro).

To use it with your nice program I added the following:

pro gmwindow::display,image,p1,p2,no_draw=no_draw,_extra=_extra
if ~self.ps then wset,self.pixmap_index
sz=size(image,/dim)
sz_cm=sz/self.ppcm_screen
q=n_elements(sz) eq 3?where(sz ne 3):[0,1]
sz[q]*=self.f
im=rebin(image,sz) ;should manage true colour as well

case (n_elements(p1) gt 0)+(n_elements(p2) gt 0)+(n_elements(p3) gt
0)+self.ps*4 of
;screen cases
0:display,im,_extra=_extra
1:display,im,p1,_extra=_extra
2:display,im,p1*self.f,p2*self.f,_extra=_extra
; 3:display,im,p1*self.f,p2*self.f,p3,_extra=_extra

;ps versions
3:display,im,_extra=_extra
4:display,im,p1,_extra=_extra
5:display,im,p1/self.ppcm_screen,p2/self.ppcm_screen,/
centimeters,xsize=sz_cm[0],ysize=sz_cm[1],_extra=_extra
; 7:display,im,p1/self.ppcm_screen,p2/self.ppcm_screen,p3,/
centimeters,xsize=sz_cm[0],ysize=sz_cm[1],_extra=_extra
endcase


I used just modified the code for gmwindow::tv (since display uses the
tv command).
It seems to work. Or did I do something wrong?


Thanks
Re: high quality 'old' direct graphics [message #73711 is a reply to message #73710] Wed, 24 November 2010 18:37 Go to previous messageGo to next message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Nov 24, 3:36 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
> p.s. Happy TG all!

So if
DG = Direct Graphics
OG = Object Graphics
NG = New Graphics
TG = Turkey Graphics?

-Jeremy.
Re: high quality 'old' direct graphics [message #73716 is a reply to message #73711] Wed, 24 November 2010 13:47 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> I think Paulo Penteado is a better choice for a more
> useful assessment in that regard since his posting history
> indicates he clearly has a much more advanced, and quite
> nuanced, understanding of NG and how to use it. (Maybe you and
> he should team up bookwise.....? :o)

The best experience of my IDL programming career
was working long-distance between Colorado and
England with Dave Burridge. We had a cheap phone
connection in those days and we talked for 45 minutes
or so every morning (well, afternoon, his time). "Talk"
is probably the wrong word. We laughed a lot. But mostly
we argued. About everything. It's a wonder we ever got
any code written for the project we were working on.

But the thing is, at the end of the day, we had
a product that was much better than either one of
us could have produced on our own. It was a fabulous
way to work.

Paulo and I would probably get along in the same
way. And I am sure I would learn a lot working with
him. You should see the number of "IDL tips" I have
stored up here from his newsgroup posts, waiting for
work on this New Graphics book to begin. In any case,
it's clear that if ITTVIS isn't going to tell us how
to use them, somebody has to. I've made a pretty good
living over the years picking up crumbs from the ITTVIS
table. :-)

Cheers,

David

P.S. Let's just say I'm thankful for a lot of things
this Thanksgiving season, but I am especially thankful
to be doing work I love again, even if I don't make any
money doing it. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: high quality 'old' direct graphics [message #73717 is a reply to message #73716] Wed, 24 November 2010 13:20 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> My tipping point was the creation of barplots with legends. I have never been able to get good DG barplots (futzing
> about with bar widths, the number of bars/category, colouring, etc). When I used the NG barplot function, it worked just
> how I would expect it to work - that is: here is my data, plot it. Voila. It just worked.

I'll write you a BarPlot function tomorrow between football
and the turkey. Maybe we can pull you back into the fold. ;-)

> but I reckon NG is about 90% of the way to replacing DG
> (not taking into account any potential lingering NG bugs).

Maybe. I hope you are right. The test will come in January
when we get to evaluate book sales. I told my wife last
night that I could be completely wrong about all of this
and I could turn out to be a bust as an author, husband,
and provider. She said she knew that. :-(

Cheers,

David

P.S. I guess the reason I've never written a BarPlot
program is that I've never needed one. What kind of
data do you put in one? Can you point me to a graphic
example of something you have used a bar plot for?
What kind of features would it have? The guys who
are waiting until 2018 to upgrade might have need of one.

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: high quality 'old' direct graphics [message #73721 is a reply to message #73717] Wed, 24 November 2010 12:36 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Paolo writes:
>
>> now I am totally confused.
>>
>> I haven't gotten to play around with IDL 8 (we just don't have it,
>> I guess astronomers just prefer to work with old software).
>>
>> From what I understood from the new object graphic system, the point
>> was that you could give various dot commands (if you create an
>> object myplot=plot(x,y) and then you would issue comamnds like
>>
>> ...
>>
>> only better looking (and that should apply for all graphic keywords,
>> with maybe a few new ones added).
>>
>> Is my understanding right?
>
> I think your understanding probably comes from listening
> to the marketing folks, but, yes, that's the general idea. :-)
>
>> If it is, why we need the wrapper?
>
> Uh, mostly to tide you over until 2018. :-)
>
>> If it isn't, what went wrong with the new plot objects?
>
> It's not that anything has gone wrong with the new graphics
> objects, it's just that not all that much has ever gone right.

Hmm. I think that was true for iTools/OG (i.e. too much code required to replace the DG "plot") but it's not as clear
with NG.

Most of the problems I've encountered have been due to me not wanting to shift my perception anchor (i.e. "Why doesn't
the NG stuff work the way DG did! Argh!" type of thing).

But, once one decides to make that change and invests the time to do it, it's not so bad. The NG learning curve is much
shallower than that for OG, but it's not flat.

My tipping point was the creation of barplots with legends. I have never been able to get good DG barplots (futzing
about with bar widths, the number of bars/category, colouring, etc). When I used the NG barplot function, it worked just
how I would expect it to work - that is: here is my data, plot it. Voila. It just worked.

> I still have hope, but not enough to stop publication of
> a book on traditional graphics, which I think people will
> still be using 10 years from now, when we are on the 6th
> (or will it be 7th) "new" edition of the New Graphics.

Yes. OG/NG is still waaaaaay too slow compared to DG to switch over completely. E.g.: I still find generating 1000's of
DG plots in a loop and watching the resulting "animation" instructive for visualisation of some types of data. No way,
no how that could be done that simply in NG.

And there is simply too much existing IDL code using DG for ITTVIS to discard that capability (without some sort of
backlash from users)

> Sooner or later, we are going to have to get something
> simple or we will never get enough bugs out of it to
> make it useful. IDL 8 graphics are clearly a step in
> the right direction. But I have my doubts about whether
> they are the final answer.

I haven't yet plumbed the depths of the NG capabilities so feel free to dismiss my opinion based on my blatant
misrepresentation where I use pulled-from-hat numbers as being quantitatively descriptive, but I reckon NG is about 90%
of the way to replacing DG (not taking into account any potential lingering NG bugs).

I think Paulo Penteado is a better choice for a more useful assessment in that regard since his posting history
indicates he clearly has a much more advanced, and quite nuanced, understanding of NG and how to use it. (Maybe you and
he should team up bookwise.....? :o)

> In the meantime, there will still be software available
> that gets the job done in a simple, elegant way. :-)

true that.

cheers,

paulv

p.s. Happy TG all!
Re: high quality 'old' direct graphics [message #73728 is a reply to message #73721] Wed, 24 November 2010 08:10 Go to previous messageGo to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Nov 24, 10:47 am, David Fanning <n...@dfanning.com> wrote:
> Paolo writes:
>> now I am totally confused.
>
>> I haven't gotten to play around with IDL 8 (we just don't have it,
>> I guess astronomers just prefer to work with old software).
>
>> From what I understood from the new object graphic system, the point
>> was that you could give various dot commands (if you create an
>> object myplot=plot(x,y) and then you would issue comamnds like
>
>> ...
>
>> only better looking (and that should apply for all graphic keywords,
>> with maybe a few new ones added).
>
>> Is my understanding right?
>
> I think your understanding probably comes from listening
> to the marketing folks, but, yes, that's the general idea. :-)
>
>> If it is, why we need the wrapper?
>
> Uh, mostly to tide you over until 2018. :-)

Ah OK, I think I got confused on what the wrapper was based on.
I mistakenly thought it would internally use the 8.0 graphic
objects - but I now realize it's entirely based on the old system.

I should have looked at the code before posting.

Ciao,
Paolo

>
> Or, alternatively, to give you graphics commands that are
> fast, simple to build, and work intuitively, none of which
> applies to new graphics commands, although maybe you
> could argue the last point. But when an image appears as a
> tiny dot in your graphics window and surfaces have
> axes that are obscured by the data, you wonder if anyone
> is actually thinking about how these commands are suppose
> to be used by people who are trying to get some work done.
>
>> If it isn't, what went wrong with the new plot objects?
>
> It's not that anything has gone wrong with the new graphics
> objects, it's just that not all that much has ever gone right.
>
> I still have hope, but not enough to stop publication of
> a book on traditional graphics, which I think people will
> still be using 10 years from now, when we are on the 6th
> (or will it be 7th) "new" edition of the New Graphics.
>
> Sooner or later, we are going to have to get something
> simple or we will never get enough bugs out of it to
> make it useful. IDL 8 graphics are clearly a step in
> the right direction. But I have my doubts about whether
> they are the final answer.
>
> In the meantime, there will still be software available
> that gets the job done in a simple, elegant way. :-)
>
> Cheers,
>
> David
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: high quality 'old' direct graphics [message #73730 is a reply to message #73728] Wed, 24 November 2010 07:47 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paolo writes:

> now I am totally confused.
>
> I haven't gotten to play around with IDL 8 (we just don't have it,
> I guess astronomers just prefer to work with old software).
>
> From what I understood from the new object graphic system, the point
> was that you could give various dot commands (if you create an
> object myplot=plot(x,y) and then you would issue comamnds like
>
> ...
>
> only better looking (and that should apply for all graphic keywords,
> with maybe a few new ones added).
>
> Is my understanding right?

I think your understanding probably comes from listening
to the marketing folks, but, yes, that's the general idea. :-)

> If it is, why we need the wrapper?

Uh, mostly to tide you over until 2018. :-)

Or, alternatively, to give you graphics commands that are
fast, simple to build, and work intuitively, none of which
applies to new graphics commands, although maybe you
could argue the last point. But when an image appears as a
tiny dot in your graphics window and surfaces have
axes that are obscured by the data, you wonder if anyone
is actually thinking about how these commands are suppose
to be used by people who are trying to get some work done.

> If it isn't, what went wrong with the new plot objects?

It's not that anything has gone wrong with the new graphics
objects, it's just that not all that much has ever gone right.

I still have hope, but not enough to stop publication of
a book on traditional graphics, which I think people will
still be using 10 years from now, when we are on the 6th
(or will it be 7th) "new" edition of the New Graphics.

Sooner or later, we are going to have to get something
simple or we will never get enough bugs out of it to
make it useful. IDL 8 graphics are clearly a step in
the right direction. But I have my doubts about whether
they are the final answer.

In the meantime, there will still be software available
that gets the job done in a simple, elegant way. :-)

Cheers,

David

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: high quality 'old' direct graphics [message #73733 is a reply to message #73730] Wed, 24 November 2010 07:22 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Nov 24, 1:08 pm, Paolo <pgri...@gmail.com> wrote:
> Is my understanding right?
>
> If it is, why we need the wrapper?
> If it isn't, what went wrong with the new plot objects?

I do not remember anything going wrong with them. For years I have
used direct graphics only on some very rare occasions, having replaced
their use with the iTools, and now I am switching to the new graphics.

The only wrapper I wrote (the only I needed) for the new graphics is
to provide functionality that was never builtin, in any graphics
system (to make grids with shared axes, similar to multiplot from
idlastro).
Re: high quality 'old' direct graphics [message #73734 is a reply to message #73733] Wed, 24 November 2010 07:08 Go to previous messageGo to next message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
Hi folks,

now I am totally confused.

I haven't gotten to play around with IDL 8 (we just don't have it,
I guess astronomers just prefer to work with old software).

From what I understood from the new object graphic system, the point
was that you could give various dot commands (if you create an
object myplot=plot(x,y) and then you would issue comamnds like

myplot.xrange=xrange
myplot.ytitle=mytitle
etc. etc.

and get an equivalent plot then the old

plot,x,y,xrange=xrange,ytitle=mytitle [,etc. etc.]

only better looking (and that should apply for all graphic keywords,
with maybe a few new ones added).

Is my understanding right?

If it is, why we need the wrapper?
If it isn't, what went wrong with the new plot objects?

Sorry about this very naive comment, but as a 7.0 user I wonder
what will happen when we upgrade to 8.0 (which will probably happen
around 2018 or so).


Ciao,
Paolo

On Nov 24, 9:53 am, David Fanning <n...@dfanning.com> wrote:
> Greg writes:
>> It's probably rather late to put out this program, now that people are
>> using IDL 8 and its new graphics system, but perhaps some, like me,
>> are still used to the old way of making plots. With this code you can
>> add the most important parts that were missing: good quality screen
>> text, smooth curves, and matching postscript output.
>
> Oh, oh. It doesn't bode well for New Graphics routines when
> customers start to write simple systems of their own
> to make traditional (there is a certain reluctance to
> use the word "old" around the office here) IDL commands
> work the way they ought to.
>
> The fact that you can make old, uh, traditional commands work
> well in a week or two of work ought to tell you something. :-)
>
> And here I was yesterday smiling when my wife came home.
> "What are you smiling at, dear?," she asked me. "I just
> realized I know how to make my new alternative graphics
> commands work in resizeable graphics windows in a way
> that will blow everyone away," I answered.
>
> Life could get interesting. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: high quality 'old' direct graphics [message #73735 is a reply to message #73734] Wed, 24 November 2010 06:53 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Greg writes:

> It's probably rather late to put out this program, now that people are
> using IDL 8 and its new graphics system, but perhaps some, like me,
> are still used to the old way of making plots. With this code you can
> add the most important parts that were missing: good quality screen
> text, smooth curves, and matching postscript output.

Oh, oh. It doesn't bode well for New Graphics routines when
customers start to write simple systems of their own
to make traditional (there is a certain reluctance to
use the word "old" around the office here) IDL commands
work the way they ought to.

The fact that you can make old, uh, traditional commands work
well in a week or two of work ought to tell you something. :-)

And here I was yesterday smiling when my wife came home.
"What are you smiling at, dear?," she asked me. "I just
realized I know how to make my new alternative graphics
commands work in resizeable graphics windows in a way
that will blow everyone away," I answered.

Life could get interesting. :-)

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: high quality 'old' direct graphics [message #73808 is a reply to message #73710] Thu, 25 November 2010 03:32 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
> I used just modified the code for gmwindow::tv (since display uses the
> tv command).
> It seems to work. Or did I do something wrong?

I don't know that routine, but if it works, I should think you did it
right! The main thing is to ensure that all the arguments get passed
on to the routine, and that any which need scaling up for the larger
pixmap rendering get multiplied by the scaling factor self.f

tv has the peculiarity that images in postscript seem to be rendered
'to fit' the plot area, whereas on the screen they appear at true
pixel scale. This is the reason for the ppcm_screen scaling.

regards,
Greg
Re: high quality 'old' direct graphics [message #73809 is a reply to message #73711] Thu, 25 November 2010 03:22 Go to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
My code wasn't a response to NG - I had been developing it over a
couple of years already. The new graphics system looks to me to be a
big improvement, its only downside being that it is a 'new system'
with an inevitably different set of quirks and tricks to learn.

I'd investigate more deeply whether it's worth making the change but
for IDL 8's habit to evaporate into thin air with probability 0.3
whenever I type .res (hey, there must be a use for a barplot here...).
This makes me reluctant to commit to anything that won't run on an
older version. In the meantime, I've found a satisfactory solution.

cheers,
Greg
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Questions about IDL 8.0
Next Topic: Make IDL record console output to a file automatically?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:51:29 PDT 2025

Total time taken to generate the page: 0.02318 seconds