Skip to content

Commit 588daed

Browse files
Fix/tsp 1294 sweep plot list y ticks (#15)
y axis tick range in sweep plot for list style fixed. Now the y ticks are calculated correctly for the sweep points entered in list. Fixed the same for list style step plot.
1 parent bc732e6 commit 588daed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

script-gen-ui/src/app/components/main-sweep/plot-container/plot-step/plot-step.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ export class PlotStepComponent
364364
const minRange = PlotUtils.computeMinRange(min, max);
365365
this.plotLayout.yaxis.range = [minRange, maxRange];
366366
this.plotLayout.yaxis2.range = [minRange, maxRange];
367-
this.plotLayout.yaxis2.dtick = maxRange;
367+
this.plotLayout.yaxis2.dtick = Math.abs(maxRange - minRange);
368368
this.plotLayout.yaxis2.tick0 = minRange;
369369
this.plotLayout.yaxis.tick0 = minRange;
370370

script-gen-ui/src/app/components/main-sweep/plot-container/plot-sweep/plot-sweep.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export class PlotSweepComponent
239239
this.numPoints = this.sweepGlobalParameters?.sweep_points;
240240
this.list = this.sweepGlobalParameters?.list_sweep;
241241
this.numSteps = this.stepGlobalParameters?.step_points.value;
242-
this.list = this.sweepGlobalParameters?.list_sweep;
242+
// this.list = this.sweepGlobalParameters?.list_sweep;
243243
this.listSweep = this.sweepChannel.start_stop_channel.list;
244244

245245
this.sweepDivID = `plotDiv${this.sweepChannel.start_stop_channel.common_chan_attributes.uuid}`;
@@ -375,11 +375,11 @@ export class PlotSweepComponent
375375
const minRange = PlotUtils.computeMinRange(min, max);
376376
this.plotLayout.yaxis.range = [minRange, maxRange];
377377
this.plotLayout.yaxis2.range = [minRange, maxRange];
378-
this.plotLayout.yaxis2.dtick = maxRange;
378+
this.plotLayout.yaxis2.dtick = Math.abs(maxRange - minRange);
379379
this.plotLayout.yaxis2.tick0 = minRange;
380380
this.plotLayout.yaxis.tick0 = minRange;
381381

382-
const dtick = (maxRange - minRange) / 4; // Divide maxRange into 4 intervals
382+
const dtick = Math.abs(maxRange - minRange) / 4; // Divide maxRange into 4 intervals
383383
this.plotLayout.yaxis.dtick = dtick;
384384
}
385385
}

0 commit comments

Comments
 (0)