|
-
Aug 13th, 2004, 09:08 AM
#1
Labelling an axis
I plot math functions on a form where 2 axes orthogonal to each other are represented. I divide them in steps and plot ticks and labels. For the horizontal labels, the steps are such that there is a sufficient distance (clearance) between 2 consecutive ones to prevent it from looking crowded.
Now the problem is when I want to represent a very very short range of values, for example:
From 3.453870 to 3.453880 using 10 steps of value=10-6
so that I would have consecutive labels like 3.453876 and 3.453877 and would probably overlap. Even a reduced number of steps would produce an impression of cramming.
For this example I had thought of using the scientific notation for the labels in the following fashion:
6E-6, 7E-6, ... which would be the offsets to be added to a base placed in a label at the right hand side of the axis, like
"+ 3.453870".
That's what I could come up with, but I wonder if anyone has ever had to do the same thing and could provide a more clever idea.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Aug 14th, 2004, 03:36 PM
#2
PowerPoster
I've working on this one myself.
Your going to run into this problem no matter whether you use
scientific notation or not depending on your XAxis spacing between points.
Only thing I could come up with is to check the label length
prior to printing, to see if it will collide with the next xaxis location
and if it does, skip either printing current or next n labels until you get enought space.
-
Aug 14th, 2004, 04:35 PM
#3
Originally posted by dw85745
Only thing I could come up with is to check the label length
prior to printing, to see if it will collide with the next xaxis location
and if it does, skip either printing current or next n labels until you get enought space.
As a matter of fact I already have some subs implemented that do exactly this, only I had never had any problems until I created a tool for zooming in by dragging a rectangle over the graph (picturebox), then by repeatedly applying the zoom I realized I had to do something when the x-axis leftmost and rightmost values got ever nearer to each other.
I think the scheme I've sketched above should work, but as it is something I have never seen anywhere it looks somewhat strange. I thought someone had thought of something else, after all lots of folks out there must have had to face this situation before me.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
-
Aug 15th, 2004, 09:15 AM
#4
PowerPoster
VB Code:
I had never had any problems until I created a tool for zooming in by dragging a rectangle over the graph (picturebox), then by repeatedly applying the zoom I realized I had to do something when the x-axis leftmost and rightmost values got ever nearer to each other.
When you zoom you should have more space not less between points since the picture/graph is enlarged. Set the zoomed rectangle area to your left and right borders (form/picturebox, etc).
Part of your zoom code should adjust for point spacing and needs to be dynamic based on rectangle size.
------------------------------------------
As long as labels stay consistent (e.g scientific notation, numbers, dates) everything goes smoothly.
What I'm working on is a mixed label in a format of:
minutes mm/dd minutes
1020 1030 08/14 0730 0740
This has created some issue as the ending time (1030 in example and ending time may vary depending on dataset) will sometime collide with the date. That is some of both the date and time will be printed at the same X location, making it appear as a double strike so it is illegible. Any ideas?
Last edited by dw85745; Aug 15th, 2004 at 10:27 AM.
-
Aug 22nd, 2004, 04:00 PM
#5
Originally posted by dw85745
When you zoom you should have more space not less between points since the picture/graph is enlarged.
I wasn't too clear about that. The actual space -distance- is of course the same, but the values are closer, so you need ever more digits to distinguish them.
Lottery is a tax on people who are bad at maths
If only mosquitoes sucked fat instead of blood...
To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|