Skip to content

Commit 87f830f

Browse files
authored
updated because colors were wrong
As GDL starts in DECOMPOSED mode (such does IDL) the colors were wrong.
1 parent 03a3316 commit 87f830f

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

notebooks/demo_gdl.ipynb

+8-3
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,14 @@
200200
"x = 2*!PI*0.01*indgen(100)\n",
201201
"y1 = sin(x)\n",
202202
"y2 = cos(x)\n",
203-
"loadct,39\n",
203+
"device,decomposed=0 ;;colors will be numbers from 0 to 255, as index in a colortable\n",
204+
"loadct,39 ;; only useful if decomposed=0 : this is the colortable chosen.\n",
205+
";; Note: if, as is the default, decomposed=1, colors are way more numerous (16777216!)\n",
206+
";; but must be defined as 'RRGGBB'x where each color component\n",
207+
";; (Red,Green,Blue) can take the 256 values from '00' to 'FF'\n",
204208
"window,xsize=800,ysize=500\n",
205-
"plot,x,y1,title='Trig Functions',xtitle='Radians',ytitle='Amplitude',xrange=[0,6],charsize=1.5,background=255,color=0\n",
209+
"plot,x,y1,title='Trig Functions',xtitle='Radians',ytitle='Amplitude',xrange=[0,6],charsize=1.5,back=255,color=0\n",
210+
";; the equivalent in 'decomposed mode' would have said: background='FFFFFF'x,color='0'x\n",
206211
"oplot,x,y2,color=50"
207212
]
208213
},
@@ -230,4 +235,4 @@
230235
},
231236
"nbformat": 4,
232237
"nbformat_minor": 0
233-
}
238+
}

0 commit comments

Comments
 (0)