bar3 x and y axis
132 views (last 30 days)
Show older comments
Commented: Roberto Chang on 23 Aug 2021
I'm trying to create a 3D histogram with bar3 (I don't have the statistic toolbox so I can't use hist3). My data is a 10x10 matrix. Thus I get a 3d hist with x and y axis going from 1 to 10. I would like to change those value to the real value of my variable (0 to 3 and 0 to 100) but I can't use Xlim and Ylim (It also change which are the bar plotted) Anyone has an idea ?
the cyclist on 12 Jan 2012
Does this do what you want?
set(gca,'XTickLabel',[10 20 30 40])
set(gca,'YTickLabel',[100 200 300])
More Answers (2)
Austin on 17 Jun 2013
This doesn't really work. I'm trying to plot Z bars against X and Y with more than a few data points. I would like the x and y axis labels to be the real x and y data. Can you help??
Here's and example:
xAxis = sort(10*rand(20,1));
sprintf('XMin: %5f xMax: %5f', [min(xAxis) max(xAxis)])
yAxis = sort(30*rand(30,1));
sprintf('yMin: %5f yMax: %5f', [min(yAxis) max(yAxis)])
the cyclist on 17 Jun 2013
Not very many people will see your question, which is buried as an "answer" to a 5-month-old question. I suggest you start a brand-new question, and perhaps reference this question with a link.
Find more on Histograms 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!