1
$\begingroup$

Whenever I try to create a Graphics object in a Mathematica notebook, the output is always "-Graphics-". I have searched and found others who had similar problems, but attempting to implement these fixes have not been successful.

The offending option seems to be the "CommandDefaultFormatTypes" "Output" option. Others have recommended changing this to "StandardForm". After I made this change, then ran the plotting command, the output was still the same- "-Graphics-".

I am running Mathematica Version 11.3 on Windows 10 on a Microsoft Surface Pro.

Though it might not be possible to diagnose the specific issue, perhaps a workaround that would allow the Graphics to be viewed?

UPDATE:

A temporary workaround is to select each cell that only displays "-Graphics-" and press "Shift+Ctrl+N"

This converts that cell to "StandardForm" and the Graphic appears. A long term solution that changes an apparently hidden setting is still desired.

$\endgroup$
  • $\begingroup$ What happens if you run Get["Version6`Graphics`"]; $DisplayFunction = Identity; first and try plotting again? $\endgroup$ – J. M. will be back soon Feb 27 at 0:38
  • $\begingroup$ You should answer questions to make progress in this. You edited the post but ignored J.M.'s question. $\endgroup$ – Szabolcs Feb 27 at 21:02
  • $\begingroup$ @Szabolcs I appreciate that these forums are so meticulously monitored that you noticed I made an edit, but it also just feels kind of creepy. This was originally produced on a colleague's computer, and I was waiting for him to run the suggested command. Unfortunately, I used my computer to verify that the "OutputForm" option caused the problem he was seeing. Now my installation is experiencing the same issue. $\endgroup$ – Karl Feb 27 at 21:44
  • $\begingroup$ @J.M.iscomputer-less The result is still "-Graphics-". $\endgroup$ – Karl Feb 27 at 21:45
  • 1
    $\begingroup$ Try this: go to this directory, SystemOpen@FileNameJoin[{$UserBaseDirectory, "FrontEnd"}]. Quit Mathematica. Delete init.m (after having backed it up!). This will reset your Front End's settings. $\endgroup$ – Szabolcs Feb 27 at 22:13
4
$\begingroup$

You could also use CurrentValue to reset things. Reproducing your situation:

CurrentValue[$FrontEnd, {CommonDefaultFormatTypes,"Output"}] = "OutputForm";

Then:

Plot[Sin[x], {x, 0, Pi}]

-Graphics-

Fixing things:

CurrentValue[$FrontEnd, {CommonDefaultFormatTypes,"Output"}] = "StandardForm";

Then:

Plot[Sin[x], {x, 0, Pi}]

enter image description here

$\endgroup$
2
$\begingroup$

As suggested in @Szabolcs comment, the init.m file was the cause of the problem. The most direct way to fix this problem is to open the directory with your init.m ( SystemOpen@FileNameJoin[{$UserBaseDirectory, "FrontEnd"}]), quit Mathematica, open the init.m file with a program other than Mathematica, find the line with CommonDefaultFormatTypes, and change "OutputForm" to "StandardForm" (without quotes).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.