2
$\begingroup$

I suddenly can't create jpegs or pngs using the menu. I have not changed versions or operating systems lately, but the method I've used all along suddenly doesn't work.

When I create a plot, left-click on it, then right-click and choose "Save Graphics As..." a Message window pops up with the error message below. Restarting MMa and my computer did not help.

4/17/16 18:41:09 The specified setting for the option WindowSize cannot be used.

During evaluation of In[7]:= Set::shape: Lists {SystemConvertersDumpheight$883,System`ConvertersDump`width$883} and {0} are not the same shape. >>

During evaluation of In[7]:= Image::imgarray: The specified argument {} should be an array of rank 2 or 3 with machine-sized numbers. >>

Strangely, I can still use "Save Graphic As..." to create PDFs.

And Export[] still works:

Export["C:\Users\admin\Desktop\example.jpg", Plot[expr, {x, 0, 3}]]

The plot I was trying to save as a jpeg was generated by this code:

ClearAll["Global`*"];
gau[x_, v_] := Exp[-(x^2)/(2 v)]/Sqrt[2*Pi*v];
f[x_, m_, v_] = gau[x + m, v] + gau[x - m, v];
g[x_, m_, v_] = gau[x + m, v] - gau[x - m, v];
h[x_, m_, v_] := 2*Log[f[x, m, v]/f[0, m, v]] + (x^2)/v + 6 x*g[x, m, v]/f[x, m, v];
Plot[h[x, 3, 1], {x, 0, 3}]

And to emphasize, I'm doing this exactly the way I did it two days ago and for months before that, and this problem just started today. Export[] gets the job done, but "Save Graphic As..." suddenly doesn't work right.

I am running MMa 10.3 on Windows 10.0.10586

$\endgroup$
  • 3
    $\begingroup$ It is cunningly prompting you to use PNGs, because nobody likes fuzzy graphs. $\endgroup$ – wxffles Apr 18 '16 at 4:25
  • $\begingroup$ Please also provide the code used to Export the plot. $\endgroup$ – Yves Klett Apr 18 '16 at 4:59
  • $\begingroup$ @Bill, thanks for the help, but I didn't understand any of that. I am not an advanced user. Also, I didn't use Export. $\endgroup$ – Jerry Guern Apr 18 '16 at 7:18
  • $\begingroup$ @wxffles Same problem when I tried PNGs. $\endgroup$ – Jerry Guern Apr 18 '16 at 7:18
  • $\begingroup$ @YvesKlett I didn't use code. I left-clicked the output plot, then right-clicked on it, and chose "Save Graphic As..." $\endgroup$ – Jerry Guern Apr 18 '16 at 7:19
2
$\begingroup$

Code:

ClearAll["Global`*"];
gau[x_, v_] := Exp[-(x^2)/(2 v)]/Sqrt[2*Pi*v];
f[x_, m_, v_] = gau[x + m, v] + gau[x - m, v];
g[x_, m_, v_] = gau[x + m, v] - gau[x - m, v];
h[x_, m_, v_] := 2*Log[f[x, m, v]/f[0, m, v]] + (x^2)/v + 6 x*g[x, m, v]/f[x, m, v];
Plot[h[x, 3, 1], {x, 0, 3}]

Example:

*.png example

Export["example1.png",Plot[h[x, 3, 1], {x, 0, 3}]]

*.jpg example

Export["example2.jpg",Plot[h[x, 3, 1], {x, 0, 3}]]

Output:

*.png example:

png example

*.jpg example

jpg example

Reference:

Export

Tutorial:

Export Graphics

$\endgroup$
  • $\begingroup$ I know about all this. Export[] works fine. It's "Save Graphic As..." on the menu that suddenly stopped working. $\endgroup$ – Jerry Guern Apr 18 '16 at 11:27

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.