Quote:
>Subject: X & Y axes on graph
>Date: 3/29/99 1:06 AM Central Standard Time
>I am fairly new to VB & have a problem with setting the X & Y axes on
>graphs I am drawing. How do I get the axes to remain at a fixed
>position on the picture-box control when the scale of the plot is
>changeable?
You have to rescale based on the ranges of the X and Y values. Usually you
want some space between the axes and the edge of the picture for axis label,
titles etc. I use the following code for this: (all on one line)
pic.Scale (LLX - .15 * (ULX - LLX), ULY + .2 * (ULY - LLY))-(ULX + .1 * (ULX -
LLX), (LLY - .2 * (ULY - LLY)))
Where LLX = lower X axis value
ULX = upper X axis value
LLY = lower Y axis value
ULY = upper Y axis value
You can vary the numbers to adjust the space between the axes and the picture
border.