Bug report: plot title [message #89576] |
Wed, 29 October 2014 09:24  |
markb77
Messages: 217 Registered: July 2006
|
Senior Member |
|
|
hi,
I am making a foray into function graphics programming and I have uncovered what I think is a bug in the way that the properties of the plot title are set.
Essentially, when you create the plot, if you request a certain font, or font color, these properties are applied to the axis fonts but not the font title. This is contrary to what is specified in the IDL documentation for the PLOT function:
-------------------
TITLE
Set this property to a string specifying a title. The title properties may be modified using FONT_COLOR, FONT_NAME, FONT_SIZE, and FONT_STYLE. After creation the TITLE property may be used to retrieve a reference to the title text object, and the TEXT properties may be used to modify the title object.
-------------------
The bug is demonstrated in the following test case:
;----
pro test_plot_title_font
mydata_x = indgen(100)
mydata_y = sin(mydata_x * !pi/25.0)
plotfont = 'Courier'
mycolor = [255,0,0]
myplot = plot(mydata_x, $
mydata_y, $
font_name=plotfont, $
font_color=mycolor)
myplot.title = 'Plot Title'
ax = myplot.axes
ax[0].title = 'X axis'
ax[1].title = 'Y axis'
mytitle = myplot.title
print, 'Test results:'
print, ''
print, 'Requested font: ', plotfont
print, 'X axis font: ', ax[0].tickfont_name
print, 'Y axis font: ', ax[1].tickfont_name
print, 'Plot title font: ', mytitle.font_name
print, ''
print, 'Requested font color: ', mycolor
print, 'X axis font color: ', ax[0].text_color
print, 'Y axis font color: ', ax[1].text_color
print, 'Plot title font color: ', mytitle.font_color
print, !version
end
;---
program output:
Test results:
Requested font: Courier
X axis font: Courier
Y axis font: Courier
Plot title font: Helvetica
Requested font color: 255 0 0
X axis font color: 255 0 0
Y axis font color: 255 0 0
Plot title font color: 0 0 0
{ x86_64 Win32 Windows Microsoft Windows 8.3 Nov 15 2013 64 64}
As you can see, the plot title doesn't get assigned the correct font name or font color - possibly other properties would also not be properly assigned. I am using IDL 8.3 x64 on Windows. Perhaps the bug has been fixed in version 8.4?
Mark
|
|
|