@@ -44,20 +44,38 @@ default to extrema(wmag) if xlims/ylims not defined or empty
44
44
"""
45
45
function getlims (xylims, plotattributes, wmag)
46
46
lims = get (plotattributes, xylims, extrema (wmag))
47
- if lims isa Tuple{<: Number , <: Number } # If x/ylims not supplied as empty
48
- return lims
49
- else
50
- return extrema (wmag)
47
+ if ! isa (lims, Tuple{<: Number , <: Number }) # If x/ylims not supplied as empty
48
+ lims = extrema (wmag)
49
+ end
50
+ if ! isempty (get_serieslist (plotattributes))
51
+ subplot = get (plotattributes, :subplot , 0 )
52
+ subplot == 0 && (return lims)
53
+ se = seriesextrema (xylims, plotattributes, subplot)
54
+ lims = extremareducer (lims, se)
55
+ end
56
+ lims
57
+ end
58
+
59
+ get_serieslist (plotattributes) = plotattributes[:plot_object ]. series_list
60
+ get_serieslist (plotattributes, subplot) = plotattributes[:plot_object ]. subplots[subplot]. series_list
61
+
62
+ function seriesextrema (xylims, plotattributes, subplot)
63
+ serieslist = get_serieslist (plotattributes, subplot)
64
+ isempty (serieslist) && (return (Inf , - Inf ))
65
+ sym = xylims == :xlims ? :x : :y
66
+ mapreduce (extremareducer, serieslist) do series
67
+ extrema (series[sym])
51
68
end
52
69
end
70
+ extremareducer (x,y) = (min (x[1 ],y[1 ]),max (x[2 ],y[2 ]))
53
71
54
72
function getLogTicks (x, minmax)
55
73
minx, maxx = minmax
56
74
major_minor_limit = 6
57
75
minor_text_limit = 8
58
76
min = ceil (log10 (minx))
59
77
max = floor (log10 (maxx))
60
- major = 10 .^ collect (min: max)
78
+ major = 10 .^ (min: max)
61
79
if Plots. backend () != Plots. GRBackend ()
62
80
majorText = [latexstring (" \$ 10^{$(round (Int64,i)) }\$ " ) for i = min: max]
63
81
else
0 commit comments