02-17-2016 09:00 AM
Hello,
Is there a way to have the format '10^0' instead of 'E0' on the Y axes.
(10^1, 10^2,10^3 instead of E+001, E+002, E+003)
Thanks
02-22-2016 03:50 PM
Hi Virgule,
Are you creating graphs using Windows Forms or Windows Presentation Foundation?
02-29-2016 05:26 AM
On Windows forms.
Thanks,
02-29-2016 12:54 PM
Hi Virgule,
I was able to use the following code to map the y axis as you requested. I did have to change the y-axis scaling for the graph to logarithmic to prevent labels on the low end from overlapping each other.
//Data to plot to the graph
double[] actualData = new double[] { 1, 200, 600, 800, 1000, 2, 4, 20, 100, 1000000000 };
//In this case, this is really the number of y-axis labels you want to map
int numberOfSamples = 10;
//Customized Y Axis
//Labels for Y axis
string[] labelData = new string[] { "10^0", "10^1", "10^2", "10^3", "10^4", "10^5", "10^6", "10^7", "10^8", "10^9" };
//Values to Map labels to
double[] indexData = new double[] { 0, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
//Hide default axis elements
yAxis1.MajorDivisions.GridVisible = false;
yAxis1.MajorDivisions.TickVisible = false;
yAxis1.MajorDivisions.LabelVisible = false;
//Loop which generates Y axis labels
for (int i = 0; i < numberOfSamples; i++)
{
// Use AxisCustomDivision to map indices to labels
yAxis1.CustomDivisions.Add(new AxisCustomDivision(indexData[i], labelData[i]));
}
//Plot actualData to plot
waveformGraph1.PlotY(actualData);
03-01-2016 05:46 AM
Thanks for this help. i will try to implement a function by using your solution.
I hope, in the future, that NI will add this new label format in the scattergraph.
Regards