Set the color of the axes per default to black (instead of dark gray)?

조회 수: 36 (최근 30일)
I am using
%#!/bin/rm
clc
clear
set(groot,'DefaultFigureGraphicsSmoothing','off') %not blurry function (circles)
set(groot, 'DefaultAxesFontSmoothing', 'off'); %not blurry axes-text-labels
close all;
fig=figure;
scatter((1:20),rand(1,20),'k'); %# example from https://de.mathworks.com/help/matlab/ref/figure.html
print('-dpng','grayAxes.png');
set(gca,'XColor','k','YColor','k');
print('-dpng','blackAxes.png');
close all force; %# https://de.mathworks.com/support/bugreports/1812836
Can I set
set(gca,'XColor','k','YColor','k');
as a default for all figures ( a: for all figures in a document on every computer ; b: for all figures created on my computer)?
  댓글 수: 2
Johannes Kalliauer
Johannes Kalliauer 2019년 6월 5일
The default color is [0.15 0.15 0.15] (which looks like black, but isn't), but I want [0 0 0].
In the Atachement you find a gray zero(left) and a black zero(right).
If you don't believe it open it in a program like gimp and pick up the color.
Adam Danz
Adam Danz 2019년 6월 5일
I see... I actually had no idea the axes were [.15 .15 .15].

댓글을 달려면 로그인하십시오.

채택된 답변

Adam Danz
Adam Danz 2019년 6월 5일
편집: Adam Danz 2019년 6월 5일
Try putting this in your startup.m file
set(groot,{'DefaultAxesXColor','DefaultAxesYColor','DefaultAxesZColor'},{'k','k','k'})
Test:
axh = axes;
axh.XAxis.Color
ans =
0 0 0
  댓글 수: 3
Adam Danz
Adam Danz 2019년 6월 5일
편집: Adam Danz 2019년 6월 5일
Ha! I also try to reload prior to answering and have noticed delays. Server sync delay?
Johannes Kalliauer
Johannes Kalliauer 2019년 10월 28일
In my case (Linux) it was in my home-directory under ~/Documents/MATLAB , on Windows it is in `%userprofile%/Documents/MATLAB`.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Jan
Jan 2019년 6월 5일
편집: Jan 2019년 6월 5일
I'd try it with:
set(groot, 'DefaultAxesXColor', [0,0,0], ...
'DefaultAxesYColor', [0,0,0], ...
'DefaultAxesZColor', [0,0,0])
  댓글 수: 3
Jan
Jan 2019년 6월 5일
편집: Jan 2019년 6월 5일
Some years ago MathWorks decided to use a medium gray on light gray for the code in this forum, while the text was medium gray on white. This looked kewl and stylish, almost like the pages of Apple. Of course this reduced the readability and this is a really bad idea for a forum for discussions about a programming language. A similar decision is to let 5/8th of the scree width blank. This might look more fancy, but reducing the information density is a bad idea and massive scrolling is one of the most tedious jobs I do, when I write in this forum.
I assume, that some designers thought, that gray looks smarter. Setting the default colors back to black in matlabrc.m or startup.m was the first thing I did.
Johannes Kalliauer
Johannes Kalliauer 2019년 6월 5일
Sorry for this offtopic, but @Jan: I assume with Greasemonkey (Firefox) or Tampermonkey (Chrome) you can fix this locally on your browser.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by