|
From: Christoph B. <us...@be...> - 2013-07-25 13:36:09
|
Hi, I was wondering, why using linestyles is not allowed for object borders. The following is not allowed: set object circle at 0,0 radius 1 fs empty border ls 1 I wanted to ask before I try to come up with a patch ;-) Christoph |
|
From: sfeam (E. Merritt) <eam...@gm...> - 2013-07-25 16:44:53
|
On Thursday, 25 July 2013, Christoph Bersch wrote:
> Hi,
>
> I was wondering, why using linestyles is not allowed for object borders.
> The following is not allowed:
>
> set object circle at 0,0 radius 1 fs empty border ls 1
Insufficient imagination at the time fillstyles were implemented :-)
The relevant structure is in term_api.h
typedef struct fill_style_type {
int fillstyle;
int filldensity;
int fillpattern;
t_colorspec border_color;
} fill_style_type;
You can see the only information held for the border is a color,
not a full line type or style.
If we're ever going to change that, right now during the long
run-up to version 5 is a good time. A quick "grep border_color *.c"
suggests there are at least 35 sites in the code that would be affected.
On the other hand, so far as I can think of there is a perfectly
adequate work-around already available - you can plot the
object or graph twice, once describing the fill and a second
time describing the outline. Have I missed a case where this
is not possible?
Ethan
> I wanted to ask before I try to come up with a patch ;-)
>
> Christoph
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> gnuplot-beta mailing list
> gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
|
|
From: Christoph B. <us...@be...> - 2013-07-25 19:35:22
|
Hi, Am 25.07.2013 18:44, schrieb sfeam (Ethan Merritt): > On Thursday, 25 July 2013, Christoph Bersch wrote: >> >> I was wondering, why using linestyles is not allowed for object borders. > > On the other hand, so far as I can think of there is a perfectly > adequate work-around already available - you can plot the > object or graph twice, once describing the fill and a second > time describing the outline. Have I missed a case where this > is not possible? I don't know, what you mean. In any case specifying a line style is not possible for an object, right? I think, dashed object borders are not possible. It is not, that I urgently need dashed circles, but although I work a lot with gnuplot, I continue struggling with the different handling of some options. And this is one of them :-) Christoph |
|
From: Ethan A M. <sf...@us...> - 2013-07-25 20:16:46
Attachments:
dash+fill.dem
dash+fill.pdf
|
On Thursday, July 25, 2013 12:35:09 pm Christoph Bersch wrote:
> Hi,
>
> Am 25.07.2013 18:44, schrieb sfeam (Ethan Merritt):
> > On Thursday, 25 July 2013, Christoph Bersch wrote:
> >>
> >> I was wondering, why using linestyles is not allowed for object borders.
> >
> > On the other hand, so far as I can think of there is a perfectly
> > adequate work-around already available - you can plot the
> > object or graph twice, once describing the fill and a second
> > time describing the outline. Have I missed a case where this
> > is not possible?
>
> I don't know, what you mean. In any case specifying a line style is not
> possible for an object, right?
>
> I think, dashed object borders are not possible.
See attached demo and output.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set term pdfcairo dash dashlength 2
set output 'dash+fill.pdf'
set key box opaque
set title "Plain circles with dash linetype"
plot 'candlesticks.dat' using 1:2:(1) with circles lt 2
set title "Filled circles"
plot 'candlesticks.dat' using 1:2:(1) with circles fs solid fc rgb "yellow"
set title "Both at once"
plot 'candlesticks.dat' using 1:2:(1) with circles fs solid fc rgb "yellow", \
'' using 1:2:(1) with circles lt 2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Ethan
>
> It is not, that I urgently need dashed circles, but although I work a
> lot with gnuplot, I continue struggling with the different handling of
> some options. And this is one of them :-)
>
> Christoph
|
|
From: Christoph B. <us...@be...> - 2013-07-26 10:42:29
Attachments:
bandstructure.gp
bandstructure.pdf
|
Am 25.07.2013 22:09, schrieb Ethan A Merritt: > On Thursday, July 25, 2013 12:35:09 pm Christoph Bersch wrote: >> >> I think, dashed object borders are not possible. > > See attached demo and output. Ok, I see. But it does not work for 'set object', which is what I use frequently. And I cannot plot "with circles" to circumvent this, because the points lie on the plot border, and the circles are clipped. See the attached example and the result which shows my usecase. This is also where my last patches come into play. http://sourceforge.net/p/gnuplot/patches/631/ http://sourceforge.net/p/gnuplot/patches/628/ (I'm improving this at the moment) Christoph |
|
From: Ethan A M. <sf...@us...> - 2013-07-26 16:51:06
|
On Friday, July 26, 2013 03:42:14 am Christoph Bersch wrote:
> Am 25.07.2013 22:09, schrieb Ethan A Merritt:
> > On Thursday, July 25, 2013 12:35:09 pm Christoph Bersch wrote:
> >>
> >> I think, dashed object borders are not possible.
> >
> > See attached demo and output.
>
> Ok, I see. But it does not work for 'set object', which is what I use
> frequently.
Thanks for the example.
I think there are 2 or 3 factors contributing to the problem.
A satisfactory fix may require changing more than one thing.
Let me summarize how things currently work:
1) When you create a new "set object ..." the linetype for drawing that
object is set to LT_DEFAULT and the fill style is set to FS_DEFAULT.
A previously created object can be returned to this state by saying
"set object N default"
2) If you set an explicit fill color either at the time of creation or
later, this has the side effect of resetting LT_DEFAULT to (-1).
There was a reason for doing this back when only a few terminals
supported RGB color, but I think it is no longer necessary.
Changing this may be part of the solution to your problem.
3) Later on when the object is actually drawn, if the object line type
is still LT_DEFAULT this is replaced by the linetype of the current
plot. If the object is not part of a plot, then instead it is
replaced by the linetype of the fill style border.
Steps (1) and (2) are implemented in the routine set_obj().
Step (3) happens in various places during plotting; they may not all
act identically so this is an area possible bugs or inconsistency.
I agree that the current behavior is not entirely satisfactory.
If you want to experiment with changing it, I suggest trying some
combination of
- Removing or changing step (2) above. It is line 4052 in set.c
this_object->lp_properties.l_type = LT_BLACK; /* Anything but LT_DEFAULT */
- Adding an explicit option "set object ... {linetype N}"
or even "set object ... {dashtype N}"
This would effectively become a step (1A) in set_obj()
- Rethinking when or if the "border" property of a fill style is applied.
For example, should it apply to fillstyle "empty"?
This is currently treated as a special case in several places.
- [your original proposal] re-interpreting the "border" property as a
line type or line style rather than as a color. One problem with this
is that there would then be _two_ line types attached to each object,
one in the top level structure object->lp_properties and a second in
object->fillstyle->border_lt (doesn't currently exist).
Which one is used under what conditions?
I suspect any changes will have unforseen side effects, but that's life :-)
Ethan
|