Re: How to color ALL the axis elements?

Ethan A Merritt <[email protected]> Sun, 15 Jun 2025 21:26:54 -0700
Newsgroups gmane.comp.graphics.gnuplot.devel
Organization University of Washington
Message-ID <3290168.5fSG56mABF@stonelion>
On Sunday, 15 June 2025 10:45:54 PDT Dima Kogan wrote:
> 
> I've a question/feature request. I often plot stuff against the
> non-default axes, and it's really helpful to make it visually clear
> which axes the different parts of the plot reference.
> 
> Something like this works:
> 
>   set ylabel "line"      textcolor linetype 1
>   set ytics              textcolor linetype 1
>   set y2label "parabola" textcolor linetype 2
>   set y2tics             textcolor linetype 2
> 
>   plot x   with lines, \
>        x*x with lines axis x1y2
> 
> So I plotted two things with different colors, and I want to color the
> axes with the appropriate colors too. Each axis has 4 things that I'd
> want to color, but here only two of those are colored; it's not clear if
> gnuplot can do the other two:
> 
> - The axis label text. I can color this
> - The tic label text. I can color that too
> - The tics themselves. I can NOT color that, and I don't see anything in
>   the docs about doing it. "set ytics textcolor" probably should control
>   those too?
> 
> - The axis line itself. This is a part of "set border". We can set the
>   color of the whole thing, but not of its separate elements, right?

Correct.

> Can we fix this?

My personal opinion is that this is not something you should do.
It makes the plot really ugly and (again IMO) distracts from the data,
which is where the focus of attention should be.
And what color would you make the x axis?

If for some reason you really need to do this, I would say it's one of the
rare cases where using multiplot to superimpose two plots is the
preferred answer.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    set margins screen 0.1, screen 0.9
    unset key

    set multiplot
      unset tics; set ytics nomirror
      set border 2 lt 1
      set xzeroaxis
      plot x with lines lt 1

      unset tics; set y2tics nomirror
      set border 8 lt 2
      plot x*x with lines axes x1y2 lt 2

      unset tics; set xtics axis -8,2,8
      set border 0 lt black
      plot 0 lc "black" notitle
   unset multiplot
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

> What kind of patch would be acceptable here?

> Also, it'd be real nice if there was ONE command to set the color of ALL
> the axis elements together.
> 
> Thanks
> 

      Ethan





_______________________________________________
gnuplot-beta mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta