Save MATLAB figure with different background color

 I want to print a MATLAB figure with a dark background and white labels. If I use the print or saveas command I lose somehow the colors. The plot symbols are dark again and the background is white. 

  points = rand(100,3);

plot3(points(:,1),points(:,2),points(:,3),'*w')
grid on
set(gca,'Color',[0.5 0.5 0.5])
saveas(gcf,'test1','pdf')
saveas(gcf,'test2','png')
print(gcf,'test3.pdf','-dpdf')

All three test files end up being wrong. If I choose "Save As" in the figure menu I am able to save the figure correctly.

Any ideas how to resolve the issue?   

NOTE:-


Matlabhelpers.com provide latest MatLab Homework Help,MatLab Assignment Help , SIMULINK APPLICATIONS HELP  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.    

Answer:  

To keep the background a 
 
SEE COMPLETE ANSWER CLICK THE LINK  

Comments

Popular posts from this blog

Why do I get a "Too many input arguments" error when not passing any?

How is full convolution performed using MATLAB's conv2 function?

Why Red, Green, Blue channels of image separetely are grayscaled (Matlab)?