Eliminating marks on bar graph

15 views (last 30 days)
Fran
Fran on 10 Oct 2014
Edited: Star Strider on 10 Oct 2014
Hello,
When I use the bar() plotting function, and input a given data set, for a particular binning (in the x-axis), the function plots the centers of the bins using the marker '*' on the x-axis, by default. I would like to remove these '*' marks on the x-axis. How do I write this in a code? I can do it using the GUI, but need it to be done via command line.
Regards,
F

Accepted Answer

Star Strider
Star Strider on 10 Oct 2014
I’ve seen this problem mentioned before. It is a default behaviour of bar. There is a posted fix for it here: How can I prevent or remove the asterisk annotations on my BAR plot in MATLAB 7.6 (R2008a)?
  1 Comment
Fran
Fran on 10 Oct 2014
Hi, yes this is what I was looking for thanks! This does the trick:
h = findobj(gca,'Type','line');
set(h,'Marker','none');

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 10 Oct 2014
Is that a tick mark? You can get rid of x ticks doing something like this:
set(gca, 'xtick', []);
set(gca, 'xticklabels', []);
or something like that.
  4 Comments
Star Strider
Star Strider on 10 Oct 2014
Edited: Star Strider on 10 Oct 2014

Kelly — I believe I first learned about it from one of your posts.

Sign in to comment.

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!