octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62241] Printing a plot to file triggers autos


From: Rik
Subject: [Octave-bug-tracker] [bug #62241] Printing a plot to file triggers autoscaling of the axes for small vertical scaling values
Date: Fri, 1 Apr 2022 15:33:34 -0400 (EDT)

Follow-up Comment #2, bug #62241 (project octave):

As was pointed out in comment #1, very small values are always going to be a
problem with plotting systems.  In particular, Octave uses OpenGL for
rendering plots (unless you are using the gnuplot toolkit) and OpenGL uses
single precision for all values such as coordinates.

The solution, also pointed out in comment #1, is simply to scale your data. 
For example,


xs = x * 1e12;
plot (xs, y);
xlabel ("X (in picomoters)");


You could also set the ticklabels manually.


plot (1:4, 1:4, 'o-');
set (gca, "xtick", 1:4);
set (gca, "xticklabels", {"1e-10", "2e-10", "3e-10", "4e-10"})


On newer versions of Octave the interpreter for the ticklabels is "tex" so you
can even have superscripts and subscripts.  The example above could be


set (gca, "xticklabels", {"1^{-10}", "2^{-10}", "3^{-10}", "4^{-10}"})


which shows rather nicely as

(file plot_exp_labels.png)


(file #53031)

    _______________________________________________________

Additional Item Attachment:

File name: plot_exp_labels.png            Size:18 KB
    <https://file.savannah.gnu.org/file/plot_exp_labels.png?file_id=53031>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62241>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]