LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change x-axis tick label

Solved!
Go to solution

I am working on a similar program like the regression example with LabVIEW. Instead of showing the default x-axis tick values, I would like to show them as A,B,C,D,E,F only to represent that the raw data on the x-axis.

2ShZxdV

NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 1 of 8
(4,205 Views)
Solution
Accepted by asukumari

See here.

 

If you can find a better way, I will be happy to learn about it.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 8
(4,185 Views)

For this application, and I mean literally for this application, for display you could create an array of integers10-15 for your six points and change the display format of the x-axis to hex.

 

HexGraph.png

 

If you've got more than six points then it's off to plan b.  Even if you do have six points I'd seriously consider plan b....

Message 3 of 8
(4,172 Views)
I would consider plan 'b' just for the reason that it is the right way to program. Will use Ben's method.
NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 4 of 8
(4,146 Views)
Thank you Ben. Looks like there is no other way to do this other than your's. I will implement using your method.

Thanks.
NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 5 of 8
(4,146 Views)

@asukumari wrote:
Thank you Ben. Looks like there is no other way to do this other than your's. I will implement using your method.

Thanks.

Another approach could use a graph and annotations. Annotations would tolerate the graph tools easier (zooming etc.).

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(4,139 Views)

That's exactly what I was looking into right now: KnowledgeBase

Looks a lot easier to do this for my purpose. I wonder how they added the left and right padding to the graph. The default settings shows first data point at the very edge of the plot (which is really counter intuitive).
I am so used to Wolfram Mathematica's ListPlot or ListLinePlot that I automatically assume I don't need to add any padding to the plot.

zRF4knQ

NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 7 of 8
(4,135 Views)

 


@asukumari wrote:

I wonder how they added the left and right padding to the graph.


 

You could try to add the coordinates (0, NaN) and (10, NaN) to try to get the padding you are looking for.  Otherwise, you will probably need to programmatically set the start and end properties for the graph's x-axis.

0 Kudos
Message 8 of 8
(4,130 Views)