Quantcast

Change Color Axis on plotyy function

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Change Color Axis on plotyy function

toutsec
Hi,
I would like to change the color of the axis on a plotyy. In default, the ylabel and yticklabel of the second graph are green and the axis himself is black.
[AX,H1,H2]=plotyy(x1,y1,x2,y2,'plot') % in order to plot the 2 sets of data
I am setting the label with this command :
set(getAX(2),'YLabel'),'String','Label 2');

This command :
set(getAX(2),'YColor'),'Color','red');
does'nt work.

Do you have any idea?
I want also to change the fontsize of the label.

Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change Color Axis on plotyy function

toutsec
With octave 3.4.0 .
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change Color Axis on plotyy function

bpabbott
Administrator
In reply to this post by toutsec
On Mar 02, 2011, at 11:36 AM, toutsec <[hidden email]> wrote:

Hi,
I would like to change the color of the axis on a plotyy. In default, the
ylabel and yticklabel of the second graph are green and the axis himself is
black.
[AX,H1,H2]=plotyy(x1,y1,x2,y2,'plot') % in order to plot the 2 sets of data
I am setting the label with this command :
set(getAX(2),'YLabel'),'String','Label 2');

This command :
set(getAX(2),'YColor'),'Color','red');
does'nt work.

Do you have any idea?
I want also to change the fontsize of the label.

Thanks!
 
"ycolor" is a property,  not an object. Try ...

    set (AX(2), "ycolor", "r")

To change the color of the ylabel ...

    set(getAX(2),'YLabel'),'String','Label 2', 'color', 'r'); 

Ben




_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change Color Axis on plotyy function

toutsec
thanks! It's work.
The eps output works fine.
Another thing :
I also use the -dpslatex output in order to include it quickly in my source.tex file.
Unfortunately, the color of the label is not keep.

Do you have an idea?
Thanks again
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Change Color Axis on plotyy function

bpabbott
Administrator
On Mar 3, 2011, at 6:13 AM, toutsec wrote:

> thanks! It's work.
> The eps output works fine.
> Another thing :
> I also use the -dpslatex output in order to include it quickly in my
> source.tex file.
> Unfortunately, the color of the label is not keep.
>
> Do you have an idea?
> Thanks again

This is a feature of how the gnuplot developers implemented the pslatex terminal.

To fix that you will need to add the color information for LaTeX yourself. To do that ...

(1) Add the line below to the top of your source.tex file

        \usepackage{color}

(2) Change the ylabel in Octave to set the color in LaTeX

        set (get (AX(2), "ylabel"), "String", "\textcolor{red}{Label 2}", "color", "r");

Essentially,  you're just changing "Label 2" to "\textcolor{red}{Label 2}"

Ben
_______________________________________________
Help-octave mailing list
[hidden email]
https://mailman.cae.wisc.edu/listinfo/help-octave
Loading...