How to change the format of the numbers displayed on in a MATLAB plot?

4 views (last 30 days)
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 ?

Accepted Answer

John BG
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?
  1 Comment
Ibrahim Abbasov
Ibrahim Abbasov on 25 Dec 2016
Yes, of course John BG. There are two matlab file . 1) plotToyExample.m 2) visualRF.m
You can to run (plotToyExample.m) in matlab software and who will see non-normal figure.1 Thanks for help John BG.

Sign in to comment.

More Answers (2)

Star Strider
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
Ibrahim Abbasov
Ibrahim Abbasov on 27 Dec 2016
I hope the author will respond as soon as possible. I'll try again. For more information, thank you for helping Star Strider.

Sign in to comment.


John BG
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
Ibrahim Abbasov
Ibrahim Abbasov on 28 Dec 2016
Edited: Ibrahim Abbasov on 28 Dec 2016
For help, I would like to thank you. My friend, Everything is perfect. When I put VisualRF.m inside plotToyExample.m, the error did not occur. İt works. I congratulate to you on the upcoming new year holiday. Happy new year.

Sign in to comment.

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!