- added colored postscript output
- added resizeable postscript output
I've added 3 Variables:
hcopypscolor
set it to enable color support
hcopyheight
hcopywidth
set them to change the size
take a look at the results at:
http://www.my-stuff.onlinehome.de/ngspicedemo.html
best regards
werner
Logged In: YES
user_id=223984
forgotten to attach the file
src/frontend/postsc.c replacement
Logged In: YES
user_id=223984
the patch and the rework-14 crash if I do this:
- start ngspice in interactiv mode
- simulate something
- set hcopydevtype to postscript
- create two plots on X11
- press the hardcopy button of both plot windows in short time
-> ngspice crashes with seg-fault
I think the problems are the static constants inside the postscript
frontend. Or maybe it's the fact that inside hardcopy_com.c the
currentgraph
has been set too late.
(see patch)
Inside the new postsc.c I've removed all static variables and
put it into
the DEVDEP structure.
Second I've used abbreviations for the postscript primitives.
This reduces
the size of the ps-file by 50%.
Some notes about the graphic backend:
The frontend writing would be much easier if the backend call
the frontend
functions in the following sequence:
- first provide currentgraph by the backend
- frontend functions
- last destroy currentgraph
The patch use this order but maybe that the graph is twice in
the memory now.
(haven't tracked that)
Inside the graphics itself the following things could be improved:
polar and smith plot:
- the "imag" and the "real" label are on the wrong place
polar plot:
- the grid (the circles) density seems to depend on the values
not on the size
smith plot:
- on the right side there are sometimes 2 wrong arcs
- the wrong color numbers are used by the smith grid
example: plot ac.v(1) ac.v(3) ac.v(5) smith
use the colors 2 4 and 6
instead of the colors 2 3 and 4
- the backend delivers some strange points tho the frontend:
for example: n -2147483600 -2147483600 m s
all plots:
- if there are more than 4 curves in a plot, the legend is written
into the plot.
- there are a lot of redundant points inside the curves:
example: P1(8,0), P2(9,0), P3(11,0)
the point P2 is redundant as it is on the line between P1
and P3.
that's all for now
best regards
werner
attachments: an example ps-file, the postsc.c and the patch for
hardcopy_com
smithgrid ps-file
patch for com_hardcopy.c
Logged In: YES
user_id=223984
Caldun Ca has pointed out a declaration error
postsc.c:434: conflicting types for `PS_SetColor'
postsc.h:17: previous declaration of `PS_SetColor'
I've change the function to void in postsc.c
please don't use the older files
best regards
werner
postsc.c 2003-05-07
Logged In: YES
user_id=58073
Thank you Werner for the patch, and please exscuse me for
the late answer. Ngspice code into CVS has support for
colored postscript. The code was given me by Dietmar
Warning but he took the patch elsewhere... may be your
patch. I have to check. I will look at the files you contribute
and make necessary changes.
Ciao,
Paolo
Logged In: YES
user_id=223984
Hi Paolo,
the current CVS code is the same as in the first upload
of me on 2002-12-01.
Later I've removed the static variables of the code and
used abreviations for postscript primitives.
best regards
werner
Logged In: NO
Hey there. I have a problem, when I do the command hardcopy it says: "internal error: bad linestyleid inside PS_SetLinestyle" and the graphic don't show any color.
see ID: 1473616
Holger