Skip to main content
XY Plots

Create an XY Plot to visualize a quantity using data points from lines or intersection curves.

Updated over 5 months ago

This is an Early Access feature that is still under development. View the Luminary Cloud Early Access Terms.

  1. In a simulation tab, create a line or intersection curve.

  2. Click the + symbol to the right of the 2D Plots section in the control panel.

  3. Click XY Plot. This will create a new XY Plot entity within the 2D Plots section and open the plot settings in the properties panel.

  4. Choose Line or Intersection Curve from the Type dropdown.

  5. Choose the Data source. You can select multiple lines or intersection curves.

  6. Choose the Quantity that you want to plot.

  7. Set the Position to spatially order the data points by Arc Length, X-, Y- or Z-Coordinate.

  8. (Optional) Adjust the Quantity Range, Position Range and Quantity Scale.

In the toolbar directly above your plot, you can swap axes by clicking on the Swap Axes icon or choose specific iterations by changing the number in the box.

You can also download your chart data in CSV format by clicking Download and selecting Download current chart data.

You can use your downloaded chart data to plot using Python or another third-party tool.

For example:

import pandas as pd 
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
csv_file_path = 'export.csv' # CSV downloaded from Luminary Cloud
df = pd.read_csv(csv_file_path)
column_headers = df.columns.tolist()

x_column = column_headers[0]
y_column = column_headers[1]

fig, ax = plt.subplots()
# Plotting one line for each segment
for name, group in df.groupby('Segment'):
ax.plot(group[x_column], group[y_column], label=name)
# ax.scatter(group[x_column], group[y_column], s=5)

# Adding labels and title
ax.set_xlabel(x_column)
ax.set_ylabel(y_column)
ax.set_title('intersection curve')
ax.legend()

max_xticks = 10
x_locator = MaxNLocator(max_xticks) plt.gca().xaxis.set_major_locator(x_locator)

max_yticks = 10
y_locator = MaxNLocator(max_yticks) plt.gca().yaxis.set_major_locator(y_locator)

# Display the plot
plt.show()
Did this answer your question?