Commit Graph

59 Commits

Author SHA1 Message Date
Holger Vogt 6b0ba58e42 Fix bug 590, but only for GUI with MS Windows.
X11 for Cygwin, Linux is not yet o.k.
2022-10-17 20:27:15 +02:00
Holger Vogt eee07be10d 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-07-20 15:11:51 +02:00
Giles Atkinson e16564edf7 Make "nogrid" plotting option work. The deleted code was in the original
commit, so the reason for it can not be traced.
2022-04-06 10:24:16 +02:00
Holger Vogt 0557bc60bf Prevent crash if nsp is evaluated to 0 2022-02-21 16:56:16 +01:00
Holger Vogt 4f82a24df2 Add parameter 'isgrid' to plotting of arcs.
Smithgrid and polar plots could not discern between xgridwidth and
xbrushwidth. This is now available, similar to straight line plotting.
Tested also for PS and SVG.
2022-02-01 12:23:29 +01:00
Holger Vogt f61ea3aa96 if 'set nounits' is given, plotting of the units is suppressed
(they may be added manually to the y and x labels for SI conformity).
2021-03-14 15:32:49 +01:00
Holger Vogt 43f3fceb75 enable svg also for console app on Windows 2021-03-14 15:32:31 +01:00
Holger Vogt dacd727d87 separate svg and postscript
suitable text placement for svg
2021-03-14 15:30:06 +01:00
Holger Vogt 87b59d22a5 add generation of svg graphics file
based on patch no. 97 by Giles Atkinson
2021-03-14 15:29:53 +01:00
Holger Vogt 273b0fb4a3 fix a plotting bug with xlog axis and ylabels 2021-01-20 16:45:54 +01:00
Holger Vogt 527abee022 Do not print "Units" on a graph, if unknown type
or settype notype is given.
2020-08-20 15:25:00 +02:00
Jim Monte 3a72b8e562 const qualifier, graph removed from SetColor, 2020-04-27 10:16:02 +02:00
Holger Vogt 74dbb1e843 Commit [88653f] Fixed assorted compiler warnings, memory leaks, etc.
branch beta_jdm by Jim Monte
2020-04-25 10:29:16 +02:00
Holger Vogt f518766c66 add a slight offset between y axis labels and grid 2020-03-15 08:51:14 +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 38bb89663d replace old_x11 by HAVE_LIBXFT defined in configure 2020-03-15 08:51:09 +01:00
Holger Vogt 7690b64571 add missing declaration of old_x11 2020-03-15 08:51:05 +01:00
h_vogt dbd0a5743a Enable utf-8 and UNICODE for string handling.
preprocessor flag EXT_ASC resets handling to old behaviour.
Add utf-16 wide char to all Windows string i/o.
Add translation between utf-8 and utf-16.
Add angle to fcn DevDrawText.
2020-03-15 08:51:04 +01:00
Holger Vogt 65ee87e0a2 grid.c, windisp.c, vertical text for postscript and WINGUI
Arial as standard font for WINGUI
2018-11-18 15:51:09 +01:00
Holger Vogt 56701e3d10 add rotation angle to text output, currently used only by postscript,
ignored by all others
2018-11-18 15:50:56 +01:00
Holger Vogt 417dbfef72 undo the previous commits dealing with snprintf,
use the C99 compliant function also with MS Visual Studio
2018-05-31 11:37:51 +02:00
Holger Vogt 3b4640dee4 _snprintf in Windows 7 does not automatically put a '\0'
to the end of the buffer, only if there is space available.
That will change in the future if Snprintf is used.
2018-05-31 10:24:09 +02:00
Holger Vogt 560cb6e970 plotting/grid.c, bug fix, avoid string buffer overflow
Prevent a crash of example/FFT_test.cir.
Buffer 'buf' in function drawlingrid() has been too small.
Increase 'buf' size, and add some protection.

The example file examples/plot/test-small-plot.cir
shows the limits of plotting:
  difference in two numbers at digit 14 is plotted well.
                            at digit 15 is plotted with bugs.
                            at digit 16 is reduced to integer.

consider compiling with
  -O1 -D_FORTIFY_SOURCE=2
for gcc, and
  /GS
for visual studio.
2018-01-27 21:58:15 +01:00
rlar aca1b3a374 use 'abs()' 2016-10-15 15:06:17 +02:00
rlar bd0bc3038b use `SWAP' macro 2016-03-22 13:04:13 +01:00
rlar 2b3220086d graph.h, grid.c, enforce consistent string buffer size (plot "units", LABEL_CHARS) 2015-03-08 19:36:46 +01:00
rlar c5e0bcde04 cleanup using `hypot()' 2014-12-06 20:41:11 +01:00
Giorgio Vazzana 0348dcd251 bug fix, #286 buffer overflow in src/frontend/plotting/grid.c 2014-06-26 19:50:18 +02:00
rlar 83e3100917 remove unused variables 2012-12-01 16:05:20 +01:00
h_vogt 986f9b7535 grid.c: prevent overflow of div_list 2012-09-26 21:12:26 +02:00
rlar fe1acd3757 src/frontend/** remove superfluous `return' invocations 2012-09-22 19:33:55 +02:00
rlar 7454a6d486 src/frontend/**, whitespace, indentation, ...
untabify
delete-trailing-whitespace
braces
...

checked for object file invariance on linux
2012-09-20 20:30:53 +02:00
rlar e91e3c4ec7 lingrid(), avoid buffer overflow
Bug ID: `Buffer overflow detected - ID: 3510521'
    reported by Zsolt Makaró

  The variable `mag3' sometimes seems to take
    unexpected values
    (for example log10 can be -Inf, which will be casted to 0x80000000)
  and seems then to have overflown a buffer buf[LABEL_CHARS]
2012-03-27 21:07:12 +02:00
rlar 0b5042e7da remove CVS `Id',`log' etc. keyword incantations 2011-12-13 19:57:45 +00:00
rlar 10346e055c #1/4 #include <ngspice/...> --> #include "ngspice/..." 2011-12-11 18:05:00 +00:00
h_vogt ccd115c6e2 Error message on exceeding resolution limit 2011-09-11 12:55:30 +00:00
rlar d26015586c #1/7 use a subdirectory "ngspice" for includes to create a uniq namespace 2011-08-20 17:27:09 +00:00
rlar f8e41f9fb5 remove second incarnation of `grid.h' 2011-08-12 09:31:52 +00:00
rlar 9e86e5ca66 rewrite (double)literal --> floating-point-literal 2011-08-09 08:07:56 +00:00
h_vogt 3547fdc5f3 explicit casts double -> int 2011-06-11 18:38:38 +00:00
rlar eb06eeb4d9 swallow type conversion warnings 2010-11-23 19:26:00 +00:00
rlar e6c30efe46 Nr 4/5 (x = ...) != NULL , swallow warnings 2010-11-19 18:52:44 +00:00
rlar abb87a6115 rename `IGNORE()' --> `NG_IGNORE()' 2010-11-16 20:38:24 +00:00
rlar 80286e0032 pour `IGNORE()' all over the source 2010-11-16 19:11:32 +00:00
rlar 75b6eeb94a add `int' casts to some strlen() expressions, and center labels on a xlog scale 2010-11-06 20:17:19 +00:00
rlar 1779d62558 add some `int' and `size_t' casts 2010-11-06 20:14:21 +00:00
rlar 5f4b0aa798 (int) cast the return value of some strlen() invocations 2010-11-06 16:54:11 +00:00
rlar 6b5debfc1e use `NUMELEMS' and add some `(int)' casts 2010-11-02 17:23:46 +00:00
rlar 8f8071aceb fix some ancient \n\r and \r\n typos 2010-09-19 16:30:39 +00:00
rlar 76d22c3691 function rename, Update() -> DevUpdate() 2010-09-08 18:06:51 +00:00