|
From: Ethan A M. <eam...@gm...> - 2018-08-13 15:47:23
|
On Monday, 13 August 2018 16:22:20 theozh wrote: > How can I put several labels with different label background colors or box frames? > I'm using gnuplot 5.2rc4 > > After painful placing colored rectangle objects behind label text, I found the "set style textbox" option. However, I haven't found how to place different styles within one plot. Development on the textbox style options kind of stalled because it is very hard to produce equivalent behaviour across all the various terminal types. That is why it is documented as an "experimental" option. textbox properties that either exist only conceptually or for only a few terminals: - control over the margin sizes - rotated box around rotated text - fill color - multiple textbox styles, to support "set label ... boxed [boxstyle N]" You are asking about that last item, but it does not exist yet. As I say, the main roadblock is that even the existing options have not been implemented on terminals gd lua pslatex x11 canvas svg It is particularly annoying that so far as I can tell there is nothing in the svg standard that would allow drawing boxed text. So we may never be able to support svg output of boxed labels, except maybe indirectly via conversion from the qt or cairo terminals to a dumped svg file. Ethan > The below example should create a red and green box but creates two green boxes. Apparently, the last style is applied to all textboxes. > Can several textbox styles 1,2,3,... be defined? Like linetype, linecolor, etc.? > > ### different label background styles within one plot??? > reset > unset label > unset object > > set label 1 "This is some text" at graph 0.1, 0.7 > > set style textbox opaque border lc rgb "black" lw 1 fc rgb "red" > set label 2 "Some text with red background" at graph 0.1, 0.6 boxed front > > set style textbox opaque noborder lw 1 fc rgb "green" > set label 3 "Some text with green background" at graph 0.1, 0.5 boxed front > > plot 10*sin(x), 10*cos(x) > ### end code |