White background plot

Standard plot has black background that’s not suitable if you have to copy in a text. And in my opinion it’s not the best way to show data in general.
How can I set background to white, and of course text to black?

KiCad 5.1.5 in openSuse Linux

Application: KiCad
Version: 5.1.5-5.1.5, release build
Libraries:
wxWidgets 3.0.3
libcurl/7.60.0 OpenSSL/1.1.0i zlib/1.2.11 libidn2/2.2.0 libpsl/0.20.1 (+libidn2/2.0.4) libssh/0.8.7/openssl/zlib nghttp2/1.39.2
Platform: Linux 4.12.14-lp151.28.40-default x86_64, 64 bit, Little endian, wxGTK
Build Info:
wxWidgets: 3.0.3 (wchar_t,STL containers,compatible with 2.8) GTK+ 2.24
Boost: 1.66.0
OpenCASCADE Community Edition: 6.9.1
Curl: 7.60.0
Compiler: GCC 7.4.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_PYTHON3=OFF
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_USE_OCC=OFF
KICAD_SPICE=ON

What you have to plot and for what purpose?

EDIT: this seems to be in simulation category, that may explain something, but the details should be stated in the question, too.

Same here. Are you plotting a schematic or PCB?
Simulation? Ah, I never printed anything from there.

I’ve never had problems with schematic, KiCad can even turn them nicely into Black & White for my monochrome laser printer.

When plotting from Pcbnew there is an option for “Negative plot”
image

I think that it was clear that in simulation I need to plot voltage and/or current.

Here you can see plot with black background I need to change in white.

Clearly obvious to you, but I would have missed it without eelik’s edit, which he added when I was halfway my post.

I had a look through the settins of KiCad’s integrated spice simulator, but I could also not find anything relevant.
I was curious about a wishlist for simulation features, but am not even sure whether to look at gitlab or github for the moment.

So for now I only see 2 workarounds. Either save a picture (or .svg?) from within the simulator and post process with a suitable program (simple command line program to invert colors?) or:
Spice Simulator / Simulation / Show Spice Netlist and then copy / paste into another simulator to redo the simulation, or save the netlist directly from Eeschema / Tools / Generate Netlist File / Spice

In nightly build this feature (switch black/white background) is already available. Then I suppose there is a way to do in 5.1.5.
And I found here in page 11

Example:
set color0 = white ; background color
set color1 = blue ; text and grid color

that sound similar to what I need. I tried to insert these in “text box” in my schematic without any effect. Not sure I understood well but it seems they are “command” .

May be you’re right but I don’t see anything else to plot in simulation but voltage and current.

ngspice in KiCAD and ngspice stand-alone are two different things.

ngspice plotting in KiCAD/Eeschema is exclusively handled by Eeschema only. I do not know of any color selection switch available in 5.1.5. Standalone ngspice plotting is switched off. Thus the ngspice manuals with their chapters and rules about plotting are not valid.

As paulvdh said, there is a way to use standalone ngspice from within Eeschema. Please have a look at http://ngspice.sourceforge.net/ngspice-eeschema.html#external for some hints about the procedure. Then you will have all the ngspice commands available for plotting.

The next ngspice release, ngspice-32, due early April, will have full color capability for background, grid/text and graphs.

1 Like

Another alternative is using the ngspice ‘gnuplot’ command within Eeschema/ngspice.

Take the laser driver example from /usr/share/kicad/demos/simulation/laser_driver as an example.

Before starting Eeschema from the bash window, set the locale for the bash session by

export LC_NUMERIC="C"

After starting Eeschema and loading the example, replace the text in the textbox of the Eeschema window

.tran 10p 150n

by

.tran 10p 150n
.control
set controlswait
gnuplot gpp V("/out") V("/in")
.endc

The output file name ‘gpp’ is arbitrary. Gnuplot offers a white background. Without the locale setting, and not being in the US, gnuplot may fail opening.

1 Like

Very good. Hope it will be possible to manage horizontal and vertical zoom independently too.

Unfortunately I can’t install gnuplot because of conflict with Qt5. Ill wait for ngspice 32.

Just updated to 5.1.8 and white background of simulation plot is still unavailable. Or I missed it.
Any hint to obtain white background in stable release?

He was talking about standalone ngspice, not the ngspice interface built into KiCad:
https://sourceforge.net/projects/ngspice/files/ng-spice-rework/33/

Then I have two questions:

  1. is there any way in 5.1.8 (the current stable release) to have white background in simulation plot?

  2. given that in nightly this feature is available when it will be available in a stable release? Hope before in version 6.

I’m sorry. I do not know enough to answer those questions. Maybe someone else can?

5.1.x releases are bugfix releases, no new features.

The nightly builds are daily development “releases” which will lead to the next stable x.y version which at this time will be 6.0. So all new features which are now available in the nightly builds will be in 6.0 but not earlier.

1 Like

Any idea on when version 6 will be available?

I heard some rumors about FOSDEM 2021 being target date so February 2021

I think it was for rc1, but the history shows that we shouldn’t hold our breaths, and even after rc1 the final release can take several months. But of course this time it may be different, and if people test and report bugs diligently it will be sooner.

1 Like

Thanks for answers .

I seldom use the simulation (preferring LTspice) but, on the few occasions when I do use it, I save the Image and use an external program to Invert the colors… That gives me something I can print on paper…

I know that LTspice is good in simulation but this need to draw a copy of schematic in LT too

Good idea waiting for the feature in KiCad.