Lines and markers with varying colors

Source code Author Update time

using Plots
gaston()

You can use the line_z and marker_z properties to associate a color with each line segment or marker in the plot.

t = range(0, stop = 1, length = 100)
θ = (6π) .* t
x = t .* cos.(θ)
y = t .* sin.(θ)
p1 = plot(x, y, line_z = t, linewidth = 3, legend = false)
p2 = scatter(x, y, marker_z = (+), color = :bluesreds, legend = false)
plot(p1, p2)
Gnuplot Produced by GNUPLOT 5.2 patchlevel 8 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 -0.5 0.0 0.5 1.0 y1 gnuplot_plot_2a gnuplot_plot_3a gnuplot_plot_4a gnuplot_plot_5a gnuplot_plot_6a gnuplot_plot_7a gnuplot_plot_8a gnuplot_plot_9a gnuplot_plot_10a gnuplot_plot_11a gnuplot_plot_12a gnuplot_plot_13a gnuplot_plot_14a gnuplot_plot_15a gnuplot_plot_16a gnuplot_plot_17a gnuplot_plot_18a gnuplot_plot_19a gnuplot_plot_20a gnuplot_plot_21a gnuplot_plot_22a gnuplot_plot_23a gnuplot_plot_24a gnuplot_plot_25a gnuplot_plot_26a gnuplot_plot_27a gnuplot_plot_28a gnuplot_plot_29a gnuplot_plot_30a gnuplot_plot_31a gnuplot_plot_32a gnuplot_plot_33a gnuplot_plot_34a gnuplot_plot_35a gnuplot_plot_36a gnuplot_plot_37a gnuplot_plot_38a gnuplot_plot_39a gnuplot_plot_40a gnuplot_plot_41a gnuplot_plot_42a gnuplot_plot_43a gnuplot_plot_44a gnuplot_plot_45a gnuplot_plot_46a gnuplot_plot_47a gnuplot_plot_48a gnuplot_plot_49a gnuplot_plot_50a gnuplot_plot_51a gnuplot_plot_52a gnuplot_plot_53a gnuplot_plot_54a gnuplot_plot_55a gnuplot_plot_56a gnuplot_plot_57a gnuplot_plot_58a gnuplot_plot_59a gnuplot_plot_60a gnuplot_plot_61a gnuplot_plot_62a gnuplot_plot_63a gnuplot_plot_64a gnuplot_plot_65a gnuplot_plot_66a gnuplot_plot_67a gnuplot_plot_68a gnuplot_plot_69a gnuplot_plot_70a gnuplot_plot_71a gnuplot_plot_72a gnuplot_plot_73a gnuplot_plot_74a gnuplot_plot_75a gnuplot_plot_76a gnuplot_plot_77a gnuplot_plot_78a gnuplot_plot_79a gnuplot_plot_80a gnuplot_plot_81a gnuplot_plot_82a gnuplot_plot_83a gnuplot_plot_84a gnuplot_plot_85a gnuplot_plot_86a gnuplot_plot_87a gnuplot_plot_88a gnuplot_plot_89a gnuplot_plot_90a gnuplot_plot_91a gnuplot_plot_92a gnuplot_plot_93a gnuplot_plot_94a gnuplot_plot_95a gnuplot_plot_96a gnuplot_plot_97a gnuplot_plot_98a gnuplot_plot_99a -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 -0.5 0.0 0.5 1.0 y1 gnuplot_plot_2b gnuplot_plot_3b gnuplot_plot_4b gnuplot_plot_5b gnuplot_plot_6b gnuplot_plot_7b gnuplot_plot_8b gnuplot_plot_9b gnuplot_plot_10b gnuplot_plot_11b gnuplot_plot_12b gnuplot_plot_13b gnuplot_plot_14b gnuplot_plot_15b gnuplot_plot_16b gnuplot_plot_17b gnuplot_plot_18b gnuplot_plot_19b gnuplot_plot_20b gnuplot_plot_21b gnuplot_plot_22b gnuplot_plot_23b gnuplot_plot_24b gnuplot_plot_25b gnuplot_plot_26b gnuplot_plot_27b gnuplot_plot_28b gnuplot_plot_29b gnuplot_plot_30b gnuplot_plot_31b gnuplot_plot_32b gnuplot_plot_33b gnuplot_plot_34b gnuplot_plot_35b gnuplot_plot_36b gnuplot_plot_37b gnuplot_plot_38b gnuplot_plot_39b gnuplot_plot_40b gnuplot_plot_41b gnuplot_plot_42b gnuplot_plot_43b gnuplot_plot_44b gnuplot_plot_45b gnuplot_plot_46b gnuplot_plot_47b gnuplot_plot_48b gnuplot_plot_49b gnuplot_plot_50b gnuplot_plot_51b gnuplot_plot_52b gnuplot_plot_53b gnuplot_plot_54b gnuplot_plot_55b gnuplot_plot_56b gnuplot_plot_57b gnuplot_plot_58b gnuplot_plot_59b gnuplot_plot_60b gnuplot_plot_61b gnuplot_plot_62b gnuplot_plot_63b gnuplot_plot_64b gnuplot_plot_65b gnuplot_plot_66b gnuplot_plot_67b gnuplot_plot_68b gnuplot_plot_69b gnuplot_plot_70b gnuplot_plot_71b gnuplot_plot_72b gnuplot_plot_73b gnuplot_plot_74b gnuplot_plot_75b gnuplot_plot_76b gnuplot_plot_77b gnuplot_plot_78b gnuplot_plot_79b gnuplot_plot_80b gnuplot_plot_81b gnuplot_plot_82b gnuplot_plot_83b gnuplot_plot_84b gnuplot_plot_85b gnuplot_plot_86b gnuplot_plot_87b gnuplot_plot_88b gnuplot_plot_89b gnuplot_plot_90b gnuplot_plot_91b gnuplot_plot_92b gnuplot_plot_93b gnuplot_plot_94b gnuplot_plot_95b gnuplot_plot_96b gnuplot_plot_97b gnuplot_plot_98b gnuplot_plot_99b gnuplot_plot_100b

This page was generated using DemoCards.jl and Literate.jl.