1
   

Logarithmic scale problem

 
 
Reply Mon 26 Dec, 2005 10:24 am
I am working on a homework for a programming class. We have to create a Logarithmic plot and add to it a marker when the program is running on the click of the mouse. That is NOT the problem Smile , in fact, that's very simple! My problem, however, is with the scale. When my plot is in linear scale it adds the marker right where it should. By that I mean that if I click on point (1,2) it adds my marker on (1,2). Now, when I switch to logarithmic scale, if I click on (0,0) it adds the marker on (1,1). If I click on values greater than 10, it adds the marker at the place where I clicked. But when my values are lower than 10, the marker is shifted to the right. How do I solve that problem? I already tried converting the values I get from my mouse-click event to logarithmic values and they are wrong. In fact I get negative numbers when the values are lower than 1; so the marker is shifted to the left. I am not good at all with log scales; so, please help me!!
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 459 • Replies: 4
No top replies

 
g day
 
  1  
Reply Mon 26 Dec, 2005 05:08 pm
10^0 = 1 by definition.

e^0 = 1 by defintion

Try a simple site like http://www.purplemath.com/modules/logs2.htm

to familarise yourself with logarithms.

BTW are both your x and y axes on logarithmic scales?
0 Replies
 
lgarcia3
 
  1  
Reply Mon 26 Dec, 2005 05:24 pm
Yes, both axeis are in log scale.
I just did a quick test to see what the event returns. As I click closer to 0, it results in a number sifted more and more to the right. I am only showing the x coordinate since the y have exactly the same results. Also, the resulting values are approximate since I did not zoom in close enough in the plot to click exactly on the number.

Click on Result
10 10
9 9.118812375
8 8.223735874
7 7.307858871
6 6.444623616
5 5.50047321
4 4.624704838
3 3.70626008
2 2.820675981
1 1.90761842
0 1.003834079

it looks like a function, I just don't know how to find it. I think that if I find it, I can solve my problem.
I've seen many of those web sites you mentioned. I tried everything I thought logically could solve it and still did not get it. That's why I decided to ask.
Thanks
0 Replies
 
markr
 
  1  
Reply Wed 28 Dec, 2005 02:54 am
Maybe you should show the relevant portion of your code.
0 Replies
 
engineer
 
  1  
Reply Fri 30 Dec, 2005 03:40 pm
Anytime you need to find a function, you should graph the data. Your data is perfectly linear:

Y = 1.0117861 + 0.9005264 X
0 Replies
 
 

Related Topics

Evolution 101 - Discussion by gungasnake
Typing Equations on a PC - Discussion by Brandon9000
The Future of Artificial Intelligence - Discussion by Brandon9000
The well known Mind vs Brain. - Discussion by crayon851
Scientists Offer Proof of 'Dark Matter' - Discussion by oralloy
Blue Saturn - Discussion by oralloy
Bald Eagle-DDT Myth Still Flying High - Discussion by gungasnake
DDT: A Weapon of Mass Survival - Discussion by gungasnake
 
  1. Forums
  2. » Logarithmic scale problem
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/13/2025 at 10:04:07