Commit Graph

107 Commits

Author SHA1 Message Date
Giles Atkinson cd6784a079 Event nodes can be plotted with offset by "iplot", like the
digitop option for "plot".  Offsets may be explicit or automatic with "-o".
A variable to set the offset is shared with "plot".  In plotcurv.c
suppress some warnings that should not apply to event nodes and do
not falsely claim that some vectors have only one x-value.
2025-04-12 18:20:19 +02:00
Holger Vogt 62f803dfa5 Remove gcc compiler warnings 2023-08-12 15:11:04 +02:00
Giles Atkinson e5a931e537 Improve commands for vector scales. "setscale" can now change
or clear the scale of an individual vector and "compose" can
explicitly create a vector from XSPICE event node history.
2023-07-15 11:28:48 +02:00
Holger Vogt 7f65a68ad6 Improve (a little) the plotting of digital data with plot option digiplot:
Repair scaling on MS Windows:
Suppress y axis lettering and unit:
Allow or dis-allow grid.
2022-10-07 13:05:56 +02:00
Holger Vogt 12a93c9fe6 Update to plotting of event nodes:
Distance is now 1.5, scaling and cutouts are possible
(with some lack of precision).

Still missing: y axis labeling (no numbers, but node names).
2022-02-21 20:19:56 +01:00
Holger Vogt 917dab9da7 new flag 'digitop' for the 'plot' command:
Plot digital (event nodes) vertically, separated by 0.1
The grid is adapted acordingly.
set xbrushwidth=3 will yield good results.
2022-02-19 17:25:57 +01:00
Holger Vogt 57f6d41e69 Enable math characters in vector (node) names for plotting
Replace ft_getpnames() by ft_getpnames_quotes().
2021-12-13 21:41:28 +01:00
Brian Taylor 38848259e4 With the ngspice gnuplot command, enable x/y contour plots for 2d Cider save file data. Usage: gnuplot <file> xycontour <expr>. xycontour is a new flag which is ignored if the plot data is not from 2d Cider. For contours, only a single plotarg <expr> is allowed. With <expr1> vs <expr2>, only <expr1> is plotted and <expr2> is ignored. 2021-10-30 13:21:32 +02:00
Holger Vogt 36e2a9af4d Add variable 'plainplot' to allow plotting without
function support, but with node names incl chatacters like + - /.
Flag to command 'plot' is renamed to plainplot.
Error message added if vector not found.
Example file added.
2020-12-22 11:09:27 +01:00
Holger Vogt f0090508b0 If new parameter 'plain' is added to the 'plot' command,
all expression handling is skipped, vectors are plotting as is.
This allows nodes names with vectors like v(+vs) or /out
to be plotted without need resorting to double quotes.
2020-12-22 11:08:57 +01:00
Holger Vogt f03a32287f If 'set ngbehavior=ki' in .spiceinit or flag 'kicad' on the plot line:
Add " around vector names containing character /
Numerical ivision in plot line then requires spaces around /
2020-08-20 15:39:00 +02:00
Holger Vogt ba1945d685 enable flags xdelta, ydelta for gnuplot command 2020-08-20 15:27:46 +02:00
Holger Vogt 3a00520071 Improve error message 2020-05-02 14:59:31 +02:00
Jim Monte 3a72b8e562 const qualifier, graph removed from SetColor, 2020-04-27 10:16:02 +02:00
Holger Vogt f24ed96cbd plug some memory leaks 2020-03-15 08:51:15 +01:00
Holger Vogt e53632c368 When plotting arrays of curves, plot lines only in the direction
of (in absolute terms) growing x values.
Example: MOS output characteristics.
In the rare case of plotting versus varying x directions
(e.g. example memristor.sp), one has to add the flag
'retraceplot' to the plot command.
2020-03-15 08:51:14 +01:00
Holger Vogt 8d986e50cc remove the remains of the old xgraph program
that has not been supported for many years
2020-03-15 08:51:12 +01:00
Holger Vogt 32722ecc57 some missing brackets, typos 2020-03-15 08:51:12 +01:00
Vogt 728ddae41e Set the color tables and linewidths personal for each graph,
added to strucht graph
Use only these data for plotting.
If zooming a plot windows, set as an extra parameter the graph id
of the 'mother graph'. Copy its color and line data to the new graph.
This is done by an extra parameter sgraphid to the internal plot
command that is issued in fcn PlotWindowProc().
Thus zooming will keep the background, text/line and graph colors.
Function setcolor() will always look into the colorarray of the
current graph.
2020-03-15 08:51:12 +01:00
Holger Vogt 3eb04b2fdc improve on memory leaks
(not yet completely satisfying)
2020-03-15 08:51:08 +01:00
Holger Vogt 46adeb5eaa plug memory leaks for the 'plot' command 2020-03-15 08:50:57 +01:00
Jim Monte 57ffe1769f Fixed "phantom vector" issue with plots and crash when plots are resized. See bugs #419 and #423 for details. Also several parameters were changed from char * to const char * in the plotting functions. 2020-03-15 08:50:54 +01:00
Jim Monte 068df274bf Made ft_numparse() thread-safe (no internal static variables) and prepared to support ngspice variable type CP_NUM. 2020-03-15 08:50:52 +01:00
Holger Vogt afdf3ff710 Partially undo commit 016c558d7, 2019-05-01
If sacles for plotting differ, issue a warning.
Skip this plot command only, when strict_errorhandling is set.
2019-08-13 23:27:15 +02:00
Holger Vogt 8af1663bba Try to detect, if one wants to plot vectors with
different scale vectors into the same graph.
Issue a warning and skip the plot command.
2019-08-13 23:26:58 +02:00
Holger Vogt 94fa272c9d A hack to repair bug reported by Clyde R. Shappee 2018-10-27 12:28:01 +02:00
Holger Vogt 09c876550f prevent string overflow by adding the string length
to the cp_getvar parameters. Used only with CP_STRING
2018-07-22 14:57:49 +02:00
h_vogt d4adb027d2 avoid retrace in output graph by adding label 'noretraceplot'
to the plot command, that creates a lin plot trying to avoid retracing
2018-05-18 17:08:27 +02:00
rlar 141ed61ec8 use memcpy() instead of deprecated bcopy() 2016-07-30 20:58:19 +02:00
h_vogt 841f2846fe plotit.c, properly free a reversed wordlist 2016-04-01 18:05:40 +02:00
rlar 40a0cea0d2 swap some `SWAP' arguments for readability 2016-03-22 15:23:05 +01:00
rlar bd0bc3038b use `SWAP' macro 2016-03-22 13:04:13 +01:00
rlar df70661c3a dvec abstraction, #11/11, introduce `dvec_realloc()' 2015-12-28 20:34:42 +01:00
rlar c2a7821449 dvec abstraction, #10/11, introduce `dvec_trunc()' 2015-12-28 20:34:42 +01:00
rlar 8243696338 dvec abstraction, #8/11, upgrade `dvec_alloc()' 2015-12-28 20:34:42 +01:00
rlar 908c650f72 dvec abstraction, #3/11, use `dvec_alloc()' 2015-12-28 20:34:42 +01:00
rlar 08ad3f6ab5 dvec abstraction, #1/11, reorder 2015-12-28 20:34:42 +01:00
rlar 5a678e38dc plotting/plotit.c, xtend(), #7/7 reorder 2015-12-27 11:21:46 +01:00
rlar 64d6a5d7c0 plotting/plotit.c, xtend(), #6/7 drop some local variables 2015-12-27 11:21:45 +01:00
rlar d1a68482a5 plotting/plotit.c, xtend(), #5/7 use `TREALLOC()' 2015-12-27 11:21:44 +01:00
rlar 64b43b0c68 plotting/plotit.c, xtend(), #4/7 support vector of zero length 2015-12-27 11:21:43 +01:00
rlar 7c6fc1343b plotting/plotit.c, xtend(), #3/7 complex assignment 2015-12-27 11:21:42 +01:00
rlar 13e649209c plotting/plotit.c, xtend(), #2/7 fix index `i' 2015-12-27 11:21:41 +01:00
rlar 83fc07e770 plotting/plotit.c, xtend(), #1/7 don't free already freed data 2015-12-27 11:21:40 +01:00
rlar 1b62c1f050 plotting/plotit.c, plotit(), `v_length' shall be updated (lpr device, asciiplot) 2015-12-23 10:30:47 +01:00
rlar a1439f5d4d plotting/plotit.c, rename local variable `j' --> `y_type' 2015-12-15 19:58:11 +01:00
rlar f97e4a2a35 plotting/plotit.c, cleanup search for common y_type 2015-12-15 19:57:12 +01:00
rlar 73731bdf77 frontend/plotting/plotit.c, cleanup, reduce scope of `struct dvec *dv' 2015-10-04 15:38:27 +02:00
Marcel Hendrix 02fe549be7 src/frontend/plotting/plotit.c, allow "plot xlog ylog" (equiv to "plot loglog") 2015-05-14 15:56:45 +02:00
rlar c5e0bcde04 cleanup using `hypot()' 2014-12-06 20:41:11 +01:00