Saving graphs as pdf

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

Dag Kolsrud
Posts: 15
Joined: Mon Jul 17, 2017 3:49 am

Saving graphs as pdf

Postby Dag Kolsrud » Thu Aug 31, 2023 2:02 am

When making graphs, they look the same in EViews 12 and 13. But I have to use EViews 12 when I save (print to disk) the graphs as pdf to get the same look in pdf as in EViews. If I use EViews 13 and save the graphs, the lines get a different and ugly look as pdf. Is that due to EViews or Windows?

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Saving graphs as pdf

Postby EViews Steve » Thu Aug 31, 2023 2:02 pm

Some screenshots would be helpful.

Dag Kolsrud
Posts: 15
Joined: Mon Jul 17, 2017 3:49 am

Re: Saving graphs as pdf

Postby Dag Kolsrud » Fri May 31, 2024 2:47 am

I have enclosed two screen shots of two spools generated by the same EViews program written by me. The only difference is that the program generating the spools was run on two different versions of EViews: EViews 12 and EViews13. Each spool was saved on disk by the manual EViews menu operations Object->Print->Printer: Microsoft Print to PDF. The resulting pdf-files are also enclosed. The pdf-files show all graphs in the spools, not only the graphs in the screen shots of the spools displayed in EViews.

The graphs are ok in the spool and pdf file generated by EView 12, but not in the spool and pdf-files generated by EViews 13. In the latter, the dashing is different (and missing in Fig 2.17) in the spool, and looks terrible in the pdf. In the pdf the lines are missing in the legend.

I wonder if the problems could be due to EViews using functions in the Windows operating system differently in the two versions 12 and 13. I am looking forward to your answer.

Sincerely, Dag
Attachments
Spool EViews 12.png
Spool EViews 12.png (124.45 KiB) Viewed 64626 times
Print pdf EViews 12.png
Print pdf EViews 12.png (31.89 KiB) Viewed 64626 times
Print pdf EViews 13.png
Print pdf EViews 13.png (35.15 KiB) Viewed 64626 times

Dag Kolsrud
Posts: 15
Joined: Mon Jul 17, 2017 3:49 am

Re: Saving graphs as pdf

Postby Dag Kolsrud » Fri May 31, 2024 3:24 am

One spool did not make it into the previous reply
Attachments
Spool EViews 13.png
Spool EViews 13.png (113.3 KiB) Viewed 64598 times

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Saving graphs as pdf

Postby EViews Steve » Fri May 31, 2024 7:26 am

As mentioned in a previous post, EViews 13 has a new opacity setting that defaults to being ON which might be the cause of your dashed line problem.

Try turning off opacity for your graph line to see if that fixes it.

Code: Select all

mygraph.setelem(1) lineopacity(off) 'turns off line opacity

Dag Kolsrud
Posts: 15
Joined: Mon Jul 17, 2017 3:49 am

Re: Saving graphs as pdf

Postby Dag Kolsrud » Wed Jun 05, 2024 12:21 am

Unfortunately, the command lineopacity(off) does not change anything. Do you have any other potential explanation or do I have to continue doing the graphing in Eviews 12?

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Saving graphs as pdf

Postby EViews Steve » Wed Jun 05, 2024 7:28 am

Did you turn off line opacity for each line in your graph? My code was only meant to be an example, but your graph seems to have multiple lines. If you still can't see any changes, please send me an EViews workfile and program that can reproduce the error you're seeing. Once I can replicate the issue, I'll look into fixing it.

Dag Kolsrud
Posts: 15
Joined: Mon Jul 17, 2017 3:49 am

Re: Saving graphs as pdf

Postby Dag Kolsrud » Tue Jun 18, 2024 1:09 am

Please find a workfile and a program that graphs series in the workfile. The program can be run by EViews12 and 13, but it is necessary to comment/uncomment lines to (de)activate the OPACITY command which only EViews 13 accepts.
Attachments
test_workfile_figure2_16_stat_nor.wf1
(73.9 KiB) Downloaded 22563 times
test_figur_2_16.prg
(3.77 KiB) Downloaded 22263 times

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Saving graphs as pdf

Postby EViews Steve » Tue Jun 18, 2024 7:41 am

Thanks for the info. I was able to reproduce the issue you're seeing. I'll take a closer look to see if there's a fix or a workaround.

igor
Posts: 27
Joined: Thu Dec 24, 2015 10:32 am

Re: Saving graphs as pdf

Postby igor » Tue Jun 18, 2024 10:07 am

Interesting example. Try fillopacity(off) instead of lineopacity(off) for the first two lines.

EViews Steve
EViews Developer
Posts: 844
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Saving graphs as pdf

Postby EViews Steve » Tue Jun 18, 2024 10:52 am

I've confirmed the issue seems to remain, even after using both fillopacity(off) and lineopacity(off) for all graph elements.

Visually, it seems like the dashes are scaled too large on the PDF, even though they look fine in the graph window. Changing the dashed-line type to a larger dash makes the problem even more pronounced in the PDF.

For now, I think you'll have to make do with the PNG output instead. We'll try to address this issue within the next few weeks.

tvonbrasch
Posts: 569
Joined: Fri Apr 15, 2011 5:35 am

Re: Saving graphs as pdf

Postby tvonbrasch » Tue Jun 10, 2025 10:31 am

I wanted to check if there have been any updates or fixes regarding the PDF export issues with dashed lines and legends in EViews graphs. Is there any new information on when this might be addressed?

Dag Kolsrud
Posts: 15
Joined: Mon Jul 17, 2017 3:49 am

Re: Saving graphs as pdf

Postby Dag Kolsrud » Fri Apr 17, 2026 6:14 am

In Statistics Norway we try to use Eviews as much as possible for building, maintaining and using a large macro model, and also for producing tables and figures/graphs. Unfortunately, after EViews12, we experience problems with graphing and have to use EViews12 to get dashed lines that look good when saved to disk (as pdf files) (se previous entries in this tread). When I try to replace dashed lines (for forecasts) with solid lines with the same color/hue but lighter tint (than the historical series), both get the same color. If I try to give them different colors, they still get the same color:

if !eviews_versjon = 12 then 'EViews12
{%gr}.setelem(1) linecolor(@rgb({%color1})) linepattern(solid) legend(%serie1) axis(l) linewidth(!valuta_linewidth )
{%gr}.setelem(2) linecolor(@rgb({%color1})) linepattern(DASH1) legend() axis(l) linewidth(!linewidth)
{%gr}.setelem(3) linecolor(@rgb({%color2})) linepattern(solid) legend(%serie2) axis(r) linewidth(!valuta_linewidth )
{%gr}.setelem(4) linecolor(@rgb({%color2})) linepattern(DASH1) legend() axis(r) linewidth({!linewidth})
{%gr}.setelem(5) linecolor(@rgb({%color3})) linepattern(solid) legend(%serie3) axis(r) linewidth(!valuta_linewidth)
{%gr}.setelem(6) linecolor(@rgb({%color3})) linepattern(DASH1) legend() axis(r) linewidth(!linewidth)
else 'EViews14
{%gr}.setelem(1) linecolor(@rgb({%color1})) linepattern(solid) legend(%serie1) axis(l) linewidth(!valuta_linewidth )
{%gr}.setelem(2) linecolor(@rgb({%color2})) linepattern(solid) legend() axis(l) linewidth(!linewidth)
{%gr}.setelem(3) linecolor(@rgb({%color3})) linepattern(solid) legend(%serie2) axis(r) linewidth(!valuta_linewidth )
{%gr}.setelem(4) linecolor(@rgb({%color1})) linepattern(solid) legend() axis(r) linewidth({!linewidth})
{%gr}.setelem(5) linecolor(@rgb({%color2})) linepattern(solid) legend(%serie3) axis(r) linewidth(!valuta_linewidth)
{%gr}.setelem(6) linecolor(@rgb({%color3})) linepattern(solid) legend() axis(r) linewidth(!linewidth)
endif

Why can we not format the line type in EViews 13 and 14?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13583
Joined: Tue Sep 16, 2008 5:38 pm

Re: Saving graphs as pdf

Postby EViews Gareth » Fri Apr 17, 2026 8:20 am

Do you have a simple example we can examine?


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 0 guests