I am having problems changing colors on my graphs. I haven't done a lot of work with graphic so bear with me.
This is my code:
proc sgplot data=work.s_av;
where VIMS_SPECIES_CODE=597;
series x=YEAR y=N_OBS;
refline 0 / axis=y lineattrs=(color=black);
title 'Trawl Shrimp Landings and Average Minimum Winter Temperatures'; run;
I'm not sure if it has anything to do with SAS's preset colors, but I am a little confused on all of that anyway. I've also tried using the RBG code instead of using the color words.
You question isn't very clear. Which color are you attempting to change? You have lines, markers, text, borders, backgrounds, marker outlines as a minimum that you can provide colors for.
Can you show the code that didn't "work" with other colors that you tried and what was not as desired for the output?
The code I gave was the code that didn't work. Attempting to change line color from blue to black. No matter what I do it just stays blue (or does the default colors, as I've found out).
Which line? The line you have set to black is the REFLINE not the SERIES.
You can specify colours using the hex code with a CX in front,
color=cxffffff;
I've already tried those codes and it still doesn't work.
@jswinford What colour are you trying to change?
What version of SAS do you have?
You can specify colour detail quite easily in SAS 9.4+
@jswinford wrote:
I've already tried those codes and it still doesn't work.
I suspect that you had a syntax problem. So show the actual code.
Doesn't work is awful vague.
Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.
No output? Post any log in a code box.
Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.