
166 Wis.2d 785 (1992)
480 N.W.2d 528
STATE of Wisconsin, Plaintiff-Respondent,
v.
Bradley BURDICK, Defendant-Appellant.
Nos. 91-0241-CR, 91-0242-CR.
Court of Appeals of Wisconsin
Submitted on briefs October 8, 1991.
Decided January 9, 1992.
*787 For the defendant-appellant the cause was submitted on the briefs of Eric Schulenburg, assistant public defender of Madison.
For the plaintiff-respondent the cause was submitted on the briefs of James E. Doyle, attorney general, with Sally L. Wellman, assistant attorney general.
Before Eich, C.J., Gartzke, P.J., and Dykman, J.
GARTZKE, P.J.
We granted Bradley Burdick's petition for leave to appeal from an order denying his request for appointment of a physician under sec. 971.16, Stats.[1] Burdick is indigent. The public defender represents *788 him. The dispositive issues are (1) whether the trial court has discretion under sec. 971.16(1), Stats., to deny a request to appoint an examining physician for the defendant in a criminal case who enters a plea of not guilty by reason of mental disease or defect and (2) if it has that discretion, whether the court abused its discretion in this case. We conclude that the purpose of the statute is to enable the trial court to obtain medical testimony through witnesses having no allegiance to either side in a criminal case. The trial court therefore had the discretion under sec. 971.16(1) not to appoint an examining physician and it did not abuse it. We affirm the order.
Burdick is charged with two felonies and two misdemeanors.[2] When the public defender questioned Burdick's competency to proceed, the trial court found him not competent and that it was in his best interest to receive treatment and medication, and committed him. Burdick was later found competent. He then pleaded not guilty and not guilty by reason of mental disease or defect.
*789 Relying on the nature of Burdick's plea and on sec. 971.16(1), Stats., the public defender requested that the trial court appoint a physician to examine Burdick. The public defender asserted that the trial court's discretion under the statute is limited to the number of physicians the court appoints, and does not extend to whether physicians are to be appointed. An appointment under sec. 971.16(1) would be at the county's expense. Since the state public defender, as an agency, believes that it correctly interprets the statute, it refuses to provide Burdick with a psychiatric witness at its expense.
The trial court ruled that if the court appoints a physician under sec. 971.16(1), Stats., the county must pay the expense, and whether to make such an appointment is within the discretion of the court. The court said that if a party desires psychiatric testimony, that party should obtain the witness and pay the expense.
[1]
Burdick correctly asserts that the indigent defendant in a criminal case who puts in issue his mental status at the time of the offense is entitled to appointment of an examining physician at state expense. "[W]hen a defendant has made a preliminary showing that his sanity at the time of the offense is likely to be a significant factor at trial, the Constitution requires that a State provide access to a psychiatrist's assistance on this issue, if the defendant cannot otherwise afford one." Ake v. Oklahoma, 470 U.S. 68, 74 (1985).
[2]
The question before us, however, is whether sec. 971.16(1), Stats., is the means of satisfying the constitutional obligation. The interpretation of the statute is a question of law for us to resolve without deference to the trial court. White v. General Casualty Co., 118 Wis. 2d 433, 437, 348 N.W.2d 614, 616 (Ct. App. 1984).
*790 [3]
The case law establishes the purpose of the statute. Given that purpose, sec. 971.16(1), Stats., is not the statutory vehicle by which a trial court must satisfy the constitutional obligation laid down by the Ake court.
Section 971.16(1), Stats., originated as sec. 4066-1, Stats. (1921).[3] At that time the statute provided in relevant part:
Whenever, in any criminal case, expert opinion evidence becomes necessary or desirable the judge of the trial court may after notice to the parties and a hearing, appoint one or more disinterested qualified experts, not exceeding three, to testify at the trial . . .. The compensation of such expert witnesses shall be fixed by the court and paid by the county upon the order of the court as a part of the costs of the action.
In Jessner v. State, 202 Wis. 184, 186-87, 231 N.W. 634, 636 (1930), the court said that the statute, by then renumbered sec. 357.12(1), Stats. (1925),[4] was enacted
in response to a well-settled conviction that, in criminal cases at least, where the interests of society were involved, there should be some technical evidence from unprejudiced and reliable sources. This conviction grew out of the belief that under the then existing procedure there was a striking tendency on the part of experts to accommodate their opinions to the necessities of that side of the case upon which they were testifying, and that such opinions were to a very large extent prejudiced and unreliable. To secure the reliable and unprejudiced opinions of the ablest experts in such cases, to the end that the purest degree of justice might be promoted, the Board of *791 Circuit Judges sponsored the enactment of this statute.
The Jessner court added:
By the statute under consideration the legislature has deliberately attempted to regulate the subject of expert evidence in criminal trials, to the end that there may be some evidence in the case, not bought and paid for, coming from impartial witnesses who owe no duty or allegiance to either side of the controversy, and that the fact of their impartiality shall be made known to the jury.
Id. at 193, 231 N.W. at 638.
After sec. 357.12(1), Stats. (1925), was renumbered sec. 957.27(1), Stats. (1955),[5] the statute's purpose was characterized as follows: "While the phrase `search for justice' is not used, it is exactly such search for justice, and for the truth as well, that is sought to be advanced by the legislation authorizing the appointment by the court of expert witnesses not beholden in any way to prosecution or defense." State v. Bergenthal, 47 Wis. 2d 668, 684, 178 N.W.2d 16, 25 (1970).
After more renumberings and modifications not pertinent to this appeal, sec. 971.16(1), Stats., reached its present form and section number by means of sec. 63, ch. 255, Laws of 1969.
[4]
The purpose of the statute continues as described by the Jessner and Bergenthal courts even though the predecessors to sec. 971.16(1), Stats., referred to appointment of experts generally and the statute is now limited to appointment of physicians when a mental defect or disease question has arisen or is likely to arise. Nowhere *792 in sec. 971.16, Stats., is there reference to a defendant's indigency. The statute refers to examination of a defendant "by a physician or other expert of his own choice." Section 971.16(3), Stats. A criminal defendant may await the report of physicians appointed under sec. 971.16(1) and then retain his or her own physician. Section 971.16(1) in its present form has long predated the Ake decision. Nothing in the statute's history after Ake shows that the legislature believes sec. 971.16(1) is the means of satisfying the constitutional obligation under that decision. The amendments to the statute since Ake do not affect subsection (1).[6]
[5]
We conclude that the purpose of sec. 971.16(1), Stats., is to provide the court, in the words of the Jessner court, with the means of obtaining "some evidence in the case, not bought and paid for, coming from impartial witnesses who owe no duty or allegiance to either side of the controversy." 202 Wis. at 193, 231 N.W. at 638. Consequently, the trial court did not err when it held that it possessed discretion whether to grant Burdick's request for appointment of a physician under sec. 971.16(1).
The public defender argues that our reading of sec. 971.16(1), Stats., will leave some indigent defendants without expert testimony to support a plea of not guilty by reason of mental disease or defect. We disagree. Every state has a constitutional duty by reason of Ake to provide an indigent defendant with a medical witness on the sanity issue in a criminal case. How Wisconsin satisfies that duty is not before us. We hold only that sec. 971.16(1) has a purpose other than satisfying that duty. *793 Our holding does not mean that Wisconsin will fail its duty to indigent criminal defendants.
[6]
We turn to the second issue: whether by refusing to appoint an examining physician, the trial court abused its discretion under sec. 971.16(1), Stats. The public defender claims an abuse has occurred because the trial court based its decision upon an erroneous view of the law. The judge whose discretionary decision is based on an error of law exceeds the limits of discretion. State v. Hutnik, 39 Wis. 2d 754, 763, 159 N.W.2d 733, 737 (1968). The court correctly interpreted sec. 971.16(1) to mean that the court may, at its option, appoint a physician. The claimed abuse did not occur.
[7, 8]
The public defender correctly asserts that the trial court's decision fails to demonstrate, on its face, any factor on which it could properly be based. A discretionary decision must be based on relevant factors. Carlson Heating, Inc. v. Onchuck, 104 Wis. 2d 175, 181, 311 N.W.2d 673, 676 (Ct. App. 1981). The statute's purpose defines the relevant factor for the exercise of the discretionary power it confers: to appoint a physician beholden only to the court and not to either party. But neither party requested that a physician be appointed for that purpose. A trial court does not abuse its discretion if it fails to consider a factor not relied on by either party. McClelland v. State, 84 Wis. 2d 145, 157-58, 267 N.W.2d 843, 848-49 (1978). The court did not abuse its discretion.
By the Court.Order affirmed.
NOTES
[1]  Section 971.16, Stats., provides in relevant part:

(1) Whenever the defendant has entered a plea of not guilty by reason of mental disease or defect or there is reason to believe that mental disease or defect of the defendant will otherwise become an issue in the case, the court may appoint at least one physician but not more than 3 to examine the defendant and to testify at the trial. The compensation of such physicians shall be fixed by the court and paid by the county upon the order of the court as part of the costs of the action.
(2) Not less than 10 days before trial, or such other time as the court directs, any physician appointed pursuant to sub. (1) shall file a report of his or her examination of the defendant with the judge, who shall cause copies to be transmitted to the district attorney and to counsel for the defendant. The contents of the report shall be confidential until the physician has testified or at the completion of the trial. The report shall contain an opinion regarding the ability of the defendant to appreciate the wrongfulness of the defendant's conduct or to conform the defendant's conduct with the requirements of law at the time of the commission of the criminal offense charged and, if sufficient information is available to the physician to reach an opinion, his or her opinion on whether the defendant needs medication or treatment and whether the defendant is not competent to refuse medication or treatment for the defendant's mental condition.
(3) Whenever the defendant wishes to be examined by a physician or other expert of his own choice, the examiner shall be permitted to have reasonable access to the defendant for the purposes of examination.
[2]  The charges are for violations of sec. 943.10(1)(a), Stats., burglary, a felony; sec. 943.23(2), Stats., operating a motor vehicle without the consent of the owner, a felony; sec. 343.44(1), Stats., operating a motor vehicle after revocation, a misdemeanor; and sec. 350.101, Stats., operating a snowmobile intoxicated, a misdemeanor.
[3]  Section 1, ch. 126, Laws of 1921.
[4]  Chapter 4, Laws of 1925.
[5]  Section 13, ch. 660, Laws of 1955.
[6]  See secs. 2854d. and 2854h., 1989 Wis. Act 31, amending subsections (2) and (4), and sec. 421, 1989 Wis. Act 359, amending subsection (2).
