How to change the format of the numbers displayed on in a MATLAB plot?
4 views (last 30 days)
Show older comments
This is normal matlab photo plot. its name is called toyExample.png (orginal photo). But When I made matlab plot , it is non-normal plot. big numbers display format. Its name photo called Figure 1. How to change Figure 1. photo to convert as toyExample.png in matlab ?
0 Comments
Accepted Answer
John BG
on 25 Dec 2016
it would help a lot that you show the code, because the graphs have handles that you can change.
Is it possible for you to post here the code?
More Answers (2)
Star Strider
on 25 Dec 2016
This is the problem (in the code for ‘visualRF.m’):
% add text to tree
text(Z(1),X(1),mheight+1,[num2str(treeID) ',' num2str(strength)],'HorizontalAlignment','left','FontSize',20);
→ → SET THE FONT SIZE TO SOMETHING SMALLER → ↑
Does this solve your problem? If so, you can Accept my Answer.
8 Comments
John BG
on 25 Dec 2016
Edited: John BG
on 25 Dec 2016
1.
in function getTree
% add text to tree
text(Z(1),X(1),mheight+1,[num2str(treeID) ',' num2str(strength)],'HorizontalAlignment','left','FontSize',10);
change FontSize to for instance 10
2.
I changed the field 'Color' to fixed 'red', in function getBinBranches, line
line([[leftStartPos(3); leftEndPos(3)],[rightStartPos(3); rightEndPos(3)]],[[leftStartPos(1); leftEndPos(1)],[rightStartPos(1); rightEndPos(1)]], [[leftStartPos(2); leftEndPos(2)],[rightStartPos(2); rightEndPos(2)]], 'LineWidth', width, 'Color', 'red');
and ctrl+R
% feaID = bin(id,2);
% color = hsv2rgb([feaID/100,1,1]);
to have your code running, otherwise I was getting the following errors
Placing tree 1 at position (86 51)
Error using hsv2rgb (line 65)
Valid colormaps cannot have values outside the range [0,1].
Error in visualRF>getBinBranches (line 172)
color = hsv2rgb([feaID/100,1,1]);
Error in visualRF>getTree (line 119)
[~,mheight] = getBinBranches(initPos, initDir, initLength, treeData, nodeID);
Error in visualRF>createForest (line 101)
getTree(position, ground(position(1), position(2)), treeData{t}, t,
treeStrength(t), initLength);
Error in visualRF (line 82)
createForest(ground, treeData, treePositions, treeStrength, tree, initLength);
Error in plt_Example (line 24)
visualRF(forestStrength, treeSim, treeStrength, treeData, tree, initLength,
hillWidth, maxHillHeight);
3. If you want to change the size of the axis tags, the [0 10 20 ..] just after plot add something like
ax=gca
and the you can change the size of that text too with for instance
ax.FontSize=20
6 Comments
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!