MATLAB: change BaseValue on a half-game chart

How to change the base value on the next line from 0 to another value (for example, 0.001)? Now it looks silly:

Ridiculous bar chart contrapted in MATLAB

the code:

h=bar(matrix); set(gca,'YScale','log') 

Bonus points / good karma for changing x-values ​​to text!

Greetings

+6
source share
2 answers

Maybe the option to change the baseValue property in the bar plot came out only in a later version of Matlab (what version do you have?), But the following works for me:

 %# create bar plot with horizontal line at 3 bar(randn(4),'baseValue',1) %# rename x-tick labels set(gca,'xticklabel',{'first','second','third'}) 

enter image description here

+3
source

EDIT: Found this one in file sharing. It seems that you want to.

This thread covers your problem. This seems to be an ugly hack. A thread does not indicate a good and built-in way to solve your problem.

0
source

Source: https://habr.com/ru/post/909933/


All Articles