@@ -170,30 +170,58 @@ export default function LightCurvePlot() {
170170 const layout : PlotLayout = {
171171 height : 500 ,
172172 grid : { rows : 2 , columns : 1 , pattern : 'independent' } ,
173- margin : { l : 50 , r : 30 , t : 40 , b : 40 } ,
173+ margin : { l : 60 , r : 40 , t : 60 , b : 60 } ,
174+
175+ // ───────── X1 (top panel) ─────────
174176 xaxis : {
175- title : xAxis , matches : 'x2' , domain : [ 0.0 , 1.0 ] , anchor : 'y1' ,
176- titlefont : { size : labelFontSize } , tickfont : { size : labelFontSize } , showgrid : true
177+ domain : [ 0 , 1 ] ,
178+ anchor : 'y1' ,
179+ matches : 'x2' ,
180+ title : { text : xAxis , standoff : 12 } ,
181+ titlefont : { size : labelFontSize } ,
182+ tickfont : { size : labelFontSize } ,
183+ showgrid : true ,
184+ automargin : true ,
177185 } ,
186+
187+ // ───────── Y1 (top panel) ─────────
178188 yaxis : {
179- title : 'SW: Surf Bright (MJy/sr)' , domain : [ 0.51 , 1.0 ] , anchor : 'x2' ,
180- titlefont : { size : labelFontSize } , tickfont : { size : labelFontSize } , showgrid : true , automargin : true
189+ domain : [ 0.52 , 1 ] ,
190+ anchor : 'x1' ,
191+ title : { text : 'SW: Surf Bright (MJy/sr)' , standoff : 10 } ,
192+ titlefont : { size : labelFontSize } ,
193+ tickfont : { size : labelFontSize } ,
194+ showgrid : true ,
195+ automargin : true ,
181196 } ,
197+
198+ // ───────── X2 (bottom panel) ─────────
182199 xaxis2 : {
183- title : xAxis , domain : [ 0.0 , 1.0 ] , anchor : 'y2' ,
184- titlefont : { size : labelFontSize } , tickfont : { size : labelFontSize } , showgrid : true
200+ domain : [ 0 , 1 ] ,
201+ anchor : 'y2' ,
202+ title : { text : xAxis , standoff : 12 } ,
203+ titlefont : { size : labelFontSize } ,
204+ tickfont : { size : labelFontSize } ,
205+ showgrid : true ,
206+ automargin : true ,
185207 } ,
208+
209+ // ───────── Y2 (bottom panel) ─────────
186210 yaxis2 : {
187- title : 'LW: Surf Bright (MJy/sr)' , domain : [ 0.0 , 0.49 ] , anchor : 'x2' ,
188- titlefont : { size : labelFontSize } , tickfont : { size : labelFontSize } , showgrid : true , automargin : true
211+ domain : [ 0 , 0.48 ] ,
212+ anchor : 'x2' ,
213+ title : { text : 'LW: Surf Bright (MJy/sr)' , standoff : 10 } ,
214+ titlefont : { size : labelFontSize } ,
215+ tickfont : { size : labelFontSize } ,
216+ showgrid : true ,
217+ automargin : true ,
189218 } ,
219+
190220 annotations : annotations ,
191221 legend : { font : { size : legendFontSize } , groupclick : 'toggleitem' } ,
192222 hoverlabel : { font : { size : tooltipFontSize } } ,
193223 font : { size : labelFontSize } ,
194- modebar : {
195- orientation : 'v' , // Vertical modebar
196- } ,
224+ modebar : { orientation : 'v' } ,
197225 } ;
198226
199227 const fullData = [
@@ -221,13 +249,15 @@ export default function LightCurvePlot() {
221249 xaxis : axisX ,
222250 yaxis : axisY ,
223251 } ) ;
224-
252+ console . log ( "Updating figure with new styles" ) ;
253+ console . log ( figure ?. layout ) ;
225254 setSettings ( {
226255 figure : {
227256 data : [
228257 ...rawFigure . tracesSW . map ( tr => applyStyle ( tr , 'x2' , 'y' ) ) ,
229258 ...rawFigure . tracesLW . map ( tr => applyStyle ( tr , 'x2' , 'y2' ) ) ,
230- ] , layout : figure ?. layout || { }
259+ ] ,
260+ layout : figure ?. layout || { }
231261 }
232262 } ) ;
233263
0 commit comments