You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Adjust the width of the black line in bubblelegend
51 views (last 30 days)
Show older comments
In the example below, I would like to increase the thickness of the black line that connects the number "88" to the number "486."
x = 1:10;
y = exp(-0.5*x) + .05 * randn(1,10);
sz = randi([20 500],[1,10]);
bubblechart(x,y,sz)
bubblelegend('Population')

4 Comments
Dyuman Joshi
on 9 Dec 2025 at 16:05
There doesn't seem to be any property of the scale line in the bubblelegend object, which can be modified.
Sim
on 9 Dec 2025 at 16:35
Edited: Sim
on 9 Dec 2025 at 16:35
Thanks for your comment @Dyuman Joshi! ...I was checking the same properties and I did not find anything yet... maybe, I might ask to the @MathWorks Support Team if they might know some trick... :-)
DGM
on 10 Dec 2025 at 16:54
Edited: DGM
on 10 Dec 2025 at 16:55
Well, those properties do exist, but you're prevented from acessing them.
x = 1:10;
y = exp(-0.5*x) + .05 * randn(1,10);
sz = randi([20 500],[1,10]);
bubblechart(x,y,sz)
hl = bubblelegend('Population');

struct(hl) % there are axle width properties and a (linestrip) axle object available
Warning: Calling STRUCT on an object prevents the object from hiding its implementation details and should thus be avoided. Use DISP or DISPLAY to see the visible public details of an object. See 'help struct' for more information.
Warning: The EraseMode property is no longer supported and will error in a future release.
ans = struct with fields:
NumBubbles: 3
NumBubblesMode: 'manual'
NumBubbles_I: 3
Style: 'vertical'
StyleMode: 'manual'
Style_I: 'vertical'
BubbleSizeOrder: 'descending'
BubbleSizeOrderMode: 'manual'
BubbleSizeOrder_I: 'descending'
LimitLabels: {3×1 cell}
LimitLabelsMode: 'auto'
LimitLabels_I: {3×1 cell}
Padding: 8
AxleWidth: 5
AxlePadding: 5
AxleIsUsed: 1
BubbleSizes: [50 40 10]
BubbleColor: [0 0 0]
Location: 'northeast'
LocationMode: 'auto'
Location_I: 'northeast'
NeutralColor: [0.4000 0.4000 0.4000]
DefaultBubbleLineWidth: 0.5000
BubbleLineWidth: 0.5000
BubbleEdgeColor: [0 0 0]
BubbleAlpha: 1
PrintSettingsCache: [1×1 struct]
BubbleContainer: [1×1 Marker]
BubbleContainerMode: 'auto'
BubbleContainer_I: [1×1 Marker]
Axle: [1×1 LineStrip]
Bubbles: [1×1 Marker]
LabelBig: [1×1 Text]
LabelMedium: [1×1 Text]
LabelSmall: [1×1 Text]
Camera: [1×1 Camera2D]
CameraMode: 'auto'
Camera_I: [1×1 Camera2D]
DataSpace: [1×1 UniformCartesianDataSpace]
DataSpaceMode: 'auto'
DataSpace_I: [1×1 UniformCartesianDataSpace]
ColorSpace: [1×1 MapColorSpace]
ColorSpaceMode: 'auto'
ColorSpace_I: [1×1 MapColorSpace]
DecorationContainer: [1×1 Group]
DecorationContainerMode: 'auto'
DecorationContainer_I: [1×1 Group]
BoxEdge: [1×1 LineLoop]
BoxEdgeMode: 'auto'
BoxEdge_I: [1×1 LineLoop]
BoxFace: [1×1 Quadrilateral]
BoxFaceMode: 'auto'
BoxFace_I: [1×1 Quadrilateral]
Title: [1×1 Text]
TitleMode: 'auto'
Title_I: [1×1 Text]
SelectionHandle: [1×1 ListOfPointsHighlight]
SelectionHandleMode: 'auto'
SelectionHandle_I: [1×1 ListOfPointsHighlight]
TitleSeparator: [1×1 LineStrip]
TitleSeparatorMode: 'auto'
TitleSeparator_I: [1×1 LineStrip]
Axes: [1×1 Axes]
AxesMode: 'manual'
Axes_I: [1×1 Axes]
AxesListenerList: [1×5 event.listener]
AxesListenerListMode: 'manual'
AxesListenerList_I: [1×5 event.listener]
Box: on
BoxMode: 'auto'
Box_I: on
Color: [1 1 1]
ColorMode: 'auto'
Color_I: [1 1 1]
EdgeColor: [0.1294 0.1294 0.1294]
EdgeColorMode: 'auto'
EdgeColor_I: [0.1294 0.1294 0.1294]
FontName: 'Helvetica'
FontNameMode: 'auto'
FontName_I: 'Helvetica'
FontSize: 9
FontSizeMode: 'auto'
FontSize_I: 9
FontUnits: 'points'
FontUnitsMode: 'auto'
FontUnits_I: 'points'
FontAngle: 'normal'
FontAngleMode: 'auto'
FontAngle_I: 'normal'
FontWeight: 'normal'
FontWeightMode: 'auto'
FontWeight_I: 'normal'
Interpreter: 'tex'
InterpreterMode: 'auto'
Interpreter_I: 'tex'
InitPositionCache: 1
WindowMouseReleaseListener: [0×0 event.listener]
WindowMouseReleaseListenerMode: 'auto'
WindowMouseReleaseListener_I: [0×0 event.listener]
LineWidth: 0.5000
LineWidthMode: 'auto'
LineWidth_I: 0.5000
Orientation: 'vertical'
OrientationMode: 'auto'
Orientation_I: 'vertical'
PlotChildren: [1×1 BubbleChart]
PlotChildrenMode: 'auto'
PlotChildren_I: [1×1 BubbleChart]
Height: 0.4448
HeightMode: 'auto'
Height_I: 0.4448
Width: 0.2384
WidthMode: 'auto'
Width_I: 0.2384
Position: [0.6471 0.4550 0.2384 0.4448]
PositionMode: 'auto'
Position_I: [0.6471 0.4550 0.2384 0.4448]
SPosition: []
PositionCache: []
ParentSizeChangedListener: [0×0 event.listener]
PrintAlphaSupported: 1
PrintAlphaSupportedMode: 'auto'
PrintAlphaSupported_I: 1
PreventLegendResizePrintingPosition: []
SelfListenerList: [0×0 event.listener]
SelfListenerListMode: 'auto'
SelfListenerList_I: [0×0 event.listener]
TextColor: [0.1294 0.1294 0.1294]
TextColorMode: 'auto'
TextColor_I: [0.1294 0.1294 0.1294]
Units: 'normalized'
UnitsMode: 'auto'
Units_I: 'normalized'
standalone: off
standaloneMode: 'auto'
standalone_I: off
ChildrenMode: 'auto'
Children_I: [0×0 GraphicsPlaceholder]
Children: [0×0 GraphicsPlaceholder]
SerializableChildren: [0×0 GraphicsPlaceholder]
Description: ''
DescriptionMode: 'auto'
Description_I: ''
Parent: [1×1 Figure]
ParentMode: 'manual'
Parent_I: [1×1 Figure]
Visible: on
VisibleMode: 'auto'
Visible_I: on
Serializable: on
SerializableMode: 'auto'
Serializable_I: on
HandleVisibility: 'on'
HandleVisibilityMode: 'auto'
HandleVisibility_I: 'on'
ErrorCallback: ''
ErrorCallbackMode: 'auto'
ErrorCallback_I: ''
Internal: 0
ApplicationData: [1×1 struct]
SerializableApplicationData: [1×1 struct]
DefaultPropMap_Internal: [0×0 struct]
Copyable: 1
NodeParent: [1×1 AxesLayoutManager]
NodeChildren: [1×1 Camera2D]
CustomThemePropertyMappings: [1×1 struct]
HG1Erase: 'normal'
HG1EraseMode: 'auto'
HG1Erase_I: 'normal'
EraseMode: 'normal'
Behavior: [1×1 struct]
BehaviorMode: 'auto'
Behavior_I: [1×1 struct]
HelpTopicKey: ''
HelpTopicKeyMode: 'auto'
HelpTopicKey_I: ''
SerializableBehavior: [1×1 struct]
ButtonDownFcnMode: 'auto'
ButtonDownFcn_I: ''
ButtonDownFcn: ''
ButtonDownFcn_IS: ''
SerializableUIContextMenu: [0×0 GraphicsPlaceholder]
ContextMenu: [0×0 GraphicsPlaceholder]
UIContextMenu: [0×0 GraphicsPlaceholder]
TopLevelSerializedObject: on
BusyAction: 'queue'
BeingDeleted: off
Interruptible: on
CreateFcnMode: 'auto'
CreateFcn_I: ''
CreateFcn: ''
CreateFcn_IS: ''
DeleteFcnMode: 'auto'
DeleteFcn_I: ''
DeleteFcn: ''
DeleteFcn_IS: ''
Type: 'bubblelegend'
TagMode: 'auto'
Tag_I: ''
Tag: ''
UserData: []
SerializableUserData: []
Selected: off
SelectedMode: 'auto'
Selected_I: off
SelectionHighlight: on
SelectionHighlightMode: 'auto'
SelectionHighlight_I: on
HitTestMode: 'auto'
HitTest_I: on
HitTest: on
PickablePartsMode: 'auto'
PickableParts_I: 'visible'
PickableParts: 'visible'
CausesLayoutUpdate: on
Layout: [0×0 matlab.ui.layout.LayoutOptions]
struct(hl.Axle) % but you're no longer allowed to access private object properties
No public property 'Axle' for class ''BubbleLegend''.
I don't know if it's the behavior of these newer graphics objects or just the behavior of newer MATLAB versions (or both), but it just feels like everything is becoming ultimately less flexible. There are hardly any public properties for the bubblelegend object. All of the useful ones are hidden and inacessible.
That said, I only have R2019b, which predates bubblelegend. I'm stuck trying to test this in the forum editor. I don't know if any of these restrictions are a consequence of that.
Sim
on 10 Dec 2025 at 17:05
Edited: Dyuman Joshi
on 10 Dec 2025 at 17:07
I have just tried the piece of code you used,
x = 1:10;
y = exp(-0.5*x) + .05 * randn(1,10);
sz = randi([20 500],[1,10]);
bubblechart(x,y,sz)
hl = bubblelegend('Population');

struct(hl)
Warning: Calling STRUCT on an object prevents the object from hiding its implementation details and should thus be avoided. Use DISP or DISPLAY to see the visible public details of an object. See 'help struct' for more information.
Warning: The EraseMode property is no longer supported and will error in a future release.
ans = struct with fields:
NumBubbles: 3
NumBubblesMode: 'manual'
NumBubbles_I: 3
Style: 'vertical'
StyleMode: 'manual'
Style_I: 'vertical'
BubbleSizeOrder: 'descending'
BubbleSizeOrderMode: 'manual'
BubbleSizeOrder_I: 'descending'
LimitLabels: {3×1 cell}
LimitLabelsMode: 'auto'
LimitLabels_I: {3×1 cell}
Padding: 8
AxleWidth: 5
AxlePadding: 5
AxleIsUsed: 1
BubbleSizes: [50 40 10]
BubbleColor: [0 0 0]
Location: 'northeast'
LocationMode: 'auto'
Location_I: 'northeast'
NeutralColor: [0.4000 0.4000 0.4000]
DefaultBubbleLineWidth: 0.5000
BubbleLineWidth: 0.5000
BubbleEdgeColor: [0 0 0]
BubbleAlpha: 1
PrintSettingsCache: [1×1 struct]
BubbleContainer: [1×1 Marker]
BubbleContainerMode: 'auto'
BubbleContainer_I: [1×1 Marker]
Axle: [1×1 LineStrip]
Bubbles: [1×1 Marker]
LabelBig: [1×1 Text]
LabelMedium: [1×1 Text]
LabelSmall: [1×1 Text]
Camera: [1×1 Camera2D]
CameraMode: 'auto'
Camera_I: [1×1 Camera2D]
DataSpace: [1×1 UniformCartesianDataSpace]
DataSpaceMode: 'auto'
DataSpace_I: [1×1 UniformCartesianDataSpace]
ColorSpace: [1×1 MapColorSpace]
ColorSpaceMode: 'auto'
ColorSpace_I: [1×1 MapColorSpace]
DecorationContainer: [1×1 Group]
DecorationContainerMode: 'auto'
DecorationContainer_I: [1×1 Group]
BoxEdge: [1×1 LineLoop]
BoxEdgeMode: 'auto'
BoxEdge_I: [1×1 LineLoop]
BoxFace: [1×1 Quadrilateral]
BoxFaceMode: 'auto'
BoxFace_I: [1×1 Quadrilateral]
Title: [1×1 Text]
TitleMode: 'auto'
Title_I: [1×1 Text]
SelectionHandle: [1×1 ListOfPointsHighlight]
SelectionHandleMode: 'auto'
SelectionHandle_I: [1×1 ListOfPointsHighlight]
TitleSeparator: [1×1 LineStrip]
TitleSeparatorMode: 'auto'
TitleSeparator_I: [1×1 LineStrip]
Axes: [1×1 Axes]
AxesMode: 'manual'
Axes_I: [1×1 Axes]
AxesListenerList: [1×5 event.listener]
AxesListenerListMode: 'manual'
AxesListenerList_I: [1×5 event.listener]
Box: on
BoxMode: 'auto'
Box_I: on
Color: [1 1 1]
ColorMode: 'auto'
Color_I: [1 1 1]
EdgeColor: [0.1294 0.1294 0.1294]
EdgeColorMode: 'auto'
EdgeColor_I: [0.1294 0.1294 0.1294]
FontName: 'Helvetica'
FontNameMode: 'auto'
FontName_I: 'Helvetica'
FontSize: 9
FontSizeMode: 'auto'
FontSize_I: 9
FontUnits: 'points'
FontUnitsMode: 'auto'
FontUnits_I: 'points'
FontAngle: 'normal'
FontAngleMode: 'auto'
FontAngle_I: 'normal'
FontWeight: 'normal'
FontWeightMode: 'auto'
FontWeight_I: 'normal'
Interpreter: 'tex'
InterpreterMode: 'auto'
Interpreter_I: 'tex'
InitPositionCache: 1
WindowMouseReleaseListener: [0×0 event.listener]
WindowMouseReleaseListenerMode: 'auto'
WindowMouseReleaseListener_I: [0×0 event.listener]
LineWidth: 0.5000
LineWidthMode: 'auto'
LineWidth_I: 0.5000
Orientation: 'vertical'
OrientationMode: 'auto'
Orientation_I: 'vertical'
PlotChildren: [1×1 BubbleChart]
PlotChildrenMode: 'auto'
PlotChildren_I: [1×1 BubbleChart]
Height: 0.4448
HeightMode: 'auto'
Height_I: 0.4448
Width: 0.2384
WidthMode: 'auto'
Width_I: 0.2384
Position: [0.6471 0.4550 0.2384 0.4448]
PositionMode: 'auto'
Position_I: [0.6471 0.4550 0.2384 0.4448]
SPosition: []
PositionCache: []
ParentSizeChangedListener: [0×0 event.listener]
PrintAlphaSupported: 1
PrintAlphaSupportedMode: 'auto'
PrintAlphaSupported_I: 1
PreventLegendResizePrintingPosition: []
SelfListenerList: [0×0 event.listener]
SelfListenerListMode: 'auto'
SelfListenerList_I: [0×0 event.listener]
TextColor: [0.1294 0.1294 0.1294]
TextColorMode: 'auto'
TextColor_I: [0.1294 0.1294 0.1294]
Units: 'normalized'
UnitsMode: 'auto'
Units_I: 'normalized'
standalone: off
standaloneMode: 'auto'
standalone_I: off
ChildrenMode: 'auto'
Children_I: [0×0 GraphicsPlaceholder]
Children: [0×0 GraphicsPlaceholder]
SerializableChildren: [0×0 GraphicsPlaceholder]
Description: ''
DescriptionMode: 'auto'
Description_I: ''
Parent: [1×1 Figure]
ParentMode: 'manual'
Parent_I: [1×1 Figure]
Visible: on
VisibleMode: 'auto'
Visible_I: on
Serializable: on
SerializableMode: 'auto'
Serializable_I: on
HandleVisibility: 'on'
HandleVisibilityMode: 'auto'
HandleVisibility_I: 'on'
ErrorCallback: ''
ErrorCallbackMode: 'auto'
ErrorCallback_I: ''
Internal: 0
ApplicationData: [1×1 struct]
SerializableApplicationData: [1×1 struct]
DefaultPropMap_Internal: [0×0 struct]
Copyable: 1
NodeParent: [1×1 AxesLayoutManager]
NodeChildren: [1×1 Camera2D]
CustomThemePropertyMappings: [1×1 struct]
HG1Erase: 'normal'
HG1EraseMode: 'auto'
HG1Erase_I: 'normal'
EraseMode: 'normal'
Behavior: [1×1 struct]
BehaviorMode: 'auto'
Behavior_I: [1×1 struct]
HelpTopicKey: ''
HelpTopicKeyMode: 'auto'
HelpTopicKey_I: ''
SerializableBehavior: [1×1 struct]
ButtonDownFcnMode: 'auto'
ButtonDownFcn_I: ''
ButtonDownFcn: ''
ButtonDownFcn_IS: ''
SerializableUIContextMenu: [0×0 GraphicsPlaceholder]
ContextMenu: [0×0 GraphicsPlaceholder]
UIContextMenu: [0×0 GraphicsPlaceholder]
TopLevelSerializedObject: on
BusyAction: 'queue'
BeingDeleted: off
Interruptible: on
CreateFcnMode: 'auto'
CreateFcn_I: ''
CreateFcn: ''
CreateFcn_IS: ''
DeleteFcnMode: 'auto'
DeleteFcn_I: ''
DeleteFcn: ''
DeleteFcn_IS: ''
Type: 'bubblelegend'
TagMode: 'auto'
Tag_I: ''
Tag: ''
UserData: []
SerializableUserData: []
Selected: off
SelectedMode: 'auto'
Selected_I: off
SelectionHighlight: on
SelectionHighlightMode: 'auto'
SelectionHighlight_I: on
HitTestMode: 'auto'
HitTest_I: on
HitTest: on
PickablePartsMode: 'auto'
PickableParts_I: 'visible'
PickableParts: 'visible'
CausesLayoutUpdate: on
Layout: [0×0 matlab.ui.layout.LayoutOptions]
and I got a long list of properties, like these ones:

However, if I try to modify the "DefaultBubbleLineWidth" or the "BubbleLineWidth":
hl.DefaultBubbleLineWidth = 2;
Setting the 'DefaultBubbleLineWidth' property of class ''BubbleLegend'' is not supported.
I get this error:
Setting the 'DefaultBubbleLineWidth' property of class 'BubbleLegend' is not supported.
Error in untitled (line 7)
hl.DefaultBubbleLineWidth = 2;
Accepted Answer
Taylor
on 9 Dec 2025 at 16:58
The LineWidth property of bubblelegend only adjusts the border around the legend. I have submitted a feature request on your behalf to the development team to add control for the scale line as well.
5 Comments
Dyuman Joshi
on 10 Dec 2025 at 17:08
Taylor
1 minute ago
Given that this feature request is really just exposing a private property to be public, I would think it would be a fairly quick implementation. It's cutting it close for the R2026a release though so it might not make it into that, but I know for certain that development has seen my feature request and added it to their "to triage" list. MathWorks development is a large ship to steer so even minor changes like this can take longer than one might expect.
Walter Roberson
about 1 hour ago
As R2026a pre-release is already out, if I understand correctly, new features are now locked; from now on it is only bug fixes and removing candidate changes.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)