Re: Sideways violin plots in one plot cmd?

Juhász Péter <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.devel
Message-ID <[email protected]>
On Sat, 2020-08-15 at 13:17 -0700, Ethan A Merritt wrote:
> On Friday, 14 August 2020 10:34:52 PDT Juhász Péter wrote:
> > On Wed, 2020-08-05 at 23:46 -0700, Dima Kogan wrote:
> > > A question. I'm looking at the violin plot demo page:
> > > 
> > >   http://gnuplot.sourceforge.net/demo/violinplot.html
> > > 
> > > It shows how to make a horizontal density plot using 'smooth
> > > kdensity'.
> > > 
> > > Then it shows to to make a vertical density plot by plotting
> > > horizontally into a table, and then plotting the table, with
> > > "using"
> > > directives used to swap the axes. This works clearly, but is
> > > there a
> > > way
> > > to do this (vertical density plots) with a single plot command?
> > > That
> > > would make my life much easier.
> > > 
> > > Thanks!
> > > 
> > > 
> > > 
> > 
> > Well, recently at $work I used gnuplot to produce a sideways
> > histogram.
> > Because it had to be sideways, I had to resort to manually
> > assembling
> > the plot with the boxxyerror style, with an awkward preprocessing
> > step.
> > 
> > This, and your question, gives me the idea that it might be worth
> > adding a general 'transpose' option to some of the "clever" plot
> > styles
> > that produce non-trivial vertical plots (histograms and boxplots,
> > mostly).
> > 
> > best regards,
> > Peter Juhasz
> 
> "How to make a sideways plot" does seem to be a very
> frequently asked question.  There may be some clever way to select
> an x/y axis transposition in the general case, but if so I have not
> been
> able to find it.  
> 

I might have mislead the discussion with my suggestion, because as it
turns out, the only common thing it has with the original violin plot
question is "would there be a way to do X in a single command". Sorry
for the confusion.

That said, I don't think bringing in 3D (s)plot styles is a good
direction towards a general solution for sideways plots. To me, it
sounds like looking for our lost car keys in the corner only because
that's where there is light.

> The program was designed from the start to have a single 2D plot mode
> with x always horizontal, [...]

Yes, originally it was designed like that, but then more complex plot
styles like histograms and boxplots were added, which do non-trivial
preprocessing and aggregating steps before plotting the data. For
boxplots (and less acutely, even for histograms) the x axis of the plot
is no longer directly maps to any column of the original data.

> Peter - would the plot you constructed
> by hand be a good example to adapt?  If the combination
>     set view projection xz
>     splot ... with boxerror
> doesn't handle it adequately, that would highlight where it would
> be worth some additional work on the code. 

No, not really, unless I misunderstand you - my point was that I wanted
to produce (IIRC) a columnstacked histogram, and if it could have been
a vertical plot, I could have used `set style histogram columnstacked;
set style data histogram`, with all the nice intuitive data layout and
all the automatic box placement that style provides. But the
requirements called for a horizontal plot, so I had to do all that by
hand. Doing the same in 3D wouldn't have helped.

Peter

> 
> 	Ethan
> 
> 



_______________________________________________
gnuplot-beta mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.