Re: Customizing linestyles for PLOT? [message #38543] |
Tue, 16 March 2004 13:35 |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Mark Hadfield wrote:
> Liam Gumley wrote:
>
>> One of my colleagues was just expressing his frustration at the
>> limitations
>> of the plotting linestyles available in IDL direct graphics. He likes to
>> plot absorption/emission spectra, and apparently the default linestyles
>> don't work well. For example, he would like to have dashed lines with
>> long
>> dashes and small gaps, and be able to adjust the lengths of the dashes
>> and
>> gaps. Before I tell him to write a wrapper for PLOT, I was wondering if
>> anyone has tackled this problem already.
>
>
> I'm sure you're aware of this already, but the Object Graphics LINESTYLE
> property supports user-defined stippling patterns. I was a little
> surprised just now to find that no such thing is mentioned in the Direct
> Graphics documentation.
>
> I do most of my line plots in Object Graphics. It's not *that* painful.
>
>
Hello,
What about resampling the data on a regular grid with finer spacing than
the original data has. Then create a CONTINUE vector to use with PLOTS;
make continue = 1 where line should look like a dash and continue = 0
for the gaps. Finally, loop through the resampled data using PLOTS with
the CONTINUE keyword.
The following uses David Fanning LoadData program and doesn't show the
resampling sampling step, but you might get the idea.
IDL> y = LoadData(17)
IDL> continue = Replicate(1B, 101)
IDL> for i = 0, 100, 5 do continue[i] = 0B
IDL> plot, y,/noData
IDL> for i = 0, 100 do PlotS, i, y[i], continue = continue[i], psym =
-3,/data
I didn't do the resampling bit, because I could not think how to (1)
preserve the original data and (2) interpolated faithfully between the
data points. I'm sure there is a away to use INTERPOL to do this quickly.
Ben
|
|
|
Re: Customizing linestyles for PLOT? [message #38546 is a reply to message #38543] |
Tue, 16 March 2004 12:51  |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
Liam Gumley wrote:
> One of my colleagues was just expressing his frustration at the limitations
> of the plotting linestyles available in IDL direct graphics. He likes to
> plot absorption/emission spectra, and apparently the default linestyles
> don't work well. For example, he would like to have dashed lines with long
> dashes and small gaps, and be able to adjust the lengths of the dashes and
> gaps. Before I tell him to write a wrapper for PLOT, I was wondering if
> anyone has tackled this problem already.
I'm sure you're aware of this already, but the Object Graphics LINESTYLE
property supports user-defined stippling patterns. I was a little
surprised just now to find that no such thing is mentioned in the Direct
Graphics documentation.
I do most of my line plots in Object Graphics. It's not *that* painful.
--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
|
|
|