mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-06 06:21:16 +08:00
Square aspect ratio now works in 3d plots. 3D plots also have --square_xy option to square the
aspect ratio ONLY for the xy axes, allowing z to scale as needed
This commit is contained in:
parent
ba4267c667
commit
009d4bea5f
@ -155,7 +155,10 @@ As an example, if line 3 of the input is "0 9 1 20"
|
|||||||
|
|
||||||
--size xxx Gnuplot size option
|
--size xxx Gnuplot size option
|
||||||
|
|
||||||
--square Plot data with aspect ratio 1
|
--square Plot data with aspect ratio 1. For 3D plots, this controls the
|
||||||
|
aspect ratio for all 3 axes
|
||||||
|
|
||||||
|
--square_xy For 3D plots, set square aspect ratio for ONLY the x,y axes
|
||||||
|
|
||||||
--hardcopy xxx If not streaming, output to a file specified here. Format
|
--hardcopy xxx If not streaming, output to a file specified here. Format
|
||||||
inferred from filename
|
inferred from filename
|
||||||
@ -206,7 +209,7 @@ OEF
|
|||||||
'circles', 'legend=s@', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s',
|
'circles', 'legend=s@', 'autolegend!', 'xlabel=s', 'ylabel=s', 'y2label=s', 'zlabel=s',
|
||||||
'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=f', 'xmax=f', 'y2min=f', 'y2max=f',
|
'title=s', 'xlen=f', 'ymin=f', 'ymax=f', 'xmin=f', 'xmax=f', 'y2min=f', 'y2max=f',
|
||||||
'zmin=f', 'zmax=f', 'y2=s@', 'curvestyle=s@', 'curvestyleall=s', 'extracmds=s@',
|
'zmin=f', 'zmax=f', 'y2=s@', 'curvestyle=s@', 'curvestyleall=s', 'extracmds=s@',
|
||||||
'size=s', 'square!', 'hardcopy=s', 'maxcurves=i', 'monotonic!',
|
'size=s', 'square!', 'square_xy!', 'hardcopy=s', 'maxcurves=i', 'monotonic!',
|
||||||
'extraValuesPerPoint=i', 'help', 'dump') or die($usage);
|
'extraValuesPerPoint=i', 'help', 'dump') or die($usage);
|
||||||
|
|
||||||
# handle various cmdline-option errors
|
# handle various cmdline-option errors
|
||||||
@ -251,11 +254,20 @@ OEF
|
|||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elsif (!$options->{colormap})
|
else
|
||||||
{
|
{
|
||||||
if ( defined $options->{zmin} || defined $options->{zmax} || defined $options->{zlabel} )
|
if(!$options->{colormap})
|
||||||
{
|
{
|
||||||
print STDERR "--zmin/zmax/zlabel only makes sense with --3d or --colormap\n";
|
if ( defined $options->{zmin} || defined $options->{zmax} || defined $options->{zlabel} )
|
||||||
|
{
|
||||||
|
print STDERR "--zmin/zmax/zlabel only makes sense with --3d or --colormap\n";
|
||||||
|
exit -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( defined $options->{square_xy} )
|
||||||
|
{
|
||||||
|
print STDERR "--square_xy only makes sense with --3d\n";
|
||||||
exit -1;
|
exit -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -387,11 +399,24 @@ sub mainThread
|
|||||||
|
|
||||||
if($options{square})
|
if($options{square})
|
||||||
{
|
{
|
||||||
$options{size} = '' unless defined $options{size};
|
# set a square aspect ratio. Gnuplot does this differently for 2D and 3D plots
|
||||||
$options{size} .= ' ratio -1';
|
if(! $options{'3d'})
|
||||||
|
{
|
||||||
|
$options{size} = '' unless defined $options{size};
|
||||||
|
$options{size} .= ' ratio -1';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print(PIPE "set view equal xyz\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print(PIPE "set size $options{size}\n") if defined $options{size};
|
print(PIPE "set size $options{size}\n") if defined $options{size};
|
||||||
|
|
||||||
|
if($options{square_xy})
|
||||||
|
{
|
||||||
|
print(PIPE "set view equal xy\n");
|
||||||
|
}
|
||||||
|
|
||||||
if($options{colormap})
|
if($options{colormap})
|
||||||
{
|
{
|
||||||
print PIPE "set cbrange [". $options{zmin} . ":" . $options{zmax} ."]\n" if length( $options{zmin} . $options{zmax} );
|
print PIPE "set cbrange [". $options{zmin} . ":" . $options{zmax} ."]\n" if length( $options{zmin} . $options{zmax} );
|
||||||
|
Loading…
Reference in New Issue
Block a user