Updated Absorption Spectrum scan
This commit is contained in:
56
script/beamline_alignment/Development/test_custom_plot.py
Executable file
56
script/beamline_alignment/Development/test_custom_plot.py
Executable file
@@ -0,0 +1,56 @@
|
||||
data_1d = [10.0, 20.0, 30.0, 40.0, 50.0]
|
||||
data_2d = [ data_1d, data_1d, data_1d, data_1d, data_1d]
|
||||
|
||||
data_x = [5.5, 2.0, 3.7, 4.2, 1.0]
|
||||
data_y = [1.0, 1.2, 6.6, 3.0, 1.0]
|
||||
|
||||
#2d-plot with optional xdata and ydata
|
||||
plot(data_2d, title = "2d", xdata = data_x, ydata = data_y)
|
||||
|
||||
#from org.jfree.chart import ChartFactory, ChartPanel
|
||||
#from org.jfree.data.xy import XYSeries, XYSeriesCollection
|
||||
#from javax.swing import JFrame
|
||||
#
|
||||
## Beispiel-Daten
|
||||
#x_values = [1, 2, 3, 4, 5]
|
||||
#y_values = [5, 7, 6, 8, 4]
|
||||
#
|
||||
## XY-Datenserie erstellen
|
||||
#series = XYSeries("Messdaten")
|
||||
#for x, y in zip(x_values, y_values):
|
||||
# series.add(x, y)
|
||||
#
|
||||
#dataset = XYSeriesCollection()
|
||||
#dataset.addSeries(series)
|
||||
#
|
||||
## Scatter-Plot erzeugen
|
||||
#chart = ChartFactory.createScatterPlot(
|
||||
# "Scatter Plot Beispiel",
|
||||
# "X-Achse",
|
||||
# "Y-Achse",
|
||||
# dataset
|
||||
#)
|
||||
#
|
||||
## --- GLEICHE SKALIERUNG FÜR X UND Y ---
|
||||
#plot = chart.getXYPlot()
|
||||
#x_axis = plot.getDomainAxis()
|
||||
#y_axis = plot.getRangeAxis()
|
||||
#
|
||||
#x_min, x_max = min(x_values), max(x_values)
|
||||
#y_min, y_max = min(y_values), max(y_values)
|
||||
#
|
||||
#range_x = x_max - x_min
|
||||
#range_y = y_max - y_min
|
||||
#max_range = max(range_x, range_y)
|
||||
#
|
||||
#x_mid = (x_min + x_max) / 2.0
|
||||
#y_mid = (y_min + y_max) / 2.0
|
||||
#
|
||||
#x_axis.setRange(x_mid - max_range/2.0, x_mid + max_range/2.0)
|
||||
#y_axis.setRange(y_mid - max_range/2.0, y_mid + max_range/2.0)
|
||||
#
|
||||
## Fenster anzeigen
|
||||
#frame = JFrame("Plot")
|
||||
#frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE)
|
||||
#frame.setSize(800, 600)
|
||||
#frame.add(ChartPanel(chart))
|
||||
Reference in New Issue
Block a user