How to change the standard of coloring figures
19 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I would like to have matlab giving my plots in b balck and white and using different styles of dotted and dashed lines instead on the standard way of differing plots with color.
This would make it much easier when you export the figure for an article.
guess there must be a way to set this up in MATLAB.
thanks,
0 Commenti
Risposte (3)
Jan
il 3 Nov 2011
figure('DefaultAxesColorOrder', [0 0 0; 0.4, 0.4, 0.4; 0.7, 0.7, 0.7], ...
'DefaultAxesLineStyleOrder', '-|:|.-');
plot(bsxfun(@plus, rand(100, 16), 1:16)); % Test data
I've omitted the '--' style, because it looks confusing sometimes.
You can set the color style as default for all new figures also:
set(0, 'DefaultAxesColorOrder', ...)
To reset it after creating the black and white diagrams:
set(0, 'DefaultAxesColorOrder', 'factory')
I prefer markers in BW diagrams with more than 4 different lines. For a line with 100 points it looks ugly when 100 markers appear. Therefore I've written a LineWithMarkers function, which adds only 10 markers per line. In addition The X-locations of the markers are shifted horizontally to reduce the overlap between the markers.
1 Commento
Patrick Kalita
il 3 Nov 2011
And if you want these defaults to apply for all figures in every MATLAB session, you can add the set(0, 'Default.. calls to a startup.m file (http://www.mathworks.com/help/techdoc/ref/startup.html).
Fangjun Jiang
il 3 Nov 2011
Function plot() allows you to specify the line color, marker and line style. You'll just need to specify the color as black ('k') all the time. To set the background color as white, use set().
f=figure(1);
set(f,'color',[1 1 1]);
plot(magic(10),'k');
grid on;
0 Commenti
Vedere anche
Categorie
Scopri di più su Graphics Object Identification in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!