[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Bar plot with logarithmic scale on y-axis
From: |
Damian Harty |
Subject: |
RE: Bar plot with logarithmic scale on y-axis |
Date: |
Mon, 24 Mar 2014 11:48:27 +0000 |
> I'd like to plot my data in a bar chart with log scale on the y-axis. Here's
> what I tried:
> h = bar ([1:10]',rand(10,1));
> set (gca,'yscale','log');
> The first command produces the expected bar chart. The second command scales
> the y-axis as expected, but the bars in the plot get screwed up. Can someone
> please help me with this?
I think the plotting algorithm tries to draw the boxes for the bars from zero
and flags a logarithm domain error at this point. Excel handles this
"intuitively" but alas Octave only draws the top of the bar.
I have 3 options to offer:
1) Edit the code to do what you want (be careful what you wish for)
2) Make a new variable that is the log of your data and plot that on
appropriately annotated scales
3) Plot the data in Excel or similar
CONFIDENTIAL: The information contained in this email communication is
confidential information intended only for the use of the addressee.
Unauthorized use, disclosure or copying of this communication is strictly
prohibited and may be unlawful. If you have received this communication in
error, please notify us immediately by return email and destroy all copies of
this communication, including all attachments.