plotting graphics for web pages [message #60248] |
Sat, 10 May 2008 08:02  |
russ[1]
Messages: 8 Registered: April 2008
|
Junior Member |
|
|
Hi
I want to make my idl code do a plot to a file format that can be
picked up by html.
I tried set_plot,'ps' etc
which creates the ps file ok that can be read into word, but if I
reference this in the normal way in html
<a href="http://www...etc" title="OUCE" class="logo"><img
src="images1.jpg" alt="OUCE" /></a>
then it doesnt show when opeing the file in explorer.
any ideas?
thanks
russ
|
|
|
Re: plotting graphics for web pages [message #60332 is a reply to message #60248] |
Mon, 19 May 2008 19:31   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> All this would be much simpler if IDL didn't change the @%$^#% charsize when multiple
> plots are displayed. Whoever thought that little beauty up (or, at the very least, decided
> that the user didn't need control over it) should've been tossed out on his/her earhole
> during the pre-implementation code review.... :o)
Uh, well, did you ever try this little trick:
IDL> Window
IDL> !p.MULTI=[0,3,2]
IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
IDL> !p.charsize=1.5
IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
Seems like that's a fairly easy way to get control over
character size in multi-plots. ;-)
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: plotting graphics for web pages [message #60337 is a reply to message #60248] |
Mon, 19 May 2008 14:41   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> Paul van Delst writes:
>
>> I do the same thing except:
>>
>> 1) I use png, rather than jpeg, files
>>
>> 2) I do a
>> device, scale_factor=2.0
>> for PS output so that the resultant ps->png conversion doesn't
>> produce teeny pictures.
>>
>> Grabbing IDL output from screen (direct graphics at least) leaves you hostage to blechy fonts.
>
> Paul,
>
> Would you be willing to provide a small code snippet to show
> us exactly how this is done? I'd be happy to publish it for
> you. :-)
I assume you're pulling my whizzer here since I know I don't do anything that isn't
already known. Maybe it's just a convention thing on my part?
At any rate, for the record I do the following sort of thing in my .pro file:
pro plot_this
; Some plotting setup stuff
font = (!d.name eq 'PS') ? 1 : -1
thick = (!d.name eq 'PS') ? 2 : 1
charsize = (!d.name eq 'PS') ? 1.5 : 1.0
; My data
n = 1000L
x = dindgen(n)/double(n-1)
y = x^2
; Do the plots
plot, x, y, $
font=font, thick=thick, charsize=charsize
end
When I want to look at/play with the data onscreen, I simply do
IDL> plot_this
To create "regular" PS output I just do
IDL> pson
IDL> plot_this
IDL> psoff
and the resultant idl.ps file contains a plot that I can e.g. insert in my latex
documents. When I want to create a png for use on a web page I just do,
IDL> pson
IDL> device, scale_factor=2.0
IDL> plot_this, x, y
IDL> psoff
and use the ImageMagick utility like so
IDL> $convert idl.ps idl.png
and the idl.png is large enough to read stuff.
I think the big trick here may simply be religious use of Liam Gumley's pson and psoff
utilities - they take care of most things PS related. Or maybe it's the usual slew of
font = (!d.name eq 'PS') ? 1 : -1
thick = (!d.name eq 'PS') ? 2 : 1
charsize = (!d.name eq 'PS') ? 1.5 : 1.0
that I do. That idiom I use often enough I'm thinking of putting it in an include file,
let's call it "plotset_1x1.pro" for a single plot. I could then use the same settings for
other single plots:
pro plot_that
@plotset_1x1
n = 1000L
x = dindgen(n)/double(n-1)
y = x^4 - 10.0d0*x^3
; Do the plots
plot, x, y, $
font=font, thick=thick, charsize=charsize
end
I just ran a test of all the above and it worked just fine. Probably a "plotset" that was
!p.multi aware and returned a structure that could be passed in via the _extra to the plot
command would be more general and handier, but the above works for me 95% of the time
(trying to satisfy the remaining 5% would probably lead to something like iTools :o)
All this would be much simpler if IDL didn't change the @%$^#% charsize when multiple
plots are displayed. Whoever thought that little beauty up (or, at the very least, decided
that the user didn't need control over it) should've been tossed out on his/her earhole
during the pre-implementation code review.... :o)
Anyway.....
cheers,
paulv
|
|
|
|
|
Re: plotting graphics for web pages [message #60436 is a reply to message #60248] |
Thu, 22 May 2008 00:46  |
d.poreh
Messages: 406 Registered: October 2007
|
Senior Member |
|
|
On May 20, 10:29 pm, David Fanning <n...@dfanning.com> wrote:
> pgri...@gmail.com writes:
>> I should have specified that this is an integer number
>> specifying the width in pixel. Try 600, 800 or 1024.
>> If you give one number, it is the xsize,
>> and ysize is scaled automatically. Otherwise, you can
>> also specify something like 800x600
>
> The command line I tried is this:
>
> convert -density 300 file.ps -resize 25% file.png
>
> This gave me a PNG file of the size I was looking for.
> Again, it is higher resolution, but is larger in size.
> I've included all three files now in the article.
> The first file is 15K, the second is 79K, and the
> third, with the command above, is 162K. Still not
> bad, but it is eating disk space as we speak. :-)
>
> http://www.dfanning.com/graphics_tips/weboutput.html
>
> 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.")
Hi Dave
it is not work for me i have got an error:
CTLOAD,4....
i use IDL6.3
Cheers
Dave
|
|
|
|
Re: plotting graphics for web pages [message #60471 is a reply to message #60248] |
Tue, 20 May 2008 21:19  |
russell.grew
Messages: 74 Registered: February 2005
|
Member |
|
|
For the record, I save as .eps from IDL and then use ghostscript from
the command line [in linux].
eg:
gs -sDEVICE=png16m -sOutputFile=foo.png -dNOPAUSE -dBATCH -dEPSCrop -
r300x300 foo.eps
Other useful devices are pdfwrite, jpeg, tiff24nc.
The EPSCrop option only considers the .eps file inside the bounding
box.
The -r300x300 is resolution of 300 DPI.
Ghostscript is well useful.
Cheers.
Russell.
On May 21, 8:36 am, David Fanning <n...@dfanning.com> wrote:
> Kenneth P. Bowman writes:
>> For presentations there is a simple rule of thumb -- print the slide on 8.5 x 11 or A4(?)
>> paper. Lay it on the floor at your feet and look at the slide while standing up.
>> If you have a hard time reading the text (or discerning details of the graphics),
>> it is too small.
>
> Oh, dear. It's not just books I can't read any more,
> now the middle distance is getting hazy. It won't be
> long before I can blame all my tennis return-of-serve
> problems on poor eyesight. :-(
>
> 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: plotting graphics for web pages [message #60488 is a reply to message #60248] |
Tue, 20 May 2008 15:36  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Kenneth P. Bowman writes:
> For presentations there is a simple rule of thumb -- print the slide on 8.5 x 11 or A4(?)
> paper. Lay it on the floor at your feet and look at the slide while standing up.
> If you have a hard time reading the text (or discerning details of the graphics),
> it is too small.
Oh, dear. It's not just books I can't read any more,
now the middle distance is getting hazy. It won't be
long before I can blame all my tennis return-of-serve
problems on poor eyesight. :-(
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: plotting graphics for web pages [message #60491 is a reply to message #60248] |
Tue, 20 May 2008 13:39  |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <g0va52$lu4$1@news.nems.noaa.gov>,
Paul van Delst <Paul.vanDelst@noaa.gov> wrote:
> My simple-minded approach to font sizes for web/ppt graphics is that if people can't read
> it clearly, then it's too small. I'm sure there's some sort of Graphic Design Golden Rule
> of ratios of font sizes that make things appear more aesthetically pleasing, but one
> doesn't like to see people leaning forward in their seats to read graphics (be they
> looking at their screen or a ppt presenation containing graphics.)
For presentations there is a simple rule of thumb -- print the slide on 8.5 x 11 or A4(?)
paper. Lay it on the floor at your feet and look at the slide while standing up.
If you have a hard time reading the text (or discerning details of the graphics),
it is too small.
Ken
|
|
|
Re: plotting graphics for web pages [message #60493 is a reply to message #60248] |
Tue, 20 May 2008 14:11  |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On May 20, 4:04 pm, Vince Hradil <hrad...@yahoo.com> wrote:
> On May 20, 3:29 pm, David Fanning <n...@dfanning.com> wrote:
>
>> pgri...@gmail.com writes:
>>> I should have specified that this is an integer number
>>> specifying the width in pixel. Try 600, 800 or 1024.
>>> If you give one number, it is the xsize,
>>> and ysize is scaled automatically. Otherwise, you can
>>> also specify something like 800x600
>
>> The command line I tried is this:
>
>> convert -density 300 file.ps -resize 25% file.png
>
>> This gave me a PNG file of the size I was looking for.
>> Again, it is higher resolution, but is larger in size.
>> I've included all three files now in the article.
>> The first file is 15K, the second is 79K, and the
>> third, with the command above, is 162K. Still not
>> bad, but it is eating disk space as we speak. :-)
>
>> http://www.dfanning.com/graphics_tips/weboutput.html
>
>> 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.")
>
> Have you tried the -quality flag?http://www.imagemagick.org/script/command-line-options. php#quality
I did - saves you a few bytes:
convert weboutput_3.png -quality 100 weboutput_4.png <- 146 KB
|
|
|
|
Re: plotting graphics for web pages [message #60495 is a reply to message #60248] |
Tue, 20 May 2008 14:04  |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On May 20, 3:29 pm, David Fanning <n...@dfanning.com> wrote:
> pgri...@gmail.com writes:
>> I should have specified that this is an integer number
>> specifying the width in pixel. Try 600, 800 or 1024.
>> If you give one number, it is the xsize,
>> and ysize is scaled automatically. Otherwise, you can
>> also specify something like 800x600
>
> The command line I tried is this:
>
> convert -density 300 file.ps -resize 25% file.png
>
> This gave me a PNG file of the size I was looking for.
> Again, it is higher resolution, but is larger in size.
> I've included all three files now in the article.
> The first file is 15K, the second is 79K, and the
> third, with the command above, is 162K. Still not
> bad, but it is eating disk space as we speak. :-)
>
> http://www.dfanning.com/graphics_tips/weboutput.html
>
> 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.")
Have you tried the -quality flag?
http://www.imagemagick.org/script/command-line-options.php#q uality
|
|
|
Re: plotting graphics for web pages [message #60496 is a reply to message #60248] |
Tue, 20 May 2008 13:59  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> pgrigis@gmail.com writes:
>
>> I should have specified that this is an integer number
>> specifying the width in pixel. Try 600, 800 or 1024.
>> If you give one number, it is the xsize,
>> and ysize is scaled automatically. Otherwise, you can
>> also specify something like 800x600
>
> The command line I tried is this:
>
> convert -density 300 file.ps -resize 25% file.png
>
> This gave me a PNG file of the size I was looking for.
> Again, it is higher resolution, but is larger in size.
> I've included all three files now in the article.
> The first file is 15K, the second is 79K, and the
> third, with the command above, is 162K. Still not
> bad, but it is eating disk space as we speak. :-)
>
> http://www.dfanning.com/graphics_tips/weboutput.html
Very nice! I've never used the density option in IM - all the numbers in the third plot
are readable.
Schweet.
cheers,
paulv
|
|
|
Re: plotting graphics for web pages [message #60498 is a reply to message #60248] |
Tue, 20 May 2008 13:48  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
David Fanning wrote:
> pgrigis@gmail.com writes:
>
>> I should have specified that this is an integer number
>> specifying the width in pixel. Try 600, 800 or 1024.
>> If you give one number, it is the xsize,
>> and ysize is scaled automatically. Otherwise, you can
>> also specify something like 800x600
>
> The command line I tried is this:
>
> convert -density 300 file.ps -resize 25% file.png
>
> This gave me a PNG file of the size I was looking for.
> Again, it is higher resolution, but is larger in size.
> I've included all three files now in the article.
> The first file is 15K, the second is 79K, and the
> third, with the command above, is 162K. Still not
> bad, but it is eating disk space as we speak. :-)
I'd suggest buying a few seagate or maxtor stocks
and stop worrying ;-)
Cheers,
Paolo
>
> http://www.dfanning.com/graphics_tips/weboutput.html
>
> 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: plotting graphics for web pages [message #60499 is a reply to message #60248] |
Tue, 20 May 2008 13:29  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pgrigis@gmail.com writes:
> I should have specified that this is an integer number
> specifying the width in pixel. Try 600, 800 or 1024.
> If you give one number, it is the xsize,
> and ysize is scaled automatically. Otherwise, you can
> also specify something like 800x600
The command line I tried is this:
convert -density 300 file.ps -resize 25% file.png
This gave me a PNG file of the size I was looking for.
Again, it is higher resolution, but is larger in size.
I've included all three files now in the article.
The first file is 15K, the second is 79K, and the
third, with the command above, is 162K. Still not
bad, but it is eating disk space as we speak. :-)
http://www.dfanning.com/graphics_tips/weboutput.html
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: plotting graphics for web pages [message #60500 is a reply to message #60248] |
Tue, 20 May 2008 13:15  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
pgri...@gmail.com wrote:
> David Fanning wrote:
>> pgrigis@gmail.com writes:
>>
>>> In any case, maybe this is a good time to point out that if one
>>> want a high resolution png image from the ps file, one should use
>>>
>>> convert -density 300 file.ps -resize npixel file.png
>>>
>>> To see why this is needed, convert any ps file with, say, 6 plots
>>> on it with & without the density option...
>>
>> Paolo,
>>
See also:
http://www.imagemagick.org/script/command-line-options.php#r esize
Paolo
> I should have specified that this is an integer number
> specifying the width in pixel. Try 600, 800 or 1024.
> If you give one number, it is the xsize,
> and ysize is scaled automatically. Otherwise, you can
> also specify something like 800x600
>
> Ciao,
> Paolo
>
>
>> The npixel seems to be causing me grief. I presume this
>> is suppose to be some kind of number. What number did you
>> have in mind?
>>
>> 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: plotting graphics for web pages [message #60501 is a reply to message #60248] |
Tue, 20 May 2008 13:14  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
David Fanning wrote:
> pgrigis@gmail.com writes:
>
>> In any case, maybe this is a good time to point out that if one
>> want a high resolution png image from the ps file, one should use
>>
>> convert -density 300 file.ps -resize npixel file.png
>>
>> To see why this is needed, convert any ps file with, say, 6 plots
>> on it with & without the density option...
>
> Paolo,
>
I should have specified that this is an integer number
specifying the width in pixel. Try 600, 800 or 1024.
If you give one number, it is the xsize,
and ysize is scaled automatically. Otherwise, you can
also specify something like 800x600
Ciao,
Paolo
> The npixel seems to be causing me grief. I presume this
> is suppose to be some kind of number. What number did you
> have in mind?
>
> 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: plotting graphics for web pages [message #60502 is a reply to message #60248] |
Tue, 20 May 2008 13:09  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pgrigis@gmail.com writes:
> In any case, maybe this is a good time to point out that if one
> want a high resolution png image from the ps file, one should use
>
> convert -density 300 file.ps -resize npixel file.png
>
> To see why this is needed, convert any ps file with, say, 6 plots
> on it with & without the density option...
Paolo,
The npixel seems to be causing me grief. I presume this
is suppose to be some kind of number. What number did you
have in mind?
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: plotting graphics for web pages [message #60503 is a reply to message #60248] |
Tue, 20 May 2008 13:02  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> Unavoidable sometimes, I agree.
I find it's usually related to how long it's been since
you last visited the optometrist. :-(
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: plotting graphics for web pages [message #60504 is a reply to message #60248] |
Tue, 20 May 2008 12:52  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> pgrigis@gmail.com writes:
>
>> Nice, but I'll argue that you should make the font size of the contour
>> & colorbar
>> label 30-50% bigger. As a matter of fact, it is hard to discern
>> whether
>> the first contour is 256 or 268 or something like that from the
>> converted
>> image (while this is clearly readable in the Hershey font version).
>
> Easily configurable in the program. Paul and I have different
> ideas about font size. This is something of a compromise. :-)
My simple-minded approach to font sizes for web/ppt graphics is that if people can't read
it clearly, then it's too small. I'm sure there's some sort of Graphic Design Golden Rule
of ratios of font sizes that make things appear more aesthetically pleasing, but one
doesn't like to see people leaning forward in their seats to read graphics (be they
looking at their screen or a ppt presenation containing graphics.)
Unavoidable sometimes, I agree.
cheers,
paulv
|
|
|
Re: plotting graphics for web pages [message #60505 is a reply to message #60248] |
Tue, 20 May 2008 12:48  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
David Fanning wrote:
> pgrigis@gmail.com writes:
>
>> Nice, but I'll argue that you should make the font size of the contour
>> & colorbar
>> label 30-50% bigger. As a matter of fact, it is hard to discern
>> whether
>> the first contour is 256 or 268 or something like that from the
>> converted
>> image (while this is clearly readable in the Hershey font version).
Don't we all love google-groups line wrapping ;-)
>
> Easily configurable in the program. Paul and I have different
> ideas about font size. This is something of a compromise. :-)
In any case, maybe this is a good time to point out that if one
want a high resolution png image from the ps file, one should use
convert -density 300 file.ps -resize npixel file.png
To see why this is needed, convert any ps file with, say, 6 plots
on it with & without the density option...
Ciao,
Paolo
>
> 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: plotting graphics for web pages [message #60506 is a reply to message #60248] |
Tue, 20 May 2008 12:45  |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
Thanks everyone for this great discussion. I also will not use tvread
again (ok, that's a lie but... I'm lazy). I want to point out to
those of us on macs that the build in ps converter does a better job
than imagemagick. Sure you have to double click on the ps files but
it does look better.
Cheers,
Brian
------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
http://people.bu.edu/balarsen/Home/IDL
|
|
|
Re: plotting graphics for web pages [message #60508 is a reply to message #60248] |
Tue, 20 May 2008 12:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
pgrigis@gmail.com writes:
> Nice, but I'll argue that you should make the font size of the contour
> & colorbar
> label 30-50% bigger. As a matter of fact, it is hard to discern
> whether
> the first contour is 256 or 268 or something like that from the
> converted
> image (while this is clearly readable in the Hershey font version).
Easily configurable in the program. Paul and I have different
ideas about font size. This is something of a compromise. :-)
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: plotting graphics for web pages [message #60509 is a reply to message #60248] |
Tue, 20 May 2008 12:24  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
David Fanning wrote:
> Paul van Delst writes:
>
>> I assume you're pulling my whizzer here since I know I don't do anything that isn't
>> already known. Maybe it's just a convention thing on my part?
>
> Despite the fact that Paul thinks everyone knows how to produce
> IDL output for display on the Web and in Powerpoint slides, *I*
> didn't know it. So, as is my practice, I wrote it down so I
> won't forget it.
>
> Actually, I was slightly more ambitious than that, since I
> also wrote a couple of new programs for the Coyote Library
> while I was about it to make this even easier to accomplish.
> (I need lots of graphics for my web page, so I figured an
> up-front investment now would save me lots of time later.)
>
> In particular, I wrote my own version of Liam's wonderful
> programs PSON and PSOFF, called PS_START and PS_END because
> I am inordinately fond of PSConfig and hate to give that
> up. (One of the nicest programs I ever wrote, if you don't
> look at the code. And, incidentally, I found a bug in that
> code--after all these years!!--so if you want to use the
> new routines, you will also need a new version of
> fsc_psconfig__define.pro. I'd get the whole damn library,
> since there have been a ton of changes in the past week or
> so.)
>
> One feature of PS_END that you wont' find in PSOFF is
> the ability to immediately convert IDL PostScript output
> to JPEG, PNG, or TIFF output, simply by setting the
> appropriate keyword. (Although I expect to see this
> functionality in PSOFF by the end of the day. :-)
>
> In any case, if you want to have a look at the article,
> you can find it here:
>
> http://www.dfanning.com/graphics_tips/weboutput.html
>
> It has rather dramatic pictures, I think, of what normal
> PNG file output looks like, and the same output converted
> with ImageMagick. Clearly, there is no possible way I am
> ever returning to TVREAD. :-(
Nice, but I'll argue that you should make the font size of the contour
& colorbar
label 30-50% bigger. As a matter of fact, it is hard to discern
whether
the first contour is 256 or 268 or something like that from the
converted
image (while this is clearly readable in the Hershey font version).
Ciao,
Paolo
>
> 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: plotting graphics for web pages [message #60511 is a reply to message #60337] |
Tue, 20 May 2008 11:29  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> I assume you're pulling my whizzer here since I know I don't do anything that isn't
> already known. Maybe it's just a convention thing on my part?
Despite the fact that Paul thinks everyone knows how to produce
IDL output for display on the Web and in Powerpoint slides, *I*
didn't know it. So, as is my practice, I wrote it down so I
won't forget it.
Actually, I was slightly more ambitious than that, since I
also wrote a couple of new programs for the Coyote Library
while I was about it to make this even easier to accomplish.
(I need lots of graphics for my web page, so I figured an
up-front investment now would save me lots of time later.)
In particular, I wrote my own version of Liam's wonderful
programs PSON and PSOFF, called PS_START and PS_END because
I am inordinately fond of PSConfig and hate to give that
up. (One of the nicest programs I ever wrote, if you don't
look at the code. And, incidentally, I found a bug in that
code--after all these years!!--so if you want to use the
new routines, you will also need a new version of
fsc_psconfig__define.pro. I'd get the whole damn library,
since there have been a ton of changes in the past week or
so.)
One feature of PS_END that you wont' find in PSOFF is
the ability to immediately convert IDL PostScript output
to JPEG, PNG, or TIFF output, simply by setting the
appropriate keyword. (Although I expect to see this
functionality in PSOFF by the end of the day. :-)
In any case, if you want to have a look at the article,
you can find it here:
http://www.dfanning.com/graphics_tips/weboutput.html
It has rather dramatic pictures, I think, of what normal
PNG file output looks like, and the same output converted
with ImageMagick. Clearly, there is no possible way I am
ever returning to TVREAD. :-(
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: plotting graphics for web pages [message #60520 is a reply to message #60332] |
Tue, 20 May 2008 07:00  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
David Fanning wrote:
> Paul van Delst writes:
>
>> All this would be much simpler if IDL didn't change the @%$^#% charsize when multiple
>> plots are displayed. Whoever thought that little beauty up (or, at the very least, decided
>> that the user didn't need control over it) should've been tossed out on his/her earhole
>> during the pre-implementation code review.... :o)
>
> Uh, well, did you ever try this little trick:
>
> IDL> Window
> IDL> !p.MULTI=[0,3,2]
> IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
> IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
> IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
> IDL> !p.charsize=1.5
> IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
> IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
> IDL> plot, findgen(11), xtitle='Signal', Ytitle='Acquisition'
>
> Seems like that's a fairly easy way to get control over
> character size in multi-plots. ;-)
Well, yes, I realise that. My point is that, for plots where I do !p.MULTI=[0,3,2], I
would like the option to have the character size to be the *same size* as when I do
!p.MULTI=0.
I find it completely ridiculous that, *by default*, !p.charsize=1.0 means different things
depending on the value of !p.multi.
Maybe there could be a sysvar flag, e.g. !p.charize_global_fix=1, to globally fix the
charsize to some absolute value, i.e. make !p.charsize insensitive to changes in !p.multi.
For the way I display plots (of course I realise others do it differently) I think it
looks decidedly low rent when different sets of PS plots have different character sizes
simply because one contains an extra row/column of plots.
cheers,
paulv
|
|
|