Message Boards Message Boards

0
|
3287 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Error while exporting a graph in png, or jpeg?

Posted 3 years ago

Hi, I'm having problems to export a simple graph. I'm simply clicking save selections as. But I'm getting the same error even choosing different formats.

x = 2^-Abs[n];

ticks = {{-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 
    6, 7, 8, 9, 10}, {0.2, 0.4, 0.6, 0.8, 1}};

xg = DiscretePlot[x, {n, -10, 10}, PlotTheme -> "Monochrome", 
  PlotRange -> Full, Ticks -> ticks]

enter image description here

I don't understand what is happening. It's saying import data as JPEG when I'm trying to export that graph. I try with different graphs and it's the same, the only format possible to export was pdf. Maybe it's a problem with my Mathematica. Thank You!!!

POSTED BY: Carlos Minu

Carlos,

To Export the graph, add the line:

Export["mypath/myfile.png", xg]

or

Export["mypath/myfile.jpg", xg]

You can experiment with various export options, or use different formats. You can find the details for exporting if you type "JPEG" or "PNG" or "TIFF" in the documentation. for every file format it will give you the appropriate Export options available.

Regards,

Neil

POSTED BY: Neil Singer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract