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

51 Ansichten (letzte 30 Tage)
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 Kommentare
Adam Danz
Adam Danz am 5 Jun. 2019
I see... I actually had no idea the axes were [.15 .15 .15].

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Adam Danz
Adam Danz am 5 Jun. 2019
Bearbeitet: Adam Danz am 5 Jun. 2019
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 Kommentare
Johannes Kalliauer
Johannes Kalliauer am 28 Okt. 2019
In my case (Linux) it was in my home-directory under ~/Documents/MATLAB , on Windows it is in `%userprofile%/Documents/MATLAB`.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Jan
Jan am 5 Jun. 2019
Bearbeitet: Jan am 5 Jun. 2019
I'd try it with:
set(groot, 'DefaultAxesXColor', [0,0,0], ...
'DefaultAxesYColor', [0,0,0], ...
'DefaultAxesZColor', [0,0,0])
  3 Kommentare
Johannes Kalliauer
Johannes Kalliauer am 5 Jun. 2019
Sorry for this offtopic, but @Jan: I assume with Greasemonkey (Firefox) or Tampermonkey (Chrome) you can fix this locally on your browser.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by