Good evening,
I made a current-voltage graph at different temperatures for my circuit but it doesn't show me any legend or a label about the curves' temperatures (only have different colors). As I searched the ngspice44 manual, it doesn't have a guide on how to create a legend, only how to delete it. Is there a way so I can create a legend or somehow change the names of the different current-voltage curves (the r2#branch on my example) so I can distinguish each temperature?
Here is the code I have until now
" name=NGSPICE_code only_toplevel=false value=
"
.lib cornerMOSlv.lib mos_tt
.control
.probe I(r2)
foreach operating_temprature 27 127 227
set temp = $operating_temprature
DC VDD 0 1.2 0.1
run
end
plot all.I(r2)
+ title 'Current vs Voltage'
+ xlabel 'Supply Voltage (V)'
+ ylabel 'Circuit Current (uA)'
write Reference_Current_design.raw
.endc
.save all
.END
"
", and the photo is my current results from the graph.
Thank you for your time.
Without the library, your test case can not be reproduced, but I think you will get a better result with "plot dc1.I(r2) plot dc2.I(r2) plot dc3.I(r2) " in place of "plot all.I(r2)". Or you could do some more scripting, and copy those vectors to get more meaningful names.
Interesting to me, as I did not know that use of "all" even existed! Where did you find it?
Scripting with the ngspice control language seems somewhat special. But it is powerful if you know what to do.
See this:
Last edit: Holger Vogt 2025-10-24
Good evening,
First of all, I would like to thank both of you for your prompt and helpful responses (and especially Mr. Vogt for the code, which was very helpful and works perfectly for my problem).
Regarding your question, Mr. Atkinson, about the .all method, I found it in other code examples I came across online, as well as in ngspice-44 manual in section 18.5.2.1.
I hope I won’t have to bother you again, although it’s quite possible since I’m doing my thesis using ngspice, and it’s the first time I’m working with it.
Thank you both very much once again for your time.