フィルターのクリア

Setting default BoxChart property values

1 回表示 (過去 30 日間)
Ingvi Örnolfsson
Ingvi Örnolfsson 2022 年 11 月 10 日
コメント済み: Ingvi Örnolfsson 2022 年 11 月 17 日
I am trying to set default values for properties BoxChart objects.
As an example, I tried the following:
set(groot,'defaultBoxChartBoxWidth',0.7)
Error using matlab.ui.Root/set
boxchartboxwidth is an invalid class name
which does not work. On further inspection, it seems that 'BoxChart' is not recognized as a class:
get(groot,'defaultBoxChart')
This returns:
Error using matlab.ui.Root/get
boxchart is an invalid class name
This is working fine for other graphics objects, like 'Line' and 'Scatter', but not for 'BoxChart'.
What is the correct way to set default property values for BoxChart objects?

回答 (1 件)

Vinayak
Vinayak 2022 年 11 月 17 日
You can use the dot notation to control the appearance and behaviour of a boxchart object.
for example:-
b = boxchart(rand(10,1));
b.BoxWidth = 0.8
You may refer to the following documentation link to learn more on how to set custom Block properties
https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.boxchart-properties.html
  1 件のコメント
Ingvi Örnolfsson
Ingvi Örnolfsson 2022 年 11 月 17 日
I am aware of this. My question is about setting the default parameters of BoxChart, such that all future boxchart objects will have the specified boxwidth without having to set it every time.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraphics Object Properties についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by